aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-19 10:01:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:33 -0400
commit30196673fe17934617b5d5bfd456a0edf057a0b9 (patch)
tree48f2d37cb7b47d83a1d45c6e9e258d7c8b26800a /net/mac80211/mlme.c
parentdc8c4585d2e6f3bf5c9d8c0a6036b591bd3baf2e (diff)
mac80211: PS processing for every Beacon with our AID in TIM
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>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b61a7819867e..54a2a1db98a3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1951,16 +1951,13 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1951 directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len, 1951 directed_tim = ieee80211_check_tim(elems.tim, elems.tim_len,
1952 ifmgd->aid); 1952 ifmgd->aid);
1953 1953
1954 ncrc = crc32_be(ncrc, (void *)&directed_tim, sizeof(directed_tim)); 1954 if (ncrc != ifmgd->beacon_crc) {
1955 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems,
1956 true);
1955 1957
1956 if (ncrc == ifmgd->beacon_crc) 1958 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param,
1957 return; 1959 elems.wmm_param_len);
1958 ifmgd->beacon_crc = ncrc; 1960 }
1959
1960 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true);
1961
1962 ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param,
1963 elems.wmm_param_len);
1964 1961
1965 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) { 1962 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) {
1966 if (directed_tim) { 1963 if (directed_tim) {
@@ -1985,6 +1982,10 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1985 } 1982 }
1986 } 1983 }
1987 1984
1985 if (ncrc == ifmgd->beacon_crc)
1986 return;
1987 ifmgd->beacon_crc = ncrc;
1988
1988 if (elems.erp_info && elems.erp_info_len >= 1) { 1989 if (elems.erp_info && elems.erp_info_len >= 1) {
1989 erp_valid = true; 1990 erp_valid = true;
1990 erp_value = elems.erp_info[0]; 1991 erp_value = elems.erp_info[0];