aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-12-23 07:15:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:55:07 -0500
commit1ed32e4fc8cfc9656cc1101e7f9617d485fcbe7b (patch)
tree81697637a36eb4776df39c81a77a9e09ec951a1a
parent98b6218388e345064c3f2d3c161383a18274c638 (diff)
mac80211: remove struct ieee80211_if_init_conf
All its members (vif, mac_addr, type) are now available in the vif struct directly, so we can pass that instead of the conf struct. I generated this patch (except the mac80211 and header file changes) with this semantic patch: @@ identifier conf, fn, hw; type tp; @@ tp fn(struct ieee80211_hw *hw, -struct ieee80211_if_init_conf *conf) +struct ieee80211_vif *vif) { <... ( -conf->type +vif->type | -conf->mac_addr +vif->addr | -conf->vif +vif ) ...> } Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/adm8211.c12
-rw-r--r--drivers/net/wireless/at76c50x-usb.c6
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c8
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c28
-rw-r--r--drivers/net/wireless/b43/main.c26
-rw-r--r--drivers/net/wireless/b43legacy/main.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h4
-rw-r--r--drivers/net/wireless/libertas_tf/main.c10
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c18
-rw-r--r--drivers/net/wireless/mwl8k.c14
-rw-r--r--drivers/net/wireless/p54/main.c12
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c26
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_dev.c12
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c10
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c14
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c10
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c10
-rw-r--r--include/net/mac80211.h57
-rw-r--r--net/mac80211/driver-ops.h12
-rw-r--r--net/mac80211/iface.c14
-rw-r--r--net/mac80211/pm.c6
-rw-r--r--net/mac80211/util.c9
25 files changed, 170 insertions, 214 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 39410016b4ff..e1f04bb437e3 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1400,15 +1400,15 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev,
1400} 1400}
1401 1401
1402static int adm8211_add_interface(struct ieee80211_hw *dev, 1402static int adm8211_add_interface(struct ieee80211_hw *dev,
1403 struct ieee80211_if_init_conf *conf) 1403 struct ieee80211_vif *vif)
1404{ 1404{
1405 struct adm8211_priv *priv = dev->priv; 1405 struct adm8211_priv *priv = dev->priv;
1406 if (priv->mode != NL80211_IFTYPE_MONITOR) 1406 if (priv->mode != NL80211_IFTYPE_MONITOR)
1407 return -EOPNOTSUPP; 1407 return -EOPNOTSUPP;
1408 1408
1409 switch (conf->type) { 1409 switch (vif->type) {
1410 case NL80211_IFTYPE_STATION: 1410 case NL80211_IFTYPE_STATION:
1411 priv->mode = conf->type; 1411 priv->mode = vif->type;
1412 break; 1412 break;
1413 default: 1413 default:
1414 return -EOPNOTSUPP; 1414 return -EOPNOTSUPP;
@@ -1416,8 +1416,8 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
1416 1416
1417 ADM8211_IDLE(); 1417 ADM8211_IDLE();
1418 1418
1419 ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)conf->mac_addr)); 1419 ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)vif->addr));
1420 ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(conf->mac_addr + 4))); 1420 ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(vif->addr + 4)));
1421 1421
1422 adm8211_update_mode(dev); 1422 adm8211_update_mode(dev);
1423 1423
@@ -1427,7 +1427,7 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
1427} 1427}
1428 1428
1429static void adm8211_remove_interface(struct ieee80211_hw *dev, 1429static void adm8211_remove_interface(struct ieee80211_hw *dev,
1430 struct ieee80211_if_init_conf *conf) 1430 struct ieee80211_vif *vif)
1431{ 1431{
1432 struct adm8211_priv *priv = dev->priv; 1432 struct adm8211_priv *priv = dev->priv;
1433 priv->mode = NL80211_IFTYPE_MONITOR; 1433 priv->mode = NL80211_IFTYPE_MONITOR;
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 2517364d3ebe..0fb419936dff 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1789,7 +1789,7 @@ static void at76_mac80211_stop(struct ieee80211_hw *hw)
1789} 1789}
1790 1790
1791static int at76_add_interface(struct ieee80211_hw *hw, 1791static int at76_add_interface(struct ieee80211_hw *hw,
1792 struct ieee80211_if_init_conf *conf) 1792 struct ieee80211_vif *vif)
1793{ 1793{
1794 struct at76_priv *priv = hw->priv; 1794 struct at76_priv *priv = hw->priv;
1795 int ret = 0; 1795 int ret = 0;
@@ -1798,7 +1798,7 @@ static int at76_add_interface(struct ieee80211_hw *hw,
1798 1798
1799 mutex_lock(&priv->mtx); 1799 mutex_lock(&priv->mtx);
1800 1800
1801 switch (conf->type) { 1801 switch (vif->type) {
1802 case NL80211_IFTYPE_STATION: 1802 case NL80211_IFTYPE_STATION:
1803 priv->iw_mode = IW_MODE_INFRA; 1803 priv->iw_mode = IW_MODE_INFRA;
1804 break; 1804 break;
@@ -1814,7 +1814,7 @@ exit:
1814} 1814}
1815 1815
1816static void at76_remove_interface(struct ieee80211_hw *hw, 1816static void at76_remove_interface(struct ieee80211_hw *hw,
1817 struct ieee80211_if_init_conf *conf) 1817 struct ieee80211_vif *vif)
1818{ 1818{
1819 at76_dbg(DBG_MAC80211, "%s()", __func__); 1819 at76_dbg(DBG_MAC80211, "%s()", __func__);
1820} 1820}
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 20f04ab2b13e..4d27f7f67c76 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1939,7 +1939,7 @@ err_free:
1939} 1939}
1940 1940
1941static int ar9170_op_add_interface(struct ieee80211_hw *hw, 1941static int ar9170_op_add_interface(struct ieee80211_hw *hw,
1942 struct ieee80211_if_init_conf *conf) 1942 struct ieee80211_vif *vif)
1943{ 1943{
1944 struct ar9170 *ar = hw->priv; 1944 struct ar9170 *ar = hw->priv;
1945 struct ath_common *common = &ar->common; 1945 struct ath_common *common = &ar->common;
@@ -1952,8 +1952,8 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
1952 goto unlock; 1952 goto unlock;
1953 } 1953 }
1954 1954
1955 ar->vif = conf->vif; 1955 ar->vif = vif;
1956 memcpy(common->macaddr, conf->mac_addr, ETH_ALEN); 1956 memcpy(common->macaddr, vif->addr, ETH_ALEN);
1957 1957
1958 if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) { 1958 if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) {
1959 ar->rx_software_decryption = true; 1959 ar->rx_software_decryption = true;
@@ -1973,7 +1973,7 @@ unlock:
1973} 1973}
1974 1974
1975static void ar9170_op_remove_interface(struct ieee80211_hw *hw, 1975static void ar9170_op_remove_interface(struct ieee80211_hw *hw,
1976 struct ieee80211_if_init_conf *conf) 1976 struct ieee80211_vif *vif)
1977{ 1977{
1978 struct ar9170 *ar = hw->priv; 1978 struct ar9170 *ar = hw->priv;
1979 1979
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a4c086f069b1..20c7e5b450aa 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -225,9 +225,9 @@ static int ath5k_reset_wake(struct ath5k_softc *sc);
225static int ath5k_start(struct ieee80211_hw *hw); 225static int ath5k_start(struct ieee80211_hw *hw);
226static void ath5k_stop(struct ieee80211_hw *hw); 226static void ath5k_stop(struct ieee80211_hw *hw);
227static int ath5k_add_interface(struct ieee80211_hw *hw, 227static int ath5k_add_interface(struct ieee80211_hw *hw,
228 struct ieee80211_if_init_conf *conf); 228 struct ieee80211_vif *vif);
229static void ath5k_remove_interface(struct ieee80211_hw *hw, 229static void ath5k_remove_interface(struct ieee80211_hw *hw,
230 struct ieee80211_if_init_conf *conf); 230 struct ieee80211_vif *vif);
231static int ath5k_config(struct ieee80211_hw *hw, u32 changed); 231static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
232static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw, 232static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
233 int mc_count, struct dev_addr_list *mc_list); 233 int mc_count, struct dev_addr_list *mc_list);
@@ -2785,7 +2785,7 @@ static void ath5k_stop(struct ieee80211_hw *hw)
2785} 2785}
2786 2786
2787static int ath5k_add_interface(struct ieee80211_hw *hw, 2787static int ath5k_add_interface(struct ieee80211_hw *hw,
2788 struct ieee80211_if_init_conf *conf) 2788 struct ieee80211_vif *vif)
2789{ 2789{
2790 struct ath5k_softc *sc = hw->priv; 2790 struct ath5k_softc *sc = hw->priv;
2791 int ret; 2791 int ret;
@@ -2796,22 +2796,22 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2796 goto end; 2796 goto end;
2797 } 2797 }
2798 2798
2799 sc->vif = conf->vif; 2799 sc->vif = vif;
2800 2800
2801 switch (conf->type) { 2801 switch (vif->type) {
2802 case NL80211_IFTYPE_AP: 2802 case NL80211_IFTYPE_AP:
2803 case NL80211_IFTYPE_STATION: 2803 case NL80211_IFTYPE_STATION:
2804 case NL80211_IFTYPE_ADHOC: 2804 case NL80211_IFTYPE_ADHOC:
2805 case NL80211_IFTYPE_MESH_POINT: 2805 case NL80211_IFTYPE_MESH_POINT:
2806 case NL80211_IFTYPE_MONITOR: 2806 case NL80211_IFTYPE_MONITOR:
2807 sc->opmode = conf->type; 2807 sc->opmode = vif->type;
2808 break; 2808 break;
2809 default: 2809 default:
2810 ret = -EOPNOTSUPP; 2810 ret = -EOPNOTSUPP;
2811 goto end; 2811 goto end;
2812 } 2812 }
2813 2813
2814 ath5k_hw_set_lladdr(sc->ah, conf->mac_addr); 2814 ath5k_hw_set_lladdr(sc->ah, vif->addr);
2815 ath5k_mode_setup(sc); 2815 ath5k_mode_setup(sc);
2816 2816
2817 ret = 0; 2817 ret = 0;
@@ -2822,13 +2822,13 @@ end:
2822 2822
2823static void 2823static void
2824ath5k_remove_interface(struct ieee80211_hw *hw, 2824ath5k_remove_interface(struct ieee80211_hw *hw,
2825 struct ieee80211_if_init_conf *conf) 2825 struct ieee80211_vif *vif)
2826{ 2826{
2827 struct ath5k_softc *sc = hw->priv; 2827 struct ath5k_softc *sc = hw->priv;
2828 u8 mac[ETH_ALEN] = {}; 2828 u8 mac[ETH_ALEN] = {};
2829 2829
2830 mutex_lock(&sc->lock); 2830 mutex_lock(&sc->lock);
2831 if (sc->vif != conf->vif) 2831 if (sc->vif != vif)
2832 goto end; 2832 goto end;
2833 2833
2834 ath5k_hw_set_lladdr(sc->ah, mac); 2834 ath5k_hw_set_lladdr(sc->ah, mac);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3f5b887d0fcd..446bd23756e5 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2534,12 +2534,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2534} 2534}
2535 2535
2536static int ath9k_add_interface(struct ieee80211_hw *hw, 2536static int ath9k_add_interface(struct ieee80211_hw *hw,
2537 struct ieee80211_if_init_conf *conf) 2537 struct ieee80211_vif *vif)
2538{ 2538{
2539 struct ath_wiphy *aphy = hw->priv; 2539 struct ath_wiphy *aphy = hw->priv;
2540 struct ath_softc *sc = aphy->sc; 2540 struct ath_softc *sc = aphy->sc;
2541 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 2541 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
2542 struct ath_vif *avp = (void *)conf->vif->drv_priv; 2542 struct ath_vif *avp = (void *)vif->drv_priv;
2543 enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED; 2543 enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED;
2544 int ret = 0; 2544 int ret = 0;
2545 2545
@@ -2551,7 +2551,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2551 goto out; 2551 goto out;
2552 } 2552 }
2553 2553
2554 switch (conf->type) { 2554 switch (vif->type) {
2555 case NL80211_IFTYPE_STATION: 2555 case NL80211_IFTYPE_STATION:
2556 ic_opmode = NL80211_IFTYPE_STATION; 2556 ic_opmode = NL80211_IFTYPE_STATION;
2557 break; 2557 break;
@@ -2562,11 +2562,11 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2562 ret = -ENOBUFS; 2562 ret = -ENOBUFS;
2563 goto out; 2563 goto out;
2564 } 2564 }
2565 ic_opmode = conf->type; 2565 ic_opmode = vif->type;
2566 break; 2566 break;
2567 default: 2567 default:
2568 ath_print(common, ATH_DBG_FATAL, 2568 ath_print(common, ATH_DBG_FATAL,
2569 "Interface type %d not yet supported\n", conf->type); 2569 "Interface type %d not yet supported\n", vif->type);
2570 ret = -EOPNOTSUPP; 2570 ret = -EOPNOTSUPP;
2571 goto out; 2571 goto out;
2572 } 2572 }
@@ -2598,18 +2598,18 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2598 * Enable MIB interrupts when there are hardware phy counters. 2598 * Enable MIB interrupts when there are hardware phy counters.
2599 * Note we only do this (at the moment) for station mode. 2599 * Note we only do this (at the moment) for station mode.
2600 */ 2600 */
2601 if ((conf->type == NL80211_IFTYPE_STATION) || 2601 if ((vif->type == NL80211_IFTYPE_STATION) ||
2602 (conf->type == NL80211_IFTYPE_ADHOC) || 2602 (vif->type == NL80211_IFTYPE_ADHOC) ||
2603 (conf->type == NL80211_IFTYPE_MESH_POINT)) { 2603 (vif->type == NL80211_IFTYPE_MESH_POINT)) {
2604 sc->imask |= ATH9K_INT_MIB; 2604 sc->imask |= ATH9K_INT_MIB;
2605 sc->imask |= ATH9K_INT_TSFOOR; 2605 sc->imask |= ATH9K_INT_TSFOOR;
2606 } 2606 }
2607 2607
2608 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); 2608 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
2609 2609
2610 if (conf->type == NL80211_IFTYPE_AP || 2610 if (vif->type == NL80211_IFTYPE_AP ||
2611 conf->type == NL80211_IFTYPE_ADHOC || 2611 vif->type == NL80211_IFTYPE_ADHOC ||
2612 conf->type == NL80211_IFTYPE_MONITOR) 2612 vif->type == NL80211_IFTYPE_MONITOR)
2613 ath_start_ani(common); 2613 ath_start_ani(common);
2614 2614
2615out: 2615out:
@@ -2618,12 +2618,12 @@ out:
2618} 2618}
2619 2619
2620static void ath9k_remove_interface(struct ieee80211_hw *hw, 2620static void ath9k_remove_interface(struct ieee80211_hw *hw,
2621 struct ieee80211_if_init_conf *conf) 2621 struct ieee80211_vif *vif)
2622{ 2622{
2623 struct ath_wiphy *aphy = hw->priv; 2623 struct ath_wiphy *aphy = hw->priv;
2624 struct ath_softc *sc = aphy->sc; 2624 struct ath_softc *sc = aphy->sc;
2625 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 2625 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
2626 struct ath_vif *avp = (void *)conf->vif->drv_priv; 2626 struct ath_vif *avp = (void *)vif->drv_priv;
2627 int i; 2627 int i;
2628 2628
2629 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); 2629 ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
@@ -2644,7 +2644,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
2644 sc->sc_flags &= ~SC_OP_BEACONS; 2644 sc->sc_flags &= ~SC_OP_BEACONS;
2645 2645
2646 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { 2646 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
2647 if (sc->beacon.bslot[i] == conf->vif) { 2647 if (sc->beacon.bslot[i] == vif) {
2648 printk(KERN_DEBUG "%s: vif had allocated beacon " 2648 printk(KERN_DEBUG "%s: vif had allocated beacon "
2649 "slot\n", __func__); 2649 "slot\n", __func__);
2650 sc->beacon.bslot[i] = NULL; 2650 sc->beacon.bslot[i] = NULL;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index b0b5ce950008..6634a77fc766 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4391,7 +4391,7 @@ err_busdown:
4391} 4391}
4392 4392
4393static int b43_op_add_interface(struct ieee80211_hw *hw, 4393static int b43_op_add_interface(struct ieee80211_hw *hw,
4394 struct ieee80211_if_init_conf *conf) 4394 struct ieee80211_vif *vif)
4395{ 4395{
4396 struct b43_wl *wl = hw_to_b43_wl(hw); 4396 struct b43_wl *wl = hw_to_b43_wl(hw);
4397 struct b43_wldev *dev; 4397 struct b43_wldev *dev;
@@ -4399,24 +4399,24 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
4399 4399
4400 /* TODO: allow WDS/AP devices to coexist */ 4400 /* TODO: allow WDS/AP devices to coexist */
4401 4401
4402 if (conf->type != NL80211_IFTYPE_AP && 4402 if (vif->type != NL80211_IFTYPE_AP &&
4403 conf->type != NL80211_IFTYPE_MESH_POINT && 4403 vif->type != NL80211_IFTYPE_MESH_POINT &&
4404 conf->type != NL80211_IFTYPE_STATION && 4404 vif->type != NL80211_IFTYPE_STATION &&
4405 conf->type != NL80211_IFTYPE_WDS && 4405 vif->type != NL80211_IFTYPE_WDS &&
4406 conf->type != NL80211_IFTYPE_ADHOC) 4406 vif->type != NL80211_IFTYPE_ADHOC)
4407 return -EOPNOTSUPP; 4407 return -EOPNOTSUPP;
4408 4408
4409 mutex_lock(&wl->mutex); 4409 mutex_lock(&wl->mutex);
4410 if (wl->operating) 4410 if (wl->operating)
4411 goto out_mutex_unlock; 4411 goto out_mutex_unlock;
4412 4412
4413 b43dbg(wl, "Adding Interface type %d\n", conf->type); 4413 b43dbg(wl, "Adding Interface type %d\n", vif->type);
4414 4414
4415 dev = wl->current_dev; 4415 dev = wl->current_dev;
4416 wl->operating = 1; 4416 wl->operating = 1;
4417 wl->vif = conf->vif; 4417 wl->vif = vif;
4418 wl->if_type = conf->type; 4418 wl->if_type = vif->type;
4419 memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); 4419 memcpy(wl->mac_addr, vif->addr, ETH_ALEN);
4420 4420
4421 b43_adjust_opmode(dev); 4421 b43_adjust_opmode(dev);
4422 b43_set_pretbtt(dev); 4422 b43_set_pretbtt(dev);
@@ -4431,17 +4431,17 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
4431} 4431}
4432 4432
4433static void b43_op_remove_interface(struct ieee80211_hw *hw, 4433static void b43_op_remove_interface(struct ieee80211_hw *hw,
4434 struct ieee80211_if_init_conf *conf) 4434 struct ieee80211_vif *vif)
4435{ 4435{
4436 struct b43_wl *wl = hw_to_b43_wl(hw); 4436 struct b43_wl *wl = hw_to_b43_wl(hw);
4437 struct b43_wldev *dev = wl->current_dev; 4437 struct b43_wldev *dev = wl->current_dev;
4438 4438
4439 b43dbg(wl, "Removing Interface type %d\n", conf->type); 4439 b43dbg(wl, "Removing Interface type %d\n", vif->type);
4440 4440
4441 mutex_lock(&wl->mutex); 4441 mutex_lock(&wl->mutex);
4442 4442
4443 B43_WARN_ON(!wl->operating); 4443 B43_WARN_ON(!wl->operating);
4444 B43_WARN_ON(wl->vif != conf->vif); 4444 B43_WARN_ON(wl->vif != vif);
4445 wl->vif = NULL; 4445 wl->vif = NULL;
4446 4446
4447 wl->operating = 0; 4447 wl->operating = 0;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index ab6a18c2e9d9..494017e4fcc9 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3361,7 +3361,7 @@ err_kfree_lo_control:
3361} 3361}
3362 3362
3363static int b43legacy_op_add_interface(struct ieee80211_hw *hw, 3363static int b43legacy_op_add_interface(struct ieee80211_hw *hw,
3364 struct ieee80211_if_init_conf *conf) 3364 struct ieee80211_vif *vif)
3365{ 3365{
3366 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 3366 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3367 struct b43legacy_wldev *dev; 3367 struct b43legacy_wldev *dev;
@@ -3370,23 +3370,23 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw,
3370 3370
3371 /* TODO: allow WDS/AP devices to coexist */ 3371 /* TODO: allow WDS/AP devices to coexist */
3372 3372
3373 if (conf->type != NL80211_IFTYPE_AP && 3373 if (vif->type != NL80211_IFTYPE_AP &&
3374 conf->type != NL80211_IFTYPE_STATION && 3374 vif->type != NL80211_IFTYPE_STATION &&
3375 conf->type != NL80211_IFTYPE_WDS && 3375 vif->type != NL80211_IFTYPE_WDS &&
3376 conf->type != NL80211_IFTYPE_ADHOC) 3376 vif->type != NL80211_IFTYPE_ADHOC)
3377 return -EOPNOTSUPP; 3377 return -EOPNOTSUPP;
3378 3378
3379 mutex_lock(&wl->mutex); 3379 mutex_lock(&wl->mutex);
3380 if (wl->operating) 3380 if (wl->operating)
3381 goto out_mutex_unlock; 3381 goto out_mutex_unlock;
3382 3382
3383 b43legacydbg(wl, "Adding Interface type %d\n", conf->type); 3383 b43legacydbg(wl, "Adding Interface type %d\n", vif->type);
3384 3384
3385 dev = wl->current_dev; 3385 dev = wl->current_dev;
3386 wl->operating = 1; 3386 wl->operating = 1;
3387 wl->vif = conf->vif; 3387 wl->vif = vif;
3388 wl->if_type = conf->type; 3388 wl->if_type = vif->type;
3389 memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); 3389 memcpy(wl->mac_addr, vif->addr, ETH_ALEN);
3390 3390
3391 spin_lock_irqsave(&wl->irq_lock, flags); 3391 spin_lock_irqsave(&wl->irq_lock, flags);
3392 b43legacy_adjust_opmode(dev); 3392 b43legacy_adjust_opmode(dev);
@@ -3403,18 +3403,18 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw,
3403} 3403}
3404 3404
3405static void b43legacy_op_remove_interface(struct ieee80211_hw *hw, 3405static void b43legacy_op_remove_interface(struct ieee80211_hw *hw,
3406 struct ieee80211_if_init_conf *conf) 3406 struct ieee80211_vif *vif)
3407{ 3407{
3408 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 3408 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
3409 struct b43legacy_wldev *dev = wl->current_dev; 3409 struct b43legacy_wldev *dev = wl->current_dev;
3410 unsigned long flags; 3410 unsigned long flags;
3411 3411
3412 b43legacydbg(wl, "Removing Interface type %d\n", conf->type); 3412 b43legacydbg(wl, "Removing Interface type %d\n", vif->type);
3413 3413
3414 mutex_lock(&wl->mutex); 3414 mutex_lock(&wl->mutex);
3415 3415
3416 B43legacy_WARN_ON(!wl->operating); 3416 B43legacy_WARN_ON(!wl->operating);
3417 B43legacy_WARN_ON(wl->vif != conf->vif); 3417 B43legacy_WARN_ON(wl->vif != vif);
3418 wl->vif = NULL; 3418 wl->vif = NULL;
3419 3419
3420 wl->operating = 0; 3420 wl->operating = 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index e3b96b48b7fe..14f482960d7f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2584,12 +2584,12 @@ int iwl_set_mode(struct iwl_priv *priv, int mode)
2584EXPORT_SYMBOL(iwl_set_mode); 2584EXPORT_SYMBOL(iwl_set_mode);
2585 2585
2586int iwl_mac_add_interface(struct ieee80211_hw *hw, 2586int iwl_mac_add_interface(struct ieee80211_hw *hw,
2587 struct ieee80211_if_init_conf *conf) 2587 struct ieee80211_vif *vif)
2588{ 2588{
2589 struct iwl_priv *priv = hw->priv; 2589 struct iwl_priv *priv = hw->priv;
2590 unsigned long flags; 2590 unsigned long flags;
2591 2591
2592 IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type); 2592 IWL_DEBUG_MAC80211(priv, "enter: type %d\n", vif->type);
2593 2593
2594 if (priv->vif) { 2594 if (priv->vif) {
2595 IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n"); 2595 IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
@@ -2597,19 +2597,19 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw,
2597 } 2597 }
2598 2598
2599 spin_lock_irqsave(&priv->lock, flags); 2599 spin_lock_irqsave(&priv->lock, flags);
2600 priv->vif = conf->vif; 2600 priv->vif = vif;
2601 priv->iw_mode = conf->type; 2601 priv->iw_mode = vif->type;
2602 2602
2603 spin_unlock_irqrestore(&priv->lock, flags); 2603 spin_unlock_irqrestore(&priv->lock, flags);
2604 2604
2605 mutex_lock(&priv->mutex); 2605 mutex_lock(&priv->mutex);
2606 2606
2607 if (conf->mac_addr) { 2607 if (vif->addr) {
2608 IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr); 2608 IWL_DEBUG_MAC80211(priv, "Set %pM\n", vif->addr);
2609 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 2609 memcpy(priv->mac_addr, vif->addr, ETH_ALEN);
2610 } 2610 }
2611 2611
2612 if (iwl_set_mode(priv, conf->type) == -EAGAIN) 2612 if (iwl_set_mode(priv, vif->type) == -EAGAIN)
2613 /* we are not ready, will run again when ready */ 2613 /* we are not ready, will run again when ready */
2614 set_bit(STATUS_MODE_PENDING, &priv->status); 2614 set_bit(STATUS_MODE_PENDING, &priv->status);
2615 2615
@@ -2621,7 +2621,7 @@ int iwl_mac_add_interface(struct ieee80211_hw *hw,
2621EXPORT_SYMBOL(iwl_mac_add_interface); 2621EXPORT_SYMBOL(iwl_mac_add_interface);
2622 2622
2623void iwl_mac_remove_interface(struct ieee80211_hw *hw, 2623void iwl_mac_remove_interface(struct ieee80211_hw *hw,
2624 struct ieee80211_if_init_conf *conf) 2624 struct ieee80211_vif *vif)
2625{ 2625{
2626 struct iwl_priv *priv = hw->priv; 2626 struct iwl_priv *priv = hw->priv;
2627 2627
@@ -2634,7 +2634,7 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
2634 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 2634 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
2635 iwlcore_commit_rxon(priv); 2635 iwlcore_commit_rxon(priv);
2636 } 2636 }
2637 if (priv->vif == conf->vif) { 2637 if (priv->vif == vif) {
2638 priv->vif = NULL; 2638 priv->vif = NULL;
2639 memset(priv->bssid, 0, ETH_ALEN); 2639 memset(priv->bssid, 0, ETH_ALEN);
2640 } 2640 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index f7acbb32900a..1728f961dcba 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -332,9 +332,9 @@ int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
332int iwl_commit_rxon(struct iwl_priv *priv); 332int iwl_commit_rxon(struct iwl_priv *priv);
333int iwl_set_mode(struct iwl_priv *priv, int mode); 333int iwl_set_mode(struct iwl_priv *priv, int mode);
334int iwl_mac_add_interface(struct ieee80211_hw *hw, 334int iwl_mac_add_interface(struct ieee80211_hw *hw,
335 struct ieee80211_if_init_conf *conf); 335 struct ieee80211_vif *vif);
336void iwl_mac_remove_interface(struct ieee80211_hw *hw, 336void iwl_mac_remove_interface(struct ieee80211_hw *hw,
337 struct ieee80211_if_init_conf *conf); 337 struct ieee80211_vif *vif);
338int iwl_mac_config(struct ieee80211_hw *hw, u32 changed); 338int iwl_mac_config(struct ieee80211_hw *hw, u32 changed);
339void iwl_config_ap(struct iwl_priv *priv); 339void iwl_config_ap(struct iwl_priv *priv);
340int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, 340int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 019431d2f8a9..15a367680f59 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -318,14 +318,14 @@ static void lbtf_op_stop(struct ieee80211_hw *hw)
318} 318}
319 319
320static int lbtf_op_add_interface(struct ieee80211_hw *hw, 320static int lbtf_op_add_interface(struct ieee80211_hw *hw,
321 struct ieee80211_if_init_conf *conf) 321 struct ieee80211_vif *vif)
322{ 322{
323 struct lbtf_private *priv = hw->priv; 323 struct lbtf_private *priv = hw->priv;
324 if (priv->vif != NULL) 324 if (priv->vif != NULL)
325 return -EOPNOTSUPP; 325 return -EOPNOTSUPP;
326 326
327 priv->vif = conf->vif; 327 priv->vif = vif;
328 switch (conf->type) { 328 switch (vif->type) {
329 case NL80211_IFTYPE_MESH_POINT: 329 case NL80211_IFTYPE_MESH_POINT:
330 case NL80211_IFTYPE_AP: 330 case NL80211_IFTYPE_AP:
331 lbtf_set_mode(priv, LBTF_AP_MODE); 331 lbtf_set_mode(priv, LBTF_AP_MODE);
@@ -337,12 +337,12 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw,
337 priv->vif = NULL; 337 priv->vif = NULL;
338 return -EOPNOTSUPP; 338 return -EOPNOTSUPP;
339 } 339 }
340 lbtf_set_mac_address(priv, (u8 *) conf->mac_addr); 340 lbtf_set_mac_address(priv, (u8 *) vif->addr);
341 return 0; 341 return 0;
342} 342}
343 343
344static void lbtf_op_remove_interface(struct ieee80211_hw *hw, 344static void lbtf_op_remove_interface(struct ieee80211_hw *hw,
345 struct ieee80211_if_init_conf *conf) 345 struct ieee80211_vif *vif)
346{ 346{
347 struct lbtf_private *priv = hw->priv; 347 struct lbtf_private *priv = hw->priv;
348 348
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4dee69a38c1d..84df3fcf37b3 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -584,24 +584,24 @@ static void mac80211_hwsim_stop(struct ieee80211_hw *hw)
584 584
585 585
586static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, 586static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
587 struct ieee80211_if_init_conf *conf) 587 struct ieee80211_vif *vif)
588{ 588{
589 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n", 589 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n",
590 wiphy_name(hw->wiphy), __func__, conf->type, 590 wiphy_name(hw->wiphy), __func__, vif->type,
591 conf->mac_addr); 591 vif->addr);
592 hwsim_set_magic(conf->vif); 592 hwsim_set_magic(vif);
593 return 0; 593 return 0;
594} 594}
595 595
596 596
597static void mac80211_hwsim_remove_interface( 597static void mac80211_hwsim_remove_interface(
598 struct ieee80211_hw *hw, struct ieee80211_if_init_conf *conf) 598 struct ieee80211_hw *hw, struct ieee80211_vif *vif)
599{ 599{
600 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n", 600 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n",
601 wiphy_name(hw->wiphy), __func__, conf->type, 601 wiphy_name(hw->wiphy), __func__, vif->type,
602 conf->mac_addr); 602 vif->addr);
603 hwsim_check_magic(conf->vif); 603 hwsim_check_magic(vif);
604 hwsim_clear_magic(conf->vif); 604 hwsim_clear_magic(vif);
605} 605}
606 606
607 607
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 97a95decf9a8..c1c6ecd0c5b3 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2835,7 +2835,7 @@ static void mwl8k_stop(struct ieee80211_hw *hw)
2835} 2835}
2836 2836
2837static int mwl8k_add_interface(struct ieee80211_hw *hw, 2837static int mwl8k_add_interface(struct ieee80211_hw *hw,
2838 struct ieee80211_if_init_conf *conf) 2838 struct ieee80211_vif *vif)
2839{ 2839{
2840 struct mwl8k_priv *priv = hw->priv; 2840 struct mwl8k_priv *priv = hw->priv;
2841 struct mwl8k_vif *mwl8k_vif; 2841 struct mwl8k_vif *mwl8k_vif;
@@ -2849,7 +2849,7 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
2849 /* 2849 /*
2850 * We only support managed interfaces for now. 2850 * We only support managed interfaces for now.
2851 */ 2851 */
2852 if (conf->type != NL80211_IFTYPE_STATION) 2852 if (vif->type != NL80211_IFTYPE_STATION)
2853 return -EINVAL; 2853 return -EINVAL;
2854 2854
2855 /* 2855 /*
@@ -2865,24 +2865,24 @@ static int mwl8k_add_interface(struct ieee80211_hw *hw,
2865 } 2865 }
2866 2866
2867 /* Clean out driver private area */ 2867 /* Clean out driver private area */
2868 mwl8k_vif = MWL8K_VIF(conf->vif); 2868 mwl8k_vif = MWL8K_VIF(vif);
2869 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif)); 2869 memset(mwl8k_vif, 0, sizeof(*mwl8k_vif));
2870 2870
2871 /* Set and save the mac address */ 2871 /* Set and save the mac address */
2872 mwl8k_cmd_set_mac_addr(hw, conf->mac_addr); 2872 mwl8k_cmd_set_mac_addr(hw, vif->addr);
2873 memcpy(mwl8k_vif->mac_addr, conf->mac_addr, ETH_ALEN); 2873 memcpy(mwl8k_vif->mac_addr, vif->addr, ETH_ALEN);
2874 2874
2875 /* Set Initial sequence number to zero */ 2875 /* Set Initial sequence number to zero */
2876 mwl8k_vif->seqno = 0; 2876 mwl8k_vif->seqno = 0;
2877 2877
2878 priv->vif = conf->vif; 2878 priv->vif = vif;
2879 priv->current_channel = NULL; 2879 priv->current_channel = NULL;
2880 2880
2881 return 0; 2881 return 0;
2882} 2882}
2883 2883
2884static void mwl8k_remove_interface(struct ieee80211_hw *hw, 2884static void mwl8k_remove_interface(struct ieee80211_hw *hw,
2885 struct ieee80211_if_init_conf *conf) 2885 struct ieee80211_vif *vif)
2886{ 2886{
2887 struct mwl8k_priv *priv = hw->priv; 2887 struct mwl8k_priv *priv = hw->priv;
2888 2888
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 18012dbfb45d..26428e4c9c60 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -216,7 +216,7 @@ static void p54_stop(struct ieee80211_hw *dev)
216} 216}
217 217
218static int p54_add_interface(struct ieee80211_hw *dev, 218static int p54_add_interface(struct ieee80211_hw *dev,
219 struct ieee80211_if_init_conf *conf) 219 struct ieee80211_vif *vif)
220{ 220{
221 struct p54_common *priv = dev->priv; 221 struct p54_common *priv = dev->priv;
222 222
@@ -226,28 +226,28 @@ static int p54_add_interface(struct ieee80211_hw *dev,
226 return -EOPNOTSUPP; 226 return -EOPNOTSUPP;
227 } 227 }
228 228
229 priv->vif = conf->vif; 229 priv->vif = vif;
230 230
231 switch (conf->type) { 231 switch (vif->type) {
232 case NL80211_IFTYPE_STATION: 232 case NL80211_IFTYPE_STATION:
233 case NL80211_IFTYPE_ADHOC: 233 case NL80211_IFTYPE_ADHOC:
234 case NL80211_IFTYPE_AP: 234 case NL80211_IFTYPE_AP:
235 case NL80211_IFTYPE_MESH_POINT: 235 case NL80211_IFTYPE_MESH_POINT:
236 priv->mode = conf->type; 236 priv->mode = vif->type;
237 break; 237 break;
238 default: 238 default:
239 mutex_unlock(&priv->conf_mutex); 239 mutex_unlock(&priv->conf_mutex);
240 return -EOPNOTSUPP; 240 return -EOPNOTSUPP;
241 } 241 }
242 242
243 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 243 memcpy(priv->mac_addr, vif->addr, ETH_ALEN);
244 p54_setup_mac(priv); 244 p54_setup_mac(priv);
245 mutex_unlock(&priv->conf_mutex); 245 mutex_unlock(&priv->conf_mutex);
246 return 0; 246 return 0;
247} 247}
248 248
249static void p54_remove_interface(struct ieee80211_hw *dev, 249static void p54_remove_interface(struct ieee80211_hw *dev,
250 struct ieee80211_if_init_conf *conf) 250 struct ieee80211_vif *vif)
251{ 251{
252 struct p54_common *priv = dev->priv; 252 struct p54_common *priv = dev->priv;
253 253
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index a664a999b2b0..b4c6e0a6d7e0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1019,9 +1019,9 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
1019int rt2x00mac_start(struct ieee80211_hw *hw); 1019int rt2x00mac_start(struct ieee80211_hw *hw);
1020void rt2x00mac_stop(struct ieee80211_hw *hw); 1020void rt2x00mac_stop(struct ieee80211_hw *hw);
1021int rt2x00mac_add_interface(struct ieee80211_hw *hw, 1021int rt2x00mac_add_interface(struct ieee80211_hw *hw,
1022 struct ieee80211_if_init_conf *conf); 1022 struct ieee80211_vif *vif);
1023void rt2x00mac_remove_interface(struct ieee80211_hw *hw, 1023void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
1024 struct ieee80211_if_init_conf *conf); 1024 struct ieee80211_vif *vif);
1025int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed); 1025int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
1026void rt2x00mac_configure_filter(struct ieee80211_hw *hw, 1026void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
1027 unsigned int changed_flags, 1027 unsigned int changed_flags,
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index de549c244ed8..00f1f939f1bb 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -187,10 +187,10 @@ void rt2x00mac_stop(struct ieee80211_hw *hw)
187EXPORT_SYMBOL_GPL(rt2x00mac_stop); 187EXPORT_SYMBOL_GPL(rt2x00mac_stop);
188 188
189int rt2x00mac_add_interface(struct ieee80211_hw *hw, 189int rt2x00mac_add_interface(struct ieee80211_hw *hw,
190 struct ieee80211_if_init_conf *conf) 190 struct ieee80211_vif *vif)
191{ 191{
192 struct rt2x00_dev *rt2x00dev = hw->priv; 192 struct rt2x00_dev *rt2x00dev = hw->priv;
193 struct rt2x00_intf *intf = vif_to_intf(conf->vif); 193 struct rt2x00_intf *intf = vif_to_intf(vif);
194 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, QID_BEACON); 194 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, QID_BEACON);
195 struct queue_entry *entry = NULL; 195 struct queue_entry *entry = NULL;
196 unsigned int i; 196 unsigned int i;
@@ -203,7 +203,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
203 !test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags)) 203 !test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags))
204 return -ENODEV; 204 return -ENODEV;
205 205
206 switch (conf->type) { 206 switch (vif->type) {
207 case NL80211_IFTYPE_AP: 207 case NL80211_IFTYPE_AP:
208 /* 208 /*
209 * We don't support mixed combinations of 209 * We don't support mixed combinations of
@@ -263,7 +263,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
263 * increase interface count and start initialization. 263 * increase interface count and start initialization.
264 */ 264 */
265 265
266 if (conf->type == NL80211_IFTYPE_AP) 266 if (vif->type == NL80211_IFTYPE_AP)
267 rt2x00dev->intf_ap_count++; 267 rt2x00dev->intf_ap_count++;
268 else 268 else
269 rt2x00dev->intf_sta_count++; 269 rt2x00dev->intf_sta_count++;
@@ -273,16 +273,16 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
273 mutex_init(&intf->beacon_skb_mutex); 273 mutex_init(&intf->beacon_skb_mutex);
274 intf->beacon = entry; 274 intf->beacon = entry;
275 275
276 if (conf->type == NL80211_IFTYPE_AP) 276 if (vif->type == NL80211_IFTYPE_AP)
277 memcpy(&intf->bssid, conf->mac_addr, ETH_ALEN); 277 memcpy(&intf->bssid, vif->addr, ETH_ALEN);
278 memcpy(&intf->mac, conf->mac_addr, ETH_ALEN); 278 memcpy(&intf->mac, vif->addr, ETH_ALEN);
279 279
280 /* 280 /*
281 * The MAC adddress must be configured after the device 281 * The MAC adddress must be configured after the device
282 * has been initialized. Otherwise the device can reset 282 * has been initialized. Otherwise the device can reset
283 * the MAC registers. 283 * the MAC registers.
284 */ 284 */
285 rt2x00lib_config_intf(rt2x00dev, intf, conf->type, intf->mac, NULL); 285 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, intf->mac, NULL);
286 286
287 /* 287 /*
288 * Some filters depend on the current working mode. We can force 288 * Some filters depend on the current working mode. We can force
@@ -296,10 +296,10 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
296EXPORT_SYMBOL_GPL(rt2x00mac_add_interface); 296EXPORT_SYMBOL_GPL(rt2x00mac_add_interface);
297 297
298void rt2x00mac_remove_interface(struct ieee80211_hw *hw, 298void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
299 struct ieee80211_if_init_conf *conf) 299 struct ieee80211_vif *vif)
300{ 300{
301 struct rt2x00_dev *rt2x00dev = hw->priv; 301 struct rt2x00_dev *rt2x00dev = hw->priv;
302 struct rt2x00_intf *intf = vif_to_intf(conf->vif); 302 struct rt2x00_intf *intf = vif_to_intf(vif);
303 303
304 /* 304 /*
305 * Don't allow interfaces to be remove while 305 * Don't allow interfaces to be remove while
@@ -307,11 +307,11 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
307 * no interface is present. 307 * no interface is present.
308 */ 308 */
309 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) || 309 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) ||
310 (conf->type == NL80211_IFTYPE_AP && !rt2x00dev->intf_ap_count) || 310 (vif->type == NL80211_IFTYPE_AP && !rt2x00dev->intf_ap_count) ||
311 (conf->type != NL80211_IFTYPE_AP && !rt2x00dev->intf_sta_count)) 311 (vif->type != NL80211_IFTYPE_AP && !rt2x00dev->intf_sta_count))
312 return; 312 return;
313 313
314 if (conf->type == NL80211_IFTYPE_AP) 314 if (vif->type == NL80211_IFTYPE_AP)
315 rt2x00dev->intf_ap_count--; 315 rt2x00dev->intf_ap_count--;
316 else 316 else
317 rt2x00dev->intf_sta_count--; 317 rt2x00dev->intf_sta_count--;
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index f01f1ef9e3be..5a2b7199f5d5 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -652,7 +652,7 @@ static void rtl8180_stop(struct ieee80211_hw *dev)
652} 652}
653 653
654static int rtl8180_add_interface(struct ieee80211_hw *dev, 654static int rtl8180_add_interface(struct ieee80211_hw *dev,
655 struct ieee80211_if_init_conf *conf) 655 struct ieee80211_vif *vif)
656{ 656{
657 struct rtl8180_priv *priv = dev->priv; 657 struct rtl8180_priv *priv = dev->priv;
658 658
@@ -662,27 +662,27 @@ static int rtl8180_add_interface(struct ieee80211_hw *dev,
662 if (priv->vif) 662 if (priv->vif)
663 return -EBUSY; 663 return -EBUSY;
664 664
665 switch (conf->type) { 665 switch (vif->type) {
666 case NL80211_IFTYPE_STATION: 666 case NL80211_IFTYPE_STATION:
667 break; 667 break;
668 default: 668 default:
669 return -EOPNOTSUPP; 669 return -EOPNOTSUPP;
670 } 670 }
671 671
672 priv->vif = conf->vif; 672 priv->vif = vif;
673 673
674 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 674 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
675 rtl818x_iowrite32(priv, (__le32 __iomem *)&priv->map->MAC[0], 675 rtl818x_iowrite32(priv, (__le32 __iomem *)&priv->map->MAC[0],
676 le32_to_cpu(*(__le32 *)conf->mac_addr)); 676 le32_to_cpu(*(__le32 *)vif->addr));
677 rtl818x_iowrite16(priv, (__le16 __iomem *)&priv->map->MAC[4], 677 rtl818x_iowrite16(priv, (__le16 __iomem *)&priv->map->MAC[4],
678 le16_to_cpu(*(__le16 *)(conf->mac_addr + 4))); 678 le16_to_cpu(*(__le16 *)(vif->addr + 4)));
679 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 679 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
680 680
681 return 0; 681 return 0;
682} 682}
683 683
684static void rtl8180_remove_interface(struct ieee80211_hw *dev, 684static void rtl8180_remove_interface(struct ieee80211_hw *dev,
685 struct ieee80211_if_init_conf *conf) 685 struct ieee80211_vif *vif)
686{ 686{
687 struct rtl8180_priv *priv = dev->priv; 687 struct rtl8180_priv *priv = dev->priv;
688 priv->vif = NULL; 688 priv->vif = NULL;
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 1cb0eff46223..f336c63053c1 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1018,7 +1018,7 @@ static void rtl8187_stop(struct ieee80211_hw *dev)
1018} 1018}
1019 1019
1020static int rtl8187_add_interface(struct ieee80211_hw *dev, 1020static int rtl8187_add_interface(struct ieee80211_hw *dev,
1021 struct ieee80211_if_init_conf *conf) 1021 struct ieee80211_vif *vif)
1022{ 1022{
1023 struct rtl8187_priv *priv = dev->priv; 1023 struct rtl8187_priv *priv = dev->priv;
1024 int i; 1024 int i;
@@ -1028,7 +1028,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
1028 if (priv->vif) 1028 if (priv->vif)
1029 goto exit; 1029 goto exit;
1030 1030
1031 switch (conf->type) { 1031 switch (vif->type) {
1032 case NL80211_IFTYPE_STATION: 1032 case NL80211_IFTYPE_STATION:
1033 break; 1033 break;
1034 default: 1034 default:
@@ -1036,12 +1036,12 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
1036 } 1036 }
1037 1037
1038 ret = 0; 1038 ret = 0;
1039 priv->vif = conf->vif; 1039 priv->vif = vif;
1040 1040
1041 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 1041 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
1042 for (i = 0; i < ETH_ALEN; i++) 1042 for (i = 0; i < ETH_ALEN; i++)
1043 rtl818x_iowrite8(priv, &priv->map->MAC[i], 1043 rtl818x_iowrite8(priv, &priv->map->MAC[i],
1044 ((u8 *)conf->mac_addr)[i]); 1044 ((u8 *)vif->addr)[i]);
1045 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 1045 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
1046 1046
1047exit: 1047exit:
@@ -1050,7 +1050,7 @@ exit:
1050} 1050}
1051 1051
1052static void rtl8187_remove_interface(struct ieee80211_hw *dev, 1052static void rtl8187_remove_interface(struct ieee80211_hw *dev,
1053 struct ieee80211_if_init_conf *conf) 1053 struct ieee80211_vif *vif)
1054{ 1054{
1055 struct rtl8187_priv *priv = dev->priv; 1055 struct rtl8187_priv *priv = dev->priv;
1056 mutex_lock(&priv->conf_mutex); 1056 mutex_lock(&priv->conf_mutex);
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 6aeffbe9e401..4e373f3dbc43 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -511,13 +511,13 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
511} 511}
512 512
513static int wl1251_op_add_interface(struct ieee80211_hw *hw, 513static int wl1251_op_add_interface(struct ieee80211_hw *hw,
514 struct ieee80211_if_init_conf *conf) 514 struct ieee80211_vif *vif)
515{ 515{
516 struct wl1251 *wl = hw->priv; 516 struct wl1251 *wl = hw->priv;
517 int ret = 0; 517 int ret = 0;
518 518
519 wl1251_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM", 519 wl1251_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
520 conf->type, conf->mac_addr); 520 vif->type, vif->addr);
521 521
522 mutex_lock(&wl->mutex); 522 mutex_lock(&wl->mutex);
523 if (wl->vif) { 523 if (wl->vif) {
@@ -525,9 +525,9 @@ static int wl1251_op_add_interface(struct ieee80211_hw *hw,
525 goto out; 525 goto out;
526 } 526 }
527 527
528 wl->vif = conf->vif; 528 wl->vif = vif;
529 529
530 switch (conf->type) { 530 switch (vif->type) {
531 case NL80211_IFTYPE_STATION: 531 case NL80211_IFTYPE_STATION:
532 wl->bss_type = BSS_TYPE_STA_BSS; 532 wl->bss_type = BSS_TYPE_STA_BSS;
533 break; 533 break;
@@ -539,8 +539,8 @@ static int wl1251_op_add_interface(struct ieee80211_hw *hw,
539 goto out; 539 goto out;
540 } 540 }
541 541
542 if (memcmp(wl->mac_addr, conf->mac_addr, ETH_ALEN)) { 542 if (memcmp(wl->mac_addr, vif->addr, ETH_ALEN)) {
543 memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); 543 memcpy(wl->mac_addr, vif->addr, ETH_ALEN);
544 SET_IEEE80211_PERM_ADDR(wl->hw, wl->mac_addr); 544 SET_IEEE80211_PERM_ADDR(wl->hw, wl->mac_addr);
545 ret = wl1251_acx_station_id(wl); 545 ret = wl1251_acx_station_id(wl);
546 if (ret < 0) 546 if (ret < 0)
@@ -553,7 +553,7 @@ out:
553} 553}
554 554
555static void wl1251_op_remove_interface(struct ieee80211_hw *hw, 555static void wl1251_op_remove_interface(struct ieee80211_hw *hw,
556 struct ieee80211_if_init_conf *conf) 556 struct ieee80211_vif *vif)
557{ 557{
558 struct wl1251 *wl = hw->priv; 558 struct wl1251 *wl = hw->priv;
559 559
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 4a997381a8d0..e4867b895c43 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1039,13 +1039,13 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
1039} 1039}
1040 1040
1041static int wl1271_op_add_interface(struct ieee80211_hw *hw, 1041static int wl1271_op_add_interface(struct ieee80211_hw *hw,
1042 struct ieee80211_if_init_conf *conf) 1042 struct ieee80211_vif *vif)
1043{ 1043{
1044 struct wl1271 *wl = hw->priv; 1044 struct wl1271 *wl = hw->priv;
1045 int ret = 0; 1045 int ret = 0;
1046 1046
1047 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM", 1047 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
1048 conf->type, conf->mac_addr); 1048 vif->type, vif->addr);
1049 1049
1050 mutex_lock(&wl->mutex); 1050 mutex_lock(&wl->mutex);
1051 if (wl->vif) { 1051 if (wl->vif) {
@@ -1053,9 +1053,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
1053 goto out; 1053 goto out;
1054 } 1054 }
1055 1055
1056 wl->vif = conf->vif; 1056 wl->vif = vif;
1057 1057
1058 switch (conf->type) { 1058 switch (vif->type) {
1059 case NL80211_IFTYPE_STATION: 1059 case NL80211_IFTYPE_STATION:
1060 wl->bss_type = BSS_TYPE_STA_BSS; 1060 wl->bss_type = BSS_TYPE_STA_BSS;
1061 break; 1061 break;
@@ -1075,7 +1075,7 @@ out:
1075} 1075}
1076 1076
1077static void wl1271_op_remove_interface(struct ieee80211_hw *hw, 1077static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
1078 struct ieee80211_if_init_conf *conf) 1078 struct ieee80211_vif *vif)
1079{ 1079{
1080 struct wl1271 *wl = hw->priv; 1080 struct wl1271 *wl = hw->priv;
1081 1081
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 8a243732c519..c4f41d0016c5 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -872,7 +872,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
872} 872}
873 873
874static int zd_op_add_interface(struct ieee80211_hw *hw, 874static int zd_op_add_interface(struct ieee80211_hw *hw,
875 struct ieee80211_if_init_conf *conf) 875 struct ieee80211_vif *vif)
876{ 876{
877 struct zd_mac *mac = zd_hw_mac(hw); 877 struct zd_mac *mac = zd_hw_mac(hw);
878 878
@@ -880,22 +880,22 @@ static int zd_op_add_interface(struct ieee80211_hw *hw,
880 if (mac->type != NL80211_IFTYPE_UNSPECIFIED) 880 if (mac->type != NL80211_IFTYPE_UNSPECIFIED)
881 return -EOPNOTSUPP; 881 return -EOPNOTSUPP;
882 882
883 switch (conf->type) { 883 switch (vif->type) {
884 case NL80211_IFTYPE_MONITOR: 884 case NL80211_IFTYPE_MONITOR:
885 case NL80211_IFTYPE_MESH_POINT: 885 case NL80211_IFTYPE_MESH_POINT:
886 case NL80211_IFTYPE_STATION: 886 case NL80211_IFTYPE_STATION:
887 case NL80211_IFTYPE_ADHOC: 887 case NL80211_IFTYPE_ADHOC:
888 mac->type = conf->type; 888 mac->type = vif->type;
889 break; 889 break;
890 default: 890 default:
891 return -EOPNOTSUPP; 891 return -EOPNOTSUPP;
892 } 892 }
893 893
894 return zd_write_mac_addr(&mac->chip, conf->mac_addr); 894 return zd_write_mac_addr(&mac->chip, vif->addr);
895} 895}
896 896
897static void zd_op_remove_interface(struct ieee80211_hw *hw, 897static void zd_op_remove_interface(struct ieee80211_hw *hw,
898 struct ieee80211_if_init_conf *conf) 898 struct ieee80211_vif *vif)
899{ 899{
900 struct zd_mac *mac = zd_hw_mac(hw); 900 struct zd_mac *mac = zd_hw_mac(hw);
901 mac->type = NL80211_IFTYPE_UNSPECIFIED; 901 mac->type = NL80211_IFTYPE_UNSPECIFIED;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 77ea34b03285..08d41357dcbe 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -702,33 +702,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
702} 702}
703 703
704/** 704/**
705 * struct ieee80211_if_init_conf - initial configuration of an interface
706 *
707 * @vif: pointer to a driver-use per-interface structure. The pointer
708 * itself is also used for various functions including
709 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
710 * @type: one of &enum nl80211_iftype constants. Determines the type of
711 * added/removed interface.
712 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
713 * until the interface is removed (i.e. it cannot be used after
714 * remove_interface() callback was called for this interface).
715 *
716 * This structure is used in add_interface() and remove_interface()
717 * callbacks of &struct ieee80211_hw.
718 *
719 * When you allow multiple interfaces to be added to your PHY, take care
720 * that the hardware can actually handle multiple MAC addresses. However,
721 * also take care that when there's no interface left with mac_addr != %NULL
722 * you remove the MAC address from the device to avoid acknowledging packets
723 * in pure monitor mode.
724 */
725struct ieee80211_if_init_conf {
726 enum nl80211_iftype type;
727 struct ieee80211_vif *vif;
728 void *mac_addr;
729};
730
731/**
732 * enum ieee80211_key_alg - key algorithm 705 * enum ieee80211_key_alg - key algorithm
733 * @ALG_WEP: WEP40 or WEP104 706 * @ALG_WEP: WEP40 or WEP104
734 * @ALG_TKIP: TKIP 707 * @ALG_TKIP: TKIP
@@ -1555,9 +1528,9 @@ struct ieee80211_ops {
1555 int (*start)(struct ieee80211_hw *hw); 1528 int (*start)(struct ieee80211_hw *hw);
1556 void (*stop)(struct ieee80211_hw *hw); 1529 void (*stop)(struct ieee80211_hw *hw);
1557 int (*add_interface)(struct ieee80211_hw *hw, 1530 int (*add_interface)(struct ieee80211_hw *hw,
1558 struct ieee80211_if_init_conf *conf); 1531 struct ieee80211_vif *vif);
1559 void (*remove_interface)(struct ieee80211_hw *hw, 1532 void (*remove_interface)(struct ieee80211_hw *hw,
1560 struct ieee80211_if_init_conf *conf); 1533 struct ieee80211_vif *vif);
1561 int (*config)(struct ieee80211_hw *hw, u32 changed); 1534 int (*config)(struct ieee80211_hw *hw, u32 changed);
1562 void (*bss_info_changed)(struct ieee80211_hw *hw, 1535 void (*bss_info_changed)(struct ieee80211_hw *hw,
1563 struct ieee80211_vif *vif, 1536 struct ieee80211_vif *vif,
@@ -1845,7 +1818,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1845/** 1818/**
1846 * ieee80211_beacon_get_tim - beacon generation function 1819 * ieee80211_beacon_get_tim - beacon generation function
1847 * @hw: pointer obtained from ieee80211_alloc_hw(). 1820 * @hw: pointer obtained from ieee80211_alloc_hw().
1848 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1821 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1849 * @tim_offset: pointer to variable that will receive the TIM IE offset. 1822 * @tim_offset: pointer to variable that will receive the TIM IE offset.
1850 * Set to 0 if invalid (in non-AP modes). 1823 * Set to 0 if invalid (in non-AP modes).
1851 * @tim_length: pointer to variable that will receive the TIM IE length, 1824 * @tim_length: pointer to variable that will receive the TIM IE length,
@@ -1873,7 +1846,7 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
1873/** 1846/**
1874 * ieee80211_beacon_get - beacon generation function 1847 * ieee80211_beacon_get - beacon generation function
1875 * @hw: pointer obtained from ieee80211_alloc_hw(). 1848 * @hw: pointer obtained from ieee80211_alloc_hw().
1876 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1849 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1877 * 1850 *
1878 * See ieee80211_beacon_get_tim(). 1851 * See ieee80211_beacon_get_tim().
1879 */ 1852 */
@@ -1886,7 +1859,7 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1886/** 1859/**
1887 * ieee80211_rts_get - RTS frame generation function 1860 * ieee80211_rts_get - RTS frame generation function
1888 * @hw: pointer obtained from ieee80211_alloc_hw(). 1861 * @hw: pointer obtained from ieee80211_alloc_hw().
1889 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1862 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1890 * @frame: pointer to the frame that is going to be protected by the RTS. 1863 * @frame: pointer to the frame that is going to be protected by the RTS.
1891 * @frame_len: the frame length (in octets). 1864 * @frame_len: the frame length (in octets).
1892 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1865 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1905,7 +1878,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1905/** 1878/**
1906 * ieee80211_rts_duration - Get the duration field for an RTS frame 1879 * ieee80211_rts_duration - Get the duration field for an RTS frame
1907 * @hw: pointer obtained from ieee80211_alloc_hw(). 1880 * @hw: pointer obtained from ieee80211_alloc_hw().
1908 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1881 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1909 * @frame_len: the length of the frame that is going to be protected by the RTS. 1882 * @frame_len: the length of the frame that is going to be protected by the RTS.
1910 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1883 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1911 * 1884 *
@@ -1920,7 +1893,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1920/** 1893/**
1921 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1894 * ieee80211_ctstoself_get - CTS-to-self frame generation function
1922 * @hw: pointer obtained from ieee80211_alloc_hw(). 1895 * @hw: pointer obtained from ieee80211_alloc_hw().
1923 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1896 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1924 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 1897 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1925 * @frame_len: the frame length (in octets). 1898 * @frame_len: the frame length (in octets).
1926 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1899 * @frame_txctl: &struct ieee80211_tx_info of the frame.
@@ -1940,7 +1913,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1940/** 1913/**
1941 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame 1914 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
1942 * @hw: pointer obtained from ieee80211_alloc_hw(). 1915 * @hw: pointer obtained from ieee80211_alloc_hw().
1943 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1916 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1944 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 1917 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1945 * @frame_txctl: &struct ieee80211_tx_info of the frame. 1918 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1946 * 1919 *
@@ -1956,7 +1929,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1956/** 1929/**
1957 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1930 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
1958 * @hw: pointer obtained from ieee80211_alloc_hw(). 1931 * @hw: pointer obtained from ieee80211_alloc_hw().
1959 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1932 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1960 * @frame_len: the length of the frame. 1933 * @frame_len: the length of the frame.
1961 * @rate: the rate at which the frame is going to be transmitted. 1934 * @rate: the rate at which the frame is going to be transmitted.
1962 * 1935 *
@@ -1971,7 +1944,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1971/** 1944/**
1972 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1945 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
1973 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1946 * @hw: pointer as obtained from ieee80211_alloc_hw().
1974 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1947 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
1975 * 1948 *
1976 * Function for accessing buffered broadcast and multicast frames. If 1949 * Function for accessing buffered broadcast and multicast frames. If
1977 * hardware/firmware does not implement buffering of broadcast/multicast 1950 * hardware/firmware does not implement buffering of broadcast/multicast
@@ -2139,7 +2112,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid);
2139 2112
2140/** 2113/**
2141 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. 2114 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
2142 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2115 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2143 * @ra: receiver address of the BA session recipient. 2116 * @ra: receiver address of the BA session recipient.
2144 * @tid: the TID to BA on. 2117 * @tid: the TID to BA on.
2145 * 2118 *
@@ -2150,7 +2123,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
2150 2123
2151/** 2124/**
2152 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. 2125 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
2153 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2126 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2154 * @ra: receiver address of the BA session recipient. 2127 * @ra: receiver address of the BA session recipient.
2155 * @tid: the TID to BA on. 2128 * @tid: the TID to BA on.
2156 * 2129 *
@@ -2178,7 +2151,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid,
2178 2151
2179/** 2152/**
2180 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. 2153 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
2181 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2154 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2182 * @ra: receiver address of the BA session recipient. 2155 * @ra: receiver address of the BA session recipient.
2183 * @tid: the desired TID to BA on. 2156 * @tid: the desired TID to BA on.
2184 * 2157 *
@@ -2189,7 +2162,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
2189 2162
2190/** 2163/**
2191 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. 2164 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
2192 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf 2165 * @vif: &struct ieee80211_vif pointer from the add_interface callback
2193 * @ra: receiver address of the BA session recipient. 2166 * @ra: receiver address of the BA session recipient.
2194 * @tid: the desired TID to BA on. 2167 * @tid: the desired TID to BA on.
2195 * 2168 *
@@ -2268,7 +2241,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2268/** 2241/**
2269 * ieee80211_beacon_loss - inform hardware does not receive beacons 2242 * ieee80211_beacon_loss - inform hardware does not receive beacons
2270 * 2243 *
2271 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 2244 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2272 * 2245 *
2273 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and 2246 * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and
2274 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the 2247 * IEEE80211_CONF_PS is set, the driver needs to inform whenever the
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index cbe133bcdf34..bc7c8f55487a 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -36,18 +36,18 @@ static inline void drv_stop(struct ieee80211_local *local)
36} 36}
37 37
38static inline int drv_add_interface(struct ieee80211_local *local, 38static inline int drv_add_interface(struct ieee80211_local *local,
39 struct ieee80211_if_init_conf *conf) 39 struct ieee80211_vif *vif)
40{ 40{
41 int ret = local->ops->add_interface(&local->hw, conf); 41 int ret = local->ops->add_interface(&local->hw, vif);
42 trace_drv_add_interface(local, vif_to_sdata(conf->vif), ret); 42 trace_drv_add_interface(local, vif_to_sdata(vif), ret);
43 return ret; 43 return ret;
44} 44}
45 45
46static inline void drv_remove_interface(struct ieee80211_local *local, 46static inline void drv_remove_interface(struct ieee80211_local *local,
47 struct ieee80211_if_init_conf *conf) 47 struct ieee80211_vif *vif)
48{ 48{
49 local->ops->remove_interface(&local->hw, conf); 49 local->ops->remove_interface(&local->hw, vif);
50 trace_drv_remove_interface(local, vif_to_sdata(conf->vif)); 50 trace_drv_remove_interface(local, vif_to_sdata(vif));
51} 51}
52 52
53static inline int drv_config(struct ieee80211_local *local, u32 changed) 53static inline int drv_config(struct ieee80211_local *local, u32 changed)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 7d410f15281a..00a1f4ccdaf1 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -96,7 +96,6 @@ static int ieee80211_open(struct net_device *dev)
96 struct ieee80211_sub_if_data *nsdata; 96 struct ieee80211_sub_if_data *nsdata;
97 struct ieee80211_local *local = sdata->local; 97 struct ieee80211_local *local = sdata->local;
98 struct sta_info *sta; 98 struct sta_info *sta;
99 struct ieee80211_if_init_conf conf;
100 u32 changed = 0; 99 u32 changed = 0;
101 int res; 100 int res;
102 u32 hw_reconf_flags = 0; 101 u32 hw_reconf_flags = 0;
@@ -248,10 +247,7 @@ static int ieee80211_open(struct net_device *dev)
248 ieee80211_configure_filter(local); 247 ieee80211_configure_filter(local);
249 break; 248 break;
250 default: 249 default:
251 conf.vif = &sdata->vif; 250 res = drv_add_interface(local, &sdata->vif);
252 conf.type = sdata->vif.type;
253 conf.mac_addr = sdata->vif.addr;
254 res = drv_add_interface(local, &conf);
255 if (res) 251 if (res)
256 goto err_stop; 252 goto err_stop;
257 253
@@ -334,7 +330,7 @@ static int ieee80211_open(struct net_device *dev)
334 330
335 return 0; 331 return 0;
336 err_del_interface: 332 err_del_interface:
337 drv_remove_interface(local, &conf); 333 drv_remove_interface(local, &sdata->vif);
338 err_stop: 334 err_stop:
339 if (!local->open_count) 335 if (!local->open_count)
340 drv_stop(local); 336 drv_stop(local);
@@ -349,7 +345,6 @@ static int ieee80211_stop(struct net_device *dev)
349{ 345{
350 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 346 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
351 struct ieee80211_local *local = sdata->local; 347 struct ieee80211_local *local = sdata->local;
352 struct ieee80211_if_init_conf conf;
353 struct sta_info *sta; 348 struct sta_info *sta;
354 unsigned long flags; 349 unsigned long flags;
355 struct sk_buff *skb, *tmp; 350 struct sk_buff *skb, *tmp;
@@ -533,12 +528,9 @@ static int ieee80211_stop(struct net_device *dev)
533 BSS_CHANGED_BEACON_ENABLED); 528 BSS_CHANGED_BEACON_ENABLED);
534 } 529 }
535 530
536 conf.vif = &sdata->vif;
537 conf.type = sdata->vif.type;
538 conf.mac_addr = sdata->vif.addr;
539 /* disable all keys for as long as this netdev is down */ 531 /* disable all keys for as long as this netdev is down */
540 ieee80211_disable_keys(sdata); 532 ieee80211_disable_keys(sdata);
541 drv_remove_interface(local, &conf); 533 drv_remove_interface(local, &sdata->vif);
542 } 534 }
543 535
544 sdata->bss = NULL; 536 sdata->bss = NULL;
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 913dc7e3b29e..47f818959ad7 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -10,7 +10,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
10{ 10{
11 struct ieee80211_local *local = hw_to_local(hw); 11 struct ieee80211_local *local = hw_to_local(hw);
12 struct ieee80211_sub_if_data *sdata; 12 struct ieee80211_sub_if_data *sdata;
13 struct ieee80211_if_init_conf conf;
14 struct sta_info *sta; 13 struct sta_info *sta;
15 unsigned long flags; 14 unsigned long flags;
16 15
@@ -100,10 +99,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
100 ieee80211_bss_info_change_notify(sdata, 99 ieee80211_bss_info_change_notify(sdata,
101 BSS_CHANGED_BEACON_ENABLED); 100 BSS_CHANGED_BEACON_ENABLED);
102 101
103 conf.vif = &sdata->vif; 102 drv_remove_interface(local, &sdata->vif);
104 conf.type = sdata->vif.type;
105 conf.mac_addr = sdata->vif.addr;
106 drv_remove_interface(local, &conf);
107 } 103 }
108 104
109 /* stop hardware - this must stop RX */ 105 /* stop hardware - this must stop RX */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 1fdb80ff9241..4b930308b1fb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1075,7 +1075,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1075{ 1075{
1076 struct ieee80211_hw *hw = &local->hw; 1076 struct ieee80211_hw *hw = &local->hw;
1077 struct ieee80211_sub_if_data *sdata; 1077 struct ieee80211_sub_if_data *sdata;
1078 struct ieee80211_if_init_conf conf;
1079 struct sta_info *sta; 1078 struct sta_info *sta;
1080 unsigned long flags; 1079 unsigned long flags;
1081 int res; 1080 int res;
@@ -1094,12 +1093,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1094 list_for_each_entry(sdata, &local->interfaces, list) { 1093 list_for_each_entry(sdata, &local->interfaces, list) {
1095 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && 1094 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
1096 sdata->vif.type != NL80211_IFTYPE_MONITOR && 1095 sdata->vif.type != NL80211_IFTYPE_MONITOR &&
1097 ieee80211_sdata_running(sdata)) { 1096 ieee80211_sdata_running(sdata))
1098 conf.vif = &sdata->vif; 1097 res = drv_add_interface(local, &sdata->vif);
1099 conf.type = sdata->vif.type;
1100 conf.mac_addr = sdata->vif.addr;
1101 res = drv_add_interface(local, &conf);
1102 }
1103 } 1098 }
1104 1099
1105 /* add STAs back */ 1100 /* add STAs back */