diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-02-10 23:25:39 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-13 21:45:22 +0300 |
commit | a4727801004f255f589478b2d75ec00f0a9e30c5 (patch) | |
tree | 9998b3e43308ea98e86a51124177a683ada3dcf6 /drivers/net/wireless/zd1211rw | |
parent | 5e1333624827e7a91b2d2cc04ce978f050cae15e (diff) | |
download | linux-a4727801004f255f589478b2d75ec00f0a9e30c5.tar.xz |
zd1211rw: honour enable_beacon conf
This makes zd1211rw honour enable_beacon, as well as fixing
a memory leak: the beacon skb is leaked when configuring it
to the hardware fails.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 732b69f40978..7579af27edbd 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c @@ -768,13 +768,23 @@ static int zd_op_config_interface(struct ieee80211_hw *hw, if (!beacon) return -ENOMEM; r = zd_mac_config_beacon(hw, beacon); + kfree_skb(beacon); + if (r < 0) return r; - r = zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS | - hw->conf.beacon_int); + } + + if (conf->changed & IEEE80211_IFCC_BEACON_ENABLED) { + u32 interval; + + if (conf->enable_beacon) + interval = BCN_MODE_IBSS | hw->conf.beacon_int; + else + interval = 0; + + r = zd_set_beacon_interval(&mac->chip, interval); if (r < 0) return r; - kfree_skb(beacon); } } else associated = is_valid_ether_addr(conf->bssid); |