aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/adm8211.c22
-rw-r--r--drivers/net/wireless/ath5k/ath5k.h4
-rw-r--r--drivers/net/wireless/ath5k/attach.c2
-rw-r--r--drivers/net/wireless/ath5k/base.c50
-rw-r--r--drivers/net/wireless/ath5k/base.h2
-rw-r--r--drivers/net/wireless/ath5k/pcu.c12
-rw-r--r--drivers/net/wireless/ath5k/reset.c2
-rw-r--r--drivers/net/wireless/ath9k/main.c28
-rw-r--r--drivers/net/wireless/b43/main.c38
-rw-r--r--drivers/net/wireless/b43/phy_common.c4
-rw-r--r--drivers/net/wireless/b43legacy/main.c30
-rw-r--r--drivers/net/wireless/b43legacy/phy.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c64
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c84
-rw-r--r--drivers/net/wireless/libertas_tf/main.c18
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c2
-rw-r--r--drivers/net/wireless/p54/p54common.c14
-rw-r--r--drivers/net/wireless/p54/p54pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c18
-rw-r--r--drivers/net/wireless/rtl8180_dev.c10
-rw-r--r--drivers/net/wireless/rtl8187_dev.c8
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c20
-rw-r--r--include/net/mac80211.h35
-rw-r--r--net/mac80211/cfg.c57
-rw-r--r--net/mac80211/debugfs_netdev.c28
-rw-r--r--net/mac80211/ht.c6
-rw-r--r--net/mac80211/ieee80211_i.h6
-rw-r--r--net/mac80211/iface.c40
-rw-r--r--net/mac80211/key.c6
-rw-r--r--net/mac80211/main.c89
-rw-r--r--net/mac80211/mlme.c40
-rw-r--r--net/mac80211/rx.c65
-rw-r--r--net/mac80211/scan.c8
-rw-r--r--net/mac80211/sta_info.c4
-rw-r--r--net/mac80211/tx.c28
-rw-r--r--net/mac80211/util.c44
-rw-r--r--net/mac80211/wext.c84
53 files changed, 517 insertions, 551 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index c6a55cd12db9..b2c050b68890 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -765,11 +765,11 @@ static void adm8211_update_mode(struct ieee80211_hw *dev)
765 765
766 priv->soft_rx_crc = 0; 766 priv->soft_rx_crc = 0;
767 switch (priv->mode) { 767 switch (priv->mode) {
768 case IEEE80211_IF_TYPE_STA: 768 case NL80211_IFTYPE_STATION:
769 priv->nar &= ~(ADM8211_NAR_PR | ADM8211_NAR_EA); 769 priv->nar &= ~(ADM8211_NAR_PR | ADM8211_NAR_EA);
770 priv->nar |= ADM8211_NAR_ST | ADM8211_NAR_SR; 770 priv->nar |= ADM8211_NAR_ST | ADM8211_NAR_SR;
771 break; 771 break;
772 case IEEE80211_IF_TYPE_IBSS: 772 case NL80211_IFTYPE_ADHOC:
773 priv->nar &= ~ADM8211_NAR_PR; 773 priv->nar &= ~ADM8211_NAR_PR;
774 priv->nar |= ADM8211_NAR_EA | ADM8211_NAR_ST | ADM8211_NAR_SR; 774 priv->nar |= ADM8211_NAR_EA | ADM8211_NAR_ST | ADM8211_NAR_SR;
775 775
@@ -777,7 +777,7 @@ static void adm8211_update_mode(struct ieee80211_hw *dev)
777 if (priv->pdev->revision >= ADM8211_REV_BA) 777 if (priv->pdev->revision >= ADM8211_REV_BA)
778 priv->soft_rx_crc = 1; 778 priv->soft_rx_crc = 1;
779 break; 779 break;
780 case IEEE80211_IF_TYPE_MNTR: 780 case NL80211_IFTYPE_MONITOR:
781 priv->nar &= ~(ADM8211_NAR_EA | ADM8211_NAR_ST); 781 priv->nar &= ~(ADM8211_NAR_EA | ADM8211_NAR_ST);
782 priv->nar |= ADM8211_NAR_PR | ADM8211_NAR_SR; 782 priv->nar |= ADM8211_NAR_PR | ADM8211_NAR_SR;
783 break; 783 break;
@@ -1410,11 +1410,11 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
1410 struct ieee80211_if_init_conf *conf) 1410 struct ieee80211_if_init_conf *conf)
1411{ 1411{
1412 struct adm8211_priv *priv = dev->priv; 1412 struct adm8211_priv *priv = dev->priv;
1413 if (priv->mode != IEEE80211_IF_TYPE_MNTR) 1413 if (priv->mode != NL80211_IFTYPE_MONITOR)
1414 return -EOPNOTSUPP; 1414 return -EOPNOTSUPP;
1415 1415
1416 switch (conf->type) { 1416 switch (conf->type) {
1417 case IEEE80211_IF_TYPE_STA: 1417 case NL80211_IFTYPE_STATION:
1418 priv->mode = conf->type; 1418 priv->mode = conf->type;
1419 break; 1419 break;
1420 default: 1420 default:
@@ -1437,7 +1437,7 @@ static void adm8211_remove_interface(struct ieee80211_hw *dev,
1437 struct ieee80211_if_init_conf *conf) 1437 struct ieee80211_if_init_conf *conf)
1438{ 1438{
1439 struct adm8211_priv *priv = dev->priv; 1439 struct adm8211_priv *priv = dev->priv;
1440 priv->mode = IEEE80211_IF_TYPE_MNTR; 1440 priv->mode = NL80211_IFTYPE_MONITOR;
1441} 1441}
1442 1442
1443static int adm8211_init_rings(struct ieee80211_hw *dev) 1443static int adm8211_init_rings(struct ieee80211_hw *dev)
@@ -1556,7 +1556,7 @@ static int adm8211_start(struct ieee80211_hw *dev)
1556 ADM8211_CSR_WRITE(IER, ADM8211_IER_NIE | ADM8211_IER_AIE | 1556 ADM8211_CSR_WRITE(IER, ADM8211_IER_NIE | ADM8211_IER_AIE |
1557 ADM8211_IER_RCIE | ADM8211_IER_TCIE | 1557 ADM8211_IER_RCIE | ADM8211_IER_TCIE |
1558 ADM8211_IER_TDUIE | ADM8211_IER_GPTIE); 1558 ADM8211_IER_TDUIE | ADM8211_IER_GPTIE);
1559 priv->mode = IEEE80211_IF_TYPE_MNTR; 1559 priv->mode = NL80211_IFTYPE_MONITOR;
1560 adm8211_update_mode(dev); 1560 adm8211_update_mode(dev);
1561 ADM8211_CSR_WRITE(RDR, 0); 1561 ADM8211_CSR_WRITE(RDR, 0);
1562 1562
@@ -1571,7 +1571,7 @@ static void adm8211_stop(struct ieee80211_hw *dev)
1571{ 1571{
1572 struct adm8211_priv *priv = dev->priv; 1572 struct adm8211_priv *priv = dev->priv;
1573 1573
1574 priv->mode = IEEE80211_IF_TYPE_INVALID; 1574 priv->mode = NL80211_IFTYPE_UNSPECIFIED;
1575 priv->nar = 0; 1575 priv->nar = 0;
1576 ADM8211_CSR_WRITE(NAR, 0); 1576 ADM8211_CSR_WRITE(NAR, 0);
1577 ADM8211_CSR_WRITE(IER, 0); 1577 ADM8211_CSR_WRITE(IER, 0);
@@ -1896,7 +1896,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
1896 priv->tx_power = 0x40; 1896 priv->tx_power = 0x40;
1897 priv->lpf_cutoff = 0xFF; 1897 priv->lpf_cutoff = 0xFF;
1898 priv->lnags_threshold = 0xFF; 1898 priv->lnags_threshold = 0xFF;
1899 priv->mode = IEEE80211_IF_TYPE_INVALID; 1899 priv->mode = NL80211_IFTYPE_UNSPECIFIED;
1900 1900
1901 /* Power-on issue. EEPROM won't read correctly without */ 1901 /* Power-on issue. EEPROM won't read correctly without */
1902 if (pdev->revision >= ADM8211_REV_BA) { 1902 if (pdev->revision >= ADM8211_REV_BA) {
@@ -1986,7 +1986,7 @@ static int adm8211_suspend(struct pci_dev *pdev, pm_message_t state)
1986 struct ieee80211_hw *dev = pci_get_drvdata(pdev); 1986 struct ieee80211_hw *dev = pci_get_drvdata(pdev);
1987 struct adm8211_priv *priv = dev->priv; 1987 struct adm8211_priv *priv = dev->priv;
1988 1988
1989 if (priv->mode != IEEE80211_IF_TYPE_INVALID) { 1989 if (priv->mode != NL80211_IFTYPE_UNSPECIFIED) {
1990 ieee80211_stop_queues(dev); 1990 ieee80211_stop_queues(dev);
1991 adm8211_stop(dev); 1991 adm8211_stop(dev);
1992 } 1992 }
@@ -2004,7 +2004,7 @@ static int adm8211_resume(struct pci_dev *pdev)
2004 pci_set_power_state(pdev, PCI_D0); 2004 pci_set_power_state(pdev, PCI_D0);
2005 pci_restore_state(pdev); 2005 pci_restore_state(pdev);
2006 2006
2007 if (priv->mode != IEEE80211_IF_TYPE_INVALID) { 2007 if (priv->mode != NL80211_IFTYPE_UNSPECIFIED) {
2008 adm8211_start(dev); 2008 adm8211_start(dev);
2009 ieee80211_wake_queues(dev); 2009 ieee80211_wake_queues(dev);
2010 } 2010 }
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index 4c0211798a7a..20018869051d 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -1008,7 +1008,7 @@ struct ath5k_hw {
1008 1008
1009 enum ath5k_int ah_imr; 1009 enum ath5k_int ah_imr;
1010 1010
1011 enum ieee80211_if_types ah_op_mode; 1011 enum nl80211_iftype ah_op_mode;
1012 enum ath5k_power_mode ah_power_mode; 1012 enum ath5k_power_mode ah_power_mode;
1013 struct ieee80211_channel ah_current_channel; 1013 struct ieee80211_channel ah_current_channel;
1014 bool ah_turbo; 1014 bool ah_turbo;
@@ -1117,7 +1117,7 @@ extern void ath5k_hw_detach(struct ath5k_hw *ah);
1117 1117
1118/* Reset Functions */ 1118/* Reset Functions */
1119extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial); 1119extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial);
1120extern int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, struct ieee80211_channel *channel, bool change_channel); 1120extern int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, struct ieee80211_channel *channel, bool change_channel);
1121/* Power management functions */ 1121/* Power management functions */
1122extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration); 1122extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration);
1123 1123
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c
index 0eb2511fe147..153c4111fabe 100644
--- a/drivers/net/wireless/ath5k/attach.c
+++ b/drivers/net/wireless/ath5k/attach.c
@@ -124,7 +124,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
124 /* 124 /*
125 * HW information 125 * HW information
126 */ 126 */
127 ah->ah_op_mode = IEEE80211_IF_TYPE_STA; 127 ah->ah_op_mode = NL80211_IFTYPE_STATION;
128 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT; 128 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT;
129 ah->ah_turbo = false; 129 ah->ah_turbo = false;
130 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; 130 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 85260c39aa2b..e09ed2ce6753 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -507,7 +507,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
507 507
508 sc->iobase = mem; /* So we can unmap it on detach */ 508 sc->iobase = mem; /* So we can unmap it on detach */
509 sc->cachelsz = csz * sizeof(u32); /* convert to bytes */ 509 sc->cachelsz = csz * sizeof(u32); /* convert to bytes */
510 sc->opmode = IEEE80211_IF_TYPE_STA; 510 sc->opmode = NL80211_IFTYPE_STATION;
511 mutex_init(&sc->lock); 511 mutex_init(&sc->lock);
512 spin_lock_init(&sc->rxbuflock); 512 spin_lock_init(&sc->rxbuflock);
513 spin_lock_init(&sc->txbuflock); 513 spin_lock_init(&sc->txbuflock);
@@ -1377,8 +1377,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
1377 ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi); 1377 ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
1378 if (ret) 1378 if (ret)
1379 return ret; 1379 return ret;
1380 if (sc->opmode == IEEE80211_IF_TYPE_AP || 1380 if (sc->opmode == NL80211_IFTYPE_AP ||
1381 sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) { 1381 sc->opmode == NL80211_IFTYPE_MESH_POINT) {
1382 /* 1382 /*
1383 * Always burst out beacon and CAB traffic 1383 * Always burst out beacon and CAB traffic
1384 * (aifs = cwmin = cwmax = 0) 1384 * (aifs = cwmin = cwmax = 0)
@@ -1386,7 +1386,7 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
1386 qi.tqi_aifs = 0; 1386 qi.tqi_aifs = 0;
1387 qi.tqi_cw_min = 0; 1387 qi.tqi_cw_min = 0;
1388 qi.tqi_cw_max = 0; 1388 qi.tqi_cw_max = 0;
1389 } else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 1389 } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
1390 /* 1390 /*
1391 * Adhoc mode; backoff between 0 and (2 * cw_min). 1391 * Adhoc mode; backoff between 0 and (2 * cw_min).
1392 */ 1392 */
@@ -1714,7 +1714,7 @@ ath5k_tasklet_rx(unsigned long data)
1714 /* let crypto-error packets fall through in MNTR */ 1714 /* let crypto-error packets fall through in MNTR */
1715 if ((rs.rs_status & 1715 if ((rs.rs_status &
1716 ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || 1716 ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) ||
1717 sc->opmode != IEEE80211_IF_TYPE_MNTR) 1717 sc->opmode != NL80211_IFTYPE_MONITOR)
1718 goto next; 1718 goto next;
1719 } 1719 }
1720accept: 1720accept:
@@ -1777,7 +1777,7 @@ accept:
1777 ath5k_debug_dump_skb(sc, skb, "RX ", 0); 1777 ath5k_debug_dump_skb(sc, skb, "RX ", 0);
1778 1778
1779 /* check beacons in IBSS mode */ 1779 /* check beacons in IBSS mode */
1780 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) 1780 if (sc->opmode == NL80211_IFTYPE_ADHOC)
1781 ath5k_check_ibss_tsf(sc, skb, &rxs); 1781 ath5k_check_ibss_tsf(sc, skb, &rxs);
1782 1782
1783 __ieee80211_rx(sc->hw, skb, &rxs); 1783 __ieee80211_rx(sc->hw, skb, &rxs);
@@ -1892,7 +1892,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
1892 ds = bf->desc; 1892 ds = bf->desc;
1893 1893
1894 flags = AR5K_TXDESC_NOACK; 1894 flags = AR5K_TXDESC_NOACK;
1895 if (sc->opmode == IEEE80211_IF_TYPE_IBSS && ath5k_hw_hasveol(ah)) { 1895 if (sc->opmode == NL80211_IFTYPE_ADHOC && ath5k_hw_hasveol(ah)) {
1896 ds->ds_link = bf->daddr; /* self-linked */ 1896 ds->ds_link = bf->daddr; /* self-linked */
1897 flags |= AR5K_TXDESC_VEOL; 1897 flags |= AR5K_TXDESC_VEOL;
1898 /* 1898 /*
@@ -1941,8 +1941,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
1941 1941
1942 ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n"); 1942 ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n");
1943 1943
1944 if (unlikely(bf->skb == NULL || sc->opmode == IEEE80211_IF_TYPE_STA || 1944 if (unlikely(bf->skb == NULL || sc->opmode == NL80211_IFTYPE_STATION ||
1945 sc->opmode == IEEE80211_IF_TYPE_MNTR)) { 1945 sc->opmode == NL80211_IFTYPE_MONITOR)) {
1946 ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL); 1946 ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL);
1947 return; 1947 return;
1948 } 1948 }
@@ -2116,9 +2116,9 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2116 sc->bmisscount = 0; 2116 sc->bmisscount = 0;
2117 sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); 2117 sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
2118 2118
2119 if (sc->opmode == IEEE80211_IF_TYPE_STA) { 2119 if (sc->opmode == NL80211_IFTYPE_STATION) {
2120 sc->imask |= AR5K_INT_BMISS; 2120 sc->imask |= AR5K_INT_BMISS;
2121 } else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2121 } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
2122 /* 2122 /*
2123 * In IBSS mode we use a self-linked tx descriptor and let the 2123 * In IBSS mode we use a self-linked tx descriptor and let the
2124 * hardware send the beacons automatically. We have to load it 2124 * hardware send the beacons automatically. We have to load it
@@ -2323,7 +2323,7 @@ ath5k_intr(int irq, void *dev_id)
2323 * transmission time) in order to detect wether 2323 * transmission time) in order to detect wether
2324 * automatic TSF updates happened. 2324 * automatic TSF updates happened.
2325 */ 2325 */
2326 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2326 if (sc->opmode == NL80211_IFTYPE_ADHOC) {
2327 /* XXX: only if VEOL suppported */ 2327 /* XXX: only if VEOL suppported */
2328 u64 tsf = ath5k_hw_get_tsf64(ah); 2328 u64 tsf = ath5k_hw_get_tsf64(ah);
2329 sc->nexttbtt += sc->bintval; 2329 sc->nexttbtt += sc->bintval;
@@ -2553,7 +2553,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2553 2553
2554 ath5k_debug_dump_skb(sc, skb, "TX ", 1); 2554 ath5k_debug_dump_skb(sc, skb, "TX ", 1);
2555 2555
2556 if (sc->opmode == IEEE80211_IF_TYPE_MNTR) 2556 if (sc->opmode == NL80211_IFTYPE_MONITOR)
2557 ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n"); 2557 ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n");
2558 2558
2559 /* 2559 /*
@@ -2688,9 +2688,9 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2688 sc->vif = conf->vif; 2688 sc->vif = conf->vif;
2689 2689
2690 switch (conf->type) { 2690 switch (conf->type) {
2691 case IEEE80211_IF_TYPE_STA: 2691 case NL80211_IFTYPE_STATION:
2692 case IEEE80211_IF_TYPE_IBSS: 2692 case NL80211_IFTYPE_ADHOC:
2693 case IEEE80211_IF_TYPE_MNTR: 2693 case NL80211_IFTYPE_MONITOR:
2694 sc->opmode = conf->type; 2694 sc->opmode = conf->type;
2695 break; 2695 break;
2696 default: 2696 default:
@@ -2761,7 +2761,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2761 } 2761 }
2762 2762
2763 if (conf->changed & IEEE80211_IFCC_BEACON && 2763 if (conf->changed & IEEE80211_IFCC_BEACON &&
2764 vif->type == IEEE80211_IF_TYPE_IBSS) { 2764 vif->type == NL80211_IFTYPE_ADHOC) {
2765 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 2765 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
2766 if (!beacon) { 2766 if (!beacon) {
2767 ret = -ENOMEM; 2767 ret = -ENOMEM;
@@ -2880,17 +2880,17 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
2880 2880
2881 /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ 2881 /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */
2882 2882
2883 if (sc->opmode == IEEE80211_IF_TYPE_MNTR) 2883 if (sc->opmode == NL80211_IFTYPE_MONITOR)
2884 rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | 2884 rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
2885 AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; 2885 AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
2886 if (sc->opmode != IEEE80211_IF_TYPE_STA) 2886 if (sc->opmode != NL80211_IFTYPE_STATION)
2887 rfilt |= AR5K_RX_FILTER_PROBEREQ; 2887 rfilt |= AR5K_RX_FILTER_PROBEREQ;
2888 if (sc->opmode != IEEE80211_IF_TYPE_AP && 2888 if (sc->opmode != NL80211_IFTYPE_AP &&
2889 sc->opmode != IEEE80211_IF_TYPE_MESH_POINT && 2889 sc->opmode != NL80211_IFTYPE_MESH_POINT &&
2890 test_bit(ATH_STAT_PROMISC, sc->status)) 2890 test_bit(ATH_STAT_PROMISC, sc->status))
2891 rfilt |= AR5K_RX_FILTER_PROM; 2891 rfilt |= AR5K_RX_FILTER_PROM;
2892 if (sc->opmode == IEEE80211_IF_TYPE_STA || 2892 if (sc->opmode == NL80211_IFTYPE_STATION ||
2893 sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2893 sc->opmode == NL80211_IFTYPE_ADHOC) {
2894 rfilt |= AR5K_RX_FILTER_BEACON; 2894 rfilt |= AR5K_RX_FILTER_BEACON;
2895 } 2895 }
2896 2896
@@ -2995,7 +2995,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw)
2995 * in IBSS mode we need to update the beacon timers too. 2995 * in IBSS mode we need to update the beacon timers too.
2996 * this will also reset the TSF if we call it with 0 2996 * this will also reset the TSF if we call it with 0
2997 */ 2997 */
2998 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) 2998 if (sc->opmode == NL80211_IFTYPE_ADHOC)
2999 ath5k_beacon_update_timers(sc, 0); 2999 ath5k_beacon_update_timers(sc, 0);
3000 else 3000 else
3001 ath5k_hw_reset_tsf(sc->ah); 3001 ath5k_hw_reset_tsf(sc->ah);
@@ -3010,7 +3010,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3010 3010
3011 ath5k_debug_dump_skb(sc, skb, "BC ", 1); 3011 ath5k_debug_dump_skb(sc, skb, "BC ", 1);
3012 3012
3013 if (sc->opmode != IEEE80211_IF_TYPE_IBSS) { 3013 if (sc->opmode != NL80211_IFTYPE_ADHOC) {
3014 ret = -EIO; 3014 ret = -EIO;
3015 goto end; 3015 goto end;
3016 } 3016 }
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h
index 1549b63d6138..9d0b728928e3 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -113,7 +113,7 @@ struct ath5k_softc {
113 struct ieee80211_channel channels[ATH_CHAN_MAX]; 113 struct ieee80211_channel channels[ATH_CHAN_MAX];
114 struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; 114 struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
115 u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; 115 u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
116 enum ieee80211_if_types opmode; 116 enum nl80211_iftype opmode;
117 struct ath5k_hw *ah; /* Atheros HW */ 117 struct ath5k_hw *ah; /* Atheros HW */
118 118
119 struct ieee80211_supported_band *curband; 119 struct ieee80211_supported_band *curband;
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c
index 5a896d1e2a2b..c77cee2a5582 100644
--- a/drivers/net/wireless/ath5k/pcu.c
+++ b/drivers/net/wireless/ath5k/pcu.c
@@ -52,26 +52,26 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
52 ATH5K_TRACE(ah->ah_sc); 52 ATH5K_TRACE(ah->ah_sc);
53 53
54 switch (ah->ah_op_mode) { 54 switch (ah->ah_op_mode) {
55 case IEEE80211_IF_TYPE_IBSS: 55 case NL80211_IFTYPE_ADHOC:
56 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA | 56 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA |
57 (ah->ah_version == AR5K_AR5210 ? 57 (ah->ah_version == AR5K_AR5210 ?
58 AR5K_STA_ID1_NO_PSPOLL : 0); 58 AR5K_STA_ID1_NO_PSPOLL : 0);
59 beacon_reg |= AR5K_BCR_ADHOC; 59 beacon_reg |= AR5K_BCR_ADHOC;
60 break; 60 break;
61 61
62 case IEEE80211_IF_TYPE_AP: 62 case NL80211_IFTYPE_AP:
63 case IEEE80211_IF_TYPE_MESH_POINT: 63 case NL80211_IFTYPE_MESH_POINT:
64 pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA | 64 pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
65 (ah->ah_version == AR5K_AR5210 ? 65 (ah->ah_version == AR5K_AR5210 ?
66 AR5K_STA_ID1_NO_PSPOLL : 0); 66 AR5K_STA_ID1_NO_PSPOLL : 0);
67 beacon_reg |= AR5K_BCR_AP; 67 beacon_reg |= AR5K_BCR_AP;
68 break; 68 break;
69 69
70 case IEEE80211_IF_TYPE_STA: 70 case NL80211_IFTYPE_STATION:
71 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | 71 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
72 (ah->ah_version == AR5K_AR5210 ? 72 (ah->ah_version == AR5K_AR5210 ?
73 AR5K_STA_ID1_PWR_SV : 0); 73 AR5K_STA_ID1_PWR_SV : 0);
74 case IEEE80211_IF_TYPE_MNTR: 74 case NL80211_IFTYPE_MONITOR:
75 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | 75 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
76 (ah->ah_version == AR5K_AR5210 ? 76 (ah->ah_version == AR5K_AR5210 ?
77 AR5K_STA_ID1_NO_PSPOLL : 0); 77 AR5K_STA_ID1_NO_PSPOLL : 0);
@@ -649,7 +649,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
649 * Set the additional timers by mode 649 * Set the additional timers by mode
650 */ 650 */
651 switch (ah->ah_op_mode) { 651 switch (ah->ah_op_mode) {
652 case IEEE80211_IF_TYPE_STA: 652 case NL80211_IFTYPE_STATION:
653 if (ah->ah_version == AR5K_AR5210) { 653 if (ah->ah_version == AR5K_AR5210) {
654 timer1 = 0xffffffff; 654 timer1 = 0xffffffff;
655 timer2 = 0xffffffff; 655 timer2 = 0xffffffff;
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index d260fba0180f..f5c3de890cdb 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -399,7 +399,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
399/* 399/*
400 * Main reset function 400 * Main reset function
401 */ 401 */
402int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, 402int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
403 struct ieee80211_channel *channel, bool change_channel) 403 struct ieee80211_channel *channel, bool change_channel)
404{ 404{
405 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 405 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index b493dff5643e..2a6e089062f3 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -140,7 +140,7 @@ static int ath_key_config(struct ath_softc *sc,
140 struct ath9k_keyval hk; 140 struct ath9k_keyval hk;
141 const u8 *mac = NULL; 141 const u8 *mac = NULL;
142 int ret = 0; 142 int ret = 0;
143 enum ieee80211_if_types opmode; 143 enum nl80211_iftype opmode;
144 144
145 memset(&hk, 0, sizeof(hk)); 145 memset(&hk, 0, sizeof(hk));
146 146
@@ -179,14 +179,14 @@ static int ath_key_config(struct ath_softc *sc,
179 */ 179 */
180 if (is_broadcast_ether_addr(addr)) { 180 if (is_broadcast_ether_addr(addr)) {
181 switch (opmode) { 181 switch (opmode) {
182 case IEEE80211_IF_TYPE_STA: 182 case NL80211_IFTYPE_STATION:
183 /* default key: could be group WPA key 183 /* default key: could be group WPA key
184 * or could be static WEP key */ 184 * or could be static WEP key */
185 mac = NULL; 185 mac = NULL;
186 break; 186 break;
187 case IEEE80211_IF_TYPE_IBSS: 187 case NL80211_IFTYPE_ADHOC:
188 break; 188 break;
189 case IEEE80211_IF_TYPE_AP: 189 case NL80211_IFTYPE_AP:
190 break; 190 break;
191 default: 191 default:
192 ASSERT(0); 192 ASSERT(0);
@@ -1147,13 +1147,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1147 return -ENOBUFS; 1147 return -ENOBUFS;
1148 1148
1149 switch (conf->type) { 1149 switch (conf->type) {
1150 case IEEE80211_IF_TYPE_STA: 1150 case NL80211_IFTYPE_STATION:
1151 ic_opmode = ATH9K_M_STA; 1151 ic_opmode = ATH9K_M_STA;
1152 break; 1152 break;
1153 case IEEE80211_IF_TYPE_IBSS: 1153 case NL80211_IFTYPE_ADHOC:
1154 ic_opmode = ATH9K_M_IBSS; 1154 ic_opmode = ATH9K_M_IBSS;
1155 break; 1155 break;
1156 case IEEE80211_IF_TYPE_AP: 1156 case NL80211_IFTYPE_AP:
1157 ic_opmode = ATH9K_M_HOSTAP; 1157 ic_opmode = ATH9K_M_HOSTAP;
1158 break; 1158 break;
1159 default: 1159 default:
@@ -1275,7 +1275,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1275 1275
1276 /* TODO: Need to decide which hw opmode to use for multi-interface 1276 /* TODO: Need to decide which hw opmode to use for multi-interface
1277 * cases */ 1277 * cases */
1278 if (vif->type == IEEE80211_IF_TYPE_AP && 1278 if (vif->type == NL80211_IFTYPE_AP &&
1279 ah->ah_opmode != ATH9K_M_HOSTAP) { 1279 ah->ah_opmode != ATH9K_M_HOSTAP) {
1280 ah->ah_opmode = ATH9K_M_HOSTAP; 1280 ah->ah_opmode = ATH9K_M_HOSTAP;
1281 ath9k_hw_setopmode(ah); 1281 ath9k_hw_setopmode(ah);
@@ -1287,8 +1287,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1287 if ((conf->changed & IEEE80211_IFCC_BSSID) && 1287 if ((conf->changed & IEEE80211_IFCC_BSSID) &&
1288 !is_zero_ether_addr(conf->bssid)) { 1288 !is_zero_ether_addr(conf->bssid)) {
1289 switch (vif->type) { 1289 switch (vif->type) {
1290 case IEEE80211_IF_TYPE_STA: 1290 case NL80211_IFTYPE_STATION:
1291 case IEEE80211_IF_TYPE_IBSS: 1291 case NL80211_IFTYPE_ADHOC:
1292 /* Update ratectrl about the new state */ 1292 /* Update ratectrl about the new state */
1293 ath_rate_newstate(sc, avp); 1293 ath_rate_newstate(sc, avp);
1294 1294
@@ -1333,8 +1333,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1333 } 1333 }
1334 1334
1335 if ((conf->changed & IEEE80211_IFCC_BEACON) && 1335 if ((conf->changed & IEEE80211_IFCC_BEACON) &&
1336 ((vif->type == IEEE80211_IF_TYPE_IBSS) || 1336 ((vif->type == NL80211_IFTYPE_ADHOC) ||
1337 (vif->type == IEEE80211_IF_TYPE_AP))) { 1337 (vif->type == NL80211_IFTYPE_AP))) {
1338 /* 1338 /*
1339 * Allocate and setup the beacon frame. 1339 * Allocate and setup the beacon frame.
1340 * 1340 *
@@ -1353,7 +1353,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1353 } 1353 }
1354 1354
1355 /* Check for WLAN_CAPABILITY_PRIVACY ? */ 1355 /* Check for WLAN_CAPABILITY_PRIVACY ? */
1356 if ((avp->av_opmode != IEEE80211_IF_TYPE_STA)) { 1356 if ((avp->av_opmode != NL80211_IFTYPE_STATION)) {
1357 for (i = 0; i < IEEE80211_WEP_NKID; i++) 1357 for (i = 0; i < IEEE80211_WEP_NKID; i++)
1358 if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) 1358 if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i))
1359 ath9k_hw_keysetmac(sc->sc_ah, 1359 ath9k_hw_keysetmac(sc->sc_ah,
@@ -1362,7 +1362,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1362 } 1362 }
1363 1363
1364 /* Only legacy IBSS for now */ 1364 /* Only legacy IBSS for now */
1365 if (vif->type == IEEE80211_IF_TYPE_IBSS) 1365 if (vif->type == NL80211_IFTYPE_ADHOC)
1366 ath_update_chainmask(sc, 0); 1366 ath_update_chainmask(sc, 0);
1367 1367
1368 return 0; 1368 return 0;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d4a356b11636..df7a1e7f4a52 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1244,13 +1244,13 @@ generate_new:
1244 1244
1245static void handle_irq_tbtt_indication(struct b43_wldev *dev) 1245static void handle_irq_tbtt_indication(struct b43_wldev *dev)
1246{ 1246{
1247 if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) { 1247 if (b43_is_mode(dev->wl, NL80211_IFTYPE_AP)) {
1248 ///TODO: PS TBTT 1248 ///TODO: PS TBTT
1249 } else { 1249 } else {
1250 if (1 /*FIXME: the last PSpoll frame was sent successfully */ ) 1250 if (1 /*FIXME: the last PSpoll frame was sent successfully */ )
1251 b43_power_saving_ctl_bits(dev, 0); 1251 b43_power_saving_ctl_bits(dev, 0);
1252 } 1252 }
1253 if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) 1253 if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC))
1254 dev->dfq_valid = 1; 1254 dev->dfq_valid = 1;
1255} 1255}
1256 1256
@@ -1599,8 +1599,8 @@ static void handle_irq_beacon(struct b43_wldev *dev)
1599 struct b43_wl *wl = dev->wl; 1599 struct b43_wl *wl = dev->wl;
1600 u32 cmd, beacon0_valid, beacon1_valid; 1600 u32 cmd, beacon0_valid, beacon1_valid;
1601 1601
1602 if (!b43_is_mode(wl, IEEE80211_IF_TYPE_AP) && 1602 if (!b43_is_mode(wl, NL80211_IFTYPE_AP) &&
1603 !b43_is_mode(wl, IEEE80211_IF_TYPE_MESH_POINT)) 1603 !b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
1604 return; 1604 return;
1605 1605
1606 /* This is the bottom half of the asynchronous beacon update. */ 1606 /* This is the bottom half of the asynchronous beacon update. */
@@ -2568,10 +2568,10 @@ static void b43_adjust_opmode(struct b43_wldev *dev)
2568 ctl &= ~B43_MACCTL_BEACPROMISC; 2568 ctl &= ~B43_MACCTL_BEACPROMISC;
2569 ctl |= B43_MACCTL_INFRA; 2569 ctl |= B43_MACCTL_INFRA;
2570 2570
2571 if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP) || 2571 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
2572 b43_is_mode(wl, IEEE80211_IF_TYPE_MESH_POINT)) 2572 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
2573 ctl |= B43_MACCTL_AP; 2573 ctl |= B43_MACCTL_AP;
2574 else if (b43_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) 2574 else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC))
2575 ctl &= ~B43_MACCTL_INFRA; 2575 ctl &= ~B43_MACCTL_INFRA;
2576 2576
2577 if (wl->filter_flags & FIF_CONTROL) 2577 if (wl->filter_flags & FIF_CONTROL)
@@ -3406,8 +3406,8 @@ static int b43_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
3406 phy->ops->set_rx_antenna(dev, antenna); 3406 phy->ops->set_rx_antenna(dev, antenna);
3407 3407
3408 /* Update templates for AP/mesh mode. */ 3408 /* Update templates for AP/mesh mode. */
3409 if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP) || 3409 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3410 b43_is_mode(wl, IEEE80211_IF_TYPE_MESH_POINT)) 3410 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
3411 b43_set_beacon_int(dev, conf->beacon_int); 3411 b43_set_beacon_int(dev, conf->beacon_int);
3412 3412
3413 if (!!conf->radio_enabled != phy->radio_on) { 3413 if (!!conf->radio_enabled != phy->radio_on) {
@@ -3595,14 +3595,14 @@ static int b43_op_config_interface(struct ieee80211_hw *hw,
3595 else 3595 else
3596 memset(wl->bssid, 0, ETH_ALEN); 3596 memset(wl->bssid, 0, ETH_ALEN);
3597 if (b43_status(dev) >= B43_STAT_INITIALIZED) { 3597 if (b43_status(dev) >= B43_STAT_INITIALIZED) {
3598 if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP) || 3598 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3599 b43_is_mode(wl, IEEE80211_IF_TYPE_MESH_POINT)) { 3599 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) {
3600 B43_WARN_ON(vif->type != wl->if_type); 3600 B43_WARN_ON(vif->type != wl->if_type);
3601 if (conf->changed & IEEE80211_IFCC_SSID) 3601 if (conf->changed & IEEE80211_IFCC_SSID)
3602 b43_set_ssid(dev, conf->ssid, conf->ssid_len); 3602 b43_set_ssid(dev, conf->ssid, conf->ssid_len);
3603 if (conf->changed & IEEE80211_IFCC_BEACON) 3603 if (conf->changed & IEEE80211_IFCC_BEACON)
3604 b43_update_templates(wl); 3604 b43_update_templates(wl);
3605 } else if (b43_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) { 3605 } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
3606 if (conf->changed & IEEE80211_IFCC_BEACON) 3606 if (conf->changed & IEEE80211_IFCC_BEACON)
3607 b43_update_templates(wl); 3607 b43_update_templates(wl);
3608 } 3608 }
@@ -3903,7 +3903,7 @@ static void b43_set_synth_pu_delay(struct b43_wldev *dev, bool idle)
3903 pu_delay = 3700; 3903 pu_delay = 3700;
3904 else 3904 else
3905 pu_delay = 1050; 3905 pu_delay = 1050;
3906 if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS) || idle) 3906 if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC) || idle)
3907 pu_delay = 500; 3907 pu_delay = 500;
3908 if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8)) 3908 if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
3909 pu_delay = max(pu_delay, (u16)2400); 3909 pu_delay = max(pu_delay, (u16)2400);
@@ -3917,7 +3917,7 @@ static void b43_set_pretbtt(struct b43_wldev *dev)
3917 u16 pretbtt; 3917 u16 pretbtt;
3918 3918
3919 /* The time value is in microseconds. */ 3919 /* The time value is in microseconds. */
3920 if (b43_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) { 3920 if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC)) {
3921 pretbtt = 2; 3921 pretbtt = 2;
3922 } else { 3922 } else {
3923 if (dev->phy.type == B43_PHYTYPE_A) 3923 if (dev->phy.type == B43_PHYTYPE_A)
@@ -4084,11 +4084,11 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
4084 4084
4085 /* TODO: allow WDS/AP devices to coexist */ 4085 /* TODO: allow WDS/AP devices to coexist */
4086 4086
4087 if (conf->type != IEEE80211_IF_TYPE_AP && 4087 if (conf->type != NL80211_IFTYPE_AP &&
4088 conf->type != IEEE80211_IF_TYPE_MESH_POINT && 4088 conf->type != NL80211_IFTYPE_MESH_POINT &&
4089 conf->type != IEEE80211_IF_TYPE_STA && 4089 conf->type != NL80211_IFTYPE_STATION &&
4090 conf->type != IEEE80211_IF_TYPE_WDS && 4090 conf->type != NL80211_IFTYPE_WDS &&
4091 conf->type != IEEE80211_IF_TYPE_IBSS) 4091 conf->type != NL80211_IFTYPE_ADHOC)
4092 return -EOPNOTSUPP; 4092 return -EOPNOTSUPP;
4093 4093
4094 mutex_lock(&wl->mutex); 4094 mutex_lock(&wl->mutex);
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 4d4345d76abf..af37abccccb3 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -162,7 +162,7 @@ void b43_phy_lock(struct b43_wldev *dev)
162#endif 162#endif
163 B43_WARN_ON(dev->dev->id.revision < 3); 163 B43_WARN_ON(dev->dev->id.revision < 3);
164 164
165 if (!b43_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) 165 if (!b43_is_mode(dev->wl, NL80211_IFTYPE_AP))
166 b43_power_saving_ctl_bits(dev, B43_PS_AWAKE); 166 b43_power_saving_ctl_bits(dev, B43_PS_AWAKE);
167} 167}
168 168
@@ -174,7 +174,7 @@ void b43_phy_unlock(struct b43_wldev *dev)
174#endif 174#endif
175 B43_WARN_ON(dev->dev->id.revision < 3); 175 B43_WARN_ON(dev->dev->id.revision < 3);
176 176
177 if (!b43_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) 177 if (!b43_is_mode(dev->wl, NL80211_IFTYPE_AP))
178 b43_power_saving_ctl_bits(dev, 0); 178 b43_power_saving_ctl_bits(dev, 0);
179} 179}
180 180
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 68f63f5093af..6e425410c99d 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -888,13 +888,13 @@ generate_new:
888 888
889static void handle_irq_tbtt_indication(struct b43legacy_wldev *dev) 889static void handle_irq_tbtt_indication(struct b43legacy_wldev *dev)
890{ 890{
891 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) { 891 if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP)) {
892 /* TODO: PS TBTT */ 892 /* TODO: PS TBTT */
893 } else { 893 } else {
894 if (1/*FIXME: the last PSpoll frame was sent successfully */) 894 if (1/*FIXME: the last PSpoll frame was sent successfully */)
895 b43legacy_power_saving_ctl_bits(dev, -1, -1); 895 b43legacy_power_saving_ctl_bits(dev, -1, -1);
896 } 896 }
897 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) 897 if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC))
898 dev->dfq_valid = 1; 898 dev->dfq_valid = 1;
899} 899}
900 900
@@ -1201,7 +1201,7 @@ static void handle_irq_beacon(struct b43legacy_wldev *dev)
1201 struct b43legacy_wl *wl = dev->wl; 1201 struct b43legacy_wl *wl = dev->wl;
1202 u32 cmd; 1202 u32 cmd;
1203 1203
1204 if (!b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) 1204 if (!b43legacy_is_mode(wl, NL80211_IFTYPE_AP))
1205 return; 1205 return;
1206 1206
1207 /* This is the bottom half of the asynchronous beacon update. */ 1207 /* This is the bottom half of the asynchronous beacon update. */
@@ -1936,9 +1936,9 @@ static void b43legacy_adjust_opmode(struct b43legacy_wldev *dev)
1936 ctl &= ~B43legacy_MACCTL_BEACPROMISC; 1936 ctl &= ~B43legacy_MACCTL_BEACPROMISC;
1937 ctl |= B43legacy_MACCTL_INFRA; 1937 ctl |= B43legacy_MACCTL_INFRA;
1938 1938
1939 if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) 1939 if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP))
1940 ctl |= B43legacy_MACCTL_AP; 1940 ctl |= B43legacy_MACCTL_AP;
1941 else if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) 1941 else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC))
1942 ctl &= ~B43legacy_MACCTL_INFRA; 1942 ctl &= ~B43legacy_MACCTL_INFRA;
1943 1943
1944 if (wl->filter_flags & FIF_CONTROL) 1944 if (wl->filter_flags & FIF_CONTROL)
@@ -2646,7 +2646,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2646 b43legacy_mgmtframe_txantenna(dev, antenna_tx); 2646 b43legacy_mgmtframe_txantenna(dev, antenna_tx);
2647 2647
2648 /* Update templates for AP mode. */ 2648 /* Update templates for AP mode. */
2649 if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) 2649 if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP))
2650 b43legacy_set_beacon_int(dev, conf->beacon_int); 2650 b43legacy_set_beacon_int(dev, conf->beacon_int);
2651 2651
2652 2652
@@ -2733,12 +2733,12 @@ static int b43legacy_op_config_interface(struct ieee80211_hw *hw,
2733 else 2733 else
2734 memset(wl->bssid, 0, ETH_ALEN); 2734 memset(wl->bssid, 0, ETH_ALEN);
2735 if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { 2735 if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) {
2736 if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) { 2736 if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) {
2737 B43legacy_WARN_ON(vif->type != IEEE80211_IF_TYPE_AP); 2737 B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP);
2738 b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len); 2738 b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len);
2739 if (conf->changed & IEEE80211_IFCC_BEACON) 2739 if (conf->changed & IEEE80211_IFCC_BEACON)
2740 b43legacy_update_templates(wl); 2740 b43legacy_update_templates(wl);
2741 } else if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) { 2741 } else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
2742 if (conf->changed & IEEE80211_IFCC_BEACON) 2742 if (conf->changed & IEEE80211_IFCC_BEACON)
2743 b43legacy_update_templates(wl); 2743 b43legacy_update_templates(wl);
2744 } 2744 }
@@ -3020,7 +3020,7 @@ static void b43legacy_set_synth_pu_delay(struct b43legacy_wldev *dev,
3020 bool idle) { 3020 bool idle) {
3021 u16 pu_delay = 1050; 3021 u16 pu_delay = 1050;
3022 3022
3023 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS) || idle) 3023 if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC) || idle)
3024 pu_delay = 500; 3024 pu_delay = 500;
3025 if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8)) 3025 if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
3026 pu_delay = max(pu_delay, (u16)2400); 3026 pu_delay = max(pu_delay, (u16)2400);
@@ -3035,7 +3035,7 @@ static void b43legacy_set_pretbtt(struct b43legacy_wldev *dev)
3035 u16 pretbtt; 3035 u16 pretbtt;
3036 3036
3037 /* The time value is in microseconds. */ 3037 /* The time value is in microseconds. */
3038 if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) 3038 if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC))
3039 pretbtt = 2; 3039 pretbtt = 2;
3040 else 3040 else
3041 pretbtt = 250; 3041 pretbtt = 250;
@@ -3259,10 +3259,10 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw,
3259 3259
3260 /* TODO: allow WDS/AP devices to coexist */ 3260 /* TODO: allow WDS/AP devices to coexist */
3261 3261
3262 if (conf->type != IEEE80211_IF_TYPE_AP && 3262 if (conf->type != NL80211_IFTYPE_AP &&
3263 conf->type != IEEE80211_IF_TYPE_STA && 3263 conf->type != NL80211_IFTYPE_STATION &&
3264 conf->type != IEEE80211_IF_TYPE_WDS && 3264 conf->type != NL80211_IFTYPE_WDS &&
3265 conf->type != IEEE80211_IF_TYPE_IBSS) 3265 conf->type != NL80211_IFTYPE_ADHOC)
3266 return -EOPNOTSUPP; 3266 return -EOPNOTSUPP;
3267 3267
3268 mutex_lock(&wl->mutex); 3268 mutex_lock(&wl->mutex);
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c
index bed67a54250c..4c9442b16f3f 100644
--- a/drivers/net/wireless/b43legacy/phy.c
+++ b/drivers/net/wireless/b43legacy/phy.c
@@ -103,7 +103,7 @@ void b43legacy_phy_lock(struct b43legacy_wldev *dev)
103 if (dev->dev->id.revision < 3) { 103 if (dev->dev->id.revision < 3) {
104 b43legacy_mac_suspend(dev); 104 b43legacy_mac_suspend(dev);
105 } else { 105 } else {
106 if (!b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) 106 if (!b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP))
107 b43legacy_power_saving_ctl_bits(dev, -1, 1); 107 b43legacy_power_saving_ctl_bits(dev, -1, 1);
108 } 108 }
109} 109}
@@ -118,7 +118,7 @@ void b43legacy_phy_unlock(struct b43legacy_wldev *dev)
118 if (dev->dev->id.revision < 3) { 118 if (dev->dev->id.revision < 3) {
119 b43legacy_mac_enable(dev); 119 b43legacy_mac_enable(dev);
120 } else { 120 } else {
121 if (!b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) 121 if (!b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP))
122 b43legacy_power_saving_ctl_bits(dev, -1, -1); 122 b43legacy_power_saving_ctl_bits(dev, -1, -1);
123 } 123 }
124} 124}
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 10c64bdb314c..da23c927380f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -682,7 +682,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
682 682
683 rs_sta = (void *)sta->rate_ctrl_priv; 683 rs_sta = (void *)sta->rate_ctrl_priv;
684 684
685 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 685 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
686 !rs_sta->ibss_sta_added) { 686 !rs_sta->ibss_sta_added) {
687 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 687 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
688 688
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 3d100e898249..7ca5627cc078 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -520,10 +520,10 @@ static int iwl3945_is_network_packet(struct iwl3945_priv *priv,
520 /* Filter incoming packets to determine if they are targeted toward 520 /* Filter incoming packets to determine if they are targeted toward
521 * this network, discarding packets coming from ourselves */ 521 * this network, discarding packets coming from ourselves */
522 switch (priv->iw_mode) { 522 switch (priv->iw_mode) {
523 case IEEE80211_IF_TYPE_IBSS: /* Header: Dest. | Source | BSSID */ 523 case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */
524 /* packets to our IBSS update information */ 524 /* packets to our IBSS update information */
525 return !compare_ether_addr(header->addr3, priv->bssid); 525 return !compare_ether_addr(header->addr3, priv->bssid);
526 case IEEE80211_IF_TYPE_STA: /* Header: Dest. | AP{BSSID} | Source */ 526 case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */
527 /* packets to our IBSS update information */ 527 /* packets to our IBSS update information */
528 return !compare_ether_addr(header->addr2, priv->bssid); 528 return !compare_ether_addr(header->addr2, priv->bssid);
529 default: 529 default:
@@ -807,7 +807,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
807 807
808 priv->stations[sta_id].current_rate.rate_n_flags = rate; 808 priv->stations[sta_id].current_rate.rate_n_flags = rate;
809 809
810 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 810 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
811 (sta_id != priv->hw_setting.bcast_sta_id) && 811 (sta_id != priv->hw_setting.bcast_sta_id) &&
812 (sta_id != IWL_MULTICAST_ID)) 812 (sta_id != IWL_MULTICAST_ID))
813 priv->stations[IWL_STA_ID].current_rate.rate_n_flags = rate; 813 priv->stations[IWL_STA_ID].current_rate.rate_n_flags = rate;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 9bbbc9d7c0e8..2a4933b5fb64 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -851,7 +851,7 @@ struct iwl3945_priv {
851 /* eeprom */ 851 /* eeprom */
852 struct iwl3945_eeprom eeprom; 852 struct iwl3945_eeprom eeprom;
853 853
854 enum ieee80211_if_types iw_mode; 854 enum nl80211_iftype iw_mode;
855 855
856 struct sk_buff *ibss_beacon; 856 struct sk_buff *ibss_beacon;
857 857
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index c293e5b6cbb5..700da67ac288 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -821,7 +821,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
821 821
822 lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; 822 lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv;
823 823
824 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 824 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
825 !lq_sta->ibss_sta_added) 825 !lq_sta->ibss_sta_added)
826 goto out; 826 goto out;
827 827
@@ -2093,7 +2093,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
2093 i = sta->last_txrate_idx; 2093 i = sta->last_txrate_idx;
2094 2094
2095 if ((lq_sta->lq.sta_id == 0xff) && 2095 if ((lq_sta->lq.sta_id == 0xff) &&
2096 (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)) 2096 (priv->iw_mode == NL80211_IFTYPE_ADHOC))
2097 goto out; 2097 goto out;
2098 2098
2099 valid_tx_ant = priv->hw_params.valid_tx_ant; 2099 valid_tx_ant = priv->hw_params.valid_tx_ant;
@@ -2163,7 +2163,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
2163 lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; 2163 lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv;
2164 i = sta->last_txrate_idx; 2164 i = sta->last_txrate_idx;
2165 2165
2166 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 2166 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
2167 !lq_sta->ibss_sta_added) { 2167 !lq_sta->ibss_sta_added) {
2168 u8 sta_id = iwl_find_station(priv, hdr->addr1); 2168 u8 sta_id = iwl_find_station(priv, hdr->addr1);
2169 DECLARE_MAC_BUF(mac); 2169 DECLARE_MAC_BUF(mac);
@@ -2243,7 +2243,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
2243 * after assoc.. */ 2243 * after assoc.. */
2244 2244
2245 lq_sta->ibss_sta_added = 0; 2245 lq_sta->ibss_sta_added = 0;
2246 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 2246 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2247 u8 sta_id = iwl_find_station(priv, sta->addr); 2247 u8 sta_id = iwl_find_station(priv, sta->addr);
2248 DECLARE_MAC_BUF(mac); 2248 DECLARE_MAC_BUF(mac);
2249 2249
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 31ea28858896..e8db33bf5e5d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -337,7 +337,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
337 /* If we have set the ASSOC_MSK and we are in BSS mode then 337 /* If we have set the ASSOC_MSK and we are in BSS mode then
338 * add the IWL_AP_ID to the station rate table */ 338 * add the IWL_AP_ID to the station rate table */
339 if (new_assoc) { 339 if (new_assoc) {
340 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) { 340 if (priv->iw_mode == NL80211_IFTYPE_STATION) {
341 ret = iwl_rxon_add_station(priv, 341 ret = iwl_rxon_add_station(priv,
342 priv->active_rxon.bssid_addr, 1); 342 priv->active_rxon.bssid_addr, 1);
343 if (ret == IWL_INVALID_STATION) { 343 if (ret == IWL_INVALID_STATION) {
@@ -448,8 +448,8 @@ static unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv,
448 const u8 *dest, int left) 448 const u8 *dest, int left)
449{ 449{
450 if (!iwl_is_associated(priv) || !priv->ibss_beacon || 450 if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
451 ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && 451 ((priv->iw_mode != NL80211_IFTYPE_ADHOC) &&
452 (priv->iw_mode != IEEE80211_IF_TYPE_AP))) 452 (priv->iw_mode != NL80211_IFTYPE_AP)))
453 return 0; 453 return 0;
454 454
455 if (priv->ibss_beacon->len > left) 455 if (priv->ibss_beacon->len > left)
@@ -672,7 +672,7 @@ static void iwl4965_setup_rxon_timing(struct iwl_priv *priv)
672 beacon_int = priv->beacon_int; 672 beacon_int = priv->beacon_int;
673 spin_unlock_irqrestore(&priv->lock, flags); 673 spin_unlock_irqrestore(&priv->lock, flags);
674 674
675 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) { 675 if (priv->iw_mode == NL80211_IFTYPE_STATION) {
676 if (beacon_int == 0) { 676 if (beacon_int == 0) {
677 priv->rxon_timing.beacon_interval = cpu_to_le16(100); 677 priv->rxon_timing.beacon_interval = cpu_to_le16(100);
678 priv->rxon_timing.beacon_init_val = cpu_to_le32(102400); 678 priv->rxon_timing.beacon_init_val = cpu_to_le32(102400);
@@ -721,7 +721,7 @@ static void iwl_set_flags_for_band(struct iwl_priv *priv,
721 else 721 else
722 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 722 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
723 723
724 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 724 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
725 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 725 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
726 726
727 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK; 727 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
@@ -740,23 +740,23 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
740 memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); 740 memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
741 741
742 switch (priv->iw_mode) { 742 switch (priv->iw_mode) {
743 case IEEE80211_IF_TYPE_AP: 743 case NL80211_IFTYPE_AP:
744 priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; 744 priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
745 break; 745 break;
746 746
747 case IEEE80211_IF_TYPE_STA: 747 case NL80211_IFTYPE_STATION:
748 priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS; 748 priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS;
749 priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK; 749 priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
750 break; 750 break;
751 751
752 case IEEE80211_IF_TYPE_IBSS: 752 case NL80211_IFTYPE_ADHOC:
753 priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS; 753 priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
754 priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK; 754 priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
755 priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK | 755 priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
756 RXON_FILTER_ACCEPT_GRP_MSK; 756 RXON_FILTER_ACCEPT_GRP_MSK;
757 break; 757 break;
758 758
759 case IEEE80211_IF_TYPE_MNTR: 759 case NL80211_IFTYPE_MONITOR:
760 priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER; 760 priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER;
761 priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK | 761 priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK |
762 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; 762 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
@@ -785,7 +785,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv)
785 * in some case A channels are all non IBSS 785 * in some case A channels are all non IBSS
786 * in this case force B/G channel 786 * in this case force B/G channel
787 */ 787 */
788 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 788 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
789 !(is_channel_ibss(ch_info))) 789 !(is_channel_ibss(ch_info)))
790 ch_info = &priv->channel_info[0]; 790 ch_info = &priv->channel_info[0];
791 791
@@ -1182,7 +1182,7 @@ static void iwl4965_rx_beacon_notif(struct iwl_priv *priv,
1182 le32_to_cpu(beacon->low_tsf), rate); 1182 le32_to_cpu(beacon->low_tsf), rate);
1183#endif 1183#endif
1184 1184
1185 if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && 1185 if ((priv->iw_mode == NL80211_IFTYPE_AP) &&
1186 (!test_bit(STATUS_EXIT_PENDING, &priv->status))) 1186 (!test_bit(STATUS_EXIT_PENDING, &priv->status)))
1187 queue_work(priv->workqueue, &priv->beacon_update); 1187 queue_work(priv->workqueue, &priv->beacon_update);
1188} 1188}
@@ -2388,7 +2388,7 @@ static void iwl4965_bg_set_monitor(struct work_struct *work)
2388 2388
2389 mutex_lock(&priv->mutex); 2389 mutex_lock(&priv->mutex);
2390 2390
2391 ret = iwl4965_set_mode(priv, IEEE80211_IF_TYPE_MNTR); 2391 ret = iwl4965_set_mode(priv, NL80211_IFTYPE_MONITOR);
2392 2392
2393 if (ret) { 2393 if (ret) {
2394 if (ret == -EAGAIN) 2394 if (ret == -EAGAIN)
@@ -2469,7 +2469,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2469 DECLARE_MAC_BUF(mac); 2469 DECLARE_MAC_BUF(mac);
2470 unsigned long flags; 2470 unsigned long flags;
2471 2471
2472 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 2472 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2473 IWL_ERROR("%s Should not be called in AP mode\n", __func__); 2473 IWL_ERROR("%s Should not be called in AP mode\n", __func__);
2474 return; 2474 return;
2475 } 2475 }
@@ -2524,7 +2524,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2524 else 2524 else
2525 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 2525 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2526 2526
2527 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 2527 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
2528 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 2528 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2529 2529
2530 } 2530 }
@@ -2532,10 +2532,10 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2532 iwl4965_commit_rxon(priv); 2532 iwl4965_commit_rxon(priv);
2533 2533
2534 switch (priv->iw_mode) { 2534 switch (priv->iw_mode) {
2535 case IEEE80211_IF_TYPE_STA: 2535 case NL80211_IFTYPE_STATION:
2536 break; 2536 break;
2537 2537
2538 case IEEE80211_IF_TYPE_IBSS: 2538 case NL80211_IFTYPE_ADHOC:
2539 2539
2540 /* assume default assoc id */ 2540 /* assume default assoc id */
2541 priv->assoc_id = 1; 2541 priv->assoc_id = 1;
@@ -2551,7 +2551,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2551 break; 2551 break;
2552 } 2552 }
2553 2553
2554 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 2554 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
2555 priv->assoc_station_added = 1; 2555 priv->assoc_station_added = 1;
2556 2556
2557 spin_lock_irqsave(&priv->lock, flags); 2557 spin_lock_irqsave(&priv->lock, flags);
@@ -2828,7 +2828,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
2828 goto out; 2828 goto out;
2829 } 2829 }
2830 2830
2831 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS && 2831 if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
2832 !is_channel_ibss(ch_info)) { 2832 !is_channel_ibss(ch_info)) {
2833 IWL_ERROR("channel %d in band %d not IBSS channel\n", 2833 IWL_ERROR("channel %d in band %d not IBSS channel\n",
2834 conf->channel->hw_value, conf->channel->band); 2834 conf->channel->hw_value, conf->channel->band);
@@ -2943,7 +2943,7 @@ static void iwl4965_config_ap(struct iwl_priv *priv)
2943 priv->staging_rxon.flags &= 2943 priv->staging_rxon.flags &=
2944 ~RXON_FLG_SHORT_SLOT_MSK; 2944 ~RXON_FLG_SHORT_SLOT_MSK;
2945 2945
2946 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 2946 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
2947 priv->staging_rxon.flags &= 2947 priv->staging_rxon.flags &=
2948 ~RXON_FLG_SHORT_SLOT_MSK; 2948 ~RXON_FLG_SHORT_SLOT_MSK;
2949 } 2949 }
@@ -2982,7 +2982,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
2982 return 0; 2982 return 0;
2983 } 2983 }
2984 2984
2985 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS && 2985 if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
2986 conf->changed & IEEE80211_IFCC_BEACON) { 2986 conf->changed & IEEE80211_IFCC_BEACON) {
2987 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 2987 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
2988 if (!beacon) 2988 if (!beacon)
@@ -2992,7 +2992,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
2992 return rc; 2992 return rc;
2993 } 2993 }
2994 2994
2995 if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && 2995 if ((priv->iw_mode == NL80211_IFTYPE_AP) &&
2996 (!conf->ssid_len)) { 2996 (!conf->ssid_len)) {
2997 IWL_DEBUG_MAC80211 2997 IWL_DEBUG_MAC80211
2998 ("Leaving in AP mode because HostAPD is not ready.\n"); 2998 ("Leaving in AP mode because HostAPD is not ready.\n");
@@ -3015,7 +3015,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
3015 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { 3015 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
3016 */ 3016 */
3017 3017
3018 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 3018 if (priv->iw_mode == NL80211_IFTYPE_AP) {
3019 if (!conf->bssid) { 3019 if (!conf->bssid) {
3020 conf->bssid = priv->mac_addr; 3020 conf->bssid = priv->mac_addr;
3021 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 3021 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
@@ -3050,11 +3050,11 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
3050 * to verify) - jpk */ 3050 * to verify) - jpk */
3051 memcpy(priv->bssid, conf->bssid, ETH_ALEN); 3051 memcpy(priv->bssid, conf->bssid, ETH_ALEN);
3052 3052
3053 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 3053 if (priv->iw_mode == NL80211_IFTYPE_AP)
3054 iwl4965_config_ap(priv); 3054 iwl4965_config_ap(priv);
3055 else { 3055 else {
3056 rc = iwl4965_commit_rxon(priv); 3056 rc = iwl4965_commit_rxon(priv);
3057 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) 3057 if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
3058 iwl_rxon_add_station( 3058 iwl_rxon_add_station(
3059 priv, priv->active_rxon.bssid_addr, 1); 3059 priv, priv->active_rxon.bssid_addr, 1);
3060 } 3060 }
@@ -3090,7 +3090,7 @@ static void iwl4965_configure_filter(struct ieee80211_hw *hw,
3090 3090
3091 if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { 3091 if (changed_flags & (*total_flags) & FIF_OTHER_BSS) {
3092 IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", 3092 IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n",
3093 IEEE80211_IF_TYPE_MNTR, 3093 NL80211_IFTYPE_MONITOR,
3094 changed_flags, *total_flags); 3094 changed_flags, *total_flags);
3095 /* queue work 'cuz mac80211 is holding a lock which 3095 /* queue work 'cuz mac80211 is holding a lock which
3096 * prevents us from issuing (synchronous) f/w cmds */ 3096 * prevents us from issuing (synchronous) f/w cmds */
@@ -3204,7 +3204,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
3204 goto out_unlock; 3204 goto out_unlock;
3205 } 3205 }
3206 3206
3207 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { /* APs don't scan */ 3207 if (priv->iw_mode == NL80211_IFTYPE_AP) { /* APs don't scan */
3208 ret = -EIO; 3208 ret = -EIO;
3209 IWL_ERROR("ERROR: APs don't scan\n"); 3209 IWL_ERROR("ERROR: APs don't scan\n");
3210 goto out_unlock; 3210 goto out_unlock;
@@ -3329,7 +3329,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3329 * in 1X mode. 3329 * in 1X mode.
3330 * In legacy wep mode, we use another host command to the uCode */ 3330 * In legacy wep mode, we use another host command to the uCode */
3331 if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id && 3331 if (key->alg == ALG_WEP && sta_id == priv->hw_params.bcast_sta_id &&
3332 priv->iw_mode != IEEE80211_IF_TYPE_AP) { 3332 priv->iw_mode != NL80211_IFTYPE_AP) {
3333 if (cmd == SET_KEY) 3333 if (cmd == SET_KEY)
3334 is_default_wep_key = !priv->key_mapping_key; 3334 is_default_wep_key = !priv->key_mapping_key;
3335 else 3335 else
@@ -3400,7 +3400,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
3400 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; 3400 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
3401 priv->qos_data.qos_active = 1; 3401 priv->qos_data.qos_active = 1;
3402 3402
3403 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 3403 if (priv->iw_mode == NL80211_IFTYPE_AP)
3404 iwl_activate_qos(priv, 1); 3404 iwl_activate_qos(priv, 1);
3405 else if (priv->assoc_id && iwl_is_associated(priv)) 3405 else if (priv->assoc_id && iwl_is_associated(priv))
3406 iwl_activate_qos(priv, 0); 3406 iwl_activate_qos(priv, 0);
@@ -3518,7 +3518,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
3518 3518
3519 priv->beacon_int = priv->hw->conf.beacon_int; 3519 priv->beacon_int = priv->hw->conf.beacon_int;
3520 priv->timestamp = 0; 3520 priv->timestamp = 0;
3521 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA)) 3521 if ((priv->iw_mode == NL80211_IFTYPE_STATION))
3522 priv->beacon_int = 0; 3522 priv->beacon_int = 0;
3523 3523
3524 spin_unlock_irqrestore(&priv->lock, flags); 3524 spin_unlock_irqrestore(&priv->lock, flags);
@@ -3532,7 +3532,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
3532 /* we are restarting association process 3532 /* we are restarting association process
3533 * clear RXON_FILTER_ASSOC_MSK bit 3533 * clear RXON_FILTER_ASSOC_MSK bit
3534 */ 3534 */
3535 if (priv->iw_mode != IEEE80211_IF_TYPE_AP) { 3535 if (priv->iw_mode != NL80211_IFTYPE_AP) {
3536 iwl_scan_cancel_timeout(priv, 100); 3536 iwl_scan_cancel_timeout(priv, 100);
3537 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 3537 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
3538 iwl4965_commit_rxon(priv); 3538 iwl4965_commit_rxon(priv);
@@ -3541,7 +3541,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
3541 iwl_power_update_mode(priv, 0); 3541 iwl_power_update_mode(priv, 0);
3542 3542
3543 /* Per mac80211.h: This is only used in IBSS mode... */ 3543 /* Per mac80211.h: This is only used in IBSS mode... */
3544 if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { 3544 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
3545 3545
3546 /* switch to CAM during association period. 3546 /* switch to CAM during association period.
3547 * the ucode will block any association/authentication 3547 * the ucode will block any association/authentication
@@ -3580,7 +3580,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
3580 return -EIO; 3580 return -EIO;
3581 } 3581 }
3582 3582
3583 if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { 3583 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
3584 IWL_DEBUG_MAC80211("leave - not IBSS\n"); 3584 IWL_DEBUG_MAC80211("leave - not IBSS\n");
3585 mutex_unlock(&priv->mutex); 3585 mutex_unlock(&priv->mutex);
3586 return -EIO; 3586 return -EIO;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 36d08b0eec43..d80184ee911c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -306,14 +306,14 @@ void iwl_reset_qos(struct iwl_priv *priv)
306 spin_lock_irqsave(&priv->lock, flags); 306 spin_lock_irqsave(&priv->lock, flags);
307 priv->qos_data.qos_active = 0; 307 priv->qos_data.qos_active = 0;
308 308
309 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) { 309 if (priv->iw_mode == NL80211_IFTYPE_ADHOC) {
310 if (priv->qos_data.qos_enable) 310 if (priv->qos_data.qos_enable)
311 priv->qos_data.qos_active = 1; 311 priv->qos_data.qos_active = 1;
312 if (!(priv->active_rate & 0xfff0)) { 312 if (!(priv->active_rate & 0xfff0)) {
313 cw_min = 31; 313 cw_min = 31;
314 is_legacy = 1; 314 is_legacy = 1;
315 } 315 }
316 } else if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 316 } else if (priv->iw_mode == NL80211_IFTYPE_AP) {
317 if (priv->qos_data.qos_enable) 317 if (priv->qos_data.qos_enable)
318 priv->qos_data.qos_active = 1; 318 priv->qos_data.qos_active = 1;
319 } else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) { 319 } else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) {
@@ -932,7 +932,7 @@ int iwl_init_drv(struct iwl_priv *priv)
932 priv->ieee_rates = NULL; 932 priv->ieee_rates = NULL;
933 priv->band = IEEE80211_BAND_2GHZ; 933 priv->band = IEEE80211_BAND_2GHZ;
934 934
935 priv->iw_mode = IEEE80211_IF_TYPE_STA; 935 priv->iw_mode = NL80211_IFTYPE_STATION;
936 936
937 priv->use_ant_b_for_management_frame = 1; /* start with ant B */ 937 priv->use_ant_b_for_management_frame = 1; /* start with ant B */
938 priv->current_ht_config.sm_ps = WLAN_HT_CAP_SM_PS_DISABLED; 938 priv->current_ht_config.sm_ps = WLAN_HT_CAP_SM_PS_DISABLED;
@@ -1396,7 +1396,7 @@ void iwl_radio_kill_sw_disable_radio(struct iwl_priv *priv)
1396 1396
1397 iwl_scan_cancel(priv); 1397 iwl_scan_cancel(priv);
1398 /* FIXME: This is a workaround for AP */ 1398 /* FIXME: This is a workaround for AP */
1399 if (priv->iw_mode != IEEE80211_IF_TYPE_AP) { 1399 if (priv->iw_mode != NL80211_IFTYPE_AP) {
1400 spin_lock_irqsave(&priv->lock, flags); 1400 spin_lock_irqsave(&priv->lock, flags);
1401 iwl_write32(priv, CSR_UCODE_DRV_GP1_SET, 1401 iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
1402 CSR_UCODE_SW_BIT_RFKILL); 1402 CSR_UCODE_SW_BIT_RFKILL);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 1823687e5820..c018121085e9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -954,7 +954,7 @@ struct iwl_priv {
954 u8 *eeprom; 954 u8 *eeprom;
955 struct iwl_eeprom_calib_info *calib_info; 955 struct iwl_eeprom_calib_info *calib_info;
956 956
957 enum ieee80211_if_types iw_mode; 957 enum nl80211_iftype iw_mode;
958 958
959 struct sk_buff *ibss_beacon; 959 struct sk_buff *ibss_beacon;
960 960
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 55ec31ec9e15..60a03d2d2d0e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -290,7 +290,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
290 final_mode = setting->critical_power_setting; 290 final_mode = setting->critical_power_setting;
291 291
292 /* driver only support CAM for non STA network */ 292 /* driver only support CAM for non STA network */
293 if (priv->iw_mode != IEEE80211_IF_TYPE_STA) 293 if (priv->iw_mode != NL80211_IFTYPE_STATION)
294 final_mode = IWL_POWER_MODE_CAM; 294 final_mode = IWL_POWER_MODE_CAM;
295 295
296 if (!iwl_is_rfkill(priv) && !setting->power_disabled && 296 if (!iwl_is_rfkill(priv) && !setting->power_disabled &&
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index faad4d3f56e1..38b2946b1d81 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -1026,10 +1026,10 @@ static int iwl_is_network_packet(struct iwl_priv *priv,
1026 /* Filter incoming packets to determine if they are targeted toward 1026 /* Filter incoming packets to determine if they are targeted toward
1027 * this network, discarding packets coming from ourselves */ 1027 * this network, discarding packets coming from ourselves */
1028 switch (priv->iw_mode) { 1028 switch (priv->iw_mode) {
1029 case IEEE80211_IF_TYPE_IBSS: /* Header: Dest. | Source | BSSID */ 1029 case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */
1030 /* packets to our IBSS update information */ 1030 /* packets to our IBSS update information */
1031 return !compare_ether_addr(header->addr3, priv->bssid); 1031 return !compare_ether_addr(header->addr3, priv->bssid);
1032 case IEEE80211_IF_TYPE_STA: /* Header: Dest. | AP{BSSID} | Source */ 1032 case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */
1033 /* packets to our IBSS update information */ 1033 /* packets to our IBSS update information */
1034 return !compare_ether_addr(header->addr2, priv->bssid); 1034 return !compare_ether_addr(header->addr2, priv->bssid);
1035 default: 1035 default:
@@ -1169,7 +1169,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1169 rx_status.flag |= RX_FLAG_SHORTPRE; 1169 rx_status.flag |= RX_FLAG_SHORTPRE;
1170 1170
1171 /* Take shortcut when only in monitor mode */ 1171 /* Take shortcut when only in monitor mode */
1172 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { 1172 if (priv->iw_mode == NL80211_IFTYPE_MONITOR) {
1173 iwl_pass_packet_to_mac80211(priv, include_phy, 1173 iwl_pass_packet_to_mac80211(priv, include_phy,
1174 rxb, &rx_status); 1174 rxb, &rx_status);
1175 return; 1175 return;
@@ -1186,7 +1186,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1186 switch (fc & IEEE80211_FCTL_FTYPE) { 1186 switch (fc & IEEE80211_FCTL_FTYPE) {
1187 case IEEE80211_FTYPE_MGMT: 1187 case IEEE80211_FTYPE_MGMT:
1188 case IEEE80211_FTYPE_DATA: 1188 case IEEE80211_FTYPE_DATA:
1189 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 1189 if (priv->iw_mode == NL80211_IFTYPE_AP)
1190 iwl_update_ps_mode(priv, fc & IEEE80211_FCTL_PM, 1190 iwl_update_ps_mode(priv, fc & IEEE80211_FCTL_PM,
1191 header->addr2); 1191 header->addr2);
1192 /* fall through */ 1192 /* fall through */
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index d026aaf62335..09c264be0496 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -463,7 +463,7 @@ void iwl_init_scan_params(struct iwl_priv *priv)
463 463
464int iwl_scan_initiate(struct iwl_priv *priv) 464int iwl_scan_initiate(struct iwl_priv *priv)
465{ 465{
466 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 466 if (priv->iw_mode == NL80211_IFTYPE_AP) {
467 IWL_ERROR("APs don't scan.\n"); 467 IWL_ERROR("APs don't scan.\n");
468 return 0; 468 return 0;
469 } 469 }
@@ -868,7 +868,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
868 868
869 scan->tx_cmd.len = cpu_to_le16(cmd_len); 869 scan->tx_cmd.len = cpu_to_le16(cmd_len);
870 870
871 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 871 if (priv->iw_mode == NL80211_IFTYPE_MONITOR)
872 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 872 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
873 873
874 scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK | 874 scan->filter_flags |= (RXON_FILTER_ACCEPT_GRP_MSK |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index a72569f1acb5..61797f3f8d5c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -47,8 +47,8 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
47 unsigned long flags; 47 unsigned long flags;
48 DECLARE_MAC_BUF(mac); 48 DECLARE_MAC_BUF(mac);
49 49
50 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) || 50 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) ||
51 (priv->iw_mode == IEEE80211_IF_TYPE_AP)) 51 (priv->iw_mode == NL80211_IFTYPE_AP))
52 start = IWL_STA_ID; 52 start = IWL_STA_ID;
53 53
54 if (is_broadcast_ether_addr(addr)) 54 if (is_broadcast_ether_addr(addr))
@@ -74,7 +74,7 @@ EXPORT_SYMBOL(iwl_find_station);
74 74
75int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) 75int iwl_get_ra_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
76{ 76{
77 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) { 77 if (priv->iw_mode == NL80211_IFTYPE_STATION) {
78 return IWL_AP_ID; 78 return IWL_AP_ID;
79 } else { 79 } else {
80 u8 *da = ieee80211_get_DA(hdr); 80 u8 *da = ieee80211_get_DA(hdr);
@@ -286,7 +286,7 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
286 286
287 /* BCAST station and IBSS stations do not work in HT mode */ 287 /* BCAST station and IBSS stations do not work in HT mode */
288 if (sta_id != priv->hw_params.bcast_sta_id && 288 if (sta_id != priv->hw_params.bcast_sta_id &&
289 priv->iw_mode != IEEE80211_IF_TYPE_IBSS) 289 priv->iw_mode != NL80211_IFTYPE_ADHOC)
290 iwl_set_ht_add_station(priv, sta_id, ht_info); 290 iwl_set_ht_add_station(priv, sta_id, ht_info);
291 291
292 spin_unlock_irqrestore(&priv->sta_lock, flags_spin); 292 spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
@@ -817,7 +817,7 @@ int iwl_send_lq_cmd(struct iwl_priv *priv,
817 }; 817 };
818 818
819 if ((lq->sta_id == 0xFF) && 819 if ((lq->sta_id == 0xFF) &&
820 (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)) 820 (priv->iw_mode == NL80211_IFTYPE_ADHOC))
821 return -EINVAL; 821 return -EINVAL;
822 822
823 if (lq->sta_id == 0xFF) 823 if (lq->sta_id == 0xFF)
@@ -904,7 +904,7 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
904 904
905 if ((is_ap) && 905 if ((is_ap) &&
906 (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && 906 (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) &&
907 (priv->iw_mode == IEEE80211_IF_TYPE_STA)) 907 (priv->iw_mode == NL80211_IFTYPE_STATION))
908 sta_id = iwl_add_station_flags(priv, addr, is_ap, 908 sta_id = iwl_add_station_flags(priv, addr, is_ap,
909 0, cur_ht_config); 909 0, cur_ht_config);
910 else 910 else
@@ -938,11 +938,11 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
938 938
939 /* If we are a client station in a BSS network, use the special 939 /* If we are a client station in a BSS network, use the special
940 * AP station entry (that's the only station we communicate with) */ 940 * AP station entry (that's the only station we communicate with) */
941 case IEEE80211_IF_TYPE_STA: 941 case NL80211_IFTYPE_STATION:
942 return IWL_AP_ID; 942 return IWL_AP_ID;
943 943
944 /* If we are an AP, then find the station, or use BCAST */ 944 /* If we are an AP, then find the station, or use BCAST */
945 case IEEE80211_IF_TYPE_AP: 945 case NL80211_IFTYPE_AP:
946 sta_id = iwl_find_station(priv, hdr->addr1); 946 sta_id = iwl_find_station(priv, hdr->addr1);
947 if (sta_id != IWL_INVALID_STATION) 947 if (sta_id != IWL_INVALID_STATION)
948 return sta_id; 948 return sta_id;
@@ -950,7 +950,7 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
950 950
951 /* If this frame is going out to an IBSS network, find the station, 951 /* If this frame is going out to an IBSS network, find the station,
952 * or create a new station table entry */ 952 * or create a new station table entry */
953 case IEEE80211_IF_TYPE_IBSS: 953 case NL80211_IFTYPE_ADHOC:
954 sta_id = iwl_find_station(priv, hdr->addr1); 954 sta_id = iwl_find_station(priv, hdr->addr1);
955 if (sta_id != IWL_INVALID_STATION) 955 if (sta_id != IWL_INVALID_STATION)
956 return sta_id; 956 return sta_id;
@@ -970,7 +970,7 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
970 970
971 /* If we are in monitor mode, use BCAST. This is required for 971 /* If we are in monitor mode, use BCAST. This is required for
972 * packet injection. */ 972 * packet injection. */
973 case IEEE80211_IF_TYPE_MNTR: 973 case NL80211_IFTYPE_MONITOR:
974 return priv->hw_params.bcast_sta_id; 974 return priv->hw_params.bcast_sta_id;
975 975
976 default: 976 default:
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 9d5bcf46cbe9..e9feca4033f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -814,10 +814,10 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
814 814
815 /* drop all data frame if we are not associated */ 815 /* drop all data frame if we are not associated */
816 if (ieee80211_is_data(fc) && 816 if (ieee80211_is_data(fc) &&
817 (priv->iw_mode != IEEE80211_IF_TYPE_MNTR || 817 (priv->iw_mode != NL80211_IFTYPE_MONITOR ||
818 !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */ 818 !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */
819 (!iwl_is_associated(priv) || 819 (!iwl_is_associated(priv) ||
820 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) || 820 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) ||
821 !priv->assoc_station_added)) { 821 !priv->assoc_station_added)) {
822 IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n"); 822 IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n");
823 goto drop_unlock; 823 goto drop_unlock;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cbbe73a12887..e6c6ef6ad62e 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1160,7 +1160,7 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
1160 /* If we have set the ASSOC_MSK and we are in BSS mode then 1160 /* If we have set the ASSOC_MSK and we are in BSS mode then
1161 * add the IWL_AP_ID to the station rate table */ 1161 * add the IWL_AP_ID to the station rate table */
1162 if (iwl3945_is_associated(priv) && 1162 if (iwl3945_is_associated(priv) &&
1163 (priv->iw_mode == IEEE80211_IF_TYPE_STA)) 1163 (priv->iw_mode == NL80211_IFTYPE_STATION))
1164 if (iwl3945_add_station(priv, priv->active_rxon.bssid_addr, 1, 0) 1164 if (iwl3945_add_station(priv, priv->active_rxon.bssid_addr, 1, 0)
1165 == IWL_INVALID_STATION) { 1165 == IWL_INVALID_STATION) {
1166 IWL_ERROR("Error adding AP address for transmit.\n"); 1166 IWL_ERROR("Error adding AP address for transmit.\n");
@@ -1447,8 +1447,8 @@ unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv,
1447{ 1447{
1448 1448
1449 if (!iwl3945_is_associated(priv) || !priv->ibss_beacon || 1449 if (!iwl3945_is_associated(priv) || !priv->ibss_beacon ||
1450 ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && 1450 ((priv->iw_mode != NL80211_IFTYPE_ADHOC) &&
1451 (priv->iw_mode != IEEE80211_IF_TYPE_AP))) 1451 (priv->iw_mode != NL80211_IFTYPE_AP)))
1452 return 0; 1452 return 0;
1453 1453
1454 if (priv->ibss_beacon->len > left) 1454 if (priv->ibss_beacon->len > left)
@@ -1746,14 +1746,14 @@ static void iwl3945_reset_qos(struct iwl3945_priv *priv)
1746 spin_lock_irqsave(&priv->lock, flags); 1746 spin_lock_irqsave(&priv->lock, flags);
1747 priv->qos_data.qos_active = 0; 1747 priv->qos_data.qos_active = 0;
1748 1748
1749 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) { 1749 if (priv->iw_mode == NL80211_IFTYPE_ADHOC) {
1750 if (priv->qos_data.qos_enable) 1750 if (priv->qos_data.qos_enable)
1751 priv->qos_data.qos_active = 1; 1751 priv->qos_data.qos_active = 1;
1752 if (!(priv->active_rate & 0xfff0)) { 1752 if (!(priv->active_rate & 0xfff0)) {
1753 cw_min = 31; 1753 cw_min = 31;
1754 is_legacy = 1; 1754 is_legacy = 1;
1755 } 1755 }
1756 } else if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 1756 } else if (priv->iw_mode == NL80211_IFTYPE_AP) {
1757 if (priv->qos_data.qos_enable) 1757 if (priv->qos_data.qos_enable)
1758 priv->qos_data.qos_active = 1; 1758 priv->qos_data.qos_active = 1;
1759 } else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) { 1759 } else if (!(priv->staging_rxon.flags & RXON_FLG_SHORT_SLOT_MSK)) {
@@ -2120,7 +2120,7 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
2120 beacon_int = priv->beacon_int; 2120 beacon_int = priv->beacon_int;
2121 spin_unlock_irqrestore(&priv->lock, flags); 2121 spin_unlock_irqrestore(&priv->lock, flags);
2122 2122
2123 if (priv->iw_mode == IEEE80211_IF_TYPE_STA) { 2123 if (priv->iw_mode == NL80211_IFTYPE_STATION) {
2124 if (beacon_int == 0) { 2124 if (beacon_int == 0) {
2125 priv->rxon_timing.beacon_interval = cpu_to_le16(100); 2125 priv->rxon_timing.beacon_interval = cpu_to_le16(100);
2126 priv->rxon_timing.beacon_init_val = cpu_to_le32(102400); 2126 priv->rxon_timing.beacon_init_val = cpu_to_le32(102400);
@@ -2156,7 +2156,7 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
2156 2156
2157static int iwl3945_scan_initiate(struct iwl3945_priv *priv) 2157static int iwl3945_scan_initiate(struct iwl3945_priv *priv)
2158{ 2158{
2159 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 2159 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2160 IWL_ERROR("APs don't scan.\n"); 2160 IWL_ERROR("APs don't scan.\n");
2161 return 0; 2161 return 0;
2162 } 2162 }
@@ -2218,7 +2218,7 @@ static void iwl3945_set_flags_for_phymode(struct iwl3945_priv *priv,
2218 else 2218 else
2219 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 2219 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2220 2220
2221 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 2221 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
2222 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 2222 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2223 2223
2224 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK; 2224 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
@@ -2237,23 +2237,23 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
2237 memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon)); 2237 memset(&priv->staging_rxon, 0, sizeof(priv->staging_rxon));
2238 2238
2239 switch (priv->iw_mode) { 2239 switch (priv->iw_mode) {
2240 case IEEE80211_IF_TYPE_AP: 2240 case NL80211_IFTYPE_AP:
2241 priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP; 2241 priv->staging_rxon.dev_type = RXON_DEV_TYPE_AP;
2242 break; 2242 break;
2243 2243
2244 case IEEE80211_IF_TYPE_STA: 2244 case NL80211_IFTYPE_STATION:
2245 priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS; 2245 priv->staging_rxon.dev_type = RXON_DEV_TYPE_ESS;
2246 priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK; 2246 priv->staging_rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
2247 break; 2247 break;
2248 2248
2249 case IEEE80211_IF_TYPE_IBSS: 2249 case NL80211_IFTYPE_ADHOC:
2250 priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS; 2250 priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
2251 priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK; 2251 priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
2252 priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK | 2252 priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
2253 RXON_FILTER_ACCEPT_GRP_MSK; 2253 RXON_FILTER_ACCEPT_GRP_MSK;
2254 break; 2254 break;
2255 2255
2256 case IEEE80211_IF_TYPE_MNTR: 2256 case NL80211_IFTYPE_MONITOR:
2257 priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER; 2257 priv->staging_rxon.dev_type = RXON_DEV_TYPE_SNIFFER;
2258 priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK | 2258 priv->staging_rxon.filter_flags = RXON_FILTER_PROMISC_MSK |
2259 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; 2259 RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
@@ -2282,7 +2282,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
2282 * in some case A channels are all non IBSS 2282 * in some case A channels are all non IBSS
2283 * in this case force B/G channel 2283 * in this case force B/G channel
2284 */ 2284 */
2285 if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && 2285 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
2286 !(is_channel_ibss(ch_info))) 2286 !(is_channel_ibss(ch_info)))
2287 ch_info = &priv->channel_info[0]; 2287 ch_info = &priv->channel_info[0];
2288 2288
@@ -2302,7 +2302,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv)
2302 2302
2303static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode) 2303static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
2304{ 2304{
2305 if (mode == IEEE80211_IF_TYPE_IBSS) { 2305 if (mode == NL80211_IFTYPE_ADHOC) {
2306 const struct iwl3945_channel_info *ch_info; 2306 const struct iwl3945_channel_info *ch_info;
2307 2307
2308 ch_info = iwl3945_get_channel_info(priv, 2308 ch_info = iwl3945_get_channel_info(priv,
@@ -2469,11 +2469,11 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2469 2469
2470 /* If we are a client station in a BSS network, use the special 2470 /* If we are a client station in a BSS network, use the special
2471 * AP station entry (that's the only station we communicate with) */ 2471 * AP station entry (that's the only station we communicate with) */
2472 case IEEE80211_IF_TYPE_STA: 2472 case NL80211_IFTYPE_STATION:
2473 return IWL_AP_ID; 2473 return IWL_AP_ID;
2474 2474
2475 /* If we are an AP, then find the station, or use BCAST */ 2475 /* If we are an AP, then find the station, or use BCAST */
2476 case IEEE80211_IF_TYPE_AP: 2476 case NL80211_IFTYPE_AP:
2477 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 2477 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
2478 if (sta_id != IWL_INVALID_STATION) 2478 if (sta_id != IWL_INVALID_STATION)
2479 return sta_id; 2479 return sta_id;
@@ -2481,7 +2481,7 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2481 2481
2482 /* If this frame is going out to an IBSS network, find the station, 2482 /* If this frame is going out to an IBSS network, find the station,
2483 * or create a new station table entry */ 2483 * or create a new station table entry */
2484 case IEEE80211_IF_TYPE_IBSS: { 2484 case NL80211_IFTYPE_ADHOC: {
2485 DECLARE_MAC_BUF(mac); 2485 DECLARE_MAC_BUF(mac);
2486 2486
2487 /* Create new station table entry */ 2487 /* Create new station table entry */
@@ -2502,7 +2502,7 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2502 } 2502 }
2503 /* If we are in monitor mode, use BCAST. This is required for 2503 /* If we are in monitor mode, use BCAST. This is required for
2504 * packet injection. */ 2504 * packet injection. */
2505 case IEEE80211_IF_TYPE_MNTR: 2505 case NL80211_IFTYPE_MONITOR:
2506 return priv->hw_setting.bcast_sta_id; 2506 return priv->hw_setting.bcast_sta_id;
2507 2507
2508 default: 2508 default:
@@ -2565,9 +2565,9 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
2565 2565
2566 /* drop all data frame if we are not associated */ 2566 /* drop all data frame if we are not associated */
2567 if (ieee80211_is_data(fc) && 2567 if (ieee80211_is_data(fc) &&
2568 (priv->iw_mode != IEEE80211_IF_TYPE_MNTR) && /* packet injection */ 2568 (priv->iw_mode != NL80211_IFTYPE_MONITOR) && /* packet injection */
2569 (!iwl3945_is_associated(priv) || 2569 (!iwl3945_is_associated(priv) ||
2570 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id))) { 2570 ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id))) {
2571 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n"); 2571 IWL_DEBUG_DROP("Dropping - !iwl3945_is_associated\n");
2572 goto drop_unlock; 2572 goto drop_unlock;
2573 } 2573 }
@@ -2806,7 +2806,7 @@ static void iwl3945_radio_kill_sw(struct iwl3945_priv *priv, int disable_radio)
2806 if (disable_radio) { 2806 if (disable_radio) {
2807 iwl3945_scan_cancel(priv); 2807 iwl3945_scan_cancel(priv);
2808 /* FIXME: This is a workaround for AP */ 2808 /* FIXME: This is a workaround for AP */
2809 if (priv->iw_mode != IEEE80211_IF_TYPE_AP) { 2809 if (priv->iw_mode != NL80211_IFTYPE_AP) {
2810 spin_lock_irqsave(&priv->lock, flags); 2810 spin_lock_irqsave(&priv->lock, flags);
2811 iwl3945_write32(priv, CSR_UCODE_DRV_GP1_SET, 2811 iwl3945_write32(priv, CSR_UCODE_DRV_GP1_SET,
2812 CSR_UCODE_SW_BIT_RFKILL); 2812 CSR_UCODE_SW_BIT_RFKILL);
@@ -3161,7 +3161,7 @@ static void iwl3945_rx_beacon_notif(struct iwl3945_priv *priv,
3161 le32_to_cpu(beacon->low_tsf), rate); 3161 le32_to_cpu(beacon->low_tsf), rate);
3162#endif 3162#endif
3163 3163
3164 if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && 3164 if ((priv->iw_mode == NL80211_IFTYPE_AP) &&
3165 (!test_bit(STATUS_EXIT_PENDING, &priv->status))) 3165 (!test_bit(STATUS_EXIT_PENDING, &priv->status)))
3166 queue_work(priv->workqueue, &priv->beacon_update); 3166 queue_work(priv->workqueue, &priv->beacon_update);
3167} 3167}
@@ -6059,7 +6059,7 @@ static void iwl3945_bg_set_monitor(struct work_struct *work)
6059 if (!iwl3945_is_ready(priv)) 6059 if (!iwl3945_is_ready(priv))
6060 IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); 6060 IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n");
6061 else 6061 else
6062 if (iwl3945_set_mode(priv, IEEE80211_IF_TYPE_MNTR) != 0) 6062 if (iwl3945_set_mode(priv, NL80211_IFTYPE_MONITOR) != 0)
6063 IWL_ERROR("iwl3945_set_mode() failed\n"); 6063 IWL_ERROR("iwl3945_set_mode() failed\n");
6064 6064
6065 mutex_unlock(&priv->mutex); 6065 mutex_unlock(&priv->mutex);
@@ -6248,7 +6248,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6248 /* select Rx antennas */ 6248 /* select Rx antennas */
6249 scan->flags |= iwl3945_get_antenna_flags(priv); 6249 scan->flags |= iwl3945_get_antenna_flags(priv);
6250 6250
6251 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 6251 if (priv->iw_mode == NL80211_IFTYPE_MONITOR)
6252 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 6252 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
6253 6253
6254 scan->channel_count = 6254 scan->channel_count =
@@ -6323,7 +6323,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6323 struct ieee80211_conf *conf = NULL; 6323 struct ieee80211_conf *conf = NULL;
6324 DECLARE_MAC_BUF(mac); 6324 DECLARE_MAC_BUF(mac);
6325 6325
6326 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 6326 if (priv->iw_mode == NL80211_IFTYPE_AP) {
6327 IWL_ERROR("%s Should not be called in AP mode\n", __func__); 6327 IWL_ERROR("%s Should not be called in AP mode\n", __func__);
6328 return; 6328 return;
6329 } 6329 }
@@ -6372,7 +6372,7 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6372 else 6372 else
6373 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 6373 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
6374 6374
6375 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 6375 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
6376 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 6376 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
6377 6377
6378 } 6378 }
@@ -6380,11 +6380,11 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6380 iwl3945_commit_rxon(priv); 6380 iwl3945_commit_rxon(priv);
6381 6381
6382 switch (priv->iw_mode) { 6382 switch (priv->iw_mode) {
6383 case IEEE80211_IF_TYPE_STA: 6383 case NL80211_IFTYPE_STATION:
6384 iwl3945_rate_scale_init(priv->hw, IWL_AP_ID); 6384 iwl3945_rate_scale_init(priv->hw, IWL_AP_ID);
6385 break; 6385 break;
6386 6386
6387 case IEEE80211_IF_TYPE_IBSS: 6387 case NL80211_IFTYPE_ADHOC:
6388 6388
6389 /* clear out the station table */ 6389 /* clear out the station table */
6390 iwl3945_clear_stations_table(priv); 6390 iwl3945_clear_stations_table(priv);
@@ -6754,7 +6754,7 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
6754 priv->staging_rxon.flags &= 6754 priv->staging_rxon.flags &=
6755 ~RXON_FLG_SHORT_SLOT_MSK; 6755 ~RXON_FLG_SHORT_SLOT_MSK;
6756 6756
6757 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) 6757 if (priv->iw_mode == NL80211_IFTYPE_ADHOC)
6758 priv->staging_rxon.flags &= 6758 priv->staging_rxon.flags &=
6759 ~RXON_FLG_SHORT_SLOT_MSK; 6759 ~RXON_FLG_SHORT_SLOT_MSK;
6760 } 6760 }
@@ -6791,7 +6791,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6791 } 6791 }
6792 6792
6793 /* handle this temporarily here */ 6793 /* handle this temporarily here */
6794 if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS && 6794 if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
6795 conf->changed & IEEE80211_IFCC_BEACON) { 6795 conf->changed & IEEE80211_IFCC_BEACON) {
6796 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 6796 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
6797 if (!beacon) 6797 if (!beacon)
@@ -6803,7 +6803,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6803 6803
6804 /* XXX: this MUST use conf->mac_addr */ 6804 /* XXX: this MUST use conf->mac_addr */
6805 6805
6806 if ((priv->iw_mode == IEEE80211_IF_TYPE_AP) && 6806 if ((priv->iw_mode == NL80211_IFTYPE_AP) &&
6807 (!conf->ssid_len)) { 6807 (!conf->ssid_len)) {
6808 IWL_DEBUG_MAC80211 6808 IWL_DEBUG_MAC80211
6809 ("Leaving in AP mode because HostAPD is not ready.\n"); 6809 ("Leaving in AP mode because HostAPD is not ready.\n");
@@ -6826,7 +6826,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6826 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) { 6826 !(priv->hw->flags & IEEE80211_HW_NO_PROBE_FILTERING)) {
6827 */ 6827 */
6828 6828
6829 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 6829 if (priv->iw_mode == NL80211_IFTYPE_AP) {
6830 if (!conf->bssid) { 6830 if (!conf->bssid) {
6831 conf->bssid = priv->mac_addr; 6831 conf->bssid = priv->mac_addr;
6832 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 6832 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
@@ -6861,11 +6861,11 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6861 * to verify) - jpk */ 6861 * to verify) - jpk */
6862 memcpy(priv->bssid, conf->bssid, ETH_ALEN); 6862 memcpy(priv->bssid, conf->bssid, ETH_ALEN);
6863 6863
6864 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 6864 if (priv->iw_mode == NL80211_IFTYPE_AP)
6865 iwl3945_config_ap(priv); 6865 iwl3945_config_ap(priv);
6866 else { 6866 else {
6867 rc = iwl3945_commit_rxon(priv); 6867 rc = iwl3945_commit_rxon(priv);
6868 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) 6868 if ((priv->iw_mode == NL80211_IFTYPE_STATION) && rc)
6869 iwl3945_add_station(priv, 6869 iwl3945_add_station(priv,
6870 priv->active_rxon.bssid_addr, 1, 0); 6870 priv->active_rxon.bssid_addr, 1, 0);
6871 } 6871 }
@@ -6901,7 +6901,7 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw,
6901 6901
6902 if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { 6902 if (changed_flags & (*total_flags) & FIF_OTHER_BSS) {
6903 IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", 6903 IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n",
6904 IEEE80211_IF_TYPE_MNTR, 6904 NL80211_IFTYPE_MONITOR,
6905 changed_flags, *total_flags); 6905 changed_flags, *total_flags);
6906 /* queue work 'cuz mac80211 is holding a lock which 6906 /* queue work 'cuz mac80211 is holding a lock which
6907 * prevents us from issuing (synchronous) f/w cmds */ 6907 * prevents us from issuing (synchronous) f/w cmds */
@@ -7010,7 +7010,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
7010 goto out_unlock; 7010 goto out_unlock;
7011 } 7011 }
7012 7012
7013 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { /* APs don't scan */ 7013 if (priv->iw_mode == NL80211_IFTYPE_AP) { /* APs don't scan */
7014 rc = -EIO; 7014 rc = -EIO;
7015 IWL_ERROR("ERROR: APs don't scan\n"); 7015 IWL_ERROR("ERROR: APs don't scan\n");
7016 goto out_unlock; 7016 goto out_unlock;
@@ -7152,7 +7152,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
7152 spin_unlock_irqrestore(&priv->lock, flags); 7152 spin_unlock_irqrestore(&priv->lock, flags);
7153 7153
7154 mutex_lock(&priv->mutex); 7154 mutex_lock(&priv->mutex);
7155 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 7155 if (priv->iw_mode == NL80211_IFTYPE_AP)
7156 iwl3945_activate_qos(priv, 1); 7156 iwl3945_activate_qos(priv, 1);
7157 else if (priv->assoc_id && iwl3945_is_associated(priv)) 7157 else if (priv->assoc_id && iwl3945_is_associated(priv))
7158 iwl3945_activate_qos(priv, 0); 7158 iwl3945_activate_qos(priv, 0);
@@ -7239,7 +7239,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7239 priv->beacon_int = priv->hw->conf.beacon_int; 7239 priv->beacon_int = priv->hw->conf.beacon_int;
7240 priv->timestamp1 = 0; 7240 priv->timestamp1 = 0;
7241 priv->timestamp0 = 0; 7241 priv->timestamp0 = 0;
7242 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA)) 7242 if ((priv->iw_mode == NL80211_IFTYPE_STATION))
7243 priv->beacon_int = 0; 7243 priv->beacon_int = 0;
7244 7244
7245 spin_unlock_irqrestore(&priv->lock, flags); 7245 spin_unlock_irqrestore(&priv->lock, flags);
@@ -7253,14 +7253,14 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7253 /* we are restarting association process 7253 /* we are restarting association process
7254 * clear RXON_FILTER_ASSOC_MSK bit 7254 * clear RXON_FILTER_ASSOC_MSK bit
7255 */ 7255 */
7256 if (priv->iw_mode != IEEE80211_IF_TYPE_AP) { 7256 if (priv->iw_mode != NL80211_IFTYPE_AP) {
7257 iwl3945_scan_cancel_timeout(priv, 100); 7257 iwl3945_scan_cancel_timeout(priv, 100);
7258 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 7258 priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
7259 iwl3945_commit_rxon(priv); 7259 iwl3945_commit_rxon(priv);
7260 } 7260 }
7261 7261
7262 /* Per mac80211.h: This is only used in IBSS mode... */ 7262 /* Per mac80211.h: This is only used in IBSS mode... */
7263 if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { 7263 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
7264 7264
7265 IWL_DEBUG_MAC80211("leave - not in IBSS\n"); 7265 IWL_DEBUG_MAC80211("leave - not in IBSS\n");
7266 mutex_unlock(&priv->mutex); 7266 mutex_unlock(&priv->mutex);
@@ -7289,7 +7289,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
7289 return -EIO; 7289 return -EIO;
7290 } 7290 }
7291 7291
7292 if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) { 7292 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
7293 IWL_DEBUG_MAC80211("leave - not IBSS\n"); 7293 IWL_DEBUG_MAC80211("leave - not IBSS\n");
7294 mutex_unlock(&priv->mutex); 7294 mutex_unlock(&priv->mutex);
7295 return -EIO; 7295 return -EIO;
@@ -7996,7 +7996,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7996 IWL_DEBUG_INFO("Radio disabled.\n"); 7996 IWL_DEBUG_INFO("Radio disabled.\n");
7997 } 7997 }
7998 7998
7999 priv->iw_mode = IEEE80211_IF_TYPE_STA; 7999 priv->iw_mode = NL80211_IFTYPE_STATION;
8000 8000
8001 printk(KERN_INFO DRV_NAME 8001 printk(KERN_INFO DRV_NAME
8002 ": Detected Intel Wireless WiFi Link %s\n", priv->cfg->name); 8002 ": Detected Intel Wireless WiFi Link %s\n", priv->cfg->name);
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index c948021bff6a..feff945ad856 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -219,7 +219,7 @@ static void lbtf_tx_work(struct work_struct *work)
219 struct sk_buff *skb = NULL; 219 struct sk_buff *skb = NULL;
220 int err; 220 int err;
221 221
222 if ((priv->vif->type == IEEE80211_IF_TYPE_AP) && 222 if ((priv->vif->type == NL80211_IFTYPE_AP) &&
223 (!skb_queue_empty(&priv->bc_ps_buf))) 223 (!skb_queue_empty(&priv->bc_ps_buf)))
224 skb = skb_dequeue(&priv->bc_ps_buf); 224 skb = skb_dequeue(&priv->bc_ps_buf);
225 else if (priv->skb_to_tx) { 225 else if (priv->skb_to_tx) {
@@ -326,11 +326,11 @@ static int lbtf_op_add_interface(struct ieee80211_hw *hw,
326 326
327 priv->vif = conf->vif; 327 priv->vif = conf->vif;
328 switch (conf->type) { 328 switch (conf->type) {
329 case IEEE80211_IF_TYPE_MESH_POINT: 329 case NL80211_IFTYPE_MESH_POINT:
330 case IEEE80211_IF_TYPE_AP: 330 case NL80211_IFTYPE_AP:
331 lbtf_set_mode(priv, LBTF_AP_MODE); 331 lbtf_set_mode(priv, LBTF_AP_MODE);
332 break; 332 break;
333 case IEEE80211_IF_TYPE_STA: 333 case NL80211_IFTYPE_STATION:
334 lbtf_set_mode(priv, LBTF_STA_MODE); 334 lbtf_set_mode(priv, LBTF_STA_MODE);
335 break; 335 break;
336 default: 336 default:
@@ -346,8 +346,8 @@ static void lbtf_op_remove_interface(struct ieee80211_hw *hw,
346{ 346{
347 struct lbtf_private *priv = hw->priv; 347 struct lbtf_private *priv = hw->priv;
348 348
349 if (priv->vif->type == IEEE80211_IF_TYPE_AP || 349 if (priv->vif->type == NL80211_IFTYPE_AP ||
350 priv->vif->type == IEEE80211_IF_TYPE_MESH_POINT) 350 priv->vif->type == NL80211_IFTYPE_MESH_POINT)
351 lbtf_beacon_ctrl(priv, 0, 0); 351 lbtf_beacon_ctrl(priv, 0, 0);
352 lbtf_set_mode(priv, LBTF_PASSIVE_MODE); 352 lbtf_set_mode(priv, LBTF_PASSIVE_MODE);
353 lbtf_set_bssid(priv, 0, NULL); 353 lbtf_set_bssid(priv, 0, NULL);
@@ -372,8 +372,8 @@ static int lbtf_op_config_interface(struct ieee80211_hw *hw,
372 struct sk_buff *beacon; 372 struct sk_buff *beacon;
373 373
374 switch (priv->vif->type) { 374 switch (priv->vif->type) {
375 case IEEE80211_IF_TYPE_AP: 375 case NL80211_IFTYPE_AP:
376 case IEEE80211_IF_TYPE_MESH_POINT: 376 case NL80211_IFTYPE_MESH_POINT:
377 beacon = ieee80211_beacon_get(hw, vif); 377 beacon = ieee80211_beacon_get(hw, vif);
378 if (beacon) { 378 if (beacon) {
379 lbtf_beacon_set(priv, beacon); 379 lbtf_beacon_set(priv, beacon);
@@ -614,7 +614,7 @@ void lbtf_bcn_sent(struct lbtf_private *priv)
614{ 614{
615 struct sk_buff *skb = NULL; 615 struct sk_buff *skb = NULL;
616 616
617 if (priv->vif->type != IEEE80211_IF_TYPE_AP) 617 if (priv->vif->type != NL80211_IFTYPE_AP)
618 return; 618 return;
619 619
620 if (skb_queue_empty(&priv->bc_ps_buf)) { 620 if (skb_queue_empty(&priv->bc_ps_buf)) {
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 6ba50f087f7b..e855211a90f8 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -267,7 +267,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
267 struct sk_buff *skb; 267 struct sk_buff *skb;
268 struct ieee80211_tx_info *info; 268 struct ieee80211_tx_info *info;
269 269
270 if (vif->type != IEEE80211_IF_TYPE_AP) 270 if (vif->type != NL80211_IFTYPE_AP)
271 return; 271 return;
272 272
273 skb = ieee80211_beacon_get(hw, vif); 273 skb = ieee80211_beacon_get(hw, vif);
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index da51786254dc..bac58ed03e5c 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -1139,7 +1139,7 @@ static int p54_start(struct ieee80211_hw *dev)
1139 1139
1140 err = priv->open(dev); 1140 err = priv->open(dev);
1141 if (!err) 1141 if (!err)
1142 priv->mode = IEEE80211_IF_TYPE_MNTR; 1142 priv->mode = NL80211_IFTYPE_MONITOR;
1143 1143
1144 p54_init_vdcf(dev); 1144 p54_init_vdcf(dev);
1145 1145
@@ -1157,7 +1157,7 @@ static void p54_stop(struct ieee80211_hw *dev)
1157 kfree_skb(skb); 1157 kfree_skb(skb);
1158 priv->stop(dev); 1158 priv->stop(dev);
1159 priv->tsf_high32 = priv->tsf_low32 = 0; 1159 priv->tsf_high32 = priv->tsf_low32 = 0;
1160 priv->mode = IEEE80211_IF_TYPE_INVALID; 1160 priv->mode = NL80211_IFTYPE_UNSPECIFIED;
1161} 1161}
1162 1162
1163static int p54_add_interface(struct ieee80211_hw *dev, 1163static int p54_add_interface(struct ieee80211_hw *dev,
@@ -1165,11 +1165,11 @@ static int p54_add_interface(struct ieee80211_hw *dev,
1165{ 1165{
1166 struct p54_common *priv = dev->priv; 1166 struct p54_common *priv = dev->priv;
1167 1167
1168 if (priv->mode != IEEE80211_IF_TYPE_MNTR) 1168 if (priv->mode != NL80211_IFTYPE_MONITOR)
1169 return -EOPNOTSUPP; 1169 return -EOPNOTSUPP;
1170 1170
1171 switch (conf->type) { 1171 switch (conf->type) {
1172 case IEEE80211_IF_TYPE_STA: 1172 case NL80211_IFTYPE_STATION:
1173 priv->mode = conf->type; 1173 priv->mode = conf->type;
1174 break; 1174 break;
1175 default: 1175 default:
@@ -1181,7 +1181,7 @@ static int p54_add_interface(struct ieee80211_hw *dev,
1181 p54_set_filter(dev, 0, NULL); 1181 p54_set_filter(dev, 0, NULL);
1182 1182
1183 switch (conf->type) { 1183 switch (conf->type) {
1184 case IEEE80211_IF_TYPE_STA: 1184 case NL80211_IFTYPE_STATION:
1185 p54_set_filter(dev, 1, NULL); 1185 p54_set_filter(dev, 1, NULL);
1186 break; 1186 break;
1187 default: 1187 default:
@@ -1198,7 +1198,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev,
1198 struct ieee80211_if_init_conf *conf) 1198 struct ieee80211_if_init_conf *conf)
1199{ 1199{
1200 struct p54_common *priv = dev->priv; 1200 struct p54_common *priv = dev->priv;
1201 priv->mode = IEEE80211_IF_TYPE_MNTR; 1201 priv->mode = NL80211_IFTYPE_MONITOR;
1202 memset(priv->mac_addr, 0, ETH_ALEN); 1202 memset(priv->mac_addr, 0, ETH_ALEN);
1203 p54_set_filter(dev, 0, NULL); 1203 p54_set_filter(dev, 0, NULL);
1204} 1204}
@@ -1380,7 +1380,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
1380 return NULL; 1380 return NULL;
1381 1381
1382 priv = dev->priv; 1382 priv = dev->priv;
1383 priv->mode = IEEE80211_IF_TYPE_INVALID; 1383 priv->mode = NL80211_IFTYPE_UNSPECIFIED;
1384 skb_queue_head_init(&priv->tx_queue); 1384 skb_queue_head_init(&priv->tx_queue);
1385 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | /* not sure */ 1385 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | /* not sure */
1386 IEEE80211_HW_RX_INCLUDES_FCS | 1386 IEEE80211_HW_RX_INCLUDES_FCS |
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index 1594786205f8..1c2a02a741af 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -616,7 +616,7 @@ static int p54p_suspend(struct pci_dev *pdev, pm_message_t state)
616 struct ieee80211_hw *dev = pci_get_drvdata(pdev); 616 struct ieee80211_hw *dev = pci_get_drvdata(pdev);
617 struct p54p_priv *priv = dev->priv; 617 struct p54p_priv *priv = dev->priv;
618 618
619 if (priv->common.mode != IEEE80211_IF_TYPE_INVALID) { 619 if (priv->common.mode != NL80211_IFTYPE_UNSPECIFIED) {
620 ieee80211_stop_queues(dev); 620 ieee80211_stop_queues(dev);
621 p54p_stop(dev); 621 p54p_stop(dev);
622 } 622 }
@@ -634,7 +634,7 @@ static int p54p_resume(struct pci_dev *pdev)
634 pci_set_power_state(pdev, PCI_D0); 634 pci_set_power_state(pdev, PCI_D0);
635 pci_restore_state(pdev); 635 pci_restore_state(pdev);
636 636
637 if (priv->common.mode != IEEE80211_IF_TYPE_INVALID) { 637 if (priv->common.mode != NL80211_IFTYPE_UNSPECIFIED) {
638 p54p_open(dev); 638 p54p_open(dev);
639 ieee80211_wake_queues(dev); 639 ieee80211_wake_queues(dev);
640 } 640 }
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index cb5f2d01a9c3..d3bf7bba611a 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -384,7 +384,7 @@ static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev,
384 rt2500usb_register_read(rt2x00dev, TXRX_CSR20, &reg); 384 rt2500usb_register_read(rt2x00dev, TXRX_CSR20, &reg);
385 rt2x00_set_field16(&reg, TXRX_CSR20_OFFSET, bcn_preload >> 6); 385 rt2x00_set_field16(&reg, TXRX_CSR20_OFFSET, bcn_preload >> 6);
386 rt2x00_set_field16(&reg, TXRX_CSR20_BCN_EXPECT_WINDOW, 386 rt2x00_set_field16(&reg, TXRX_CSR20_BCN_EXPECT_WINDOW,
387 2 * (conf->type != IEEE80211_IF_TYPE_STA)); 387 2 * (conf->type != NL80211_IFTYPE_STATION));
388 rt2500usb_register_write(rt2x00dev, TXRX_CSR20, reg); 388 rt2500usb_register_write(rt2x00dev, TXRX_CSR20, reg);
389 389
390 /* 390 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 6f296cef76ad..1359a3768404 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -483,7 +483,7 @@ struct rt2x00intf_conf {
483 /* 483 /*
484 * Interface type 484 * Interface type
485 */ 485 */
486 enum ieee80211_if_types type; 486 enum nl80211_iftype type;
487 487
488 /* 488 /*
489 * TSF sync value, this is dependant on the operation type. 489 * TSF sync value, this is dependant on the operation type.
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index ca051f50ef10..4d5e87b015a0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -31,7 +31,7 @@
31 31
32void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, 32void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
33 struct rt2x00_intf *intf, 33 struct rt2x00_intf *intf,
34 enum ieee80211_if_types type, 34 enum nl80211_iftype type,
35 u8 *mac, u8 *bssid) 35 u8 *mac, u8 *bssid)
36{ 36{
37 struct rt2x00intf_conf conf; 37 struct rt2x00intf_conf conf;
@@ -40,11 +40,11 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
40 conf.type = type; 40 conf.type = type;
41 41
42 switch (type) { 42 switch (type) {
43 case IEEE80211_IF_TYPE_IBSS: 43 case NL80211_IFTYPE_ADHOC:
44 case IEEE80211_IF_TYPE_AP: 44 case NL80211_IFTYPE_AP:
45 conf.sync = TSF_SYNC_BEACON; 45 conf.sync = TSF_SYNC_BEACON;
46 break; 46 break;
47 case IEEE80211_IF_TYPE_STA: 47 case NL80211_IFTYPE_STATION:
48 conf.sync = TSF_SYNC_INFRA; 48 conf.sync = TSF_SYNC_INFRA;
49 break; 49 break;
50 default: 50 default:
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 2f3bfc606880..86840e3585e8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -467,8 +467,8 @@ static void rt2x00lib_beacondone_iter(void *data, u8 *mac,
467 struct rt2x00_dev *rt2x00dev = data; 467 struct rt2x00_dev *rt2x00dev = data;
468 struct rt2x00_intf *intf = vif_to_intf(vif); 468 struct rt2x00_intf *intf = vif_to_intf(vif);
469 469
470 if (vif->type != IEEE80211_IF_TYPE_AP && 470 if (vif->type != NL80211_IFTYPE_AP &&
471 vif->type != IEEE80211_IF_TYPE_IBSS) 471 vif->type != NL80211_IFTYPE_ADHOC)
472 return; 472 return;
473 473
474 /* 474 /*
@@ -1212,8 +1212,8 @@ static void rt2x00lib_resume_intf(void *data, u8 *mac,
1212 /* 1212 /*
1213 * Master or Ad-hoc mode require a new beacon update. 1213 * Master or Ad-hoc mode require a new beacon update.
1214 */ 1214 */
1215 if (vif->type == IEEE80211_IF_TYPE_AP || 1215 if (vif->type == NL80211_IFTYPE_AP ||
1216 vif->type == IEEE80211_IF_TYPE_IBSS) 1216 vif->type == NL80211_IFTYPE_ADHOC)
1217 intf->delayed_flags |= DELAYED_UPDATE_BEACON; 1217 intf->delayed_flags |= DELAYED_UPDATE_BEACON;
1218 1218
1219 spin_unlock(&intf->lock); 1219 spin_unlock(&intf->lock);
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 7bbc16b1b6c6..797eb619aa0a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -88,7 +88,7 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev);
88 */ 88 */
89void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, 89void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
90 struct rt2x00_intf *intf, 90 struct rt2x00_intf *intf,
91 enum ieee80211_if_types type, 91 enum nl80211_iftype type,
92 u8 *mac, u8 *bssid); 92 u8 *mac, u8 *bssid);
93void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev, 93void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
94 struct rt2x00_intf *intf, 94 struct rt2x00_intf *intf,
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 56829fad3471..485c40de5cc0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -211,7 +211,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
211 return -ENODEV; 211 return -ENODEV;
212 212
213 switch (conf->type) { 213 switch (conf->type) {
214 case IEEE80211_IF_TYPE_AP: 214 case NL80211_IFTYPE_AP:
215 /* 215 /*
216 * We don't support mixed combinations of 216 * We don't support mixed combinations of
217 * sta and ap interfaces. 217 * sta and ap interfaces.
@@ -227,8 +227,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
227 return -ENOBUFS; 227 return -ENOBUFS;
228 228
229 break; 229 break;
230 case IEEE80211_IF_TYPE_STA: 230 case NL80211_IFTYPE_STATION:
231 case IEEE80211_IF_TYPE_IBSS: 231 case NL80211_IFTYPE_ADHOC:
232 /* 232 /*
233 * We don't support mixed combinations of 233 * We don't support mixed combinations of
234 * sta and ap interfaces. 234 * sta and ap interfaces.
@@ -268,7 +268,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
268 * increase interface count and start initialization. 268 * increase interface count and start initialization.
269 */ 269 */
270 270
271 if (conf->type == IEEE80211_IF_TYPE_AP) 271 if (conf->type == NL80211_IFTYPE_AP)
272 rt2x00dev->intf_ap_count++; 272 rt2x00dev->intf_ap_count++;
273 else 273 else
274 rt2x00dev->intf_sta_count++; 274 rt2x00dev->intf_sta_count++;
@@ -277,7 +277,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
277 spin_lock_init(&intf->seqlock); 277 spin_lock_init(&intf->seqlock);
278 intf->beacon = entry; 278 intf->beacon = entry;
279 279
280 if (conf->type == IEEE80211_IF_TYPE_AP) 280 if (conf->type == NL80211_IFTYPE_AP)
281 memcpy(&intf->bssid, conf->mac_addr, ETH_ALEN); 281 memcpy(&intf->bssid, conf->mac_addr, ETH_ALEN);
282 memcpy(&intf->mac, conf->mac_addr, ETH_ALEN); 282 memcpy(&intf->mac, conf->mac_addr, ETH_ALEN);
283 283
@@ -311,11 +311,11 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
311 * no interface is present. 311 * no interface is present.
312 */ 312 */
313 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) || 313 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) ||
314 (conf->type == IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_ap_count) || 314 (conf->type == NL80211_IFTYPE_AP && !rt2x00dev->intf_ap_count) ||
315 (conf->type != IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_sta_count)) 315 (conf->type != NL80211_IFTYPE_AP && !rt2x00dev->intf_sta_count))
316 return; 316 return;
317 317
318 if (conf->type == IEEE80211_IF_TYPE_AP) 318 if (conf->type == NL80211_IFTYPE_AP)
319 rt2x00dev->intf_ap_count--; 319 rt2x00dev->intf_ap_count--;
320 else 320 else
321 rt2x00dev->intf_sta_count--; 321 rt2x00dev->intf_sta_count--;
@@ -331,7 +331,7 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
331 * are cleared to prevent false ACKing of frames. 331 * are cleared to prevent false ACKing of frames.
332 */ 332 */
333 rt2x00lib_config_intf(rt2x00dev, intf, 333 rt2x00lib_config_intf(rt2x00dev, intf,
334 IEEE80211_IF_TYPE_INVALID, NULL, NULL); 334 NL80211_IFTYPE_UNSPECIFIED, NULL, NULL);
335} 335}
336EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface); 336EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface);
337 337
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c
index 861c76a65d6a..abcd641c54be 100644
--- a/drivers/net/wireless/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl8180_dev.c
@@ -615,7 +615,7 @@ static int rtl8180_start(struct ieee80211_hw *dev)
615 reg |= RTL818X_CMD_TX_ENABLE; 615 reg |= RTL818X_CMD_TX_ENABLE;
616 rtl818x_iowrite8(priv, &priv->map->CMD, reg); 616 rtl818x_iowrite8(priv, &priv->map->CMD, reg);
617 617
618 priv->mode = IEEE80211_IF_TYPE_MNTR; 618 priv->mode = NL80211_IFTYPE_MONITOR;
619 return 0; 619 return 0;
620 620
621 err_free_rings: 621 err_free_rings:
@@ -633,7 +633,7 @@ static void rtl8180_stop(struct ieee80211_hw *dev)
633 u8 reg; 633 u8 reg;
634 int i; 634 int i;
635 635
636 priv->mode = IEEE80211_IF_TYPE_INVALID; 636 priv->mode = NL80211_IFTYPE_UNSPECIFIED;
637 637
638 rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0); 638 rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0);
639 639
@@ -661,11 +661,11 @@ static int rtl8180_add_interface(struct ieee80211_hw *dev,
661{ 661{
662 struct rtl8180_priv *priv = dev->priv; 662 struct rtl8180_priv *priv = dev->priv;
663 663
664 if (priv->mode != IEEE80211_IF_TYPE_MNTR) 664 if (priv->mode != NL80211_IFTYPE_MONITOR)
665 return -EOPNOTSUPP; 665 return -EOPNOTSUPP;
666 666
667 switch (conf->type) { 667 switch (conf->type) {
668 case IEEE80211_IF_TYPE_STA: 668 case NL80211_IFTYPE_STATION:
669 priv->mode = conf->type; 669 priv->mode = conf->type;
670 break; 670 break;
671 default: 671 default:
@@ -688,7 +688,7 @@ static void rtl8180_remove_interface(struct ieee80211_hw *dev,
688 struct ieee80211_if_init_conf *conf) 688 struct ieee80211_if_init_conf *conf)
689{ 689{
690 struct rtl8180_priv *priv = dev->priv; 690 struct rtl8180_priv *priv = dev->priv;
691 priv->mode = IEEE80211_IF_TYPE_MNTR; 691 priv->mode = NL80211_IFTYPE_MONITOR;
692 priv->vif = NULL; 692 priv->vif = NULL;
693} 693}
694 694
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 8a42bfa6d4f0..e9902613e2ee 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -836,11 +836,11 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
836 struct rtl8187_priv *priv = dev->priv; 836 struct rtl8187_priv *priv = dev->priv;
837 int i; 837 int i;
838 838
839 if (priv->mode != IEEE80211_IF_TYPE_MNTR) 839 if (priv->mode != NL80211_IFTYPE_MONITOR)
840 return -EOPNOTSUPP; 840 return -EOPNOTSUPP;
841 841
842 switch (conf->type) { 842 switch (conf->type) {
843 case IEEE80211_IF_TYPE_STA: 843 case NL80211_IFTYPE_STATION:
844 priv->mode = conf->type; 844 priv->mode = conf->type;
845 break; 845 break;
846 default: 846 default:
@@ -865,7 +865,7 @@ static void rtl8187_remove_interface(struct ieee80211_hw *dev,
865{ 865{
866 struct rtl8187_priv *priv = dev->priv; 866 struct rtl8187_priv *priv = dev->priv;
867 mutex_lock(&priv->conf_mutex); 867 mutex_lock(&priv->conf_mutex);
868 priv->mode = IEEE80211_IF_TYPE_MNTR; 868 priv->mode = NL80211_IFTYPE_MONITOR;
869 priv->vif = NULL; 869 priv->vif = NULL;
870 mutex_unlock(&priv->conf_mutex); 870 mutex_unlock(&priv->conf_mutex);
871} 871}
@@ -1057,7 +1057,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1057 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; 1057 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band;
1058 1058
1059 1059
1060 priv->mode = IEEE80211_IF_TYPE_MNTR; 1060 priv->mode = NL80211_IFTYPE_MONITOR;
1061 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | 1061 dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
1062 IEEE80211_HW_RX_INCLUDES_FCS; 1062 IEEE80211_HW_RX_INCLUDES_FCS;
1063 1063
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 3005dd1fde42..a3da014f928d 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -716,15 +716,15 @@ static int zd_op_add_interface(struct ieee80211_hw *hw,
716{ 716{
717 struct zd_mac *mac = zd_hw_mac(hw); 717 struct zd_mac *mac = zd_hw_mac(hw);
718 718
719 /* using IEEE80211_IF_TYPE_INVALID to indicate no mode selected */ 719 /* using NL80211_IFTYPE_UNSPECIFIED to indicate no mode selected */
720 if (mac->type != IEEE80211_IF_TYPE_INVALID) 720 if (mac->type != NL80211_IFTYPE_UNSPECIFIED)
721 return -EOPNOTSUPP; 721 return -EOPNOTSUPP;
722 722
723 switch (conf->type) { 723 switch (conf->type) {
724 case IEEE80211_IF_TYPE_MNTR: 724 case NL80211_IFTYPE_MONITOR:
725 case IEEE80211_IF_TYPE_MESH_POINT: 725 case NL80211_IFTYPE_MESH_POINT:
726 case IEEE80211_IF_TYPE_STA: 726 case NL80211_IFTYPE_STATION:
727 case IEEE80211_IF_TYPE_IBSS: 727 case NL80211_IFTYPE_ADHOC:
728 mac->type = conf->type; 728 mac->type = conf->type;
729 break; 729 break;
730 default: 730 default:
@@ -738,7 +738,7 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw,
738 struct ieee80211_if_init_conf *conf) 738 struct ieee80211_if_init_conf *conf)
739{ 739{
740 struct zd_mac *mac = zd_hw_mac(hw); 740 struct zd_mac *mac = zd_hw_mac(hw);
741 mac->type = IEEE80211_IF_TYPE_INVALID; 741 mac->type = NL80211_IFTYPE_UNSPECIFIED;
742 zd_set_beacon_interval(&mac->chip, 0); 742 zd_set_beacon_interval(&mac->chip, 0);
743 zd_write_mac_addr(&mac->chip, NULL); 743 zd_write_mac_addr(&mac->chip, NULL);
744} 744}
@@ -757,8 +757,8 @@ static int zd_op_config_interface(struct ieee80211_hw *hw,
757 int associated; 757 int associated;
758 int r; 758 int r;
759 759
760 if (mac->type == IEEE80211_IF_TYPE_MESH_POINT || 760 if (mac->type == NL80211_IFTYPE_MESH_POINT ||
761 mac->type == IEEE80211_IF_TYPE_IBSS) { 761 mac->type == NL80211_IFTYPE_ADHOC) {
762 associated = true; 762 associated = true;
763 if (conf->changed & IEEE80211_IFCC_BEACON) { 763 if (conf->changed & IEEE80211_IFCC_BEACON) {
764 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 764 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
@@ -955,7 +955,7 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
955 spin_lock_init(&mac->lock); 955 spin_lock_init(&mac->lock);
956 mac->hw = hw; 956 mac->hw = hw;
957 957
958 mac->type = IEEE80211_IF_TYPE_INVALID; 958 mac->type = NL80211_IFTYPE_UNSPECIFIED;
959 959
960 memcpy(mac->channels, zd_channels, sizeof(zd_channels)); 960 memcpy(mac->channels, zd_channels, sizeof(zd_channels));
961 memcpy(mac->rates, zd_rates, sizeof(zd_rates)); 961 memcpy(mac->rates, zd_rates, sizeof(zd_rates));
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c81e579c17f3..7f5ea55e00f5 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -478,33 +478,6 @@ struct ieee80211_conf {
478}; 478};
479 479
480/** 480/**
481 * enum ieee80211_if_types - types of 802.11 network interfaces
482 *
483 * @IEEE80211_IF_TYPE_INVALID: invalid interface type, not used
484 * by mac80211 itself
485 * @IEEE80211_IF_TYPE_AP: interface in AP mode.
486 * @IEEE80211_IF_TYPE_MGMT: special interface for communication with hostap
487 * daemon. Drivers should never see this type.
488 * @IEEE80211_IF_TYPE_STA: interface in STA (client) mode.
489 * @IEEE80211_IF_TYPE_IBSS: interface in IBSS (ad-hoc) mode.
490 * @IEEE80211_IF_TYPE_MNTR: interface in monitor (rfmon) mode.
491 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode.
492 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers
493 * will never see this type.
494 * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point
495 */
496enum ieee80211_if_types {
497 IEEE80211_IF_TYPE_INVALID,
498 IEEE80211_IF_TYPE_AP,
499 IEEE80211_IF_TYPE_STA,
500 IEEE80211_IF_TYPE_IBSS,
501 IEEE80211_IF_TYPE_MESH_POINT,
502 IEEE80211_IF_TYPE_MNTR,
503 IEEE80211_IF_TYPE_WDS,
504 IEEE80211_IF_TYPE_VLAN,
505};
506
507/**
508 * struct ieee80211_vif - per-interface data 481 * struct ieee80211_vif - per-interface data
509 * 482 *
510 * Data in this structure is continually present for driver 483 * Data in this structure is continually present for driver
@@ -515,7 +488,7 @@ enum ieee80211_if_types {
515 * sizeof(void *). 488 * sizeof(void *).
516 */ 489 */
517struct ieee80211_vif { 490struct ieee80211_vif {
518 enum ieee80211_if_types type; 491 enum nl80211_iftype type;
519 /* must be last */ 492 /* must be last */
520 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 493 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
521}; 494};
@@ -523,7 +496,7 @@ struct ieee80211_vif {
523static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 496static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
524{ 497{
525#ifdef CONFIG_MAC80211_MESH 498#ifdef CONFIG_MAC80211_MESH
526 return vif->type == IEEE80211_IF_TYPE_MESH_POINT; 499 return vif->type == NL80211_IFTYPE_MESH_POINT;
527#endif 500#endif
528 return false; 501 return false;
529} 502}
@@ -534,7 +507,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
534 * @vif: pointer to a driver-use per-interface structure. The pointer 507 * @vif: pointer to a driver-use per-interface structure. The pointer
535 * itself is also used for various functions including 508 * itself is also used for various functions including
536 * ieee80211_beacon_get() and ieee80211_get_buffered_bc(). 509 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
537 * @type: one of &enum ieee80211_if_types constants. Determines the type of 510 * @type: one of &enum nl80211_iftype constants. Determines the type of
538 * added/removed interface. 511 * added/removed interface.
539 * @mac_addr: pointer to MAC address of the interface. This pointer is valid 512 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
540 * until the interface is removed (i.e. it cannot be used after 513 * until the interface is removed (i.e. it cannot be used after
@@ -550,7 +523,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
550 * in pure monitor mode. 523 * in pure monitor mode.
551 */ 524 */
552struct ieee80211_if_init_conf { 525struct ieee80211_if_init_conf {
553 enum ieee80211_if_types type; 526 enum nl80211_iftype type;
554 struct ieee80211_vif *vif; 527 struct ieee80211_vif *vif;
555 void *mac_addr; 528 void *mac_addr;
556}; 529};
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 6ec2127f9a60..d004351050cc 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -24,26 +24,19 @@ struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy)
24} 24}
25EXPORT_SYMBOL(wiphy_to_hw); 25EXPORT_SYMBOL(wiphy_to_hw);
26 26
27static enum ieee80211_if_types 27static bool nl80211_type_check(enum nl80211_iftype type)
28nl80211_type_to_mac80211_type(enum nl80211_iftype type)
29{ 28{
30 switch (type) { 29 switch (type) {
31 case NL80211_IFTYPE_UNSPECIFIED:
32 return IEEE80211_IF_TYPE_STA;
33 case NL80211_IFTYPE_ADHOC: 30 case NL80211_IFTYPE_ADHOC:
34 return IEEE80211_IF_TYPE_IBSS;
35 case NL80211_IFTYPE_STATION: 31 case NL80211_IFTYPE_STATION:
36 return IEEE80211_IF_TYPE_STA;
37 case NL80211_IFTYPE_MONITOR: 32 case NL80211_IFTYPE_MONITOR:
38 return IEEE80211_IF_TYPE_MNTR;
39#ifdef CONFIG_MAC80211_MESH 33#ifdef CONFIG_MAC80211_MESH
40 case NL80211_IFTYPE_MESH_POINT: 34 case NL80211_IFTYPE_MESH_POINT:
41 return IEEE80211_IF_TYPE_MESH_POINT;
42#endif 35#endif
43 case NL80211_IFTYPE_WDS: 36 case NL80211_IFTYPE_WDS:
44 return IEEE80211_IF_TYPE_WDS; 37 return true;
45 default: 38 default:
46 return IEEE80211_IF_TYPE_INVALID; 39 return false;
47 } 40 }
48} 41}
49 42
@@ -52,17 +45,15 @@ static int ieee80211_add_iface(struct wiphy *wiphy, char *name,
52 struct vif_params *params) 45 struct vif_params *params)
53{ 46{
54 struct ieee80211_local *local = wiphy_priv(wiphy); 47 struct ieee80211_local *local = wiphy_priv(wiphy);
55 enum ieee80211_if_types itype;
56 struct net_device *dev; 48 struct net_device *dev;
57 struct ieee80211_sub_if_data *sdata; 49 struct ieee80211_sub_if_data *sdata;
58 int err; 50 int err;
59 51
60 itype = nl80211_type_to_mac80211_type(type); 52 if (!nl80211_type_check(type))
61 if (itype == IEEE80211_IF_TYPE_INVALID)
62 return -EINVAL; 53 return -EINVAL;
63 54
64 err = ieee80211_if_add(local, name, &dev, itype, params); 55 err = ieee80211_if_add(local, name, &dev, type, params);
65 if (err || itype != IEEE80211_IF_TYPE_MNTR || !flags) 56 if (err || type != NL80211_IFTYPE_MONITOR || !flags)
66 return err; 57 return err;
67 58
68 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 59 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -93,7 +84,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
93{ 84{
94 struct ieee80211_local *local = wiphy_priv(wiphy); 85 struct ieee80211_local *local = wiphy_priv(wiphy);
95 struct net_device *dev; 86 struct net_device *dev;
96 enum ieee80211_if_types itype;
97 struct ieee80211_sub_if_data *sdata; 87 struct ieee80211_sub_if_data *sdata;
98 int ret; 88 int ret;
99 89
@@ -102,8 +92,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
102 if (!dev) 92 if (!dev)
103 return -ENODEV; 93 return -ENODEV;
104 94
105 itype = nl80211_type_to_mac80211_type(type); 95 if (!nl80211_type_check(type))
106 if (itype == IEEE80211_IF_TYPE_INVALID)
107 return -EINVAL; 96 return -EINVAL;
108 97
109 if (dev == local->mdev) 98 if (dev == local->mdev)
@@ -111,7 +100,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
111 100
112 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 101 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
113 102
114 ret = ieee80211_if_change_type(sdata, itype); 103 ret = ieee80211_if_change_type(sdata, type);
115 if (ret) 104 if (ret)
116 return ret; 105 return ret;
117 106
@@ -120,7 +109,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
120 params->mesh_id_len, 109 params->mesh_id_len,
121 params->mesh_id); 110 params->mesh_id);
122 111
123 if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR || !flags) 112 if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags)
124 return 0; 113 return 0;
125 114
126 sdata->u.mntr_flags = *flags; 115 sdata->u.mntr_flags = *flags;
@@ -516,7 +505,7 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
516 505
517 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 506 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
518 507
519 if (sdata->vif.type != IEEE80211_IF_TYPE_AP) 508 if (sdata->vif.type != NL80211_IFTYPE_AP)
520 return -EINVAL; 509 return -EINVAL;
521 510
522 old = sdata->u.ap.beacon; 511 old = sdata->u.ap.beacon;
@@ -539,7 +528,7 @@ static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
539 528
540 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 529 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
541 530
542 if (sdata->vif.type != IEEE80211_IF_TYPE_AP) 531 if (sdata->vif.type != NL80211_IFTYPE_AP)
543 return -EINVAL; 532 return -EINVAL;
544 533
545 old = sdata->u.ap.beacon; 534 old = sdata->u.ap.beacon;
@@ -561,7 +550,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
561 550
562 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 551 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
563 552
564 if (sdata->vif.type != IEEE80211_IF_TYPE_AP) 553 if (sdata->vif.type != NL80211_IFTYPE_AP)
565 return -EINVAL; 554 return -EINVAL;
566 555
567 old = sdata->u.ap.beacon; 556 old = sdata->u.ap.beacon;
@@ -716,8 +705,8 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
716 if (params->vlan) { 705 if (params->vlan) {
717 sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 706 sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
718 707
719 if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN && 708 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
720 sdata->vif.type != IEEE80211_IF_TYPE_AP) 709 sdata->vif.type != NL80211_IFTYPE_AP)
721 return -EINVAL; 710 return -EINVAL;
722 } else 711 } else
723 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 712 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -747,8 +736,8 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
747 return err; 736 return err;
748 } 737 }
749 738
750 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN || 739 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
751 sdata->vif.type == IEEE80211_IF_TYPE_AP) 740 sdata->vif.type == NL80211_IFTYPE_AP)
752 ieee80211_send_layer2_update(sta); 741 ieee80211_send_layer2_update(sta);
753 742
754 rcu_read_unlock(); 743 rcu_read_unlock();
@@ -812,8 +801,8 @@ static int ieee80211_change_station(struct wiphy *wiphy,
812 if (params->vlan && params->vlan != sta->sdata->dev) { 801 if (params->vlan && params->vlan != sta->sdata->dev) {
813 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); 802 vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
814 803
815 if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN && 804 if (vlansdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
816 vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { 805 vlansdata->vif.type != NL80211_IFTYPE_AP) {
817 rcu_read_unlock(); 806 rcu_read_unlock();
818 return -EINVAL; 807 return -EINVAL;
819 } 808 }
@@ -847,7 +836,7 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
847 836
848 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 837 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
849 838
850 if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) 839 if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
851 return -ENOTSUPP; 840 return -ENOTSUPP;
852 841
853 rcu_read_lock(); 842 rcu_read_lock();
@@ -903,7 +892,7 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
903 892
904 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 893 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
905 894
906 if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) 895 if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
907 return -ENOTSUPP; 896 return -ENOTSUPP;
908 897
909 rcu_read_lock(); 898 rcu_read_lock();
@@ -978,7 +967,7 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
978 967
979 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 968 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
980 969
981 if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) 970 if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
982 return -ENOTSUPP; 971 return -ENOTSUPP;
983 972
984 rcu_read_lock(); 973 rcu_read_lock();
@@ -1006,7 +995,7 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev,
1006 995
1007 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 996 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1008 997
1009 if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) 998 if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
1010 return -ENOTSUPP; 999 return -ENOTSUPP;
1011 1000
1012 rcu_read_lock(); 1001 rcu_read_lock();
@@ -1035,7 +1024,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
1035 1024
1036 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1025 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1037 1026
1038 if (sdata->vif.type != IEEE80211_IF_TYPE_AP) 1027 if (sdata->vif.type != NL80211_IFTYPE_AP)
1039 return -EINVAL; 1028 return -EINVAL;
1040 1029
1041 if (params->use_cts_prot >= 0) { 1030 if (params->use_cts_prot >= 0) {
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 0fa7681a3d20..1b33cad24abc 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -345,26 +345,26 @@ static void add_files(struct ieee80211_sub_if_data *sdata)
345 return; 345 return;
346 346
347 switch (sdata->vif.type) { 347 switch (sdata->vif.type) {
348 case IEEE80211_IF_TYPE_MESH_POINT: 348 case NL80211_IFTYPE_MESH_POINT:
349#ifdef CONFIG_MAC80211_MESH 349#ifdef CONFIG_MAC80211_MESH
350 add_mesh_stats(sdata); 350 add_mesh_stats(sdata);
351 add_mesh_config(sdata); 351 add_mesh_config(sdata);
352#endif 352#endif
353 break; 353 break;
354 case IEEE80211_IF_TYPE_STA: 354 case NL80211_IFTYPE_STATION:
355 case IEEE80211_IF_TYPE_IBSS: 355 case NL80211_IFTYPE_ADHOC:
356 add_sta_files(sdata); 356 add_sta_files(sdata);
357 break; 357 break;
358 case IEEE80211_IF_TYPE_AP: 358 case NL80211_IFTYPE_AP:
359 add_ap_files(sdata); 359 add_ap_files(sdata);
360 break; 360 break;
361 case IEEE80211_IF_TYPE_WDS: 361 case NL80211_IFTYPE_WDS:
362 add_wds_files(sdata); 362 add_wds_files(sdata);
363 break; 363 break;
364 case IEEE80211_IF_TYPE_MNTR: 364 case NL80211_IFTYPE_MONITOR:
365 add_monitor_files(sdata); 365 add_monitor_files(sdata);
366 break; 366 break;
367 case IEEE80211_IF_TYPE_VLAN: 367 case NL80211_IFTYPE_AP_VLAN:
368 add_vlan_files(sdata); 368 add_vlan_files(sdata);
369 break; 369 break;
370 default: 370 default:
@@ -482,26 +482,26 @@ static void del_files(struct ieee80211_sub_if_data *sdata)
482 return; 482 return;
483 483
484 switch (sdata->vif.type) { 484 switch (sdata->vif.type) {
485 case IEEE80211_IF_TYPE_MESH_POINT: 485 case NL80211_IFTYPE_MESH_POINT:
486#ifdef CONFIG_MAC80211_MESH 486#ifdef CONFIG_MAC80211_MESH
487 del_mesh_stats(sdata); 487 del_mesh_stats(sdata);
488 del_mesh_config(sdata); 488 del_mesh_config(sdata);
489#endif 489#endif
490 break; 490 break;
491 case IEEE80211_IF_TYPE_STA: 491 case NL80211_IFTYPE_STATION:
492 case IEEE80211_IF_TYPE_IBSS: 492 case NL80211_IFTYPE_ADHOC:
493 del_sta_files(sdata); 493 del_sta_files(sdata);
494 break; 494 break;
495 case IEEE80211_IF_TYPE_AP: 495 case NL80211_IFTYPE_AP:
496 del_ap_files(sdata); 496 del_ap_files(sdata);
497 break; 497 break;
498 case IEEE80211_IF_TYPE_WDS: 498 case NL80211_IFTYPE_WDS:
499 del_wds_files(sdata); 499 del_wds_files(sdata);
500 break; 500 break;
501 case IEEE80211_IF_TYPE_MNTR: 501 case NL80211_IFTYPE_MONITOR:
502 del_monitor_files(sdata); 502 del_monitor_files(sdata);
503 break; 503 break;
504 case IEEE80211_IF_TYPE_VLAN: 504 case NL80211_IFTYPE_AP_VLAN:
505 del_vlan_files(sdata); 505 del_vlan_files(sdata);
506 break; 506 break;
507 default: 507 default:
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 4dc35c9dabc7..bc3c71ad7ae3 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -89,7 +89,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
89 memset(mgmt, 0, 24); 89 memset(mgmt, 0, 24);
90 memcpy(mgmt->da, da, ETH_ALEN); 90 memcpy(mgmt->da, da, ETH_ALEN);
91 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 91 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
92 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) 92 if (sdata->vif.type == NL80211_IFTYPE_AP)
93 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); 93 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN);
94 else 94 else
95 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 95 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
@@ -139,7 +139,7 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d
139 memset(mgmt, 0, 24); 139 memset(mgmt, 0, 24);
140 memcpy(mgmt->da, da, ETH_ALEN); 140 memcpy(mgmt->da, da, ETH_ALEN);
141 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 141 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
142 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) 142 if (sdata->vif.type == NL80211_IFTYPE_AP)
143 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); 143 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN);
144 else 144 else
145 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 145 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
@@ -185,7 +185,7 @@ static void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
185 memset(mgmt, 0, 24); 185 memset(mgmt, 0, 24);
186 memcpy(mgmt->da, da, ETH_ALEN); 186 memcpy(mgmt->da, da, ETH_ALEN);
187 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 187 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN);
188 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) 188 if (sdata->vif.type == NL80211_IFTYPE_AP)
189 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); 189 memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN);
190 else 190 else
191 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); 191 memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 21cc6d07b020..80d88f5ff90c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -954,10 +954,10 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local,
954/* interface handling */ 954/* interface handling */
955void ieee80211_if_setup(struct net_device *dev); 955void ieee80211_if_setup(struct net_device *dev);
956int ieee80211_if_add(struct ieee80211_local *local, const char *name, 956int ieee80211_if_add(struct ieee80211_local *local, const char *name,
957 struct net_device **new_dev, enum ieee80211_if_types type, 957 struct net_device **new_dev, enum nl80211_iftype type,
958 struct vif_params *params); 958 struct vif_params *params);
959int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, 959int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
960 enum ieee80211_if_types type); 960 enum nl80211_iftype type);
961void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); 961void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
962void ieee80211_remove_interfaces(struct ieee80211_local *local); 962void ieee80211_remove_interfaces(struct ieee80211_local *local);
963 963
@@ -1001,7 +1001,7 @@ extern void *mac80211_wiphy_privid; /* for wiphy privid */
1001extern const unsigned char rfc1042_header[6]; 1001extern const unsigned char rfc1042_header[6];
1002extern const unsigned char bridge_tunnel_header[6]; 1002extern const unsigned char bridge_tunnel_header[6];
1003u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, 1003u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
1004 enum ieee80211_if_types type); 1004 enum nl80211_iftype type);
1005int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, 1005int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
1006 int rate, int erp, int short_preamble); 1006 int rate, int erp, int short_preamble);
1007void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, 1007void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index dab8eba2602f..004fb23241da 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -41,7 +41,7 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
41 sdata->fragment_next = 0; 41 sdata->fragment_next = 0;
42 42
43 switch (sdata->vif.type) { 43 switch (sdata->vif.type) {
44 case IEEE80211_IF_TYPE_AP: 44 case NL80211_IFTYPE_AP:
45 beacon = sdata->u.ap.beacon; 45 beacon = sdata->u.ap.beacon;
46 rcu_assign_pointer(sdata->u.ap.beacon, NULL); 46 rcu_assign_pointer(sdata->u.ap.beacon, NULL);
47 synchronize_rcu(); 47 synchronize_rcu();
@@ -53,22 +53,23 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
53 } 53 }
54 54
55 break; 55 break;
56 case IEEE80211_IF_TYPE_MESH_POINT: 56 case NL80211_IFTYPE_MESH_POINT:
57 if (ieee80211_vif_is_mesh(&sdata->vif)) 57 if (ieee80211_vif_is_mesh(&sdata->vif))
58 mesh_rmc_free(sdata); 58 mesh_rmc_free(sdata);
59 break; 59 break;
60 case IEEE80211_IF_TYPE_STA: 60 case NL80211_IFTYPE_STATION:
61 case IEEE80211_IF_TYPE_IBSS: 61 case NL80211_IFTYPE_ADHOC:
62 kfree(sdata->u.sta.extra_ie); 62 kfree(sdata->u.sta.extra_ie);
63 kfree(sdata->u.sta.assocreq_ies); 63 kfree(sdata->u.sta.assocreq_ies);
64 kfree(sdata->u.sta.assocresp_ies); 64 kfree(sdata->u.sta.assocresp_ies);
65 kfree_skb(sdata->u.sta.probe_resp); 65 kfree_skb(sdata->u.sta.probe_resp);
66 break; 66 break;
67 case IEEE80211_IF_TYPE_WDS: 67 case NL80211_IFTYPE_WDS:
68 case IEEE80211_IF_TYPE_VLAN: 68 case NL80211_IFTYPE_AP_VLAN:
69 case IEEE80211_IF_TYPE_MNTR: 69 case NL80211_IFTYPE_MONITOR:
70 break; 70 break;
71 case IEEE80211_IF_TYPE_INVALID: 71 case NL80211_IFTYPE_UNSPECIFIED:
72 case __NL80211_IFTYPE_AFTER_LAST:
72 BUG(); 73 BUG();
73 break; 74 break;
74 } 75 }
@@ -81,7 +82,7 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
81 * Helper function to initialise an interface to a specific type. 82 * Helper function to initialise an interface to a specific type.
82 */ 83 */
83static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, 84static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
84 enum ieee80211_if_types type) 85 enum nl80211_iftype type)
85{ 86{
86 /* clear type-dependent union */ 87 /* clear type-dependent union */
87 memset(&sdata->u, 0, sizeof(sdata->u)); 88 memset(&sdata->u, 0, sizeof(sdata->u));
@@ -93,28 +94,29 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
93 sdata->dev->type = ARPHRD_ETHER; 94 sdata->dev->type = ARPHRD_ETHER;
94 95
95 switch (type) { 96 switch (type) {
96 case IEEE80211_IF_TYPE_AP: 97 case NL80211_IFTYPE_AP:
97 skb_queue_head_init(&sdata->u.ap.ps_bc_buf); 98 skb_queue_head_init(&sdata->u.ap.ps_bc_buf);
98 INIT_LIST_HEAD(&sdata->u.ap.vlans); 99 INIT_LIST_HEAD(&sdata->u.ap.vlans);
99 break; 100 break;
100 case IEEE80211_IF_TYPE_STA: 101 case NL80211_IFTYPE_STATION:
101 case IEEE80211_IF_TYPE_IBSS: 102 case NL80211_IFTYPE_ADHOC:
102 ieee80211_sta_setup_sdata(sdata); 103 ieee80211_sta_setup_sdata(sdata);
103 break; 104 break;
104 case IEEE80211_IF_TYPE_MESH_POINT: 105 case NL80211_IFTYPE_MESH_POINT:
105 if (ieee80211_vif_is_mesh(&sdata->vif)) 106 if (ieee80211_vif_is_mesh(&sdata->vif))
106 ieee80211_mesh_init_sdata(sdata); 107 ieee80211_mesh_init_sdata(sdata);
107 break; 108 break;
108 case IEEE80211_IF_TYPE_MNTR: 109 case NL80211_IFTYPE_MONITOR:
109 sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; 110 sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP;
110 sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit; 111 sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit;
111 sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | 112 sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
112 MONITOR_FLAG_OTHER_BSS; 113 MONITOR_FLAG_OTHER_BSS;
113 break; 114 break;
114 case IEEE80211_IF_TYPE_WDS: 115 case NL80211_IFTYPE_WDS:
115 case IEEE80211_IF_TYPE_VLAN: 116 case NL80211_IFTYPE_AP_VLAN:
116 break; 117 break;
117 case IEEE80211_IF_TYPE_INVALID: 118 case NL80211_IFTYPE_UNSPECIFIED:
119 case __NL80211_IFTYPE_AFTER_LAST:
118 BUG(); 120 BUG();
119 break; 121 break;
120 } 122 }
@@ -123,7 +125,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
123} 125}
124 126
125int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, 127int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
126 enum ieee80211_if_types type) 128 enum nl80211_iftype type)
127{ 129{
128 ASSERT_RTNL(); 130 ASSERT_RTNL();
129 131
@@ -153,7 +155,7 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
153} 155}
154 156
155int ieee80211_if_add(struct ieee80211_local *local, const char *name, 157int ieee80211_if_add(struct ieee80211_local *local, const char *name,
156 struct net_device **new_dev, enum ieee80211_if_types type, 158 struct net_device **new_dev, enum nl80211_iftype type,
157 struct vif_params *params) 159 struct vif_params *params)
158{ 160{
159 struct net_device *ndev; 161 struct net_device *ndev;
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 6597c779e35a..d5b95748db2a 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -118,8 +118,8 @@ static const u8 *get_mac_for_key(struct ieee80211_key *key)
118 * address to indicate a transmit-only key. 118 * address to indicate a transmit-only key.
119 */ 119 */
120 if (key->conf.alg != ALG_WEP && 120 if (key->conf.alg != ALG_WEP &&
121 (key->sdata->vif.type == IEEE80211_IF_TYPE_AP || 121 (key->sdata->vif.type == NL80211_IFTYPE_AP ||
122 key->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) 122 key->sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
123 addr = zero_addr; 123 addr = zero_addr;
124 124
125 if (key->sta) 125 if (key->sta)
@@ -331,7 +331,7 @@ void ieee80211_key_link(struct ieee80211_key *key,
331 */ 331 */
332 key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE; 332 key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
333 } else { 333 } else {
334 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { 334 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
335 struct sta_info *ap; 335 struct sta_info *ap;
336 336
337 /* 337 /*
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 4c424acc01a4..584a75bd6cfe 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -146,7 +146,7 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
146 int meshhdrlen; 146 int meshhdrlen;
147 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 147 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
148 148
149 meshhdrlen = (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) ? 5 : 0; 149 meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0;
150 150
151 /* FIX: what would be proper limits for MTU? 151 /* FIX: what would be proper limits for MTU?
152 * This interface uses 802.3 frames. */ 152 * This interface uses 802.3 frames. */
@@ -164,18 +164,16 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
164 164
165static inline int identical_mac_addr_allowed(int type1, int type2) 165static inline int identical_mac_addr_allowed(int type1, int type2)
166{ 166{
167 return (type1 == IEEE80211_IF_TYPE_MNTR || 167 return type1 == NL80211_IFTYPE_MONITOR ||
168 type2 == IEEE80211_IF_TYPE_MNTR || 168 type2 == NL80211_IFTYPE_MONITOR ||
169 (type1 == IEEE80211_IF_TYPE_AP && 169 (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_WDS) ||
170 type2 == IEEE80211_IF_TYPE_WDS) || 170 (type1 == NL80211_IFTYPE_WDS &&
171 (type1 == IEEE80211_IF_TYPE_WDS && 171 (type2 == NL80211_IFTYPE_WDS ||
172 (type2 == IEEE80211_IF_TYPE_WDS || 172 type2 == NL80211_IFTYPE_AP)) ||
173 type2 == IEEE80211_IF_TYPE_AP)) || 173 (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_AP_VLAN) ||
174 (type1 == IEEE80211_IF_TYPE_AP && 174 (type1 == NL80211_IFTYPE_AP_VLAN &&
175 type2 == IEEE80211_IF_TYPE_VLAN) || 175 (type2 == NL80211_IFTYPE_AP ||
176 (type1 == IEEE80211_IF_TYPE_VLAN && 176 type2 == NL80211_IFTYPE_AP_VLAN));
177 (type2 == IEEE80211_IF_TYPE_AP ||
178 type2 == IEEE80211_IF_TYPE_VLAN)));
179} 177}
180 178
181static int ieee80211_open(struct net_device *dev) 179static int ieee80211_open(struct net_device *dev)
@@ -211,8 +209,8 @@ static int ieee80211_open(struct net_device *dev)
211 * belonging to the same hardware. Then, however, we're 209 * belonging to the same hardware. Then, however, we're
212 * faced with having to adopt two different TSF timers... 210 * faced with having to adopt two different TSF timers...
213 */ 211 */
214 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && 212 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
215 nsdata->vif.type == IEEE80211_IF_TYPE_IBSS) 213 nsdata->vif.type == NL80211_IFTYPE_ADHOC)
216 return -EBUSY; 214 return -EBUSY;
217 215
218 /* 216 /*
@@ -232,37 +230,38 @@ static int ieee80211_open(struct net_device *dev)
232 /* 230 /*
233 * can only add VLANs to enabled APs 231 * can only add VLANs to enabled APs
234 */ 232 */
235 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN && 233 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
236 nsdata->vif.type == IEEE80211_IF_TYPE_AP) 234 nsdata->vif.type == NL80211_IFTYPE_AP)
237 sdata->bss = &nsdata->u.ap; 235 sdata->bss = &nsdata->u.ap;
238 } 236 }
239 } 237 }
240 238
241 switch (sdata->vif.type) { 239 switch (sdata->vif.type) {
242 case IEEE80211_IF_TYPE_WDS: 240 case NL80211_IFTYPE_WDS:
243 if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) 241 if (!is_valid_ether_addr(sdata->u.wds.remote_addr))
244 return -ENOLINK; 242 return -ENOLINK;
245 break; 243 break;
246 case IEEE80211_IF_TYPE_VLAN: 244 case NL80211_IFTYPE_AP_VLAN:
247 if (!sdata->bss) 245 if (!sdata->bss)
248 return -ENOLINK; 246 return -ENOLINK;
249 list_add(&sdata->u.vlan.list, &sdata->bss->vlans); 247 list_add(&sdata->u.vlan.list, &sdata->bss->vlans);
250 break; 248 break;
251 case IEEE80211_IF_TYPE_AP: 249 case NL80211_IFTYPE_AP:
252 sdata->bss = &sdata->u.ap; 250 sdata->bss = &sdata->u.ap;
253 break; 251 break;
254 case IEEE80211_IF_TYPE_MESH_POINT: 252 case NL80211_IFTYPE_MESH_POINT:
255 if (!ieee80211_vif_is_mesh(&sdata->vif)) 253 if (!ieee80211_vif_is_mesh(&sdata->vif))
256 break; 254 break;
257 /* mesh ifaces must set allmulti to forward mcast traffic */ 255 /* mesh ifaces must set allmulti to forward mcast traffic */
258 atomic_inc(&local->iff_allmultis); 256 atomic_inc(&local->iff_allmultis);
259 break; 257 break;
260 case IEEE80211_IF_TYPE_STA: 258 case NL80211_IFTYPE_STATION:
261 case IEEE80211_IF_TYPE_MNTR: 259 case NL80211_IFTYPE_MONITOR:
262 case IEEE80211_IF_TYPE_IBSS: 260 case NL80211_IFTYPE_ADHOC:
263 /* no special treatment */ 261 /* no special treatment */
264 break; 262 break;
265 case IEEE80211_IF_TYPE_INVALID: 263 case NL80211_IFTYPE_UNSPECIFIED:
264 case __NL80211_IFTYPE_AFTER_LAST:
266 /* cannot happen */ 265 /* cannot happen */
267 WARN_ON(1); 266 WARN_ON(1);
268 break; 267 break;
@@ -309,10 +308,10 @@ static int ieee80211_open(struct net_device *dev)
309 } 308 }
310 309
311 switch (sdata->vif.type) { 310 switch (sdata->vif.type) {
312 case IEEE80211_IF_TYPE_VLAN: 311 case NL80211_IFTYPE_AP_VLAN:
313 /* no need to tell driver */ 312 /* no need to tell driver */
314 break; 313 break;
315 case IEEE80211_IF_TYPE_MNTR: 314 case NL80211_IFTYPE_MONITOR:
316 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { 315 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) {
317 local->cooked_mntrs++; 316 local->cooked_mntrs++;
318 break; 317 break;
@@ -336,8 +335,8 @@ static int ieee80211_open(struct net_device *dev)
336 ieee80211_configure_filter(local); 335 ieee80211_configure_filter(local);
337 netif_addr_unlock_bh(local->mdev); 336 netif_addr_unlock_bh(local->mdev);
338 break; 337 break;
339 case IEEE80211_IF_TYPE_STA: 338 case NL80211_IFTYPE_STATION:
340 case IEEE80211_IF_TYPE_IBSS: 339 case NL80211_IFTYPE_ADHOC:
341 sdata->u.sta.flags &= ~IEEE80211_STA_PREV_BSSID_SET; 340 sdata->u.sta.flags &= ~IEEE80211_STA_PREV_BSSID_SET;
342 /* fall through */ 341 /* fall through */
343 default: 342 default:
@@ -354,14 +353,14 @@ static int ieee80211_open(struct net_device *dev)
354 ieee80211_bss_info_change_notify(sdata, changed); 353 ieee80211_bss_info_change_notify(sdata, changed);
355 ieee80211_enable_keys(sdata); 354 ieee80211_enable_keys(sdata);
356 355
357 if (sdata->vif.type == IEEE80211_IF_TYPE_STA && 356 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
358 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) 357 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME))
359 netif_carrier_off(dev); 358 netif_carrier_off(dev);
360 else 359 else
361 netif_carrier_on(dev); 360 netif_carrier_on(dev);
362 } 361 }
363 362
364 if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { 363 if (sdata->vif.type == NL80211_IFTYPE_WDS) {
365 /* Create STA entry for the WDS peer */ 364 /* Create STA entry for the WDS peer */
366 sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, 365 sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
367 GFP_KERNEL); 366 GFP_KERNEL);
@@ -417,8 +416,8 @@ static int ieee80211_open(struct net_device *dev)
417 * yet be effective. Trigger execution of ieee80211_sta_work 416 * yet be effective. Trigger execution of ieee80211_sta_work
418 * to fix this. 417 * to fix this.
419 */ 418 */
420 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 419 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
421 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 420 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
422 struct ieee80211_if_sta *ifsta = &sdata->u.sta; 421 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
423 queue_work(local->hw.workqueue, &ifsta->work); 422 queue_work(local->hw.workqueue, &ifsta->work);
424 } 423 }
@@ -433,7 +432,7 @@ static int ieee80211_open(struct net_device *dev)
433 local->ops->stop(local_to_hw(local)); 432 local->ops->stop(local_to_hw(local));
434 err_del_bss: 433 err_del_bss:
435 sdata->bss = NULL; 434 sdata->bss = NULL;
436 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) 435 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
437 list_del(&sdata->u.vlan.list); 436 list_del(&sdata->u.vlan.list);
438 return res; 437 return res;
439} 438}
@@ -496,7 +495,7 @@ static int ieee80211_stop(struct net_device *dev)
496 dev_mc_unsync(local->mdev, dev); 495 dev_mc_unsync(local->mdev, dev);
497 496
498 /* APs need special treatment */ 497 /* APs need special treatment */
499 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 498 if (sdata->vif.type == NL80211_IFTYPE_AP) {
500 struct ieee80211_sub_if_data *vlan, *tmp; 499 struct ieee80211_sub_if_data *vlan, *tmp;
501 struct beacon_data *old_beacon = sdata->u.ap.beacon; 500 struct beacon_data *old_beacon = sdata->u.ap.beacon;
502 501
@@ -515,11 +514,11 @@ static int ieee80211_stop(struct net_device *dev)
515 local->open_count--; 514 local->open_count--;
516 515
517 switch (sdata->vif.type) { 516 switch (sdata->vif.type) {
518 case IEEE80211_IF_TYPE_VLAN: 517 case NL80211_IFTYPE_AP_VLAN:
519 list_del(&sdata->u.vlan.list); 518 list_del(&sdata->u.vlan.list);
520 /* no need to tell driver */ 519 /* no need to tell driver */
521 break; 520 break;
522 case IEEE80211_IF_TYPE_MNTR: 521 case NL80211_IFTYPE_MONITOR:
523 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { 522 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) {
524 local->cooked_mntrs--; 523 local->cooked_mntrs--;
525 break; 524 break;
@@ -542,8 +541,8 @@ static int ieee80211_stop(struct net_device *dev)
542 ieee80211_configure_filter(local); 541 ieee80211_configure_filter(local);
543 netif_addr_unlock_bh(local->mdev); 542 netif_addr_unlock_bh(local->mdev);
544 break; 543 break;
545 case IEEE80211_IF_TYPE_STA: 544 case NL80211_IFTYPE_STATION:
546 case IEEE80211_IF_TYPE_IBSS: 545 case NL80211_IFTYPE_ADHOC:
547 sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED; 546 sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED;
548 memset(sdata->u.sta.bssid, 0, ETH_ALEN); 547 memset(sdata->u.sta.bssid, 0, ETH_ALEN);
549 del_timer_sync(&sdata->u.sta.timer); 548 del_timer_sync(&sdata->u.sta.timer);
@@ -569,7 +568,7 @@ static int ieee80211_stop(struct net_device *dev)
569 sdata->u.sta.extra_ie = NULL; 568 sdata->u.sta.extra_ie = NULL;
570 sdata->u.sta.extra_ie_len = 0; 569 sdata->u.sta.extra_ie_len = 0;
571 /* fall through */ 570 /* fall through */
572 case IEEE80211_IF_TYPE_MESH_POINT: 571 case NL80211_IFTYPE_MESH_POINT:
573 if (ieee80211_vif_is_mesh(&sdata->vif)) { 572 if (ieee80211_vif_is_mesh(&sdata->vif)) {
574 /* allmulti is always set on mesh ifaces */ 573 /* allmulti is always set on mesh ifaces */
575 atomic_dec(&local->iff_allmultis); 574 atomic_dec(&local->iff_allmultis);
@@ -698,12 +697,12 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
698 memset(&conf, 0, sizeof(conf)); 697 memset(&conf, 0, sizeof(conf));
699 conf.changed = changed; 698 conf.changed = changed;
700 699
701 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 700 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
702 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 701 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
703 conf.bssid = sdata->u.sta.bssid; 702 conf.bssid = sdata->u.sta.bssid;
704 conf.ssid = sdata->u.sta.ssid; 703 conf.ssid = sdata->u.sta.ssid;
705 conf.ssid_len = sdata->u.sta.ssid_len; 704 conf.ssid_len = sdata->u.sta.ssid_len;
706 } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 705 } else if (sdata->vif.type == NL80211_IFTYPE_AP) {
707 conf.bssid = sdata->dev->dev_addr; 706 conf.bssid = sdata->dev->dev_addr;
708 conf.ssid = sdata->u.ap.ssid; 707 conf.ssid = sdata->u.ap.ssid;
709 conf.ssid_len = sdata->u.ap.ssid_len; 708 conf.ssid_len = sdata->u.ap.ssid_len;
@@ -1204,7 +1203,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
1204 1203
1205 rcu_read_lock(); 1204 rcu_read_lock();
1206 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 1205 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
1207 if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR) { 1206 if (sdata->vif.type == NL80211_IFTYPE_MONITOR) {
1208 if (!netif_running(sdata->dev)) 1207 if (!netif_running(sdata->dev))
1209 continue; 1208 continue;
1210 1209
@@ -1450,7 +1449,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1450 1449
1451 /* add one default STA interface */ 1450 /* add one default STA interface */
1452 result = ieee80211_if_add(local, "wlan%d", NULL, 1451 result = ieee80211_if_add(local, "wlan%d", NULL,
1453 IEEE80211_IF_TYPE_STA, NULL); 1452 NL80211_IFTYPE_STATION, NULL);
1454 if (result) 1453 if (result)
1455 printk(KERN_WARNING "%s: Failed to add default virtual iface\n", 1454 printk(KERN_WARNING "%s: Failed to add default virtual iface\n",
1456 wiphy_name(local->hw.wiphy)); 1455 wiphy_name(local->hw.wiphy));
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 55bc60713937..8a2cfd3609b5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -678,7 +678,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
678 678
679 ifsta->flags |= IEEE80211_STA_ASSOCIATED; 679 ifsta->flags |= IEEE80211_STA_ASSOCIATED;
680 680
681 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 681 if (sdata->vif.type != NL80211_IFTYPE_STATION)
682 return; 682 return;
683 683
684 bss = ieee80211_rx_bss_get(local, ifsta->bssid, 684 bss = ieee80211_rx_bss_get(local, ifsta->bssid,
@@ -1002,17 +1002,17 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1002 DECLARE_MAC_BUF(mac); 1002 DECLARE_MAC_BUF(mac);
1003 1003
1004 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE && 1004 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE &&
1005 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 1005 sdata->vif.type != NL80211_IFTYPE_ADHOC)
1006 return; 1006 return;
1007 1007
1008 if (len < 24 + 6) 1008 if (len < 24 + 6)
1009 return; 1009 return;
1010 1010
1011 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1011 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1012 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) 1012 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0)
1013 return; 1013 return;
1014 1014
1015 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1015 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1016 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) 1016 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0)
1017 return; 1017 return;
1018 1018
@@ -1020,7 +1020,7 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1020 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); 1020 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
1021 status_code = le16_to_cpu(mgmt->u.auth.status_code); 1021 status_code = le16_to_cpu(mgmt->u.auth.status_code);
1022 1022
1023 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 1023 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
1024 /* 1024 /*
1025 * IEEE 802.11 standard does not require authentication in IBSS 1025 * IEEE 802.11 standard does not require authentication in IBSS
1026 * networks and most implementations do not seem to use it. 1026 * networks and most implementations do not seem to use it.
@@ -1487,7 +1487,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1487 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) 1487 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
1488 return; 1488 return;
1489 1489
1490 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && elems->supp_rates && 1490 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && elems->supp_rates &&
1491 memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) { 1491 memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) {
1492 supp_rates = ieee80211_sta_get_rates(local, elems, band); 1492 supp_rates = ieee80211_sta_get_rates(local, elems, band);
1493 1493
@@ -1532,14 +1532,14 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1532 * In STA mode, the remaining parameters should not be overridden 1532 * In STA mode, the remaining parameters should not be overridden
1533 * by beacons because they're not necessarily accurate there. 1533 * by beacons because they're not necessarily accurate there.
1534 */ 1534 */
1535 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1535 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1536 bss->last_probe_resp && beacon) { 1536 bss->last_probe_resp && beacon) {
1537 ieee80211_rx_bss_put(local, bss); 1537 ieee80211_rx_bss_put(local, bss);
1538 return; 1538 return;
1539 } 1539 }
1540 1540
1541 /* check if we need to merge IBSS */ 1541 /* check if we need to merge IBSS */
1542 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && beacon && 1542 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && beacon &&
1543 bss->capability & WLAN_CAPABILITY_IBSS && 1543 bss->capability & WLAN_CAPABILITY_IBSS &&
1544 bss->freq == local->oper_channel->center_freq && 1544 bss->freq == local->oper_channel->center_freq &&
1545 elems->ssid_len == sdata->u.sta.ssid_len && 1545 elems->ssid_len == sdata->u.sta.ssid_len &&
@@ -1649,7 +1649,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1649 1649
1650 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true); 1650 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true);
1651 1651
1652 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 1652 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1653 return; 1653 return;
1654 ifsta = &sdata->u.sta; 1654 ifsta = &sdata->u.sta;
1655 1655
@@ -1700,7 +1700,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1700 DECLARE_MAC_BUF(mac3); 1700 DECLARE_MAC_BUF(mac3);
1701#endif 1701#endif
1702 1702
1703 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS || 1703 if (sdata->vif.type != NL80211_IFTYPE_ADHOC ||
1704 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED || 1704 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED ||
1705 len < 24 + 2 || !ifsta->probe_resp) 1705 len < 24 + 2 || !ifsta->probe_resp)
1706 return; 1706 return;
@@ -2212,8 +2212,8 @@ static void ieee80211_sta_work(struct work_struct *work)
2212 if (local->sw_scanning || local->hw_scanning) 2212 if (local->sw_scanning || local->hw_scanning)
2213 return; 2213 return;
2214 2214
2215 if (WARN_ON(sdata->vif.type != IEEE80211_IF_TYPE_STA && 2215 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION &&
2216 sdata->vif.type != IEEE80211_IF_TYPE_IBSS)) 2216 sdata->vif.type != NL80211_IFTYPE_ADHOC))
2217 return; 2217 return;
2218 ifsta = &sdata->u.sta; 2218 ifsta = &sdata->u.sta;
2219 2219
@@ -2273,7 +2273,7 @@ static void ieee80211_sta_work(struct work_struct *work)
2273 2273
2274static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) 2274static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
2275{ 2275{
2276 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) 2276 if (sdata->vif.type == NL80211_IFTYPE_STATION)
2277 queue_work(sdata->local->hw.workqueue, 2277 queue_work(sdata->local->hw.workqueue,
2278 &sdata->u.sta.work); 2278 &sdata->u.sta.work);
2279} 2279}
@@ -2355,7 +2355,7 @@ void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata,
2355{ 2355{
2356 struct ieee80211_local *local = sdata->local; 2356 struct ieee80211_local *local = sdata->local;
2357 2357
2358 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2358 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2359 return; 2359 return;
2360 2360
2361 if ((ifsta->flags & (IEEE80211_STA_BSSID_SET | 2361 if ((ifsta->flags & (IEEE80211_STA_BSSID_SET |
@@ -2407,7 +2407,7 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size
2407 else 2407 else
2408 ifsta->flags &= ~IEEE80211_STA_SSID_SET; 2408 ifsta->flags &= ~IEEE80211_STA_SSID_SET;
2409 2409
2410 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && 2410 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
2411 !(ifsta->flags & IEEE80211_STA_BSSID_SET)) { 2411 !(ifsta->flags & IEEE80211_STA_BSSID_SET)) {
2412 ifsta->ibss_join_req = jiffies; 2412 ifsta->ibss_join_req = jiffies;
2413 ifsta->state = IEEE80211_STA_MLME_IBSS_SEARCH; 2413 ifsta->state = IEEE80211_STA_MLME_IBSS_SEARCH;
@@ -2482,8 +2482,8 @@ int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason
2482 printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n", 2482 printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n",
2483 sdata->dev->name, reason); 2483 sdata->dev->name, reason);
2484 2484
2485 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 2485 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
2486 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 2486 sdata->vif.type != NL80211_IFTYPE_ADHOC)
2487 return -EINVAL; 2487 return -EINVAL;
2488 2488
2489 ieee80211_set_disassoc(sdata, ifsta, true, true, reason); 2489 ieee80211_set_disassoc(sdata, ifsta, true, true, reason);
@@ -2497,7 +2497,7 @@ int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason)
2497 printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n", 2497 printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n",
2498 sdata->dev->name, reason); 2498 sdata->dev->name, reason);
2499 2499
2500 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2500 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2501 return -EINVAL; 2501 return -EINVAL;
2502 2502
2503 if (!(ifsta->flags & IEEE80211_STA_ASSOCIATED)) 2503 if (!(ifsta->flags & IEEE80211_STA_ASSOCIATED))
@@ -2513,7 +2513,7 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
2513 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 2513 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
2514 struct ieee80211_if_sta *ifsta; 2514 struct ieee80211_if_sta *ifsta;
2515 2515
2516 if (sdata && sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 2516 if (sdata && sdata->vif.type == NL80211_IFTYPE_ADHOC) {
2517 ifsta = &sdata->u.sta; 2517 ifsta = &sdata->u.sta;
2518 if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || 2518 if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) ||
2519 (!(ifsta->state == IEEE80211_STA_MLME_IBSS_JOINED) && 2519 (!(ifsta->state == IEEE80211_STA_MLME_IBSS_JOINED) &&
@@ -2539,7 +2539,7 @@ void ieee80211_notify_mac(struct ieee80211_hw *hw,
2539 case IEEE80211_NOTIFY_RE_ASSOC: 2539 case IEEE80211_NOTIFY_RE_ASSOC:
2540 rcu_read_lock(); 2540 rcu_read_lock();
2541 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 2541 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
2542 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2542 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2543 continue; 2543 continue;
2544 2544
2545 ieee80211_sta_req_auth(sdata, &sdata->u.sta); 2545 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 33530b29c422..8c3dda5f00b2 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -295,7 +295,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
295 if (!netif_running(sdata->dev)) 295 if (!netif_running(sdata->dev))
296 continue; 296 continue;
297 297
298 if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR) 298 if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
299 continue; 299 continue;
300 300
301 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) 301 if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES)
@@ -512,7 +512,7 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx)
512 512
513 if (unlikely((ieee80211_is_data(hdr->frame_control) || 513 if (unlikely((ieee80211_is_data(hdr->frame_control) ||
514 ieee80211_is_pspoll(hdr->frame_control)) && 514 ieee80211_is_pspoll(hdr->frame_control)) &&
515 rx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 515 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC &&
516 (!rx->sta || !test_sta_flags(rx->sta, WLAN_STA_ASSOC)))) { 516 (!rx->sta || !test_sta_flags(rx->sta, WLAN_STA_ASSOC)))) {
517 if ((!ieee80211_has_fromds(hdr->frame_control) && 517 if ((!ieee80211_has_fromds(hdr->frame_control) &&
518 !ieee80211_has_tods(hdr->frame_control) && 518 !ieee80211_has_tods(hdr->frame_control) &&
@@ -724,14 +724,14 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
724 /* Update last_rx only for IBSS packets which are for the current 724 /* Update last_rx only for IBSS packets which are for the current
725 * BSSID to avoid keeping the current IBSS network alive in cases where 725 * BSSID to avoid keeping the current IBSS network alive in cases where
726 * other STAs are using different BSSID. */ 726 * other STAs are using different BSSID. */
727 if (rx->sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 727 if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) {
728 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, 728 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len,
729 IEEE80211_IF_TYPE_IBSS); 729 NL80211_IFTYPE_ADHOC);
730 if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0) 730 if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0)
731 sta->last_rx = jiffies; 731 sta->last_rx = jiffies;
732 } else 732 } else
733 if (!is_multicast_ether_addr(hdr->addr1) || 733 if (!is_multicast_ether_addr(hdr->addr1) ||
734 rx->sdata->vif.type == IEEE80211_IF_TYPE_STA) { 734 rx->sdata->vif.type == NL80211_IFTYPE_STATION) {
735 /* Update last_rx only for unicast frames in order to prevent 735 /* Update last_rx only for unicast frames in order to prevent
736 * the Probe Request frames (the only broadcast frames from a 736 * the Probe Request frames (the only broadcast frames from a
737 * STA in infrastructure mode) from keeping a connection alive. 737 * STA in infrastructure mode) from keeping a connection alive.
@@ -751,8 +751,8 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
751 sta->last_noise = rx->status->noise; 751 sta->last_noise = rx->status->noise;
752 752
753 if (!ieee80211_has_morefrags(hdr->frame_control) && 753 if (!ieee80211_has_morefrags(hdr->frame_control) &&
754 (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP || 754 (rx->sdata->vif.type == NL80211_IFTYPE_AP ||
755 rx->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) { 755 rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) {
756 /* Change STA power saving mode only in the end of a frame 756 /* Change STA power saving mode only in the end of a frame
757 * exchange sequence */ 757 * exchange sequence */
758 if (test_sta_flags(sta, WLAN_STA_PS) && 758 if (test_sta_flags(sta, WLAN_STA_PS) &&
@@ -982,8 +982,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
982 !(rx->flags & IEEE80211_RX_RA_MATCH))) 982 !(rx->flags & IEEE80211_RX_RA_MATCH)))
983 return RX_CONTINUE; 983 return RX_CONTINUE;
984 984
985 if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) && 985 if ((sdata->vif.type != NL80211_IFTYPE_AP) &&
986 (sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) 986 (sdata->vif.type != NL80211_IFTYPE_AP_VLAN))
987 return RX_DROP_UNUSABLE; 987 return RX_DROP_UNUSABLE;
988 988
989 skb = skb_dequeue(&rx->sta->tx_filtered); 989 skb = skb_dequeue(&rx->sta->tx_filtered);
@@ -1131,23 +1131,23 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
1131 switch (hdr->frame_control & 1131 switch (hdr->frame_control &
1132 cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) { 1132 cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
1133 case __constant_cpu_to_le16(IEEE80211_FCTL_TODS): 1133 case __constant_cpu_to_le16(IEEE80211_FCTL_TODS):
1134 if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_AP && 1134 if (unlikely(sdata->vif.type != NL80211_IFTYPE_AP &&
1135 sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) 1135 sdata->vif.type != NL80211_IFTYPE_AP_VLAN))
1136 return -1; 1136 return -1;
1137 break; 1137 break;
1138 case __constant_cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): 1138 case __constant_cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS):
1139 if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS && 1139 if (unlikely(sdata->vif.type != NL80211_IFTYPE_WDS &&
1140 sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)) 1140 sdata->vif.type != NL80211_IFTYPE_MESH_POINT))
1141 return -1; 1141 return -1;
1142 break; 1142 break;
1143 case __constant_cpu_to_le16(IEEE80211_FCTL_FROMDS): 1143 case __constant_cpu_to_le16(IEEE80211_FCTL_FROMDS):
1144 if (sdata->vif.type != IEEE80211_IF_TYPE_STA || 1144 if (sdata->vif.type != NL80211_IFTYPE_STATION ||
1145 (is_multicast_ether_addr(dst) && 1145 (is_multicast_ether_addr(dst) &&
1146 !compare_ether_addr(src, dev->dev_addr))) 1146 !compare_ether_addr(src, dev->dev_addr)))
1147 return -1; 1147 return -1;
1148 break; 1148 break;
1149 case __constant_cpu_to_le16(0): 1149 case __constant_cpu_to_le16(0):
1150 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 1150 if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
1151 return -1; 1151 return -1;
1152 break; 1152 break;
1153 } 1153 }
@@ -1221,8 +1221,8 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1221 skb = rx->skb; 1221 skb = rx->skb;
1222 xmit_skb = NULL; 1222 xmit_skb = NULL;
1223 1223
1224 if ((sdata->vif.type == IEEE80211_IF_TYPE_AP || 1224 if ((sdata->vif.type == NL80211_IFTYPE_AP ||
1225 sdata->vif.type == IEEE80211_IF_TYPE_VLAN) && 1225 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
1226 !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && 1226 !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
1227 (rx->flags & IEEE80211_RX_RA_MATCH)) { 1227 (rx->flags & IEEE80211_RX_RA_MATCH)) {
1228 if (is_multicast_ether_addr(ehdr->h_dest)) { 1228 if (is_multicast_ether_addr(ehdr->h_dest)) {
@@ -1536,8 +1536,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
1536 * FIXME: revisit this, I'm sure we should handle most 1536 * FIXME: revisit this, I'm sure we should handle most
1537 * of these frames in other modes as well! 1537 * of these frames in other modes as well!
1538 */ 1538 */
1539 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 1539 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
1540 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 1540 sdata->vif.type != NL80211_IFTYPE_ADHOC)
1541 return RX_DROP_MONITOR; 1541 return RX_DROP_MONITOR;
1542 1542
1543 switch (mgmt->u.action.category) { 1543 switch (mgmt->u.action.category) {
@@ -1595,8 +1595,8 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
1595 if (ieee80211_vif_is_mesh(&sdata->vif)) 1595 if (ieee80211_vif_is_mesh(&sdata->vif))
1596 return ieee80211_mesh_rx_mgmt(sdata, rx->skb, rx->status); 1596 return ieee80211_mesh_rx_mgmt(sdata, rx->skb, rx->status);
1597 1597
1598 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 1598 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
1599 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 1599 sdata->vif.type != NL80211_IFTYPE_ADHOC)
1600 return RX_DROP_MONITOR; 1600 return RX_DROP_MONITOR;
1601 1601
1602 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) 1602 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)
@@ -1632,7 +1632,7 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1632 if (!ieee80211_has_protected(hdr->frame_control)) 1632 if (!ieee80211_has_protected(hdr->frame_control))
1633 goto ignore; 1633 goto ignore;
1634 1634
1635 if (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP && keyidx) { 1635 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && keyidx) {
1636 /* 1636 /*
1637 * APs with pairwise keys should never receive Michael MIC 1637 * APs with pairwise keys should never receive Michael MIC
1638 * errors for non-zero keyidx because these are reserved for 1638 * errors for non-zero keyidx because these are reserved for
@@ -1702,7 +1702,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx)
1702 if (!netif_running(sdata->dev)) 1702 if (!netif_running(sdata->dev))
1703 continue; 1703 continue;
1704 1704
1705 if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR || 1705 if (sdata->vif.type != NL80211_IFTYPE_MONITOR ||
1706 !(sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES)) 1706 !(sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES))
1707 continue; 1707 continue;
1708 1708
@@ -1801,7 +1801,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1801 int multicast = is_multicast_ether_addr(hdr->addr1); 1801 int multicast = is_multicast_ether_addr(hdr->addr1);
1802 1802
1803 switch (sdata->vif.type) { 1803 switch (sdata->vif.type) {
1804 case IEEE80211_IF_TYPE_STA: 1804 case NL80211_IFTYPE_STATION:
1805 if (!bssid) 1805 if (!bssid)
1806 return 0; 1806 return 0;
1807 if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { 1807 if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) {
@@ -1816,7 +1816,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1816 rx->flags &= ~IEEE80211_RX_RA_MATCH; 1816 rx->flags &= ~IEEE80211_RX_RA_MATCH;
1817 } 1817 }
1818 break; 1818 break;
1819 case IEEE80211_IF_TYPE_IBSS: 1819 case NL80211_IFTYPE_ADHOC:
1820 if (!bssid) 1820 if (!bssid)
1821 return 0; 1821 return 0;
1822 if (ieee80211_is_beacon(hdr->frame_control)) { 1822 if (ieee80211_is_beacon(hdr->frame_control)) {
@@ -1837,7 +1837,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1837 bssid, hdr->addr2, 1837 bssid, hdr->addr2,
1838 BIT(rx->status->rate_idx)); 1838 BIT(rx->status->rate_idx));
1839 break; 1839 break;
1840 case IEEE80211_IF_TYPE_MESH_POINT: 1840 case NL80211_IFTYPE_MESH_POINT:
1841 if (!multicast && 1841 if (!multicast &&
1842 compare_ether_addr(sdata->dev->dev_addr, 1842 compare_ether_addr(sdata->dev->dev_addr,
1843 hdr->addr1) != 0) { 1843 hdr->addr1) != 0) {
@@ -1847,8 +1847,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1847 rx->flags &= ~IEEE80211_RX_RA_MATCH; 1847 rx->flags &= ~IEEE80211_RX_RA_MATCH;
1848 } 1848 }
1849 break; 1849 break;
1850 case IEEE80211_IF_TYPE_VLAN: 1850 case NL80211_IFTYPE_AP_VLAN:
1851 case IEEE80211_IF_TYPE_AP: 1851 case NL80211_IFTYPE_AP:
1852 if (!bssid) { 1852 if (!bssid) {
1853 if (compare_ether_addr(sdata->dev->dev_addr, 1853 if (compare_ether_addr(sdata->dev->dev_addr,
1854 hdr->addr1)) 1854 hdr->addr1))
@@ -1860,16 +1860,17 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1860 rx->flags &= ~IEEE80211_RX_RA_MATCH; 1860 rx->flags &= ~IEEE80211_RX_RA_MATCH;
1861 } 1861 }
1862 break; 1862 break;
1863 case IEEE80211_IF_TYPE_WDS: 1863 case NL80211_IFTYPE_WDS:
1864 if (bssid || !ieee80211_is_data(hdr->frame_control)) 1864 if (bssid || !ieee80211_is_data(hdr->frame_control))
1865 return 0; 1865 return 0;
1866 if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) 1866 if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2))
1867 return 0; 1867 return 0;
1868 break; 1868 break;
1869 case IEEE80211_IF_TYPE_MNTR: 1869 case NL80211_IFTYPE_MONITOR:
1870 /* take everything */ 1870 /* take everything */
1871 break; 1871 break;
1872 case IEEE80211_IF_TYPE_INVALID: 1872 case NL80211_IFTYPE_UNSPECIFIED:
1873 case __NL80211_IFTYPE_AFTER_LAST:
1873 /* should never get here */ 1874 /* should never get here */
1874 WARN_ON(1); 1875 WARN_ON(1);
1875 break; 1876 break;
@@ -1930,7 +1931,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
1930 if (!netif_running(sdata->dev)) 1931 if (!netif_running(sdata->dev))
1931 continue; 1932 continue;
1932 1933
1933 if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR) 1934 if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
1934 continue; 1935 continue;
1935 1936
1936 bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type); 1937 bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 5e719e7b720b..8e6685e7ae85 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -475,7 +475,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
475 rcu_read_lock(); 475 rcu_read_lock();
476 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 476 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
477 /* Tell AP we're back */ 477 /* Tell AP we're back */
478 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { 478 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
479 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 479 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
480 ieee80211_send_nullfunc(local, sdata, 0); 480 ieee80211_send_nullfunc(local, sdata, 0);
481 netif_tx_wake_all_queues(sdata->dev); 481 netif_tx_wake_all_queues(sdata->dev);
@@ -539,7 +539,7 @@ void ieee80211_scan_work(struct work_struct *work)
539 chan = &sband->channels[local->scan_channel_idx]; 539 chan = &sband->channels[local->scan_channel_idx];
540 540
541 if (chan->flags & IEEE80211_CHAN_DISABLED || 541 if (chan->flags & IEEE80211_CHAN_DISABLED ||
542 (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && 542 (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
543 chan->flags & IEEE80211_CHAN_NO_IBSS)) 543 chan->flags & IEEE80211_CHAN_NO_IBSS))
544 skip = 1; 544 skip = 1;
545 545
@@ -638,7 +638,7 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata,
638 638
639 rcu_read_lock(); 639 rcu_read_lock();
640 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 640 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
641 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { 641 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
642 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 642 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
643 netif_tx_stop_all_queues(sdata->dev); 643 netif_tx_stop_all_queues(sdata->dev);
644 ieee80211_send_nullfunc(local, sdata, 1); 644 ieee80211_send_nullfunc(local, sdata, 1);
@@ -681,7 +681,7 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
681 struct ieee80211_local *local = sdata->local; 681 struct ieee80211_local *local = sdata->local;
682 struct ieee80211_if_sta *ifsta; 682 struct ieee80211_if_sta *ifsta;
683 683
684 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 684 if (sdata->vif.type != NL80211_IFTYPE_STATION)
685 return ieee80211_start_scan(sdata, ssid, ssid_len); 685 return ieee80211_start_scan(sdata, ssid, ssid_len);
686 686
687 /* 687 /*
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 3370b2625633..31246d8e5327 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -319,7 +319,7 @@ int sta_info_insert(struct sta_info *sta)
319 319
320 /* notify driver */ 320 /* notify driver */
321 if (local->ops->sta_notify) { 321 if (local->ops->sta_notify) {
322 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) 322 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
323 sdata = container_of(sdata->bss, 323 sdata = container_of(sdata->bss,
324 struct ieee80211_sub_if_data, 324 struct ieee80211_sub_if_data,
325 u.ap); 325 u.ap);
@@ -456,7 +456,7 @@ static void __sta_info_unlink(struct sta_info **sta)
456 local->num_sta--; 456 local->num_sta--;
457 457
458 if (local->ops->sta_notify) { 458 if (local->ops->sta_notify) {
459 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) 459 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
460 sdata = container_of(sdata->bss, 460 sdata = container_of(sdata->bss,
461 struct ieee80211_sub_if_data, 461 struct ieee80211_sub_if_data,
462 u.ap); 462 u.ap);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index a523189f10c4..f4bcc589d674 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -226,7 +226,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
226 !ieee80211_is_probe_req(hdr->frame_control)) 226 !ieee80211_is_probe_req(hdr->frame_control))
227 return TX_DROP; 227 return TX_DROP;
228 228
229 if (tx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) 229 if (tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
230 return TX_CONTINUE; 230 return TX_CONTINUE;
231 231
232 if (tx->flags & IEEE80211_TX_PS_BUFFERED) 232 if (tx->flags & IEEE80211_TX_PS_BUFFERED)
@@ -236,7 +236,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
236 236
237 if (likely(tx->flags & IEEE80211_TX_UNICAST)) { 237 if (likely(tx->flags & IEEE80211_TX_UNICAST)) {
238 if (unlikely(!(sta_flags & WLAN_STA_ASSOC) && 238 if (unlikely(!(sta_flags & WLAN_STA_ASSOC) &&
239 tx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 239 tx->sdata->vif.type != NL80211_IFTYPE_ADHOC &&
240 ieee80211_is_data(hdr->frame_control))) { 240 ieee80211_is_data(hdr->frame_control))) {
241#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 241#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
242 DECLARE_MAC_BUF(mac); 242 DECLARE_MAC_BUF(mac);
@@ -250,7 +250,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
250 } else { 250 } else {
251 if (unlikely(ieee80211_is_data(hdr->frame_control) && 251 if (unlikely(ieee80211_is_data(hdr->frame_control) &&
252 tx->local->num_sta == 0 && 252 tx->local->num_sta == 0 &&
253 tx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS)) { 253 tx->sdata->vif.type != NL80211_IFTYPE_ADHOC)) {
254 /* 254 /*
255 * No associated STAs - no need to send multicast 255 * No associated STAs - no need to send multicast
256 * frames. 256 * frames.
@@ -281,7 +281,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
281 281
282 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 282 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
283 struct ieee80211_if_ap *ap; 283 struct ieee80211_if_ap *ap;
284 if (sdata->vif.type != IEEE80211_IF_TYPE_AP) 284 if (sdata->vif.type != NL80211_IFTYPE_AP)
285 continue; 285 continue;
286 ap = &sdata->u.ap; 286 ap = &sdata->u.ap;
287 skb = skb_dequeue(&ap->ps_bc_buf); 287 skb = skb_dequeue(&ap->ps_bc_buf);
@@ -979,7 +979,7 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx,
979 979
980 /* process and remove the injection radiotap header */ 980 /* process and remove the injection radiotap header */
981 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 981 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
982 if (unlikely(sdata->vif.type == IEEE80211_IF_TYPE_MNTR)) { 982 if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) {
983 if (__ieee80211_parse_tx_radiotap(tx, skb) == TX_DROP) 983 if (__ieee80211_parse_tx_radiotap(tx, skb) == TX_DROP)
984 return TX_DROP; 984 return TX_DROP;
985 985
@@ -1457,8 +1457,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1457 fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA); 1457 fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA);
1458 1458
1459 switch (sdata->vif.type) { 1459 switch (sdata->vif.type) {
1460 case IEEE80211_IF_TYPE_AP: 1460 case NL80211_IFTYPE_AP:
1461 case IEEE80211_IF_TYPE_VLAN: 1461 case NL80211_IFTYPE_AP_VLAN:
1462 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS); 1462 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
1463 /* DA BSSID SA */ 1463 /* DA BSSID SA */
1464 memcpy(hdr.addr1, skb->data, ETH_ALEN); 1464 memcpy(hdr.addr1, skb->data, ETH_ALEN);
@@ -1466,7 +1466,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1466 memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); 1466 memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
1467 hdrlen = 24; 1467 hdrlen = 24;
1468 break; 1468 break;
1469 case IEEE80211_IF_TYPE_WDS: 1469 case NL80211_IFTYPE_WDS:
1470 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); 1470 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS);
1471 /* RA TA DA SA */ 1471 /* RA TA DA SA */
1472 memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN); 1472 memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN);
@@ -1476,7 +1476,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1476 hdrlen = 30; 1476 hdrlen = 30;
1477 break; 1477 break;
1478#ifdef CONFIG_MAC80211_MESH 1478#ifdef CONFIG_MAC80211_MESH
1479 case IEEE80211_IF_TYPE_MESH_POINT: 1479 case NL80211_IFTYPE_MESH_POINT:
1480 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); 1480 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS);
1481 /* RA TA DA SA */ 1481 /* RA TA DA SA */
1482 memset(hdr.addr1, 0, ETH_ALEN); 1482 memset(hdr.addr1, 0, ETH_ALEN);
@@ -1493,7 +1493,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1493 hdrlen = 30; 1493 hdrlen = 30;
1494 break; 1494 break;
1495#endif 1495#endif
1496 case IEEE80211_IF_TYPE_STA: 1496 case NL80211_IFTYPE_STATION:
1497 fc |= cpu_to_le16(IEEE80211_FCTL_TODS); 1497 fc |= cpu_to_le16(IEEE80211_FCTL_TODS);
1498 /* BSSID SA DA */ 1498 /* BSSID SA DA */
1499 memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN); 1499 memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
@@ -1501,7 +1501,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1501 memcpy(hdr.addr3, skb->data, ETH_ALEN); 1501 memcpy(hdr.addr3, skb->data, ETH_ALEN);
1502 hdrlen = 24; 1502 hdrlen = 24;
1503 break; 1503 break;
1504 case IEEE80211_IF_TYPE_IBSS: 1504 case NL80211_IFTYPE_ADHOC:
1505 /* DA SA BSSID */ 1505 /* DA SA BSSID */
1506 memcpy(hdr.addr1, skb->data, ETH_ALEN); 1506 memcpy(hdr.addr1, skb->data, ETH_ALEN);
1507 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); 1507 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
@@ -1812,7 +1812,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1812 sdata = vif_to_sdata(vif); 1812 sdata = vif_to_sdata(vif);
1813 bdev = sdata->dev; 1813 bdev = sdata->dev;
1814 1814
1815 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 1815 if (sdata->vif.type == NL80211_IFTYPE_AP) {
1816 ap = &sdata->u.ap; 1816 ap = &sdata->u.ap;
1817 beacon = rcu_dereference(ap->beacon); 1817 beacon = rcu_dereference(ap->beacon);
1818 if (ap && beacon) { 1818 if (ap && beacon) {
@@ -1854,7 +1854,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1854 num_beacons = &ap->num_beacons; 1854 num_beacons = &ap->num_beacons;
1855 } else 1855 } else
1856 goto out; 1856 goto out;
1857 } else if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 1857 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
1858 struct ieee80211_hdr *hdr; 1858 struct ieee80211_hdr *hdr;
1859 ifsta = &sdata->u.sta; 1859 ifsta = &sdata->u.sta;
1860 1860
@@ -1999,7 +1999,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
1999 rcu_read_lock(); 1999 rcu_read_lock();
2000 beacon = rcu_dereference(bss->beacon); 2000 beacon = rcu_dereference(bss->beacon);
2001 2001
2002 if (sdata->vif.type != IEEE80211_IF_TYPE_AP || !beacon || !beacon->head) 2002 if (sdata->vif.type != NL80211_IFTYPE_AP || !beacon || !beacon->head)
2003 goto out; 2003 goto out;
2004 2004
2005 if (bss->dtim_count != 0) 2005 if (bss->dtim_count != 0)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index d6aca91e612d..6eb222369bcb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -43,7 +43,7 @@ const unsigned char bridge_tunnel_header[] __aligned(2) =
43 43
44 44
45u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, 45u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
46 enum ieee80211_if_types type) 46 enum nl80211_iftype type)
47{ 47{
48 __le16 fc = hdr->frame_control; 48 __le16 fc = hdr->frame_control;
49 49
@@ -77,10 +77,10 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
77 77
78 if (ieee80211_is_back_req(fc)) { 78 if (ieee80211_is_back_req(fc)) {
79 switch (type) { 79 switch (type) {
80 case IEEE80211_IF_TYPE_STA: 80 case NL80211_IFTYPE_STATION:
81 return hdr->addr2; 81 return hdr->addr2;
82 case IEEE80211_IF_TYPE_AP: 82 case NL80211_IFTYPE_AP:
83 case IEEE80211_IF_TYPE_VLAN: 83 case NL80211_IFTYPE_AP_VLAN:
84 return hdr->addr1; 84 return hdr->addr1;
85 default: 85 default:
86 break; /* fall through to the return */ 86 break; /* fall through to the return */
@@ -376,15 +376,16 @@ void ieee80211_iterate_active_interfaces(
376 376
377 list_for_each_entry(sdata, &local->interfaces, list) { 377 list_for_each_entry(sdata, &local->interfaces, list) {
378 switch (sdata->vif.type) { 378 switch (sdata->vif.type) {
379 case IEEE80211_IF_TYPE_INVALID: 379 case __NL80211_IFTYPE_AFTER_LAST:
380 case IEEE80211_IF_TYPE_MNTR: 380 case NL80211_IFTYPE_UNSPECIFIED:
381 case IEEE80211_IF_TYPE_VLAN: 381 case NL80211_IFTYPE_MONITOR:
382 case NL80211_IFTYPE_AP_VLAN:
382 continue; 383 continue;
383 case IEEE80211_IF_TYPE_AP: 384 case NL80211_IFTYPE_AP:
384 case IEEE80211_IF_TYPE_STA: 385 case NL80211_IFTYPE_STATION:
385 case IEEE80211_IF_TYPE_IBSS: 386 case NL80211_IFTYPE_ADHOC:
386 case IEEE80211_IF_TYPE_WDS: 387 case NL80211_IFTYPE_WDS:
387 case IEEE80211_IF_TYPE_MESH_POINT: 388 case NL80211_IFTYPE_MESH_POINT:
388 break; 389 break;
389 } 390 }
390 if (netif_running(sdata->dev)) 391 if (netif_running(sdata->dev))
@@ -409,15 +410,16 @@ void ieee80211_iterate_active_interfaces_atomic(
409 410
410 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 411 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
411 switch (sdata->vif.type) { 412 switch (sdata->vif.type) {
412 case IEEE80211_IF_TYPE_INVALID: 413 case __NL80211_IFTYPE_AFTER_LAST:
413 case IEEE80211_IF_TYPE_MNTR: 414 case NL80211_IFTYPE_UNSPECIFIED:
414 case IEEE80211_IF_TYPE_VLAN: 415 case NL80211_IFTYPE_MONITOR:
416 case NL80211_IFTYPE_AP_VLAN:
415 continue; 417 continue;
416 case IEEE80211_IF_TYPE_AP: 418 case NL80211_IFTYPE_AP:
417 case IEEE80211_IF_TYPE_STA: 419 case NL80211_IFTYPE_STATION:
418 case IEEE80211_IF_TYPE_IBSS: 420 case NL80211_IFTYPE_ADHOC:
419 case IEEE80211_IF_TYPE_WDS: 421 case NL80211_IFTYPE_WDS:
420 case IEEE80211_IF_TYPE_MESH_POINT: 422 case NL80211_IFTYPE_MESH_POINT:
421 break; 423 break;
422 } 424 }
423 if (netif_running(sdata->dev)) 425 if (netif_running(sdata->dev))
@@ -622,7 +624,7 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz)
622 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); 624 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
623 625
624 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { 626 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
625 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && 627 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
626 chan->flags & IEEE80211_CHAN_NO_IBSS) { 628 chan->flags & IEEE80211_CHAN_NO_IBSS) {
627 printk(KERN_DEBUG "%s: IBSS not allowed on frequency " 629 printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
628 "%d MHz\n", sdata->dev->name, chan->center_freq); 630 "%d MHz\n", sdata->dev->name, chan->center_freq);
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 77b68ed8b832..aef9707700fd 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -122,8 +122,8 @@ static int ieee80211_ioctl_siwgenie(struct net_device *dev,
122 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) 122 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)
123 return -EOPNOTSUPP; 123 return -EOPNOTSUPP;
124 124
125 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 125 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
126 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 126 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
127 int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length); 127 int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length);
128 if (ret) 128 if (ret)
129 return ret; 129 return ret;
@@ -273,21 +273,21 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
273 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 273 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
274 int type; 274 int type;
275 275
276 if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) 276 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
277 return -EOPNOTSUPP; 277 return -EOPNOTSUPP;
278 278
279 switch (*mode) { 279 switch (*mode) {
280 case IW_MODE_INFRA: 280 case IW_MODE_INFRA:
281 type = IEEE80211_IF_TYPE_STA; 281 type = NL80211_IFTYPE_STATION;
282 break; 282 break;
283 case IW_MODE_ADHOC: 283 case IW_MODE_ADHOC:
284 type = IEEE80211_IF_TYPE_IBSS; 284 type = NL80211_IFTYPE_ADHOC;
285 break; 285 break;
286 case IW_MODE_REPEAT: 286 case IW_MODE_REPEAT:
287 type = IEEE80211_IF_TYPE_WDS; 287 type = NL80211_IFTYPE_WDS;
288 break; 288 break;
289 case IW_MODE_MONITOR: 289 case IW_MODE_MONITOR:
290 type = IEEE80211_IF_TYPE_MNTR; 290 type = NL80211_IFTYPE_MONITOR;
291 break; 291 break;
292 default: 292 default:
293 return -EINVAL; 293 return -EINVAL;
@@ -305,22 +305,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev,
305 305
306 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 306 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
307 switch (sdata->vif.type) { 307 switch (sdata->vif.type) {
308 case IEEE80211_IF_TYPE_AP: 308 case NL80211_IFTYPE_AP:
309 *mode = IW_MODE_MASTER; 309 *mode = IW_MODE_MASTER;
310 break; 310 break;
311 case IEEE80211_IF_TYPE_STA: 311 case NL80211_IFTYPE_STATION:
312 *mode = IW_MODE_INFRA; 312 *mode = IW_MODE_INFRA;
313 break; 313 break;
314 case IEEE80211_IF_TYPE_IBSS: 314 case NL80211_IFTYPE_ADHOC:
315 *mode = IW_MODE_ADHOC; 315 *mode = IW_MODE_ADHOC;
316 break; 316 break;
317 case IEEE80211_IF_TYPE_MNTR: 317 case NL80211_IFTYPE_MONITOR:
318 *mode = IW_MODE_MONITOR; 318 *mode = IW_MODE_MONITOR;
319 break; 319 break;
320 case IEEE80211_IF_TYPE_WDS: 320 case NL80211_IFTYPE_WDS:
321 *mode = IW_MODE_REPEAT; 321 *mode = IW_MODE_REPEAT;
322 break; 322 break;
323 case IEEE80211_IF_TYPE_VLAN: 323 case NL80211_IFTYPE_AP_VLAN:
324 *mode = IW_MODE_SECOND; /* FIXME */ 324 *mode = IW_MODE_SECOND; /* FIXME */
325 break; 325 break;
326 default: 326 default:
@@ -336,13 +336,13 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
336{ 336{
337 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 337 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
338 338
339 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) 339 if (sdata->vif.type == NL80211_IFTYPE_STATION)
340 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL; 340 sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL;
341 341
342 /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */ 342 /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
343 if (freq->e == 0) { 343 if (freq->e == 0) {
344 if (freq->m < 0) { 344 if (freq->m < 0) {
345 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) 345 if (sdata->vif.type == NL80211_IFTYPE_STATION)
346 sdata->u.sta.flags |= 346 sdata->u.sta.flags |=
347 IEEE80211_STA_AUTO_CHANNEL_SEL; 347 IEEE80211_STA_AUTO_CHANNEL_SEL;
348 return 0; 348 return 0;
@@ -386,8 +386,8 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
386 len--; 386 len--;
387 387
388 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 388 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
389 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 389 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
390 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 390 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
391 int ret; 391 int ret;
392 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { 392 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
393 if (len > IEEE80211_MAX_SSID_LEN) 393 if (len > IEEE80211_MAX_SSID_LEN)
@@ -407,7 +407,7 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
407 return 0; 407 return 0;
408 } 408 }
409 409
410 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 410 if (sdata->vif.type == NL80211_IFTYPE_AP) {
411 memcpy(sdata->u.ap.ssid, ssid, len); 411 memcpy(sdata->u.ap.ssid, ssid, len);
412 memset(sdata->u.ap.ssid + len, 0, 412 memset(sdata->u.ap.ssid + len, 0,
413 IEEE80211_MAX_SSID_LEN - len); 413 IEEE80211_MAX_SSID_LEN - len);
@@ -426,8 +426,8 @@ static int ieee80211_ioctl_giwessid(struct net_device *dev,
426 426
427 struct ieee80211_sub_if_data *sdata; 427 struct ieee80211_sub_if_data *sdata;
428 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 428 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
429 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 429 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
430 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 430 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
431 int res = ieee80211_sta_get_ssid(sdata, ssid, &len); 431 int res = ieee80211_sta_get_ssid(sdata, ssid, &len);
432 if (res == 0) { 432 if (res == 0) {
433 data->length = len; 433 data->length = len;
@@ -437,7 +437,7 @@ static int ieee80211_ioctl_giwessid(struct net_device *dev,
437 return res; 437 return res;
438 } 438 }
439 439
440 if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 440 if (sdata->vif.type == NL80211_IFTYPE_AP) {
441 len = sdata->u.ap.ssid_len; 441 len = sdata->u.ap.ssid_len;
442 if (len > IW_ESSID_MAX_SIZE) 442 if (len > IW_ESSID_MAX_SIZE)
443 len = IW_ESSID_MAX_SIZE; 443 len = IW_ESSID_MAX_SIZE;
@@ -457,8 +457,8 @@ static int ieee80211_ioctl_siwap(struct net_device *dev,
457 struct ieee80211_sub_if_data *sdata; 457 struct ieee80211_sub_if_data *sdata;
458 458
459 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 459 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
460 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 460 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
461 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 461 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
462 int ret; 462 int ret;
463 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { 463 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
464 memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data, 464 memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data,
@@ -477,7 +477,7 @@ static int ieee80211_ioctl_siwap(struct net_device *dev,
477 return ret; 477 return ret;
478 ieee80211_sta_req_auth(sdata, &sdata->u.sta); 478 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
479 return 0; 479 return 0;
480 } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { 480 } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
481 /* 481 /*
482 * If it is necessary to update the WDS peer address 482 * If it is necessary to update the WDS peer address
483 * while the interface is running, then we need to do 483 * while the interface is running, then we need to do
@@ -505,8 +505,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
505 struct ieee80211_sub_if_data *sdata; 505 struct ieee80211_sub_if_data *sdata;
506 506
507 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 507 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
508 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 508 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
509 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 509 sdata->vif.type == NL80211_IFTYPE_ADHOC) {
510 if (sdata->u.sta.state == IEEE80211_STA_MLME_ASSOCIATED || 510 if (sdata->u.sta.state == IEEE80211_STA_MLME_ASSOCIATED ||
511 sdata->u.sta.state == IEEE80211_STA_MLME_IBSS_JOINED) { 511 sdata->u.sta.state == IEEE80211_STA_MLME_IBSS_JOINED) {
512 ap_addr->sa_family = ARPHRD_ETHER; 512 ap_addr->sa_family = ARPHRD_ETHER;
@@ -516,7 +516,7 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
516 memset(&ap_addr->sa_data, 0, ETH_ALEN); 516 memset(&ap_addr->sa_data, 0, ETH_ALEN);
517 return 0; 517 return 0;
518 } 518 }
519 } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { 519 } else if (sdata->vif.type == NL80211_IFTYPE_WDS) {
520 ap_addr->sa_family = ARPHRD_ETHER; 520 ap_addr->sa_family = ARPHRD_ETHER;
521 memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); 521 memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
522 return 0; 522 return 0;
@@ -538,10 +538,10 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
538 if (!netif_running(dev)) 538 if (!netif_running(dev))
539 return -ENETDOWN; 539 return -ENETDOWN;
540 540
541 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 541 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
542 sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 542 sdata->vif.type != NL80211_IFTYPE_ADHOC &&
543 sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT && 543 sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
544 sdata->vif.type != IEEE80211_IF_TYPE_AP) 544 sdata->vif.type != NL80211_IFTYPE_AP)
545 return -EOPNOTSUPP; 545 return -EOPNOTSUPP;
546 546
547 /* if SSID was specified explicitly then use that */ 547 /* if SSID was specified explicitly then use that */
@@ -627,7 +627,7 @@ static int ieee80211_ioctl_giwrate(struct net_device *dev,
627 627
628 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 628 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
629 629
630 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 630 if (sdata->vif.type != NL80211_IFTYPE_STATION)
631 return -EOPNOTSUPP; 631 return -EOPNOTSUPP;
632 632
633 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 633 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
@@ -858,8 +858,8 @@ static int ieee80211_ioctl_siwmlme(struct net_device *dev,
858 struct iw_mlme *mlme = (struct iw_mlme *) extra; 858 struct iw_mlme *mlme = (struct iw_mlme *) extra;
859 859
860 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 860 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
861 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 861 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
862 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 862 sdata->vif.type != NL80211_IFTYPE_ADHOC)
863 return -EINVAL; 863 return -EINVAL;
864 864
865 switch (mlme->cmd) { 865 switch (mlme->cmd) {
@@ -954,7 +954,7 @@ static int ieee80211_ioctl_giwencode(struct net_device *dev,
954 erq->length = sdata->keys[idx]->conf.keylen; 954 erq->length = sdata->keys[idx]->conf.keylen;
955 erq->flags |= IW_ENCODE_ENABLED; 955 erq->flags |= IW_ENCODE_ENABLED;
956 956
957 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { 957 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
958 struct ieee80211_if_sta *ifsta = &sdata->u.sta; 958 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
959 switch (ifsta->auth_alg) { 959 switch (ifsta->auth_alg) {
960 case WLAN_AUTH_OPEN: 960 case WLAN_AUTH_OPEN:
@@ -1028,7 +1028,7 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
1028 sdata->drop_unencrypted = !!data->value; 1028 sdata->drop_unencrypted = !!data->value;
1029 break; 1029 break;
1030 case IW_AUTH_PRIVACY_INVOKED: 1030 case IW_AUTH_PRIVACY_INVOKED:
1031 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 1031 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1032 ret = -EINVAL; 1032 ret = -EINVAL;
1033 else { 1033 else {
1034 sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; 1034 sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
@@ -1043,8 +1043,8 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
1043 } 1043 }
1044 break; 1044 break;
1045 case IW_AUTH_80211_AUTH_ALG: 1045 case IW_AUTH_80211_AUTH_ALG:
1046 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 1046 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1047 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) 1047 sdata->vif.type == NL80211_IFTYPE_ADHOC)
1048 sdata->u.sta.auth_algs = data->value; 1048 sdata->u.sta.auth_algs = data->value;
1049 else 1049 else
1050 ret = -EOPNOTSUPP; 1050 ret = -EOPNOTSUPP;
@@ -1066,8 +1066,8 @@ static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev
1066 1066
1067 rcu_read_lock(); 1067 rcu_read_lock();
1068 1068
1069 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 1069 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1070 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) 1070 sdata->vif.type == NL80211_IFTYPE_ADHOC)
1071 sta = sta_info_get(local, sdata->u.sta.bssid); 1071 sta = sta_info_get(local, sdata->u.sta.bssid);
1072 if (!sta) { 1072 if (!sta) {
1073 wstats->discard.fragment = 0; 1073 wstats->discard.fragment = 0;
@@ -1097,8 +1097,8 @@ static int ieee80211_ioctl_giwauth(struct net_device *dev,
1097 1097
1098 switch (data->flags & IW_AUTH_INDEX) { 1098 switch (data->flags & IW_AUTH_INDEX) {
1099 case IW_AUTH_80211_AUTH_ALG: 1099 case IW_AUTH_80211_AUTH_ALG:
1100 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 1100 if (sdata->vif.type == NL80211_IFTYPE_STATION ||
1101 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) 1101 sdata->vif.type == NL80211_IFTYPE_ADHOC)
1102 data->value = sdata->u.sta.auth_algs; 1102 data->value = sdata->u.sta.auth_algs;
1103 else 1103 else
1104 ret = -EOPNOTSUPP; 1104 ret = -EOPNOTSUPP;