Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Johannes Berg and committed by
John W. Linville
2d0ddec5 57c4d7b4

+504 -778
+8 -6
drivers/net/wireless/adm8211.c
··· 1311 1311 return 0; 1312 1312 } 1313 1313 1314 - static int adm8211_config_interface(struct ieee80211_hw *dev, 1315 - struct ieee80211_vif *vif, 1316 - struct ieee80211_if_conf *conf) 1314 + static void adm8211_bss_info_changed(struct ieee80211_hw *dev, 1315 + struct ieee80211_vif *vif, 1316 + struct ieee80211_bss_conf *conf, 1317 + u32 changes) 1317 1318 { 1318 1319 struct adm8211_priv *priv = dev->priv; 1320 + 1321 + if (!(changes & BSS_CHANGED_BSSID)) 1322 + return; 1319 1323 1320 1324 if (memcmp(conf->bssid, priv->bssid, ETH_ALEN)) { 1321 1325 adm8211_set_bssid(dev, conf->bssid); 1322 1326 memcpy(priv->bssid, conf->bssid, ETH_ALEN); 1323 1327 } 1324 - 1325 - return 0; 1326 1328 } 1327 1329 1328 1330 static void adm8211_configure_filter(struct ieee80211_hw *dev, ··· 1755 1753 .add_interface = adm8211_add_interface, 1756 1754 .remove_interface = adm8211_remove_interface, 1757 1755 .config = adm8211_config, 1758 - .config_interface = adm8211_config_interface, 1756 + .bss_info_changed = adm8211_bss_info_changed, 1759 1757 .configure_filter = adm8211_configure_filter, 1760 1758 .get_stats = adm8211_get_stats, 1761 1759 .get_tx_stats = adm8211_get_tx_stats,
+9 -6
drivers/net/wireless/at76c50x-usb.c
··· 1965 1965 return 0; 1966 1966 } 1967 1967 1968 - static int at76_config_interface(struct ieee80211_hw *hw, 1969 - struct ieee80211_vif *vif, 1970 - struct ieee80211_if_conf *conf) 1968 + static void at76_bss_info_changed(struct ieee80211_hw *hw, 1969 + struct ieee80211_vif *vif, 1970 + struct ieee80211_bss_conf *conf, 1971 + u32 changed) 1971 1972 { 1972 1973 struct at76_priv *priv = hw->priv; 1973 1974 1974 1975 at76_dbg(DBG_MAC80211, "%s():", __func__); 1976 + 1977 + if (!(changed & BSS_CHANGED_BSSID)) 1978 + return; 1979 + 1975 1980 at76_dbg_dump(DBG_MAC80211, conf->bssid, ETH_ALEN, "bssid:"); 1976 1981 1977 1982 mutex_lock(&priv->mtx); ··· 1988 1983 at76_join(priv); 1989 1984 1990 1985 mutex_unlock(&priv->mtx); 1991 - 1992 - return 0; 1993 1986 } 1994 1987 1995 1988 /* must be atomic */ ··· 2079 2076 .add_interface = at76_add_interface, 2080 2077 .remove_interface = at76_remove_interface, 2081 2078 .config = at76_config, 2082 - .config_interface = at76_config_interface, 2079 + .bss_info_changed = at76_bss_info_changed, 2083 2080 .configure_filter = at76_configure_filter, 2084 2081 .start = at76_mac80211_start, 2085 2082 .stop = at76_mac80211_stop,
+11 -28
drivers/net/wireless/ath/ar9170/main.c
··· 1360 1360 return err; 1361 1361 } 1362 1362 1363 - static int ar9170_op_config_interface(struct ieee80211_hw *hw, 1364 - struct ieee80211_vif *vif, 1365 - struct ieee80211_if_conf *conf) 1366 - { 1367 - struct ar9170 *ar = hw->priv; 1368 - int err = 0; 1369 - 1370 - mutex_lock(&ar->mutex); 1371 - 1372 - if (conf->changed & IEEE80211_IFCC_BSSID) { 1373 - memcpy(ar->bssid, conf->bssid, ETH_ALEN); 1374 - err = ar9170_set_operating_mode(ar); 1375 - } 1376 - 1377 - if (conf->changed & IEEE80211_IFCC_BEACON) { 1378 - err = ar9170_update_beacon(ar); 1379 - 1380 - if (err) 1381 - goto out; 1382 - err = ar9170_set_beacon_timers(ar); 1383 - } 1384 - 1385 - out: 1386 - mutex_unlock(&ar->mutex); 1387 - return err; 1388 - } 1389 - 1390 1363 static void ar9170_set_filters(struct work_struct *work) 1391 1364 { 1392 1365 struct ar9170 *ar = container_of(work, struct ar9170, ··· 1460 1487 int err = 0; 1461 1488 1462 1489 mutex_lock(&ar->mutex); 1490 + 1491 + if (changed & BSS_CHANGED_BSSID) { 1492 + memcpy(ar->bssid, bss_conf->bssid, ETH_ALEN); 1493 + err = ar9170_set_operating_mode(ar); 1494 + } 1495 + 1496 + if (changed & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) { 1497 + err = ar9170_update_beacon(ar); 1498 + if (!err) 1499 + ar9170_set_beacon_timers(ar); 1500 + } 1463 1501 1464 1502 ar9170_regwrite_begin(ar); 1465 1503 ··· 1780 1796 .add_interface = ar9170_op_add_interface, 1781 1797 .remove_interface = ar9170_op_remove_interface, 1782 1798 .config = ar9170_op_config, 1783 - .config_interface = ar9170_op_config_interface, 1784 1799 .configure_filter = ar9170_op_configure_filter, 1785 1800 .conf_tx = ar9170_conf_tx, 1786 1801 .bss_info_changed = ar9170_op_bss_info_changed,
+27 -44
drivers/net/wireless/ath/ath5k/base.c
··· 227 227 static void ath5k_remove_interface(struct ieee80211_hw *hw, 228 228 struct ieee80211_if_init_conf *conf); 229 229 static int ath5k_config(struct ieee80211_hw *hw, u32 changed); 230 - static int ath5k_config_interface(struct ieee80211_hw *hw, 231 - struct ieee80211_vif *vif, 232 - struct ieee80211_if_conf *conf); 233 230 static void ath5k_configure_filter(struct ieee80211_hw *hw, 234 231 unsigned int changed_flags, 235 232 unsigned int *new_flags, ··· 256 259 .add_interface = ath5k_add_interface, 257 260 .remove_interface = ath5k_remove_interface, 258 261 .config = ath5k_config, 259 - .config_interface = ath5k_config_interface, 260 262 .configure_filter = ath5k_configure_filter, 261 263 .set_key = ath5k_set_key, 262 264 .get_stats = ath5k_get_stats, ··· 2760 2764 return ret; 2761 2765 } 2762 2766 2763 - static int 2764 - ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2765 - struct ieee80211_if_conf *conf) 2766 - { 2767 - struct ath5k_softc *sc = hw->priv; 2768 - struct ath5k_hw *ah = sc->ah; 2769 - int ret = 0; 2770 - 2771 - mutex_lock(&sc->lock); 2772 - if (sc->vif != vif) { 2773 - ret = -EIO; 2774 - goto unlock; 2775 - } 2776 - if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) { 2777 - /* Cache for later use during resets */ 2778 - memcpy(ah->ah_bssid, conf->bssid, ETH_ALEN); 2779 - /* XXX: assoc id is set to 0 for now, mac80211 doesn't have 2780 - * a clean way of letting us retrieve this yet. */ 2781 - ath5k_hw_set_associd(ah, ah->ah_bssid, 0); 2782 - mmiowb(); 2783 - } 2784 - if (conf->changed & IEEE80211_IFCC_BEACON && 2785 - (vif->type == NL80211_IFTYPE_ADHOC || 2786 - vif->type == NL80211_IFTYPE_MESH_POINT || 2787 - vif->type == NL80211_IFTYPE_AP)) { 2788 - struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 2789 - if (!beacon) { 2790 - ret = -ENOMEM; 2791 - goto unlock; 2792 - } 2793 - ath5k_beacon_update(sc, beacon); 2794 - } 2795 - 2796 - unlock: 2797 - mutex_unlock(&sc->lock); 2798 - return ret; 2799 - } 2800 - 2801 2767 #define SUPPORTED_FIF_FLAGS \ 2802 2768 FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | \ 2803 2769 FIF_PLCPFAIL | FIF_CONTROL | FIF_OTHER_BSS | \ ··· 3040 3082 u32 changes) 3041 3083 { 3042 3084 struct ath5k_softc *sc = hw->priv; 3085 + struct ath5k_hw *ah = sc->ah; 3086 + 3087 + mutex_lock(&sc->lock); 3088 + if (WARN_ON(sc->vif != vif)) 3089 + goto unlock; 3090 + 3091 + if (changes & BSS_CHANGED_BSSID) { 3092 + /* Cache for later use during resets */ 3093 + memcpy(ah->ah_bssid, bss_conf->bssid, ETH_ALEN); 3094 + /* XXX: assoc id is set to 0 for now, mac80211 doesn't have 3095 + * a clean way of letting us retrieve this yet. */ 3096 + ath5k_hw_set_associd(ah, ah->ah_bssid, 0); 3097 + mmiowb(); 3098 + } 3043 3099 3044 3100 if (changes & BSS_CHANGED_BEACON_INT) 3045 3101 sc->bintval = bss_conf->beacon_int; 3046 3102 3047 3103 if (changes & BSS_CHANGED_ASSOC) { 3048 - mutex_lock(&sc->lock); 3049 3104 sc->assoc = bss_conf->assoc; 3050 3105 if (sc->opmode == NL80211_IFTYPE_STATION) 3051 3106 set_beacon_filter(hw, sc->assoc); 3052 - mutex_unlock(&sc->lock); 3053 3107 } 3108 + 3109 + if (changes & BSS_CHANGED_BEACON && 3110 + (vif->type == NL80211_IFTYPE_ADHOC || 3111 + vif->type == NL80211_IFTYPE_MESH_POINT || 3112 + vif->type == NL80211_IFTYPE_AP)) { 3113 + struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 3114 + 3115 + if (beacon) 3116 + ath5k_beacon_update(sc, beacon); 3117 + } 3118 + 3119 + unlock: 3120 + mutex_unlock(&sc->lock); 3054 3121 }
+83 -99
drivers/net/wireless/ath/ath9k/main.c
··· 2363 2363 return 0; 2364 2364 } 2365 2365 2366 - static int ath9k_config_interface(struct ieee80211_hw *hw, 2367 - struct ieee80211_vif *vif, 2368 - struct ieee80211_if_conf *conf) 2369 - { 2370 - struct ath_wiphy *aphy = hw->priv; 2371 - struct ath_softc *sc = aphy->sc; 2372 - struct ath_hw *ah = sc->sc_ah; 2373 - struct ath_vif *avp = (void *)vif->drv_priv; 2374 - u32 rfilt = 0; 2375 - int error, i; 2376 - 2377 - mutex_lock(&sc->mutex); 2378 - 2379 - /* TODO: Need to decide which hw opmode to use for multi-interface 2380 - * cases */ 2381 - if (vif->type == NL80211_IFTYPE_AP && 2382 - ah->opmode != NL80211_IFTYPE_AP) { 2383 - ah->opmode = NL80211_IFTYPE_STATION; 2384 - ath9k_hw_setopmode(ah); 2385 - memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); 2386 - sc->curaid = 0; 2387 - ath9k_hw_write_associd(sc); 2388 - /* Request full reset to get hw opmode changed properly */ 2389 - sc->sc_flags |= SC_OP_FULL_RESET; 2390 - } 2391 - 2392 - if ((conf->changed & IEEE80211_IFCC_BSSID) && 2393 - !is_zero_ether_addr(conf->bssid)) { 2394 - switch (vif->type) { 2395 - case NL80211_IFTYPE_STATION: 2396 - case NL80211_IFTYPE_ADHOC: 2397 - case NL80211_IFTYPE_MESH_POINT: 2398 - /* Set BSSID */ 2399 - memcpy(sc->curbssid, conf->bssid, ETH_ALEN); 2400 - memcpy(avp->bssid, conf->bssid, ETH_ALEN); 2401 - sc->curaid = 0; 2402 - ath9k_hw_write_associd(sc); 2403 - 2404 - /* Set aggregation protection mode parameters */ 2405 - sc->config.ath_aggr_prot = 0; 2406 - 2407 - DPRINTF(sc, ATH_DBG_CONFIG, 2408 - "RX filter 0x%x bssid %pM aid 0x%x\n", 2409 - rfilt, sc->curbssid, sc->curaid); 2410 - 2411 - /* need to reconfigure the beacon */ 2412 - sc->sc_flags &= ~SC_OP_BEACONS ; 2413 - 2414 - break; 2415 - default: 2416 - break; 2417 - } 2418 - } 2419 - 2420 - if ((vif->type == NL80211_IFTYPE_ADHOC) || 2421 - (vif->type == NL80211_IFTYPE_AP) || 2422 - (vif->type == NL80211_IFTYPE_MESH_POINT)) { 2423 - if ((conf->changed & IEEE80211_IFCC_BEACON) || 2424 - (conf->changed & IEEE80211_IFCC_BEACON_ENABLED && 2425 - conf->enable_beacon)) { 2426 - /* 2427 - * Allocate and setup the beacon frame. 2428 - * 2429 - * Stop any previous beacon DMA. This may be 2430 - * necessary, for example, when an ibss merge 2431 - * causes reconfiguration; we may be called 2432 - * with beacon transmission active. 2433 - */ 2434 - ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 2435 - 2436 - error = ath_beacon_alloc(aphy, vif); 2437 - if (error != 0) { 2438 - mutex_unlock(&sc->mutex); 2439 - return error; 2440 - } 2441 - 2442 - ath_beacon_config(sc, vif); 2443 - } 2444 - } 2445 - 2446 - /* Check for WLAN_CAPABILITY_PRIVACY ? */ 2447 - if ((avp->av_opmode != NL80211_IFTYPE_STATION)) { 2448 - for (i = 0; i < IEEE80211_WEP_NKID; i++) 2449 - if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) 2450 - ath9k_hw_keysetmac(sc->sc_ah, 2451 - (u16)i, 2452 - sc->curbssid); 2453 - } 2454 - 2455 - /* Only legacy IBSS for now */ 2456 - if (vif->type == NL80211_IFTYPE_ADHOC) 2457 - ath_update_chainmask(sc, 0); 2458 - 2459 - mutex_unlock(&sc->mutex); 2460 - 2461 - return 0; 2462 - } 2463 - 2464 2366 #define SUPPORTED_FILTERS \ 2465 2367 (FIF_PROMISC_IN_BSS | \ 2466 2368 FIF_ALLMULTI | \ ··· 2499 2597 { 2500 2598 struct ath_wiphy *aphy = hw->priv; 2501 2599 struct ath_softc *sc = aphy->sc; 2600 + struct ath_hw *ah = sc->sc_ah; 2601 + struct ath_vif *avp = (void *)vif->drv_priv; 2602 + u32 rfilt = 0; 2603 + int error, i; 2502 2604 2503 2605 mutex_lock(&sc->mutex); 2606 + 2607 + /* 2608 + * TODO: Need to decide which hw opmode to use for 2609 + * multi-interface cases 2610 + * XXX: This belongs into add_interface! 2611 + */ 2612 + if (vif->type == NL80211_IFTYPE_AP && 2613 + ah->opmode != NL80211_IFTYPE_AP) { 2614 + ah->opmode = NL80211_IFTYPE_STATION; 2615 + ath9k_hw_setopmode(ah); 2616 + memcpy(sc->curbssid, sc->sc_ah->macaddr, ETH_ALEN); 2617 + sc->curaid = 0; 2618 + ath9k_hw_write_associd(sc); 2619 + /* Request full reset to get hw opmode changed properly */ 2620 + sc->sc_flags |= SC_OP_FULL_RESET; 2621 + } 2622 + 2623 + if ((changed & BSS_CHANGED_BSSID) && 2624 + !is_zero_ether_addr(bss_conf->bssid)) { 2625 + switch (vif->type) { 2626 + case NL80211_IFTYPE_STATION: 2627 + case NL80211_IFTYPE_ADHOC: 2628 + case NL80211_IFTYPE_MESH_POINT: 2629 + /* Set BSSID */ 2630 + memcpy(sc->curbssid, bss_conf->bssid, ETH_ALEN); 2631 + memcpy(avp->bssid, bss_conf->bssid, ETH_ALEN); 2632 + sc->curaid = 0; 2633 + ath9k_hw_write_associd(sc); 2634 + 2635 + /* Set aggregation protection mode parameters */ 2636 + sc->config.ath_aggr_prot = 0; 2637 + 2638 + DPRINTF(sc, ATH_DBG_CONFIG, 2639 + "RX filter 0x%x bssid %pM aid 0x%x\n", 2640 + rfilt, sc->curbssid, sc->curaid); 2641 + 2642 + /* need to reconfigure the beacon */ 2643 + sc->sc_flags &= ~SC_OP_BEACONS ; 2644 + 2645 + break; 2646 + default: 2647 + break; 2648 + } 2649 + } 2650 + 2651 + if ((vif->type == NL80211_IFTYPE_ADHOC) || 2652 + (vif->type == NL80211_IFTYPE_AP) || 2653 + (vif->type == NL80211_IFTYPE_MESH_POINT)) { 2654 + if ((changed & BSS_CHANGED_BEACON) || 2655 + (changed & BSS_CHANGED_BEACON_ENABLED && 2656 + bss_conf->enable_beacon)) { 2657 + /* 2658 + * Allocate and setup the beacon frame. 2659 + * 2660 + * Stop any previous beacon DMA. This may be 2661 + * necessary, for example, when an ibss merge 2662 + * causes reconfiguration; we may be called 2663 + * with beacon transmission active. 2664 + */ 2665 + ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 2666 + 2667 + error = ath_beacon_alloc(aphy, vif); 2668 + if (!error) 2669 + ath_beacon_config(sc, vif); 2670 + } 2671 + } 2672 + 2673 + /* Check for WLAN_CAPABILITY_PRIVACY ? */ 2674 + if ((avp->av_opmode != NL80211_IFTYPE_STATION)) { 2675 + for (i = 0; i < IEEE80211_WEP_NKID; i++) 2676 + if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) 2677 + ath9k_hw_keysetmac(sc->sc_ah, 2678 + (u16)i, 2679 + sc->curbssid); 2680 + } 2681 + 2682 + /* Only legacy IBSS for now */ 2683 + if (vif->type == NL80211_IFTYPE_ADHOC) 2684 + ath_update_chainmask(sc, 0); 2504 2685 2505 2686 if (changed & BSS_CHANGED_ERP_PREAMBLE) { 2506 2687 DPRINTF(sc, ATH_DBG_CONFIG, "BSS Changed PREAMBLE %d\n", ··· 2742 2757 .add_interface = ath9k_add_interface, 2743 2758 .remove_interface = ath9k_remove_interface, 2744 2759 .config = ath9k_config, 2745 - .config_interface = ath9k_config_interface, 2746 2760 .configure_filter = ath9k_configure_filter, 2747 2761 .sta_notify = ath9k_sta_notify, 2748 2762 .conf_tx = ath9k_conf_tx,
+26 -38
drivers/net/wireless/b43/main.c
··· 3543 3543 { 3544 3544 struct b43_wl *wl = hw_to_b43_wl(hw); 3545 3545 struct b43_wldev *dev; 3546 + unsigned long flags; 3546 3547 3547 3548 mutex_lock(&wl->mutex); 3548 3549 3549 3550 dev = wl->current_dev; 3550 3551 if (!dev || b43_status(dev) < B43_STAT_STARTED) 3551 3552 goto out_unlock_mutex; 3553 + 3554 + B43_WARN_ON(wl->vif != vif); 3555 + 3556 + if (changed & BSS_CHANGED_BSSID) { 3557 + spin_lock_irqsave(&wl->irq_lock, flags); 3558 + if (conf->bssid) 3559 + memcpy(wl->bssid, conf->bssid, ETH_ALEN); 3560 + else 3561 + memset(wl->bssid, 0, ETH_ALEN); 3562 + 3563 + if (b43_status(dev) >= B43_STAT_INITIALIZED) { 3564 + if (b43_is_mode(wl, NL80211_IFTYPE_AP) || 3565 + b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) { 3566 + B43_WARN_ON(vif->type != wl->if_type); 3567 + if (changed & BSS_CHANGED_BEACON) 3568 + b43_update_templates(wl); 3569 + } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) { 3570 + if (changed & BSS_CHANGED_BEACON) 3571 + b43_update_templates(wl); 3572 + } 3573 + b43_write_mac_bssid_templates(dev); 3574 + } 3575 + spin_unlock_irqrestore(&wl->irq_lock, flags); 3576 + } 3577 + 3552 3578 b43_mac_suspend(dev); 3553 3579 3554 3580 /* Update templates for AP/mesh mode. */ ··· 3597 3571 b43_mac_enable(dev); 3598 3572 out_unlock_mutex: 3599 3573 mutex_unlock(&wl->mutex); 3600 - 3601 - return; 3602 3574 } 3603 3575 3604 3576 static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ··· 3752 3728 if (changed && b43_status(dev) >= B43_STAT_INITIALIZED) 3753 3729 b43_adjust_opmode(dev); 3754 3730 spin_unlock_irqrestore(&wl->irq_lock, flags); 3755 - } 3756 - 3757 - static int b43_op_config_interface(struct ieee80211_hw *hw, 3758 - struct ieee80211_vif *vif, 3759 - struct ieee80211_if_conf *conf) 3760 - { 3761 - struct b43_wl *wl = hw_to_b43_wl(hw); 3762 - struct b43_wldev *dev = wl->current_dev; 3763 - unsigned long flags; 3764 - 3765 - if (!dev) 3766 - return -ENODEV; 3767 - mutex_lock(&wl->mutex); 3768 - spin_lock_irqsave(&wl->irq_lock, flags); 3769 - B43_WARN_ON(wl->vif != vif); 3770 - if (conf->bssid) 3771 - memcpy(wl->bssid, conf->bssid, ETH_ALEN); 3772 - else 3773 - memset(wl->bssid, 0, ETH_ALEN); 3774 - if (b43_status(dev) >= B43_STAT_INITIALIZED) { 3775 - if (b43_is_mode(wl, NL80211_IFTYPE_AP) || 3776 - b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) { 3777 - B43_WARN_ON(vif->type != wl->if_type); 3778 - if (conf->changed & IEEE80211_IFCC_BEACON) 3779 - b43_update_templates(wl); 3780 - } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) { 3781 - if (conf->changed & IEEE80211_IFCC_BEACON) 3782 - b43_update_templates(wl); 3783 - } 3784 - b43_write_mac_bssid_templates(dev); 3785 - } 3786 - spin_unlock_irqrestore(&wl->irq_lock, flags); 3787 - mutex_unlock(&wl->mutex); 3788 - 3789 - return 0; 3790 3731 } 3791 3732 3792 3733 /* Locking: wl->mutex */ ··· 4423 4434 .remove_interface = b43_op_remove_interface, 4424 4435 .config = b43_op_config, 4425 4436 .bss_info_changed = b43_op_bss_info_changed, 4426 - .config_interface = b43_op_config_interface, 4427 4437 .configure_filter = b43_op_configure_filter, 4428 4438 .set_key = b43_op_set_key, 4429 4439 .get_stats = b43_op_get_stats,
+24 -39
drivers/net/wireless/b43legacy/main.c
··· 2804 2804 u32 savedirqs; 2805 2805 2806 2806 mutex_lock(&wl->mutex); 2807 + B43legacy_WARN_ON(wl->vif != vif); 2807 2808 2808 2809 dev = wl->current_dev; 2809 2810 phy = &dev->phy; ··· 2818 2817 goto out_unlock_mutex; 2819 2818 } 2820 2819 savedirqs = b43legacy_interrupt_disable(dev, B43legacy_IRQ_ALL); 2821 - spin_unlock_irqrestore(&wl->irq_lock, flags); 2822 - b43legacy_synchronize_irq(dev); 2820 + 2821 + if (changed & BSS_CHANGED_BSSID) { 2822 + spin_unlock_irqrestore(&wl->irq_lock, flags); 2823 + b43legacy_synchronize_irq(dev); 2824 + 2825 + if (conf->bssid) 2826 + memcpy(wl->bssid, conf->bssid, ETH_ALEN); 2827 + else 2828 + memset(wl->bssid, 0, ETH_ALEN); 2829 + 2830 + if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { 2831 + if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) { 2832 + B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP); 2833 + if (changed & BSS_CHANGED_BEACON) 2834 + b43legacy_update_templates(wl); 2835 + } else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) { 2836 + if (changed & BSS_CHANGED_BEACON) 2837 + b43legacy_update_templates(wl); 2838 + } 2839 + b43legacy_write_mac_bssid_templates(dev); 2840 + } 2841 + spin_unlock_irqrestore(&wl->irq_lock, flags); 2842 + } 2823 2843 2824 2844 b43legacy_mac_suspend(dev); 2825 2845 ··· 2868 2846 spin_unlock_irqrestore(&wl->irq_lock, flags); 2869 2847 out_unlock_mutex: 2870 2848 mutex_unlock(&wl->mutex); 2871 - 2872 - return; 2873 2849 } 2874 2850 2875 2851 static void b43legacy_op_configure_filter(struct ieee80211_hw *hw, ··· 2907 2887 if (changed && b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) 2908 2888 b43legacy_adjust_opmode(dev); 2909 2889 spin_unlock_irqrestore(&wl->irq_lock, flags); 2910 - } 2911 - 2912 - static int b43legacy_op_config_interface(struct ieee80211_hw *hw, 2913 - struct ieee80211_vif *vif, 2914 - struct ieee80211_if_conf *conf) 2915 - { 2916 - struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 2917 - struct b43legacy_wldev *dev = wl->current_dev; 2918 - unsigned long flags; 2919 - 2920 - if (!dev) 2921 - return -ENODEV; 2922 - mutex_lock(&wl->mutex); 2923 - spin_lock_irqsave(&wl->irq_lock, flags); 2924 - B43legacy_WARN_ON(wl->vif != vif); 2925 - if (conf->bssid) 2926 - memcpy(wl->bssid, conf->bssid, ETH_ALEN); 2927 - else 2928 - memset(wl->bssid, 0, ETH_ALEN); 2929 - if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { 2930 - if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) { 2931 - B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP); 2932 - if (conf->changed & IEEE80211_IFCC_BEACON) 2933 - b43legacy_update_templates(wl); 2934 - } else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) { 2935 - if (conf->changed & IEEE80211_IFCC_BEACON) 2936 - b43legacy_update_templates(wl); 2937 - } 2938 - b43legacy_write_mac_bssid_templates(dev); 2939 - } 2940 - spin_unlock_irqrestore(&wl->irq_lock, flags); 2941 - mutex_unlock(&wl->mutex); 2942 - 2943 - return 0; 2944 2890 } 2945 2891 2946 2892 /* Locking: wl->mutex */ ··· 3549 3563 .remove_interface = b43legacy_op_remove_interface, 3550 3564 .config = b43legacy_op_dev_config, 3551 3565 .bss_info_changed = b43legacy_op_bss_info_changed, 3552 - .config_interface = b43legacy_op_config_interface, 3553 3566 .configure_filter = b43legacy_op_configure_filter, 3554 3567 .get_stats = b43legacy_op_get_stats, 3555 3568 .get_tx_stats = b43legacy_op_get_tx_stats,
-1
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 2623 2623 .add_interface = iwl_mac_add_interface, 2624 2624 .remove_interface = iwl_mac_remove_interface, 2625 2625 .config = iwl_mac_config, 2626 - .config_interface = iwl_mac_config_interface, 2627 2626 .configure_filter = iwl_configure_filter, 2628 2627 .set_key = iwl_mac_set_key, 2629 2628 .update_tkip_key = iwl_mac_update_tkip_key,
+58 -104
drivers/net/wireless/iwlwifi/iwl-core.c
··· 2238 2238 2239 2239 #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) 2240 2240 void iwl_bss_info_changed(struct ieee80211_hw *hw, 2241 - struct ieee80211_vif *vif, 2242 - struct ieee80211_bss_conf *bss_conf, 2243 - u32 changes) 2241 + struct ieee80211_vif *vif, 2242 + struct ieee80211_bss_conf *bss_conf, 2243 + u32 changes) 2244 2244 { 2245 2245 struct iwl_priv *priv = hw->priv; 2246 2246 int ret; 2247 2247 2248 2248 IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes); 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); 2249 2303 2250 2304 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 2251 2305 IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n", ··· 2359 2305 &priv->staging_rxon, 2360 2306 sizeof(struct iwl_rxon_cmd)); 2361 2307 } 2362 - 2308 + IWL_DEBUG_MAC80211(priv, "leave\n"); 2363 2309 } 2364 2310 EXPORT_SYMBOL(iwl_bss_info_changed); 2365 2311 ··· 2642 2588 return ret; 2643 2589 } 2644 2590 EXPORT_SYMBOL(iwl_mac_config); 2645 - 2646 - int iwl_mac_config_interface(struct ieee80211_hw *hw, 2647 - struct ieee80211_vif *vif, 2648 - struct ieee80211_if_conf *conf) 2649 - { 2650 - struct iwl_priv *priv = hw->priv; 2651 - int rc; 2652 - 2653 - if (conf == NULL) 2654 - return -EIO; 2655 - 2656 - if (priv->vif != vif) { 2657 - IWL_DEBUG_MAC80211(priv, "leave - priv->vif != vif\n"); 2658 - return 0; 2659 - } 2660 - 2661 - if (priv->iw_mode == NL80211_IFTYPE_ADHOC && 2662 - conf->changed & IEEE80211_IFCC_BEACON) { 2663 - struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 2664 - if (!beacon) 2665 - return -ENOMEM; 2666 - mutex_lock(&priv->mutex); 2667 - rc = iwl_mac_beacon_update(hw, beacon); 2668 - mutex_unlock(&priv->mutex); 2669 - if (rc) 2670 - return rc; 2671 - } 2672 - 2673 - if (!iwl_is_alive(priv)) 2674 - return -EAGAIN; 2675 - 2676 - mutex_lock(&priv->mutex); 2677 - 2678 - if (conf->bssid) 2679 - IWL_DEBUG_MAC80211(priv, "bssid: %pM\n", conf->bssid); 2680 - 2681 - /* 2682 - * very dubious code was here; the probe filtering flag is never set: 2683 - * 2684 - if (unlikely(test_bit(STATUS_SCANNING, &priv->status)) && 2685 - !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { 2686 - */ 2687 - 2688 - if (priv->iw_mode == NL80211_IFTYPE_AP) { 2689 - if (!conf->bssid) { 2690 - conf->bssid = priv->mac_addr; 2691 - memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 2692 - IWL_DEBUG_MAC80211(priv, "bssid was set to: %pM\n", 2693 - conf->bssid); 2694 - } 2695 - if (priv->ibss_beacon) 2696 - dev_kfree_skb(priv->ibss_beacon); 2697 - 2698 - priv->ibss_beacon = ieee80211_beacon_get(hw, vif); 2699 - } 2700 - 2701 - if (iwl_is_rfkill(priv)) 2702 - goto done; 2703 - 2704 - if (conf->bssid && !is_zero_ether_addr(conf->bssid) && 2705 - !is_multicast_ether_addr(conf->bssid)) { 2706 - /* If there is currently a HW scan going on in the background 2707 - * then we need to cancel it else the RXON below will fail. */ 2708 - if (iwl_scan_cancel_timeout(priv, 100)) { 2709 - IWL_WARN(priv, "Aborted scan still in progress " 2710 - "after 100ms\n"); 2711 - IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n"); 2712 - mutex_unlock(&priv->mutex); 2713 - return -EAGAIN; 2714 - } 2715 - memcpy(priv->staging_rxon.bssid_addr, conf->bssid, ETH_ALEN); 2716 - 2717 - /* TODO: Audit driver for usage of these members and see 2718 - * if mac80211 deprecates them (priv->bssid looks like it 2719 - * shouldn't be there, but I haven't scanned the IBSS code 2720 - * to verify) - jpk */ 2721 - memcpy(priv->bssid, conf->bssid, ETH_ALEN); 2722 - 2723 - if (priv->iw_mode == NL80211_IFTYPE_AP) 2724 - iwlcore_config_ap(priv); 2725 - else { 2726 - rc = iwlcore_commit_rxon(priv); 2727 - if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc) 2728 - iwl_rxon_add_station( 2729 - priv, priv->active_rxon.bssid_addr, 1); 2730 - } 2731 - 2732 - } else { 2733 - iwl_scan_cancel_timeout(priv, 100); 2734 - priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 2735 - iwlcore_commit_rxon(priv); 2736 - } 2737 - 2738 - done: 2739 - IWL_DEBUG_MAC80211(priv, "leave\n"); 2740 - mutex_unlock(&priv->mutex); 2741 - 2742 - return 0; 2743 - } 2744 - EXPORT_SYMBOL(iwl_mac_config_interface); 2745 2591 2746 2592 int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, 2747 2593 struct ieee80211_tx_queue_stats *stats)
-3
drivers/net/wireless/iwlwifi/iwl-core.h
··· 281 281 struct ieee80211_if_init_conf *conf); 282 282 int iwl_mac_config(struct ieee80211_hw *hw, u32 changed); 283 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 284 int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, 288 285 struct ieee80211_tx_queue_stats *stats); 289 286 void iwl_mac_reset_tsf(struct ieee80211_hw *hw);
-1
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 4106 4106 .add_interface = iwl_mac_add_interface, 4107 4107 .remove_interface = iwl_mac_remove_interface, 4108 4108 .config = iwl_mac_config, 4109 - .config_interface = iwl_mac_config_interface, 4110 4109 .configure_filter = iwl_configure_filter, 4111 4110 .set_key = iwl3945_mac_set_key, 4112 4111 .get_tx_stats = iwl_mac_get_tx_stats,
+23 -33
drivers/net/wireless/libertas_tf/main.c
··· 366 366 return 0; 367 367 } 368 368 369 - static int lbtf_op_config_interface(struct ieee80211_hw *hw, 370 - struct ieee80211_vif *vif, 371 - struct ieee80211_if_conf *conf) 372 - { 373 - struct lbtf_private *priv = hw->priv; 374 - struct sk_buff *beacon; 375 - 376 - switch (priv->vif->type) { 377 - case NL80211_IFTYPE_AP: 378 - case NL80211_IFTYPE_MESH_POINT: 379 - beacon = ieee80211_beacon_get(hw, vif); 380 - if (beacon) { 381 - lbtf_beacon_set(priv, beacon); 382 - kfree_skb(beacon); 383 - lbtf_beacon_ctrl(priv, 1, vif->bss_conf.beacon_int); 384 - } 385 - break; 386 - default: 387 - break; 388 - } 389 - 390 - if (conf->bssid) { 391 - u8 null_bssid[ETH_ALEN] = {0}; 392 - bool activate = compare_ether_addr(conf->bssid, null_bssid); 393 - lbtf_set_bssid(priv, activate, conf->bssid); 394 - } 395 - 396 - return 0; 397 - } 398 - 399 369 #define SUPPORTED_FIF_FLAGS (FIF_PROMISC_IN_BSS | FIF_ALLMULTI) 400 370 static void lbtf_op_configure_filter(struct ieee80211_hw *hw, 401 371 unsigned int changed_flags, ··· 421 451 u32 changes) 422 452 { 423 453 struct lbtf_private *priv = hw->priv; 454 + struct sk_buff *beacon; 455 + 456 + if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_INT)) { 457 + switch (priv->vif->type) { 458 + case NL80211_IFTYPE_AP: 459 + case NL80211_IFTYPE_MESH_POINT: 460 + beacon = ieee80211_beacon_get(hw, vif); 461 + if (beacon) { 462 + lbtf_beacon_set(priv, beacon); 463 + kfree_skb(beacon); 464 + lbtf_beacon_ctrl(priv, 1, 465 + bss_conf->beacon_int); 466 + } 467 + break; 468 + default: 469 + break; 470 + } 471 + } 472 + 473 + if (changes & BSS_CHANGED_BSSID) { 474 + bool activate = !is_zero_ether_addr(bss_conf->bssid); 475 + lbtf_set_bssid(priv, activate, bss_conf->bssid); 476 + } 424 477 425 478 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 426 479 if (bss_conf->use_short_preamble) ··· 452 459 priv->preamble = CMD_TYPE_LONG_PREAMBLE; 453 460 lbtf_set_radio_control(priv); 454 461 } 455 - 456 - return; 457 462 } 458 463 459 464 static const struct ieee80211_ops lbtf_ops = { ··· 461 470 .add_interface = lbtf_op_add_interface, 462 471 .remove_interface = lbtf_op_remove_interface, 463 472 .config = lbtf_op_config, 464 - .config_interface = lbtf_op_config_interface, 465 473 .configure_filter = lbtf_op_configure_filter, 466 474 .bss_info_changed = lbtf_op_bss_info_changed, 467 475 };
+7 -18
drivers/net/wireless/mac80211_hwsim.c
··· 587 587 *total_flags = data->rx_filter; 588 588 } 589 589 590 - static int mac80211_hwsim_config_interface(struct ieee80211_hw *hw, 591 - struct ieee80211_vif *vif, 592 - struct ieee80211_if_conf *conf) 593 - { 594 - struct hwsim_vif_priv *vp = (void *)vif->drv_priv; 595 - 596 - hwsim_check_magic(vif); 597 - if (conf->changed & IEEE80211_IFCC_BSSID) { 598 - DECLARE_MAC_BUF(mac); 599 - printk(KERN_DEBUG "%s:%s: BSSID changed: %pM\n", 600 - wiphy_name(hw->wiphy), __func__, 601 - conf->bssid); 602 - memcpy(vp->bssid, conf->bssid, ETH_ALEN); 603 - } 604 - return 0; 605 - } 606 - 607 590 static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, 608 591 struct ieee80211_vif *vif, 609 592 struct ieee80211_bss_conf *info, ··· 599 616 600 617 printk(KERN_DEBUG "%s:%s(changed=0x%x)\n", 601 618 wiphy_name(hw->wiphy), __func__, changed); 619 + 620 + if (changed & BSS_CHANGED_BSSID) { 621 + printk(KERN_DEBUG "%s:%s: BSSID changed: %pM\n", 622 + wiphy_name(hw->wiphy), __func__, 623 + info->bssid); 624 + memcpy(vp->bssid, info->bssid, ETH_ALEN); 625 + } 602 626 603 627 if (changed & BSS_CHANGED_ASSOC) { 604 628 printk(KERN_DEBUG " %s: ASSOC: assoc=%d aid=%d\n", ··· 698 708 .remove_interface = mac80211_hwsim_remove_interface, 699 709 .config = mac80211_hwsim_config, 700 710 .configure_filter = mac80211_hwsim_configure_filter, 701 - .config_interface = mac80211_hwsim_config_interface, 702 711 .bss_info_changed = mac80211_hwsim_bss_info_changed, 703 712 .sta_notify = mac80211_hwsim_sta_notify, 704 713 .set_tim = mac80211_hwsim_set_tim,
+4 -14
drivers/net/wireless/mwl8k.c
··· 3089 3089 return rc ? -EINVAL : 0; 3090 3090 } 3091 3091 3092 - static int mwl8k_config_interface(struct ieee80211_hw *hw, 3093 - struct ieee80211_vif *vif, 3094 - struct ieee80211_if_conf *conf) 3095 - { 3096 - struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); 3097 - u32 changed = conf->changed; 3098 - 3099 - if (changed & IEEE80211_IFCC_BSSID) 3100 - memcpy(mv_vif->bssid, conf->bssid, IEEE80211_ADDR_LEN); 3101 - 3102 - return 0; 3103 - } 3104 - 3105 3092 struct mwl8k_bss_info_changed_worker { 3106 3093 struct mwl8k_work_struct header; 3107 3094 struct ieee80211_vif *vif; ··· 3170 3183 { 3171 3184 struct mwl8k_bss_info_changed_worker *worker; 3172 3185 struct mwl8k_priv *priv = hw->priv; 3186 + struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); 3173 3187 int rc; 3188 + 3189 + if (changed & BSS_CHANGED_BSSID) 3190 + memcpy(mv_vif->bssid, info->bssid, IEEE80211_ADDR_LEN); 3174 3191 3175 3192 if ((changed & BSS_CHANGED_ASSOC) == 0) 3176 3193 return; ··· 3433 3442 .add_interface = mwl8k_add_interface, 3434 3443 .remove_interface = mwl8k_remove_interface, 3435 3444 .config = mwl8k_config, 3436 - .config_interface = mwl8k_config_interface, 3437 3445 .bss_info_changed = mwl8k_bss_info_changed, 3438 3446 .configure_filter = mwl8k_configure_filter, 3439 3447 .set_rts_threshold = mwl8k_set_rts_threshold,
+25 -38
drivers/net/wireless/p54/p54common.c
··· 2204 2204 return ret; 2205 2205 } 2206 2206 2207 - static int p54_config_interface(struct ieee80211_hw *dev, 2208 - struct ieee80211_vif *vif, 2209 - struct ieee80211_if_conf *conf) 2210 - { 2211 - struct p54_common *priv = dev->priv; 2212 - int ret = 0; 2213 - 2214 - mutex_lock(&priv->conf_mutex); 2215 - if (conf->changed & IEEE80211_IFCC_BSSID) { 2216 - memcpy(priv->bssid, conf->bssid, ETH_ALEN); 2217 - ret = p54_setup_mac(dev); 2218 - if (ret) 2219 - goto out; 2220 - } 2221 - 2222 - if (conf->changed & IEEE80211_IFCC_BEACON) { 2223 - ret = p54_scan(dev, P54_SCAN_EXIT, 0); 2224 - if (ret) 2225 - goto out; 2226 - ret = p54_setup_mac(dev); 2227 - if (ret) 2228 - goto out; 2229 - ret = p54_beacon_update(dev, vif); 2230 - if (ret) 2231 - goto out; 2232 - ret = p54_set_edcf(dev); 2233 - if (ret) 2234 - goto out; 2235 - } 2236 - 2237 - out: 2238 - mutex_unlock(&priv->conf_mutex); 2239 - return ret; 2240 - } 2241 - 2242 2207 static void p54_configure_filter(struct ieee80211_hw *dev, 2243 2208 unsigned int changed_flags, 2244 2209 unsigned int *total_flags, ··· 2307 2342 u32 changed) 2308 2343 { 2309 2344 struct p54_common *priv = dev->priv; 2345 + int ret; 2310 2346 2311 - if (changed & BSS_CHANGED_ERP_SLOT) { 2347 + mutex_lock(&priv->conf_mutex); 2348 + if (changed & BSS_CHANGED_BSSID) { 2349 + memcpy(priv->bssid, info->bssid, ETH_ALEN); 2350 + ret = p54_setup_mac(dev); 2351 + if (ret) 2352 + goto out; 2353 + } 2354 + 2355 + if (changed & BSS_CHANGED_BEACON) { 2356 + ret = p54_scan(dev, P54_SCAN_EXIT, 0); 2357 + if (ret) 2358 + goto out; 2359 + ret = p54_setup_mac(dev); 2360 + if (ret) 2361 + goto out; 2362 + ret = p54_beacon_update(dev, vif); 2363 + if (ret) 2364 + goto out; 2365 + } 2366 + /* XXX: this mimics having two callbacks... clean up */ 2367 + out: 2368 + mutex_unlock(&priv->conf_mutex); 2369 + 2370 + if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_BEACON)) { 2312 2371 priv->use_short_slot = info->use_short_slot; 2313 2372 p54_set_edcf(dev); 2314 2373 } ··· 2353 2364 p54_setup_mac(dev); 2354 2365 } 2355 2366 } 2356 - 2357 2367 } 2358 2368 2359 2369 static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, ··· 2607 2619 .sta_notify = p54_sta_notify, 2608 2620 .set_key = p54_set_key, 2609 2621 .config = p54_config, 2610 - .config_interface = p54_config_interface, 2611 2622 .bss_info_changed = p54_bss_info_changed, 2612 2623 .configure_filter = p54_configure_filter, 2613 2624 .conf_tx = p54_conf_tx,
-1
drivers/net/wireless/rt2x00/rt2400pci.c
··· 1580 1580 .add_interface = rt2x00mac_add_interface, 1581 1581 .remove_interface = rt2x00mac_remove_interface, 1582 1582 .config = rt2x00mac_config, 1583 - .config_interface = rt2x00mac_config_interface, 1584 1583 .configure_filter = rt2x00mac_configure_filter, 1585 1584 .get_stats = rt2x00mac_get_stats, 1586 1585 .bss_info_changed = rt2x00mac_bss_info_changed,
-1
drivers/net/wireless/rt2x00/rt2500pci.c
··· 1879 1879 .add_interface = rt2x00mac_add_interface, 1880 1880 .remove_interface = rt2x00mac_remove_interface, 1881 1881 .config = rt2x00mac_config, 1882 - .config_interface = rt2x00mac_config_interface, 1883 1882 .configure_filter = rt2x00mac_configure_filter, 1884 1883 .get_stats = rt2x00mac_get_stats, 1885 1884 .bss_info_changed = rt2x00mac_bss_info_changed,
-1
drivers/net/wireless/rt2x00/rt2500usb.c
··· 1908 1908 .add_interface = rt2x00mac_add_interface, 1909 1909 .remove_interface = rt2x00mac_remove_interface, 1910 1910 .config = rt2x00mac_config, 1911 - .config_interface = rt2x00mac_config_interface, 1912 1911 .configure_filter = rt2x00mac_configure_filter, 1913 1912 .set_key = rt2x00mac_set_key, 1914 1913 .get_stats = rt2x00mac_get_stats,
-3
drivers/net/wireless/rt2x00/rt2x00.h
··· 943 943 void rt2x00mac_remove_interface(struct ieee80211_hw *hw, 944 944 struct ieee80211_if_init_conf *conf); 945 945 int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed); 946 - int rt2x00mac_config_interface(struct ieee80211_hw *hw, 947 - struct ieee80211_vif *vif, 948 - struct ieee80211_if_conf *conf); 949 946 void rt2x00mac_configure_filter(struct ieee80211_hw *hw, 950 947 unsigned int changed_flags, 951 948 unsigned int *total_flags,
+38 -50
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 390 390 } 391 391 EXPORT_SYMBOL_GPL(rt2x00mac_config); 392 392 393 - int rt2x00mac_config_interface(struct ieee80211_hw *hw, 394 - struct ieee80211_vif *vif, 395 - struct ieee80211_if_conf *conf) 396 - { 397 - struct rt2x00_dev *rt2x00dev = hw->priv; 398 - struct rt2x00_intf *intf = vif_to_intf(vif); 399 - int update_bssid = 0; 400 - int status = 0; 401 - 402 - /* 403 - * Mac80211 might be calling this function while we are trying 404 - * to remove the device or perhaps suspending it. 405 - */ 406 - if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 407 - return 0; 408 - 409 - spin_lock(&intf->lock); 410 - 411 - /* 412 - * conf->bssid can be NULL if coming from the internal 413 - * beacon update routine. 414 - */ 415 - if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) { 416 - update_bssid = 1; 417 - memcpy(&intf->bssid, conf->bssid, ETH_ALEN); 418 - } 419 - 420 - spin_unlock(&intf->lock); 421 - 422 - /* 423 - * Call rt2x00_config_intf() outside of the spinlock context since 424 - * the call will sleep for USB drivers. By using the ieee80211_if_conf 425 - * values as arguments we make keep access to rt2x00_intf thread safe 426 - * even without the lock. 427 - */ 428 - rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, 429 - update_bssid ? conf->bssid : NULL); 430 - 431 - /* 432 - * Update the beacon. 433 - */ 434 - if (conf->changed & (IEEE80211_IFCC_BEACON | 435 - IEEE80211_IFCC_BEACON_ENABLED)) 436 - status = rt2x00queue_update_beacon(rt2x00dev, vif, 437 - conf->enable_beacon); 438 - 439 - return status; 440 - } 441 - EXPORT_SYMBOL_GPL(rt2x00mac_config_interface); 442 - 443 393 void rt2x00mac_configure_filter(struct ieee80211_hw *hw, 444 394 unsigned int changed_flags, 445 395 unsigned int *total_flags, ··· 573 623 struct rt2x00_dev *rt2x00dev = hw->priv; 574 624 struct rt2x00_intf *intf = vif_to_intf(vif); 575 625 unsigned int delayed = 0; 626 + int update_bssid = 0; 627 + 628 + /* 629 + * Mac80211 might be calling this function while we are trying 630 + * to remove the device or perhaps suspending it. 631 + */ 632 + if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) 633 + return; 634 + 635 + spin_lock(&intf->lock); 636 + 637 + /* 638 + * conf->bssid can be NULL if coming from the internal 639 + * beacon update routine. 640 + */ 641 + if (changes & BSS_CHANGED_BSSID) { 642 + update_bssid = 1; 643 + memcpy(&intf->bssid, bss_conf->bssid, ETH_ALEN); 644 + } 645 + 646 + spin_unlock(&intf->lock); 647 + 648 + /* 649 + * Call rt2x00_config_intf() outside of the spinlock context since 650 + * the call will sleep for USB drivers. By using the ieee80211_if_conf 651 + * values as arguments we make keep access to rt2x00_intf thread safe 652 + * even without the lock. 653 + */ 654 + if (changes & BSS_CHANGED_BSSID) 655 + rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, 656 + update_bssid ? bss_conf->bssid : NULL); 657 + 658 + /* 659 + * Update the beacon. 660 + */ 661 + if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED)) 662 + rt2x00queue_update_beacon(rt2x00dev, vif, 663 + bss_conf->enable_beacon); 576 664 577 665 /* 578 666 * When the association status has changed we must reset the link
-1
drivers/net/wireless/rt2x00/rt61pci.c
··· 2735 2735 .add_interface = rt2x00mac_add_interface, 2736 2736 .remove_interface = rt2x00mac_remove_interface, 2737 2737 .config = rt2x00mac_config, 2738 - .config_interface = rt2x00mac_config_interface, 2739 2738 .configure_filter = rt2x00mac_configure_filter, 2740 2739 .set_key = rt2x00mac_set_key, 2741 2740 .get_stats = rt2x00mac_get_stats,
-1
drivers/net/wireless/rt2x00/rt73usb.c
··· 2259 2259 .add_interface = rt2x00mac_add_interface, 2260 2260 .remove_interface = rt2x00mac_remove_interface, 2261 2261 .config = rt2x00mac_config, 2262 - .config_interface = rt2x00mac_config_interface, 2263 2262 .configure_filter = rt2x00mac_configure_filter, 2264 2263 .set_key = rt2x00mac_set_key, 2265 2264 .get_stats = rt2x00mac_get_stats,
+14 -19
drivers/net/wireless/rtl818x/rtl8180_dev.c
··· 702 702 return 0; 703 703 } 704 704 705 - static int rtl8180_config_interface(struct ieee80211_hw *dev, 706 - struct ieee80211_vif *vif, 707 - struct ieee80211_if_conf *conf) 708 - { 709 - struct rtl8180_priv *priv = dev->priv; 710 - int i; 711 - 712 - for (i = 0; i < ETH_ALEN; i++) 713 - rtl818x_iowrite8(priv, &priv->map->BSSID[i], conf->bssid[i]); 714 - 715 - if (is_valid_ether_addr(conf->bssid)) 716 - rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_INFRA); 717 - else 718 - rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_NO_LINK); 719 - 720 - return 0; 721 - } 722 - 723 705 static void rtl8180_bss_info_changed(struct ieee80211_hw *dev, 724 706 struct ieee80211_vif *vif, 725 707 struct ieee80211_bss_conf *info, 726 708 u32 changed) 727 709 { 728 710 struct rtl8180_priv *priv = dev->priv; 711 + int i; 712 + 713 + if (changed & BSS_CHANGED_BSSID) { 714 + for (i = 0; i < ETH_ALEN; i++) 715 + rtl818x_iowrite8(priv, &priv->map->BSSID[i], 716 + info->bssid[i]); 717 + 718 + if (is_valid_ether_addr(info->bssid)) 719 + rtl818x_iowrite8(priv, &priv->map->MSR, 720 + RTL818X_MSR_INFRA); 721 + else 722 + rtl818x_iowrite8(priv, &priv->map->MSR, 723 + RTL818X_MSR_NO_LINK); 724 + } 729 725 730 726 if (changed & BSS_CHANGED_ERP_SLOT && priv->rf->conf_erp) 731 727 priv->rf->conf_erp(dev, info); ··· 766 770 .add_interface = rtl8180_add_interface, 767 771 .remove_interface = rtl8180_remove_interface, 768 772 .config = rtl8180_config, 769 - .config_interface = rtl8180_config_interface, 770 773 .bss_info_changed = rtl8180_bss_info_changed, 771 774 .configure_filter = rtl8180_configure_filter, 772 775 };
+21 -27
drivers/net/wireless/rtl818x/rtl8187_dev.c
··· 1090 1090 return 0; 1091 1091 } 1092 1092 1093 - static int rtl8187_config_interface(struct ieee80211_hw *dev, 1094 - struct ieee80211_vif *vif, 1095 - struct ieee80211_if_conf *conf) 1096 - { 1097 - struct rtl8187_priv *priv = dev->priv; 1098 - int i; 1099 - u8 reg; 1100 - 1101 - mutex_lock(&priv->conf_mutex); 1102 - for (i = 0; i < ETH_ALEN; i++) 1103 - rtl818x_iowrite8(priv, &priv->map->BSSID[i], conf->bssid[i]); 1104 - 1105 - if (is_valid_ether_addr(conf->bssid)) { 1106 - reg = RTL818X_MSR_INFRA; 1107 - if (priv->is_rtl8187b) 1108 - reg |= RTL818X_MSR_ENEDCA; 1109 - rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1110 - } else { 1111 - reg = RTL818X_MSR_NO_LINK; 1112 - rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1113 - } 1114 - 1115 - mutex_unlock(&priv->conf_mutex); 1116 - return 0; 1117 - } 1118 - 1119 1093 /* 1120 1094 * With 8187B, AC_*_PARAM clashes with FEMR definition in struct rtl818x_csr for 1121 1095 * example. Thus we have to use raw values for AC_*_PARAM register addresses. ··· 1167 1193 u32 changed) 1168 1194 { 1169 1195 struct rtl8187_priv *priv = dev->priv; 1196 + int i; 1197 + u8 reg; 1198 + 1199 + if (changed & BSS_CHANGED_BSSID) { 1200 + mutex_lock(&priv->conf_mutex); 1201 + for (i = 0; i < ETH_ALEN; i++) 1202 + rtl818x_iowrite8(priv, &priv->map->BSSID[i], 1203 + info->bssid[i]); 1204 + 1205 + if (is_valid_ether_addr(info->bssid)) { 1206 + reg = RTL818X_MSR_INFRA; 1207 + if (priv->is_rtl8187b) 1208 + reg |= RTL818X_MSR_ENEDCA; 1209 + rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1210 + } else { 1211 + reg = RTL818X_MSR_NO_LINK; 1212 + rtl818x_iowrite8(priv, &priv->map->MSR, reg); 1213 + } 1214 + 1215 + mutex_unlock(&priv->conf_mutex); 1216 + } 1170 1217 1171 1218 if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_ERP_PREAMBLE)) 1172 1219 rtl8187_conf_erp(priv, info->use_short_slot, ··· 1269 1274 .add_interface = rtl8187_add_interface, 1270 1275 .remove_interface = rtl8187_remove_interface, 1271 1276 .config = rtl8187_config, 1272 - .config_interface = rtl8187_config_interface, 1273 1277 .bss_info_changed = rtl8187_bss_info_changed, 1274 1278 .configure_filter = rtl8187_configure_filter, 1275 1279 .conf_tx = rtl8187_conf_tx
+33 -47
drivers/net/wireless/zd1211rw/zd_mac.c
··· 755 755 return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); 756 756 } 757 757 758 - static int zd_op_config_interface(struct ieee80211_hw *hw, 759 - struct ieee80211_vif *vif, 760 - struct ieee80211_if_conf *conf) 761 - { 762 - struct zd_mac *mac = zd_hw_mac(hw); 763 - int associated; 764 - int r; 765 - 766 - if (mac->type == NL80211_IFTYPE_MESH_POINT || 767 - mac->type == NL80211_IFTYPE_ADHOC) { 768 - associated = true; 769 - if (conf->changed & IEEE80211_IFCC_BEACON) { 770 - struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 771 - 772 - if (!beacon) 773 - return -ENOMEM; 774 - r = zd_mac_config_beacon(hw, beacon); 775 - kfree_skb(beacon); 776 - 777 - if (r < 0) 778 - return r; 779 - } 780 - 781 - if (conf->changed & IEEE80211_IFCC_BEACON_ENABLED) { 782 - u32 interval; 783 - 784 - if (conf->enable_beacon) 785 - interval = BCN_MODE_IBSS | hw->conf.beacon_int; 786 - else 787 - interval = 0; 788 - 789 - r = zd_set_beacon_interval(&mac->chip, interval); 790 - if (r < 0) 791 - return r; 792 - } 793 - } else 794 - associated = is_valid_ether_addr(conf->bssid); 795 - 796 - spin_lock_irq(&mac->lock); 797 - mac->associated = associated; 798 - spin_unlock_irq(&mac->lock); 799 - 800 - /* TODO: do hardware bssid filtering */ 801 - return 0; 802 - } 803 - 804 758 static void zd_process_intr(struct work_struct *work) 805 759 { 806 760 u16 int_status; ··· 877 923 { 878 924 struct zd_mac *mac = zd_hw_mac(hw); 879 925 unsigned long flags; 926 + int associated; 880 927 881 928 dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes); 929 + 930 + if (mac->type == NL80211_IFTYPE_MESH_POINT || 931 + mac->type == NL80211_IFTYPE_ADHOC) { 932 + associated = true; 933 + if (changes & BSS_CHANGED_BEACON) { 934 + struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 935 + 936 + if (beacon) { 937 + zd_mac_config_beacon(hw, beacon); 938 + kfree_skb(beacon); 939 + } 940 + } 941 + 942 + if (changes & BSS_CHANGED_BEACON_ENABLED) { 943 + u32 interval; 944 + 945 + if (bss_conf->enable_beacon) 946 + interval = BCN_MODE_IBSS | 947 + bss_conf->beacon_int; 948 + else 949 + interval = 0; 950 + 951 + zd_set_beacon_interval(&mac->chip, interval); 952 + } 953 + } else 954 + associated = is_valid_ether_addr(bss_conf->bssid); 955 + 956 + spin_lock_irq(&mac->lock); 957 + mac->associated = associated; 958 + spin_unlock_irq(&mac->lock); 959 + 960 + /* TODO: do hardware bssid filtering */ 882 961 883 962 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 884 963 spin_lock_irqsave(&mac->lock, flags); ··· 939 952 .add_interface = zd_op_add_interface, 940 953 .remove_interface = zd_op_remove_interface, 941 954 .config = zd_op_config, 942 - .config_interface = zd_op_config_interface, 943 955 .configure_filter = zd_op_configure_filter, 944 956 .bss_info_changed = zd_op_bss_info_changed, 945 957 .get_tsf = zd_op_get_tsf,
+13 -38
include/net/mac80211.h
··· 150 150 * @BSS_CHANGED_HT: 802.11n parameters changed 151 151 * @BSS_CHANGED_BASIC_RATES: Basic rateset changed 152 152 * @BSS_CHANGED_BEACON_INT: Beacon interval changed 153 + * @BSS_CHANGED_BSSID: BSSID changed, for whatever 154 + * reason (IBSS and managed mode) 155 + * @BSS_CHANGED_BEACON: Beacon data changed, retrieve 156 + * new beacon (beaconing modes) 157 + * @BSS_CHANGED_BEACON_ENABLED: Beaconing should be 158 + * enabled/disabled (beaconing modes) 153 159 */ 154 160 enum ieee80211_bss_change { 155 161 BSS_CHANGED_ASSOC = 1<<0, ··· 165 159 BSS_CHANGED_HT = 1<<4, 166 160 BSS_CHANGED_BASIC_RATES = 1<<5, 167 161 BSS_CHANGED_BEACON_INT = 1<<6, 162 + BSS_CHANGED_BSSID = 1<<7, 163 + BSS_CHANGED_BEACON = 1<<8, 164 + BSS_CHANGED_BEACON_ENABLED = 1<<9, 168 165 }; 169 166 170 167 /** ··· 201 192 * @basic_rates: bitmap of basic rates, each bit stands for an 202 193 * index into the rate table configured by the driver in 203 194 * the current band. 195 + * @bssid: The BSSID for this BSS 196 + * @enable_beacon: whether beaconing should be enabled or not 204 197 */ 205 198 struct ieee80211_bss_conf { 199 + const u8 *bssid; 206 200 /* association related data */ 207 201 bool assoc; 208 202 u16 aid; ··· 213 201 bool use_cts_prot; 214 202 bool use_short_preamble; 215 203 bool use_short_slot; 204 + bool enable_beacon; 216 205 u8 dtim_period; 217 206 u16 beacon_int; 218 207 u16 assoc_capability; ··· 670 657 enum nl80211_iftype type; 671 658 struct ieee80211_vif *vif; 672 659 void *mac_addr; 673 - }; 674 - 675 - /** 676 - * enum ieee80211_if_conf_change - interface config change flags 677 - * 678 - * @IEEE80211_IFCC_BSSID: The BSSID changed. 679 - * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 680 - * (currently AP and MESH only), use ieee80211_beacon_get(). 681 - * @IEEE80211_IFCC_BEACON_ENABLED: The enable_beacon value changed. 682 - */ 683 - enum ieee80211_if_conf_change { 684 - IEEE80211_IFCC_BSSID = BIT(0), 685 - IEEE80211_IFCC_BEACON = BIT(1), 686 - IEEE80211_IFCC_BEACON_ENABLED = BIT(2), 687 - }; 688 - 689 - /** 690 - * struct ieee80211_if_conf - configuration of an interface 691 - * 692 - * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 693 - * @bssid: BSSID of the network we are associated to/creating. 694 - * @enable_beacon: Indicates whether beacons can be sent. 695 - * This is valid only for AP/IBSS/MESH modes. 696 - * 697 - * This structure is passed to the config_interface() callback of 698 - * &struct ieee80211_hw. 699 - */ 700 - struct ieee80211_if_conf { 701 - u32 changed; 702 - const u8 *bssid; 703 - bool enable_beacon; 704 660 }; 705 661 706 662 /** ··· 1340 1358 * This function should never fail but returns a negative error code 1341 1359 * if it does. 1342 1360 * 1343 - * @config_interface: Handler for configuration requests related to interfaces 1344 - * (e.g. BSSID changes.) 1345 - * Returns a negative error code which will be seen in userspace. 1346 - * 1347 1361 * @bss_info_changed: Handler for configuration requests related to BSS 1348 1362 * parameters that may vary during BSS's lifespan, and may affect low 1349 1363 * level driver (e.g. assoc/disassoc status, erp parameters). ··· 1441 1463 void (*remove_interface)(struct ieee80211_hw *hw, 1442 1464 struct ieee80211_if_init_conf *conf); 1443 1465 int (*config)(struct ieee80211_hw *hw, u32 changed); 1444 - int (*config_interface)(struct ieee80211_hw *hw, 1445 - struct ieee80211_vif *vif, 1446 - struct ieee80211_if_conf *conf); 1447 1466 void (*bss_info_changed)(struct ieee80211_hw *hw, 1448 1467 struct ieee80211_vif *vif, 1449 1468 struct ieee80211_bss_conf *info,
+5 -3
net/mac80211/cfg.c
··· 521 521 522 522 kfree(old); 523 523 524 - return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON | 525 - IEEE80211_IFCC_BEACON_ENABLED); 524 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | 525 + BSS_CHANGED_BEACON); 526 + return 0; 526 527 } 527 528 528 529 static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, ··· 574 573 synchronize_rcu(); 575 574 kfree(old); 576 575 577 - return ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED); 576 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); 577 + return 0; 578 578 } 579 579 580 580 /* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */
+8 -10
net/mac80211/ibss.c
··· 95 95 96 96 sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; 97 97 98 - ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID); 99 - 100 98 local->oper_channel = chan; 101 99 local->oper_channel_type = NL80211_CHAN_NO_HT; 102 100 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); 103 - 104 - sdata->vif.bss_conf.beacon_int = beacon_int; 105 - bss_change = BSS_CHANGED_BEACON_INT; 106 - bss_change |= ieee80211_reset_erp_info(sdata); 107 - ieee80211_bss_info_change_notify(sdata, bss_change); 108 101 109 102 sband = local->hw.wiphy->bands[chan->band]; 110 103 ··· 154 161 155 162 rcu_assign_pointer(ifibss->presp, skb); 156 163 157 - ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON | 158 - IEEE80211_IFCC_BEACON_ENABLED); 164 + sdata->vif.bss_conf.beacon_int = beacon_int; 165 + bss_change = BSS_CHANGED_BEACON_INT; 166 + bss_change |= ieee80211_reset_erp_info(sdata); 167 + bss_change |= BSS_CHANGED_BSSID; 168 + bss_change |= BSS_CHANGED_BEACON; 169 + bss_change |= BSS_CHANGED_BEACON_ENABLED; 170 + ieee80211_bss_info_change_notify(sdata, bss_change); 159 171 160 172 rates = 0; 161 173 for (i = 0; i < supp_rates_len; i++) { ··· 885 887 kfree(sdata->u.ibss.ie); 886 888 skb = sdata->u.ibss.presp; 887 889 rcu_assign_pointer(sdata->u.ibss.presp, NULL); 888 - ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED); 890 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); 889 891 synchronize_rcu(); 890 892 kfree_skb(skb); 891 893
-1
net/mac80211/ieee80211_i.h
··· 906 906 907 907 908 908 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed); 909 - int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed); 910 909 void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); 911 910 void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, 912 911 u32 changed);
+55 -76
net/mac80211/main.c
··· 152 152 ieee80211_configure_filter(local); 153 153 } 154 154 155 - /* everything else */ 156 - 157 - int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed) 158 - { 159 - struct ieee80211_local *local = sdata->local; 160 - struct ieee80211_if_conf conf; 161 - 162 - if (WARN_ON(!netif_running(sdata->dev))) 163 - return 0; 164 - 165 - memset(&conf, 0, sizeof(conf)); 166 - 167 - if (sdata->vif.type == NL80211_IFTYPE_STATION) 168 - conf.bssid = sdata->u.mgd.bssid; 169 - else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) 170 - conf.bssid = sdata->u.ibss.bssid; 171 - else if (sdata->vif.type == NL80211_IFTYPE_AP) 172 - conf.bssid = sdata->dev->dev_addr; 173 - else if (ieee80211_vif_is_mesh(&sdata->vif)) { 174 - static const u8 zero[ETH_ALEN] = { 0 }; 175 - conf.bssid = zero; 176 - } else { 177 - WARN_ON(1); 178 - return -EINVAL; 179 - } 180 - 181 - if (!local->ops->config_interface) 182 - return 0; 183 - 184 - switch (sdata->vif.type) { 185 - case NL80211_IFTYPE_AP: 186 - case NL80211_IFTYPE_ADHOC: 187 - case NL80211_IFTYPE_MESH_POINT: 188 - break; 189 - default: 190 - /* do not warn to simplify caller in scan.c */ 191 - changed &= ~IEEE80211_IFCC_BEACON_ENABLED; 192 - if (WARN_ON(changed & IEEE80211_IFCC_BEACON)) 193 - return -EINVAL; 194 - changed &= ~IEEE80211_IFCC_BEACON; 195 - break; 196 - } 197 - 198 - if (changed & IEEE80211_IFCC_BEACON_ENABLED) { 199 - if (local->sw_scanning) { 200 - conf.enable_beacon = false; 201 - } else { 202 - /* 203 - * Beacon should be enabled, but AP mode must 204 - * check whether there is a beacon configured. 205 - */ 206 - switch (sdata->vif.type) { 207 - case NL80211_IFTYPE_AP: 208 - conf.enable_beacon = 209 - !!rcu_dereference(sdata->u.ap.beacon); 210 - break; 211 - case NL80211_IFTYPE_ADHOC: 212 - conf.enable_beacon = !!sdata->u.ibss.presp; 213 - break; 214 - case NL80211_IFTYPE_MESH_POINT: 215 - conf.enable_beacon = true; 216 - break; 217 - default: 218 - /* not reached */ 219 - WARN_ON(1); 220 - break; 221 - } 222 - } 223 - } 224 - 225 - conf.changed = changed; 226 - 227 - return local->ops->config_interface(local_to_hw(local), 228 - &sdata->vif, &conf); 229 - } 230 - 231 155 int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) 232 156 { 233 157 struct ieee80211_channel *chan; ··· 220 296 221 297 if (!changed) 222 298 return; 299 + 300 + if (sdata->vif.type == NL80211_IFTYPE_STATION) 301 + sdata->vif.bss_conf.bssid = sdata->u.mgd.bssid; 302 + else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) 303 + sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid; 304 + else if (sdata->vif.type == NL80211_IFTYPE_AP) 305 + sdata->vif.bss_conf.bssid = sdata->dev->dev_addr; 306 + else if (ieee80211_vif_is_mesh(&sdata->vif)) { 307 + static const u8 zero[ETH_ALEN] = { 0 }; 308 + sdata->vif.bss_conf.bssid = zero; 309 + } else { 310 + WARN_ON(1); 311 + return; 312 + } 313 + 314 + switch (sdata->vif.type) { 315 + case NL80211_IFTYPE_AP: 316 + case NL80211_IFTYPE_ADHOC: 317 + case NL80211_IFTYPE_MESH_POINT: 318 + break; 319 + default: 320 + /* do not warn to simplify caller in scan.c */ 321 + changed &= ~BSS_CHANGED_BEACON_ENABLED; 322 + if (WARN_ON(changed & BSS_CHANGED_BEACON)) 323 + return; 324 + break; 325 + } 326 + 327 + if (changed & BSS_CHANGED_BEACON_ENABLED) { 328 + if (local->sw_scanning) { 329 + sdata->vif.bss_conf.enable_beacon = false; 330 + } else { 331 + /* 332 + * Beacon should be enabled, but AP mode must 333 + * check whether there is a beacon configured. 334 + */ 335 + switch (sdata->vif.type) { 336 + case NL80211_IFTYPE_AP: 337 + sdata->vif.bss_conf.enable_beacon = 338 + !!rcu_dereference(sdata->u.ap.beacon); 339 + break; 340 + case NL80211_IFTYPE_ADHOC: 341 + sdata->vif.bss_conf.enable_beacon = 342 + !!rcu_dereference(sdata->u.ibss.presp); 343 + break; 344 + case NL80211_IFTYPE_MESH_POINT: 345 + sdata->vif.bss_conf.enable_beacon = true; 346 + break; 347 + default: 348 + /* not reached */ 349 + WARN_ON(1); 350 + break; 351 + } 352 + } 353 + } 223 354 224 355 if (local->ops->bss_info_changed) 225 356 local->ops->bss_info_changed(local_to_hw(local),
+3 -3
net/mac80211/mesh.c
··· 417 417 418 418 free_plinks = mesh_plink_availables(sdata); 419 419 if (free_plinks != sdata->u.mesh.accepting_plinks) 420 - ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON); 420 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); 421 421 422 422 ifmsh->housekeeping = false; 423 423 mod_timer(&ifmsh->housekeeping_timer, ··· 432 432 433 433 ifmsh->housekeeping = true; 434 434 queue_work(local->hw.workqueue, &ifmsh->work); 435 - ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON | 436 - IEEE80211_IFCC_BEACON_ENABLED); 435 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON | 436 + BSS_CHANGED_BEACON_ENABLED); 437 437 } 438 438 439 439 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
+2 -6
net/mac80211/mlme.c
··· 2289 2289 ifmgd->flags &= ~IEEE80211_STA_BSSID_SET; 2290 2290 } 2291 2291 2292 - if (netif_running(sdata->dev)) { 2293 - if (ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID)) { 2294 - printk(KERN_DEBUG "%s: Failed to config new BSSID to " 2295 - "the low-level driver\n", sdata->dev->name); 2296 - } 2297 - } 2292 + if (netif_running(sdata->dev)) 2293 + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 2298 2294 2299 2295 return ieee80211_sta_commit(sdata); 2300 2296 }
+4 -4
net/mac80211/scan.c
··· 346 346 if (sdata->vif.type == NL80211_IFTYPE_AP || 347 347 sdata->vif.type == NL80211_IFTYPE_ADHOC || 348 348 sdata->vif.type == NL80211_IFTYPE_MESH_POINT) 349 - ieee80211_if_config(sdata, 350 - IEEE80211_IFCC_BEACON_ENABLED); 349 + ieee80211_bss_info_change_notify( 350 + sdata, BSS_CHANGED_BEACON_ENABLED); 351 351 } 352 352 mutex_unlock(&local->iflist_mtx); 353 353 ··· 387 387 if (sdata->vif.type == NL80211_IFTYPE_AP || 388 388 sdata->vif.type == NL80211_IFTYPE_ADHOC || 389 389 sdata->vif.type == NL80211_IFTYPE_MESH_POINT) 390 - ieee80211_if_config(sdata, 391 - IEEE80211_IFCC_BEACON_ENABLED); 390 + ieee80211_bss_info_change_notify( 391 + sdata, BSS_CHANGED_BEACON_ENABLED); 392 392 393 393 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 394 394 if (sdata->u.mgd.flags & IEEE80211_STA_ASSOCIATED) {
+3 -14
net/mac80211/util.c
··· 1063 1063 switch (sdata->vif.type) { 1064 1064 case NL80211_IFTYPE_STATION: 1065 1065 /* disable beacon change bits */ 1066 - changed &= ~IEEE80211_IFCC_BEACON; 1066 + changed &= ~(BSS_CHANGED_BEACON | 1067 + BSS_CHANGED_BEACON_ENABLED); 1067 1068 /* fall through */ 1068 1069 case NL80211_IFTYPE_ADHOC: 1069 1070 case NL80211_IFTYPE_AP: 1070 1071 case NL80211_IFTYPE_MESH_POINT: 1071 - /* 1072 - * Driver's config_interface can fail if rfkill is 1073 - * enabled. Accommodate this return code. 1074 - * FIXME: When mac80211 has knowledge of rfkill 1075 - * state the code below can change back to: 1076 - * WARN(ieee80211_if_config(sdata, changed)); 1077 - * ieee80211_bss_info_change_notify(sdata, ~0); 1078 - */ 1079 - if (ieee80211_if_config(sdata, changed)) 1080 - printk(KERN_DEBUG "%s: failed to configure interface during resume\n", 1081 - sdata->dev->name); 1082 - else 1083 - ieee80211_bss_info_change_notify(sdata, ~0); 1072 + ieee80211_bss_info_change_notify(sdata, changed); 1084 1073 break; 1085 1074 case NL80211_IFTYPE_WDS: 1086 1075 break;