diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-09 08:40:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-14 14:30:07 -0400 |
commit | 9d139c810a2aa17365cc548d0cd2a189d8433c65 (patch) | |
tree | ef10ca55f93689ab97368376d277102d2527c961 /drivers/net/wireless/b43legacy | |
parent | f3947e2dfa3b18f375b7acd03b7ee2877d0751fc (diff) |
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/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 069157eea05c..a1b8bf3ee732 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -1138,14 +1138,22 @@ static void b43legacy_write_probe_resp_template(struct b43legacy_wldev *dev, | |||
1138 | 1138 | ||
1139 | /* Asynchronously update the packet templates in template RAM. | 1139 | /* Asynchronously update the packet templates in template RAM. |
1140 | * Locking: Requires wl->irq_lock to be locked. */ | 1140 | * Locking: Requires wl->irq_lock to be locked. */ |
1141 | static void b43legacy_update_templates(struct b43legacy_wl *wl, | 1141 | static void b43legacy_update_templates(struct b43legacy_wl *wl) |
1142 | struct sk_buff *beacon) | ||
1143 | { | 1142 | { |
1143 | struct sk_buff *beacon; | ||
1144 | /* This is the top half of the ansynchronous beacon update. The bottom | 1144 | /* This is the top half of the ansynchronous beacon update. The bottom |
1145 | * half is the beacon IRQ. Beacon update must be asynchronous to avoid | 1145 | * half is the beacon IRQ. Beacon update must be asynchronous to avoid |
1146 | * sending an invalid beacon. This can happen for example, if the | 1146 | * sending an invalid beacon. This can happen for example, if the |
1147 | * firmware transmits a beacon while we are updating it. */ | 1147 | * firmware transmits a beacon while we are updating it. */ |
1148 | 1148 | ||
1149 | /* We could modify the existing beacon and set the aid bit in the TIM | ||
1150 | * field, but that would probably require resizing and moving of data | ||
1151 | * within the beacon template. Simply request a new beacon and let | ||
1152 | * mac80211 do the hard work. */ | ||
1153 | beacon = ieee80211_beacon_get(wl->hw, wl->vif); | ||
1154 | if (unlikely(!beacon)) | ||
1155 | return; | ||
1156 | |||
1149 | if (wl->current_beacon) | 1157 | if (wl->current_beacon) |
1150 | dev_kfree_skb_any(wl->current_beacon); | 1158 | dev_kfree_skb_any(wl->current_beacon); |
1151 | wl->current_beacon = beacon; | 1159 | wl->current_beacon = beacon; |
@@ -2727,10 +2735,13 @@ static int b43legacy_op_config_interface(struct ieee80211_hw *hw, | |||
2727 | memset(wl->bssid, 0, ETH_ALEN); | 2735 | memset(wl->bssid, 0, ETH_ALEN); |
2728 | if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { | 2736 | if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { |
2729 | if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) { | 2737 | if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) { |
2730 | B43legacy_WARN_ON(conf->type != IEEE80211_IF_TYPE_AP); | 2738 | B43legacy_WARN_ON(vif->type != IEEE80211_IF_TYPE_AP); |
2731 | b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len); | 2739 | b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len); |
2732 | if (conf->beacon) | 2740 | if (conf->changed & IEEE80211_IFCC_BEACON) |
2733 | b43legacy_update_templates(wl, conf->beacon); | 2741 | b43legacy_update_templates(wl); |
2742 | } else if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) { | ||
2743 | if (conf->changed & IEEE80211_IFCC_BEACON) | ||
2744 | b43legacy_update_templates(wl); | ||
2734 | } | 2745 | } |
2735 | b43legacy_write_mac_bssid_templates(dev); | 2746 | b43legacy_write_mac_bssid_templates(dev); |
2736 | } | 2747 | } |
@@ -3396,31 +3407,10 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3396 | int aid, int set) | 3407 | int aid, int set) |
3397 | { | 3408 | { |
3398 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3409 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3399 | struct sk_buff *beacon; | ||
3400 | unsigned long flags; | ||
3401 | |||
3402 | /* We could modify the existing beacon and set the aid bit in the TIM | ||
3403 | * field, but that would probably require resizing and moving of data | ||
3404 | * within the beacon template. Simply request a new beacon and let | ||
3405 | * mac80211 do the hard work. */ | ||
3406 | beacon = ieee80211_beacon_get(hw, wl->vif); | ||
3407 | if (unlikely(!beacon)) | ||
3408 | return -ENOMEM; | ||
3409 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
3410 | b43legacy_update_templates(wl, beacon); | ||
3411 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
3412 | |||
3413 | return 0; | ||
3414 | } | ||
3415 | |||
3416 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, | ||
3417 | struct sk_buff *beacon) | ||
3418 | { | ||
3419 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | ||
3420 | unsigned long flags; | 3410 | unsigned long flags; |
3421 | 3411 | ||
3422 | spin_lock_irqsave(&wl->irq_lock, flags); | 3412 | spin_lock_irqsave(&wl->irq_lock, flags); |
3423 | b43legacy_update_templates(wl, beacon); | 3413 | b43legacy_update_templates(wl); |
3424 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 3414 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
3425 | 3415 | ||
3426 | return 0; | 3416 | return 0; |
@@ -3440,7 +3430,6 @@ static const struct ieee80211_ops b43legacy_hw_ops = { | |||
3440 | .stop = b43legacy_op_stop, | 3430 | .stop = b43legacy_op_stop, |
3441 | .set_retry_limit = b43legacy_op_set_retry_limit, | 3431 | .set_retry_limit = b43legacy_op_set_retry_limit, |
3442 | .set_tim = b43legacy_op_beacon_set_tim, | 3432 | .set_tim = b43legacy_op_beacon_set_tim, |
3443 | .beacon_update = b43legacy_op_ibss_beacon_update, | ||
3444 | }; | 3433 | }; |
3445 | 3434 | ||
3446 | /* Hard-reset the chip. Do not call this directly. | 3435 | /* Hard-reset the chip. Do not call this directly. |