aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-09-19 12:15:07 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-22 03:08:00 -0400
commit32c1087460626f9cfa2b397eafd247bf039bacac (patch)
treea18779264bf721ee4b8cd6451bcd2024ef744e6a
parent551185ca0a97a11917edc3ad8e11d68912795902 (diff)
ath6kl: Export beacon interval and DTIM period through STA info
Now that we allow the first Beacon frame after each connection to be processed at the host, we can figure out the DTIM period and expose it with Beacon interval through STA info BSS parameters to user space. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c16
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.h3
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c11
3 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0bdd837d6121..c3540bbfcac6 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -483,6 +483,13 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel,
483 assoc_req_len -= assoc_req_ie_offset; 483 assoc_req_len -= assoc_req_ie_offset;
484 assoc_resp_len -= assoc_resp_ie_offset; 484 assoc_resp_len -= assoc_resp_ie_offset;
485 485
486 /*
487 * Store Beacon interval here; DTIM period will be available only once
488 * a Beacon frame from the AP is seen.
489 */
490 ar->assoc_bss_beacon_int = beacon_intvl;
491 clear_bit(DTIM_PERIOD_AVAIL, &ar->flag);
492
486 if (nw_type & ADHOC_NETWORK) { 493 if (nw_type & ADHOC_NETWORK) {
487 if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) { 494 if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) {
488 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 495 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
@@ -1366,6 +1373,15 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
1366 1373
1367 sinfo->filled |= STATION_INFO_TX_BITRATE; 1374 sinfo->filled |= STATION_INFO_TX_BITRATE;
1368 1375
1376 if (test_bit(CONNECTED, &ar->flag) &&
1377 test_bit(DTIM_PERIOD_AVAIL, &ar->flag) &&
1378 ar->nw_type == INFRA_NETWORK) {
1379 sinfo->filled |= STATION_INFO_BSS_PARAM;
1380 sinfo->bss_param.flags = 0;
1381 sinfo->bss_param.dtim_period = ar->assoc_bss_dtim_period;
1382 sinfo->bss_param.beacon_interval = ar->assoc_bss_beacon_int;
1383 }
1384
1369 return 0; 1385 return 0;
1370} 1386}
1371 1387
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index c14bb75d3614..82be42f5edc8 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -395,6 +395,7 @@ struct ath6kl_req_key {
395#define WLAN_ENABLED 12 395#define WLAN_ENABLED 12
396#define TESTMODE 13 396#define TESTMODE 13
397#define CLEAR_BSSFILTER_ON_BEACON 14 397#define CLEAR_BSSFILTER_ON_BEACON 14
398#define DTIM_PERIOD_AVAIL 15
398 399
399struct ath6kl { 400struct ath6kl {
400 struct device *dev; 401 struct device *dev;
@@ -511,6 +512,8 @@ struct ath6kl {
511 u16 next_chan; 512 u16 next_chan;
512 513
513 bool p2p; 514 bool p2p;
515 u16 assoc_bss_beacon_int;
516 u8 assoc_bss_dtim_period;
514 517
515#ifdef CONFIG_ATH6KL_DEBUG 518#ifdef CONFIG_ATH6KL_DEBUG
516 struct { 519 struct {
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index f7dcb56ab354..b90d116c018c 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -930,6 +930,17 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len)
930 if (len < 8 + 2 + 2) 930 if (len < 8 + 2 + 2)
931 return -EINVAL; 931 return -EINVAL;
932 932
933 if (bih->frame_type == BEACON_FTYPE && test_bit(CONNECTED, &ar->flag) &&
934 memcmp(bih->bssid, ar->bssid, ETH_ALEN) == 0) {
935 const u8 *tim;
936 tim = cfg80211_find_ie(WLAN_EID_TIM, buf + 8 + 2 + 2,
937 len - 8 - 2 - 2);
938 if (tim && tim[1] >= 2) {
939 ar->assoc_bss_dtim_period = tim[3];
940 set_bit(DTIM_PERIOD_AVAIL, &ar->flag);
941 }
942 }
943
933 /* 944 /*
934 * In theory, use of cfg80211_inform_bss() would be more natural here 945 * In theory, use of cfg80211_inform_bss() would be more natural here
935 * since we do not have the full frame. However, at least for now, 946 * since we do not have the full frame. However, at least for now,