diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 10:13:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:36 -0400 |
commit | 2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch) | |
tree | 9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/iwlwifi | |
parent | 57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (diff) |
mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the
BSSID and beacon updates, while bss_info_changed contains most
other BSS information for each interface. This patch removes
config_interface and rolls all the information it previously
passed to drivers into bss_info_changed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 162 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 1 |
4 files changed, 58 insertions, 109 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 4920dcf7d7b0..dd8b15ed8296 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2623,7 +2623,6 @@ static struct ieee80211_ops iwl_hw_ops = { | |||
2623 | .add_interface = iwl_mac_add_interface, | 2623 | .add_interface = iwl_mac_add_interface, |
2624 | .remove_interface = iwl_mac_remove_interface, | 2624 | .remove_interface = iwl_mac_remove_interface, |
2625 | .config = iwl_mac_config, | 2625 | .config = iwl_mac_config, |
2626 | .config_interface = iwl_mac_config_interface, | ||
2627 | .configure_filter = iwl_configure_filter, | 2626 | .configure_filter = iwl_configure_filter, |
2628 | .set_key = iwl_mac_set_key, | 2627 | .set_key = iwl_mac_set_key, |
2629 | .update_tkip_key = iwl_mac_update_tkip_key, | 2628 | .update_tkip_key = iwl_mac_update_tkip_key, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index cd8a5ed97c4f..0f21fc136ca7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2238,15 +2238,69 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
2238 | 2238 | ||
2239 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | 2239 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) |
2240 | void iwl_bss_info_changed(struct ieee80211_hw *hw, | 2240 | void iwl_bss_info_changed(struct ieee80211_hw *hw, |
2241 | struct ieee80211_vif *vif, | 2241 | struct ieee80211_vif *vif, |
2242 | struct ieee80211_bss_conf *bss_conf, | 2242 | struct ieee80211_bss_conf *bss_conf, |
2243 | u32 changes) | 2243 | u32 changes) |
2244 | { | 2244 | { |
2245 | struct iwl_priv *priv = hw->priv; | 2245 | struct iwl_priv *priv = hw->priv; |
2246 | int ret; | 2246 | int ret; |
2247 | 2247 | ||
2248 | IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes); | 2248 | IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes); |
2249 | 2249 | ||
2250 | if (!iwl_is_alive(priv)) | ||
2251 | return; | ||
2252 | |||
2253 | mutex_lock(&priv->mutex); | ||
2254 | |||
2255 | if (changes & BSS_CHANGED_BEACON && | ||
2256 | priv->iw_mode == NL80211_IFTYPE_AP) { | ||
2257 | dev_kfree_skb(priv->ibss_beacon); | ||
2258 | priv->ibss_beacon = ieee80211_beacon_get(hw, vif); | ||
2259 | } | ||
2260 | |||
2261 | if ((changes & BSS_CHANGED_BSSID) && !iwl_is_rfkill(priv)) { | ||
2262 | /* If there is currently a HW scan going on in the background | ||
2263 | * then we need to cancel it else the RXON below will fail. */ | ||
2264 | if (iwl_scan_cancel_timeout(priv, 100)) { | ||
2265 | IWL_WARN(priv, "Aborted scan still in progress " | ||
2266 | "after 100ms\n"); | ||
2267 | IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n"); | ||
2268 | mutex_unlock(&priv->mutex); | ||
2269 | return; | ||
2270 | } | ||
2271 | memcpy(priv->staging_rxon.bssid_addr, | ||
2272 | bss_conf->bssid, ETH_ALEN); | ||
2273 | |||
2274 | /* TODO: Audit driver for usage of these members and see | ||
2275 | * if mac80211 deprecates them (priv->bssid looks like it | ||
2276 | * shouldn't be there, but I haven't scanned the IBSS code | ||
2277 | * to verify) - jpk */ | ||
2278 | memcpy(priv->bssid, bss_conf->bssid, ETH_ALEN); | ||
2279 | |||
2280 | if (priv->iw_mode == NL80211_IFTYPE_AP) | ||
2281 | iwlcore_config_ap(priv); | ||
2282 | else { | ||
2283 | int rc = iwlcore_commit_rxon(priv); | ||
2284 | if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc) | ||
2285 | iwl_rxon_add_station( | ||
2286 | priv, priv->active_rxon.bssid_addr, 1); | ||
2287 | } | ||
2288 | } else if (!iwl_is_rfkill(priv)) { | ||
2289 | iwl_scan_cancel_timeout(priv, 100); | ||
2290 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
2291 | iwlcore_commit_rxon(priv); | ||
2292 | } | ||
2293 | |||
2294 | if (priv->iw_mode == NL80211_IFTYPE_ADHOC && | ||
2295 | changes & BSS_CHANGED_BEACON) { | ||
2296 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
2297 | |||
2298 | if (beacon) | ||
2299 | iwl_mac_beacon_update(hw, beacon); | ||
2300 | } | ||
2301 | |||
2302 | mutex_unlock(&priv->mutex); | ||
2303 | |||
2250 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { | 2304 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { |
2251 | IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n", | 2305 | IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n", |
2252 | bss_conf->use_short_preamble); | 2306 | bss_conf->use_short_preamble); |
@@ -2305,7 +2359,7 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw, | |||
2305 | &priv->staging_rxon, | 2359 | &priv->staging_rxon, |
2306 | sizeof(struct iwl_rxon_cmd)); | 2360 | sizeof(struct iwl_rxon_cmd)); |
2307 | } | 2361 | } |
2308 | 2362 | IWL_DEBUG_MAC80211(priv, "leave\n"); | |
2309 | } | 2363 | } |
2310 | EXPORT_SYMBOL(iwl_bss_info_changed); | 2364 | EXPORT_SYMBOL(iwl_bss_info_changed); |
2311 | 2365 | ||
@@ -2589,106 +2643,6 @@ out: | |||
2589 | } | 2643 | } |
2590 | EXPORT_SYMBOL(iwl_mac_config); | 2644 | EXPORT_SYMBOL(iwl_mac_config); |
2591 | 2645 | ||
2592 | int iwl_mac_config_interface(struct ieee80211_hw *hw, | ||
2593 | struct ieee80211_vif *vif, | ||
2594 | struct ieee80211_if_conf *conf) | ||
2595 | { | ||
2596 | struct iwl_priv *priv = hw->priv; | ||
2597 | int rc; | ||
2598 | |||
2599 | if (conf == NULL) | ||
2600 | return -EIO; | ||
2601 | |||
2602 | if (priv->vif != vif) { | ||
2603 | IWL_DEBUG_MAC80211(priv, "leave - priv->vif != vif\n"); | ||
2604 | return 0; | ||
2605 | } | ||
2606 | |||
2607 | if (priv->iw_mode == NL80211_IFTYPE_ADHOC && | ||
2608 | conf->changed & IEEE80211_IFCC_BEACON) { | ||
2609 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | ||
2610 | if (!beacon) | ||
2611 | return -ENOMEM; | ||
2612 | mutex_lock(&priv->mutex); | ||
2613 | rc = iwl_mac_beacon_update(hw, beacon); | ||
2614 | mutex_unlock(&priv->mutex); | ||
2615 | if (rc) | ||
2616 | return rc; | ||
2617 | } | ||
2618 | |||
2619 | if (!iwl_is_alive(priv)) | ||
2620 | return -EAGAIN; | ||
2621 | |||
2622 | mutex_lock(&priv->mutex); | ||
2623 | |||
2624 | if (conf->bssid) | ||
2625 | IWL_DEBUG_MAC80211(priv, "bssid: %pM\n", conf->bssid); | ||
2626 | |||
2627 | /* | ||
2628 | * very dubious code was here; the probe filtering flag is never set: | ||
2629 | * | ||
2630 | if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) && | ||
2631 | !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { | ||
2632 | */ | ||
2633 | |||
2634 | if (priv->iw_mode == NL80211_IFTYPE_AP) { | ||
2635 | if (!conf->bssid) { | ||
2636 | conf->bssid = priv->mac_addr; | ||
2637 | memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); | ||
2638 | IWL_DEBUG_MAC80211(priv, "bssid was set to: %pM\n", | ||
2639 | conf->bssid); | ||
2640 | } | ||
2641 | if (priv->ibss_beacon) | ||
2642 | dev_kfree_skb(priv->ibss_beacon); | ||
2643 | |||
2644 | priv->ibss_beacon = ieee80211_beacon_get(hw, vif); | ||
2645 | } | ||
2646 | |||
2647 | if (iwl_is_rfkill(priv)) | ||
2648 | goto done; | ||
2649 | |||
2650 | if (conf->bssid && !is_zero_ether_addr(conf->bssid) && | ||
2651 | !is_multicast_ether_addr(conf->bssid)) { | ||
2652 | /* If there is currently a HW scan going on in the background | ||
2653 | * then we need to cancel it else the RXON below will fail. */ | ||
2654 | if (iwl_scan_cancel_timeout(priv, 100)) { | ||
2655 | IWL_WARN(priv, "Aborted scan still in progress " | ||
2656 | "after 100ms\n"); | ||
2657 | IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n"); | ||
2658 | mutex_unlock(&priv->mutex); | ||
2659 | return -EAGAIN; | ||
2660 | } | ||
2661 | memcpy(priv->staging_rxon.bssid_addr, conf->bssid, ETH_ALEN); | ||
2662 | |||
2663 | /* TODO: Audit driver for usage of these members and see | ||
2664 | * if mac80211 deprecates them (priv->bssid looks like it | ||
2665 | * shouldn't be there, but I haven't scanned the IBSS code | ||
2666 | * to verify) - jpk */ | ||
2667 | memcpy(priv->bssid, conf->bssid, ETH_ALEN); | ||
2668 | |||
2669 | if (priv->iw_mode == NL80211_IFTYPE_AP) | ||
2670 | iwlcore_config_ap(priv); | ||
2671 | else { | ||
2672 | rc = iwlcore_commit_rxon(priv); | ||
2673 | if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc) | ||
2674 | iwl_rxon_add_station( | ||
2675 | priv, priv->active_rxon.bssid_addr, 1); | ||
2676 | } | ||
2677 | |||
2678 | } else { | ||
2679 | iwl_scan_cancel_timeout(priv, 100); | ||
2680 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
2681 | iwlcore_commit_rxon(priv); | ||
2682 | } | ||
2683 | |||
2684 | done: | ||
2685 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
2686 | mutex_unlock(&priv->mutex); | ||
2687 | |||
2688 | return 0; | ||
2689 | } | ||
2690 | EXPORT_SYMBOL(iwl_mac_config_interface); | ||
2691 | |||
2692 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, | 2646 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, |
2693 | struct ieee80211_tx_queue_stats *stats) | 2647 | struct ieee80211_tx_queue_stats *stats) |
2694 | { | 2648 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index d4c60afa2891..bd7f9d9616bc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -281,9 +281,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
281 | struct ieee80211_if_init_conf *conf); | 281 | struct ieee80211_if_init_conf *conf); |
282 | int iwl_mac_config(struct ieee80211_hw *hw, u32 changed); | 282 | int iwl_mac_config(struct ieee80211_hw *hw, u32 changed); |
283 | void iwl_config_ap(struct iwl_priv *priv); | 283 | void iwl_config_ap(struct iwl_priv *priv); |
284 | int iwl_mac_config_interface(struct ieee80211_hw *hw, | ||
285 | struct ieee80211_vif *vif, | ||
286 | struct ieee80211_if_conf *conf); | ||
287 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, | 284 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, |
288 | struct ieee80211_tx_queue_stats *stats); | 285 | struct ieee80211_tx_queue_stats *stats); |
289 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); | 286 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index f9d9b65ef300..5cd4321d7cf5 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4106,7 +4106,6 @@ static struct ieee80211_ops iwl3945_hw_ops = { | |||
4106 | .add_interface = iwl_mac_add_interface, | 4106 | .add_interface = iwl_mac_add_interface, |
4107 | .remove_interface = iwl_mac_remove_interface, | 4107 | .remove_interface = iwl_mac_remove_interface, |
4108 | .config = iwl_mac_config, | 4108 | .config = iwl_mac_config, |
4109 | .config_interface = iwl_mac_config_interface, | ||
4110 | .configure_filter = iwl_configure_filter, | 4109 | .configure_filter = iwl_configure_filter, |
4111 | .set_key = iwl3945_mac_set_key, | 4110 | .set_key = iwl3945_mac_set_key, |
4112 | .get_tx_stats = iwl_mac_get_tx_stats, | 4111 | .get_tx_stats = iwl_mac_get_tx_stats, |