aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-02-21 15:06:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-21 15:06:35 -0500
commita9802d43f205faa2fff422502a1336a50b9615c3 (patch)
tree57152d6c84556320570802d01bbe04cefd8a2a7d /drivers/net/wireless/mwifiex
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
parentca994a36f585432458ead9133fcfe05440edbb7b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c23
-rw-r--r--drivers/net/wireless/mwifiex/init.c1
-rw-r--r--drivers/net/wireless/mwifiex/main.h2
-rw-r--r--drivers/net/wireless/mwifiex/scan.c6
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c60
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmdresp.c3
6 files changed, 32 insertions, 63 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 6fef4925d13a..8d8ee639fe56 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -376,7 +376,12 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
376 struct ieee80211_channel *chan, 376 struct ieee80211_channel *chan,
377 enum nl80211_channel_type channel_type) 377 enum nl80211_channel_type channel_type)
378{ 378{
379 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 379 struct mwifiex_private *priv;
380
381 if (dev)
382 priv = mwifiex_netdev_get_priv(dev);
383 else
384 priv = mwifiex_cfg80211_get_priv(wiphy);
380 385
381 if (priv->media_connected) { 386 if (priv->media_connected) {
382 wiphy_err(wiphy, "This setting is valid only when station " 387 wiphy_err(wiphy, "This setting is valid only when station "
@@ -534,6 +539,11 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
534 ret = -EFAULT; 539 ret = -EFAULT;
535 } 540 }
536 541
542 /* Get DTIM period information from firmware */
543 mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_SNMP_MIB,
544 HostCmd_ACT_GEN_GET, DTIM_PERIOD_I,
545 &priv->dtim_period);
546
537 /* 547 /*
538 * Bit 0 in tx_htinfo indicates that current Tx rate is 11n rate. Valid 548 * Bit 0 in tx_htinfo indicates that current Tx rate is 11n rate. Valid
539 * MCS index values for us are 0 to 7. 549 * MCS index values for us are 0 to 7.
@@ -568,8 +578,7 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
568 WLAN_CAPABILITY_SHORT_SLOT_TIME) 578 WLAN_CAPABILITY_SHORT_SLOT_TIME)
569 sinfo->bss_param.flags |= 579 sinfo->bss_param.flags |=
570 BSS_PARAM_FLAGS_SHORT_SLOT_TIME; 580 BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
571 sinfo->bss_param.dtim_period = 581 sinfo->bss_param.dtim_period = priv->dtim_period;
572 priv->curr_bss_params.bss_descriptor.dtim_period;
573 sinfo->bss_param.beacon_interval = 582 sinfo->bss_param.beacon_interval =
574 priv->curr_bss_params.bss_descriptor.beacon_period; 583 priv->curr_bss_params.bss_descriptor.beacon_period;
575 } 584 }
@@ -858,7 +867,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
858 ret = mwifiex_set_rf_channel(priv, channel, 867 ret = mwifiex_set_rf_channel(priv, channel,
859 priv->adapter->channel_type); 868 priv->adapter->channel_type);
860 869
861 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ 870 /* As this is new association, clear locally stored
871 * keys and security related flags */
872 priv->sec_info.wpa_enabled = false;
873 priv->sec_info.wpa2_enabled = false;
874 priv->wep_key_curr_index = 0;
875 ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);
862 876
863 if (mode == NL80211_IFTYPE_ADHOC) { 877 if (mode == NL80211_IFTYPE_ADHOC) {
864 /* "privacy" is set only for ad-hoc mode */ 878 /* "privacy" is set only for ad-hoc mode */
@@ -903,6 +917,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
903 dev_dbg(priv->adapter->dev, 917 dev_dbg(priv->adapter->dev,
904 "info: setting wep encryption" 918 "info: setting wep encryption"
905 " with key len %d\n", sme->key_len); 919 " with key len %d\n", sme->key_len);
920 priv->wep_key_curr_index = sme->key_idx;
906 ret = mwifiex_set_encode(priv, sme->key, sme->key_len, 921 ret = mwifiex_set_encode(priv, sme->key, sme->key_len,
907 sme->key_idx, 0); 922 sme->key_idx, 0);
908 } 923 }
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 84fcb741a296..ca59cc0d013e 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -280,6 +280,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
280 adapter->adhoc_awake_period = 0; 280 adapter->adhoc_awake_period = 0;
281 memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter)); 281 memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter));
282 adapter->arp_filter_size = 0; 282 adapter->arp_filter_size = 0;
283 adapter->channel_type = NL80211_CHAN_HT20;
283} 284}
284 285
285/* 286/*
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 3dc0f721c1db..52810b1497ea 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -249,7 +249,6 @@ struct mwifiex_bssdescriptor {
249 u32 channel; 249 u32 channel;
250 u32 freq; 250 u32 freq;
251 u16 beacon_period; 251 u16 beacon_period;
252 u8 dtim_period;
253 u8 erp_flags; 252 u8 erp_flags;
254 u32 bss_mode; 253 u32 bss_mode;
255 u8 supported_rates[MWIFIEX_SUPPORTED_RATES]; 254 u8 supported_rates[MWIFIEX_SUPPORTED_RATES];
@@ -392,6 +391,7 @@ struct mwifiex_private {
392 u8 prev_bssid[ETH_ALEN]; 391 u8 prev_bssid[ETH_ALEN];
393 struct mwifiex_current_bss_params curr_bss_params; 392 struct mwifiex_current_bss_params curr_bss_params;
394 u16 beacon_period; 393 u16 beacon_period;
394 u8 dtim_period;
395 u16 listen_interval; 395 u16 listen_interval;
396 u16 atim_window; 396 u16 atim_window;
397 u8 adhoc_channel; 397 u8 adhoc_channel;
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 135208596aff..98f1ca9cd6d8 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1086,7 +1086,6 @@ mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
1086 struct ieee_types_vendor_specific *vendor_ie; 1086 struct ieee_types_vendor_specific *vendor_ie;
1087 const u8 wpa_oui[4] = { 0x00, 0x50, 0xf2, 0x01 }; 1087 const u8 wpa_oui[4] = { 0x00, 0x50, 0xf2, 0x01 };
1088 const u8 wmm_oui[4] = { 0x00, 0x50, 0xf2, 0x02 }; 1088 const u8 wmm_oui[4] = { 0x00, 0x50, 0xf2, 0x02 };
1089 struct ieee80211_tim_ie *tim_ie;
1090 1089
1091 found_data_rate_ie = false; 1090 found_data_rate_ie = false;
1092 rate_size = 0; 1091 rate_size = 0;
@@ -1259,11 +1258,6 @@ mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
1259 sizeof(struct ieee_types_header) - 1258 sizeof(struct ieee_types_header) -
1260 bss_entry->beacon_buf); 1259 bss_entry->beacon_buf);
1261 break; 1260 break;
1262 case WLAN_EID_TIM:
1263 tim_ie = (void *) (current_ptr +
1264 sizeof(struct ieee_types_header));
1265 bss_entry->dtim_period = tim_ie->dtim_period;
1266 break;
1267 default: 1261 default:
1268 break; 1262 break;
1269 } 1263 }
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 6e443ffa0465..324c651527cb 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -103,7 +103,7 @@ static int mwifiex_cmd_mac_control(struct mwifiex_private *priv,
103static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv, 103static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv,
104 struct host_cmd_ds_command *cmd, 104 struct host_cmd_ds_command *cmd,
105 u16 cmd_action, u32 cmd_oid, 105 u16 cmd_action, u32 cmd_oid,
106 u32 *ul_temp) 106 u16 *ul_temp)
107{ 107{
108 struct host_cmd_ds_802_11_snmp_mib *snmp_mib = &cmd->params.smib; 108 struct host_cmd_ds_802_11_snmp_mib *snmp_mib = &cmd->params.smib;
109 109
@@ -112,62 +112,18 @@ static int mwifiex_cmd_802_11_snmp_mib(struct mwifiex_private *priv,
112 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_snmp_mib) 112 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_snmp_mib)
113 - 1 + S_DS_GEN); 113 - 1 + S_DS_GEN);
114 114
115 snmp_mib->oid = cpu_to_le16((u16)cmd_oid);
115 if (cmd_action == HostCmd_ACT_GEN_GET) { 116 if (cmd_action == HostCmd_ACT_GEN_GET) {
116 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_GET); 117 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_GET);
117 snmp_mib->buf_size = cpu_to_le16(MAX_SNMP_BUF_SIZE); 118 snmp_mib->buf_size = cpu_to_le16(MAX_SNMP_BUF_SIZE);
118 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) 119 le16_add_cpu(&cmd->size, MAX_SNMP_BUF_SIZE);
119 + MAX_SNMP_BUF_SIZE); 120 } else if (cmd_action == HostCmd_ACT_GEN_SET) {
121 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
122 snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
123 *((__le16 *) (snmp_mib->value)) = cpu_to_le16(*ul_temp);
124 le16_add_cpu(&cmd->size, sizeof(u16));
120 } 125 }
121 126
122 switch (cmd_oid) {
123 case FRAG_THRESH_I:
124 snmp_mib->oid = cpu_to_le16((u16) FRAG_THRESH_I);
125 if (cmd_action == HostCmd_ACT_GEN_SET) {
126 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
127 snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
128 *((__le16 *) (snmp_mib->value)) =
129 cpu_to_le16((u16) *ul_temp);
130 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size)
131 + sizeof(u16));
132 }
133 break;
134 case RTS_THRESH_I:
135 snmp_mib->oid = cpu_to_le16((u16) RTS_THRESH_I);
136 if (cmd_action == HostCmd_ACT_GEN_SET) {
137 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
138 snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
139 *(__le16 *) (snmp_mib->value) =
140 cpu_to_le16((u16) *ul_temp);
141 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size)
142 + sizeof(u16));
143 }
144 break;
145
146 case SHORT_RETRY_LIM_I:
147 snmp_mib->oid = cpu_to_le16((u16) SHORT_RETRY_LIM_I);
148 if (cmd_action == HostCmd_ACT_GEN_SET) {
149 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
150 snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
151 *((__le16 *) (snmp_mib->value)) =
152 cpu_to_le16((u16) *ul_temp);
153 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size)
154 + sizeof(u16));
155 }
156 break;
157 case DOT11D_I:
158 snmp_mib->oid = cpu_to_le16((u16) DOT11D_I);
159 if (cmd_action == HostCmd_ACT_GEN_SET) {
160 snmp_mib->query_type = cpu_to_le16(HostCmd_ACT_GEN_SET);
161 snmp_mib->buf_size = cpu_to_le16(sizeof(u16));
162 *((__le16 *) (snmp_mib->value)) =
163 cpu_to_le16((u16) *ul_temp);
164 cmd->size = cpu_to_le16(le16_to_cpu(cmd->size)
165 + sizeof(u16));
166 }
167 break;
168 default:
169 break;
170 }
171 dev_dbg(priv->adapter->dev, 127 dev_dbg(priv->adapter->dev,
172 "cmd: SNMP_CMD: Action=0x%x, OID=0x%x, OIDSize=0x%x," 128 "cmd: SNMP_CMD: Action=0x%x, OID=0x%x, OIDSize=0x%x,"
173 " Value=0x%x\n", 129 " Value=0x%x\n",
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index e812db8b695c..0d8618a8443f 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -210,6 +210,9 @@ static int mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv,
210 dev_dbg(priv->adapter->dev, 210 dev_dbg(priv->adapter->dev,
211 "info: SNMP_RESP: TxRetryCount=%u\n", ul_temp); 211 "info: SNMP_RESP: TxRetryCount=%u\n", ul_temp);
212 break; 212 break;
213 case DTIM_PERIOD_I:
214 dev_dbg(priv->adapter->dev,
215 "info: SNMP_RESP: DTIM period=%u\n", ul_temp);
213 default: 216 default:
214 break; 217 break;
215 } 218 }