Skip to content

Commit

Permalink
mac80211: PS processing for every Beacon with our AID in TIM
Browse files Browse the repository at this point in the history
If the AP includes our AID in the TIM IE, we need to process the
Beacon frame as far as PS is concerned (send PS-Poll or nullfunc data
with PM=0). The previous code skipped this in cases where the CRC
value did not change and it would not change if the AP continues
including our AID in the TIM..

There is no need to count the crc32 value for directed_tim with this
change, so we can remove that part. In order not to change the order
of operations (i.e., update WMM parameters prior to sending PS-Poll),
the CRC match is checked twice as only after the PS processing step,
the rest of the function is skipped if nothing changed in the Beacon.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed May 20, 2009
1 parent dc8c458 commit 3019667
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1951,16 +1951,13 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len,
ifmgd->aid);

ncrc = crc32_be(ncrc, (void *)&directed_tim, sizeof(directed_tim));
if (ncrc != ifmgd->beacon_crc) {
ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems,
true);

if (ncrc == ifmgd->beacon_crc)
return;
ifmgd->beacon_crc = ncrc;

ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true);

ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param,
elems.wmm_param_len);
ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param,
elems.wmm_param_len);
}

if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) {
if (directed_tim) {
Expand All @@ -1985,6 +1982,10 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
}
}

if (ncrc == ifmgd->beacon_crc)
return;
ifmgd->beacon_crc = ncrc;

if (elems.erp_info && elems.erp_info_len >= 1) {
erp_valid = true;
erp_value = elems.erp_info[0];
Expand Down

0 comments on commit 3019667

Please sign in to comment.