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

mac80211: use nl80211 interface types

There's really no reason for mac80211 to be using its
own interface type defines. Use the nl80211 types and
simplify the configuration code a bit: there's no need
to translate them any more now.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
05c914fe 96dd22ac

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