diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-10-17 15:05:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-17 15:05:26 -0400 |
commit | 41ebe9cde738a972d05c7282e09f5ed54cff0e8d (patch) | |
tree | 223bf0feb7305e46989b60c3f070bef87d5fcab4 /drivers/net/wireless/libertas/main.c | |
parent | fd38f734cb8200529e281338514945fcbff2364b (diff) | |
parent | 5c1381ac3f3f49ab1e0886ea8f1432c9a5def519 (diff) | |
download | op-kernel-dev-41ebe9cde738a972d05c7282e09f5ed54cff0e8d.zip op-kernel-dev-41ebe9cde738a972d05c7282e09f5ed54cff0e8d.tar.gz |
Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index c50ae07..b03779b 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c @@ -99,6 +99,32 @@ u8 lbs_data_rate_to_fw_index(u32 rate) return 0; } +int lbs_set_iface_type(struct lbs_private *priv, enum nl80211_iftype type) +{ + int ret = 0; + + switch (type) { + case NL80211_IFTYPE_MONITOR: + ret = lbs_set_monitor_mode(priv, 1); + break; + case NL80211_IFTYPE_STATION: + if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) + ret = lbs_set_monitor_mode(priv, 0); + if (!ret) + ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 1); + break; + case NL80211_IFTYPE_ADHOC: + if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR) + ret = lbs_set_monitor_mode(priv, 0); + if (!ret) + ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 2); + break; + default: + ret = -ENOTSUPP; + } + return ret; +} + int lbs_start_iface(struct lbs_private *priv) { struct cmd_ds_802_11_mac_address cmd; @@ -120,6 +146,12 @@ int lbs_start_iface(struct lbs_private *priv) goto err; } + ret = lbs_set_iface_type(priv, priv->wdev->iftype); + if (ret) { + lbs_deb_net("set iface type failed\n"); + goto err; + } + lbs_update_channel(priv); priv->iface_running = true; |