6fa00890af710a1e4dd591fc3afcdc271997cd14
[openwrt/openwrt.git] / package / madwifi / patches / 130-chanswitch_beacon_fix_PR_1477.patch
1 Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2
3 Index: madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c
4 ===================================================================
5 --- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_beacon.c 2007-10-20 20:52:09.000000000 +0200
6 +++ madwifi-ng-r2568-20070710/net80211/ieee80211_beacon.c 2007-10-20 20:52:31.000000000 +0200
7 @@ -305,13 +305,17 @@
8 */
9 c = ieee80211_doth_findchan(vap, ic->ic_chanchange_chan);
10 if (c == NULL) {
11 + /*
12 + * The channel we have been requested to change to
13 + * is not valid. Drop the channel switch annoucement
14 + * from the beacon and don't change channel.
15 + */
16 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DOTH,
17 - "%s: find channel failure\n", __func__);
18 - IEEE80211_UNLOCK_IRQ_EARLY(ic);
19 - return 0;
20 + "%s: find channel failure\n",
21 + __func__);
22 + } else {
23 + ic->ic_bsschan = c;
24 }
25 - ic->ic_bsschan = c;
26 -
27 skb_pull(skb, sizeof(struct ieee80211_frame));
28 skb_trim(skb, 0);
29 frm = skb->data;
30 @@ -321,8 +325,10 @@
31 vap->iv_flags &= ~IEEE80211_F_CHANSWITCH;
32 ic->ic_flags &= ~IEEE80211_F_CHANSWITCH;
33
34 - /* NB: only for the first VAP to get here */
35 - if (ic->ic_curchan != c) {
36 + /* NB: only for the first VAP to get here, and we have a valid
37 + * new channel to change to.
38 + */
39 + if (c && ic->ic_curchan != c) {
40 ic->ic_curchan = c;
41 ic->ic_set_channel(ic);
42 }