summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-07-09 14:40:37 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:30:07 -0400
commit9d139c810a2aa17365cc548d0cd2a189d8433c65 (patch)
treeef10ca55f93689ab97368376d277102d2527c961 /drivers/net/wireless/rt2x00/rt2x00mac.c
parentf3947e2dfa3b18f375b7acd03b7ee2877d0751fc (diff)
downloadblackbird-op-linux-9d139c810a2aa17365cc548d0cd2a189d8433c65.tar.gz
blackbird-op-linux-9d139c810a2aa17365cc548d0cd2a189d8433c65.zip
mac80211: revamp beacon configuration
This patch changes mac80211's beacon configuration handling to never pass skbs to the driver directly but rather always require the driver to use ieee80211_beacon_get(). Additionally, it introduces "change flags" on the config_interface() call to enable drivers to figure out what is changing. Finally, it removes the beacon_update() driver callback in favour of having IBSS beacon delivered by ieee80211_beacon_get() as well. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 3a1fb6d47e5d..84b51f49175e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -348,6 +348,7 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
{
struct rt2x00_dev *rt2x00dev = hw->priv;
struct rt2x00_intf *intf = vif_to_intf(vif);
+ struct sk_buff *beacon;
int status;
/*
@@ -363,8 +364,11 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
* If the interface does not work in master mode,
* then the bssid value in the interface structure
* should now be set.
+ *
+ * conf->bssid can be NULL if coming from the internal
+ * beacon update routine.
*/
- if (conf->type != IEEE80211_IF_TYPE_AP)
+ if (conf->bssid && vif->type != IEEE80211_IF_TYPE_AP)
memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
spin_unlock(&intf->lock);
@@ -375,17 +379,23 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
* values as arguments we make keep access to rt2x00_intf thread safe
* even without the lock.
*/
- rt2x00lib_config_intf(rt2x00dev, intf, conf->type, NULL, conf->bssid);
+ rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, conf->bssid);
/*
- * We only need to initialize the beacon when master mode is enabled.
+ * We only need to initialize the beacon when in master/ibss mode.
*/
- if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon)
+ if ((vif->type != IEEE80211_IF_TYPE_AP &&
+ vif->type != IEEE80211_IF_TYPE_IBSS) ||
+ !(conf->changed & IEEE80211_IFCC_BEACON))
return 0;
- status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, conf->beacon);
+ beacon = ieee80211_beacon_get(rt2x00dev->hw, vif);
+ if (!beacon)
+ return -ENOMEM;
+
+ status = rt2x00dev->ops->lib->beacon_update(rt2x00dev->hw, beacon);
if (status)
- dev_kfree_skb(conf->beacon);
+ dev_kfree_skb(beacon);
return status;
}
OpenPOWER on IntegriCloud