aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-02-02 23:48:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:55:54 -0500
commitcaf60a6c957e7a35837a41f845e57b4433e20276 (patch)
treedc2170bbc80a9269b6183aef94f98af769e8bd06
parentf3c8d2591fa7278abe58ee0278a41d5b130d1718 (diff)
mwifiex: update correct dtim_period in dump_station()
Earlier we were using dtim period extracted from scan response buffer provided by FW in scan operation. But it is observed that sometimes the buffer doesn't contain dtim period tlv, and wrong value (0) was sent to user space. After association FW will start listening to beacon frames of connected AP and store dtim period. Therefore we can get it from FW in dump_station() instead of using wrong value obtained in scanning. Redundant code after adapting new approach for dtim period is also removed in this patch. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c8
-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_cmdresp.c3
4 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 54e45c829c53..478d2f12c024 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -539,6 +539,11 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
539 ret = -EFAULT; 539 ret = -EFAULT;
540 } 540 }
541 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
542 /* 547 /*
543 * 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
544 * MCS index values for us are 0 to 7. 549 * MCS index values for us are 0 to 7.
@@ -573,8 +578,7 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
573 WLAN_CAPABILITY_SHORT_SLOT_TIME) 578 WLAN_CAPABILITY_SHORT_SLOT_TIME)
574 sinfo->bss_param.flags |= 579 sinfo->bss_param.flags |=
575 BSS_PARAM_FLAGS_SHORT_SLOT_TIME; 580 BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
576 sinfo->bss_param.dtim_period = 581 sinfo->bss_param.dtim_period = priv->dtim_period;
577 priv->curr_bss_params.bss_descriptor.dtim_period;
578 sinfo->bss_param.beacon_interval = 582 sinfo->bss_param.beacon_interval =
579 priv->curr_bss_params.bss_descriptor.beacon_period; 583 priv->curr_bss_params.bss_descriptor.beacon_period;
580 } 584 }
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_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 }