Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266614
b: refs/heads/master
c: 32c1087
h: refs/heads/master
v: v3
  • Loading branch information
Jouni Malinen authored and Kalle Valo committed Sep 22, 2011
1 parent 60c562d commit 04b97c3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 551185ca0a97a11917edc3ad8e11d68912795902
refs/heads/master: 32c1087460626f9cfa2b397eafd247bf039bacac
16 changes: 16 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,13 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel,
assoc_req_len -= assoc_req_ie_offset;
assoc_resp_len -= assoc_resp_ie_offset;

/*
* Store Beacon interval here; DTIM period will be available only once
* a Beacon frame from the AP is seen.
*/
ar->assoc_bss_beacon_int = beacon_intvl;
clear_bit(DTIM_PERIOD_AVAIL, &ar->flag);

if (nw_type & ADHOC_NETWORK) {
if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) {
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
Expand Down Expand Up @@ -1366,6 +1373,15 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,

sinfo->filled |= STATION_INFO_TX_BITRATE;

if (test_bit(CONNECTED, &ar->flag) &&
test_bit(DTIM_PERIOD_AVAIL, &ar->flag) &&
ar->nw_type == INFRA_NETWORK) {
sinfo->filled |= STATION_INFO_BSS_PARAM;
sinfo->bss_param.flags = 0;
sinfo->bss_param.dtim_period = ar->assoc_bss_dtim_period;
sinfo->bss_param.beacon_interval = ar->assoc_bss_beacon_int;
}

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ struct ath6kl_req_key {
#define WLAN_ENABLED 12
#define TESTMODE 13
#define CLEAR_BSSFILTER_ON_BEACON 14
#define DTIM_PERIOD_AVAIL 15

struct ath6kl {
struct device *dev;
Expand Down Expand Up @@ -511,6 +512,8 @@ struct ath6kl {
u16 next_chan;

bool p2p;
u16 assoc_bss_beacon_int;
u8 assoc_bss_dtim_period;

#ifdef CONFIG_ATH6KL_DEBUG
struct {
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,17 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len)
if (len < 8 + 2 + 2)
return -EINVAL;

if (bih->frame_type == BEACON_FTYPE && test_bit(CONNECTED, &ar->flag) &&
memcmp(bih->bssid, ar->bssid, ETH_ALEN) == 0) {
const u8 *tim;
tim = cfg80211_find_ie(WLAN_EID_TIM, buf + 8 + 2 + 2,
len - 8 - 2 - 2);
if (tim && tim[1] >= 2) {
ar->assoc_bss_dtim_period = tim[3];
set_bit(DTIM_PERIOD_AVAIL, &ar->flag);
}
}

/*
* In theory, use of cfg80211_inform_bss() would be more natural here
* since we do not have the full frame. However, at least for now,
Expand Down

0 comments on commit 04b97c3

Please sign in to comment.