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>
This commit is contained in:
Johannes Berg 2009-02-10 21:25:39 +01:00 committed by John W. Linville
parent 5e13336248
commit a472780100

View file

@ -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);
if (r < 0)
return r;
r = zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS |
hw->conf.beacon_int);
if (r < 0)
return r;
kfree_skb(beacon);
if (r < 0)
return r;
}
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;
}
} else
associated = is_valid_ether_addr(conf->bssid);