Commit 05c914fe authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 96dd22ac
...@@ -765,11 +765,11 @@ static void adm8211_update_mode(struct ieee80211_hw *dev) ...@@ -765,11 +765,11 @@ static void adm8211_update_mode(struct ieee80211_hw *dev)
priv->soft_rx_crc = 0; priv->soft_rx_crc = 0;
switch (priv->mode) { switch (priv->mode) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
priv->nar &= ~(ADM8211_NAR_PR | ADM8211_NAR_EA); priv->nar &= ~(ADM8211_NAR_PR | ADM8211_NAR_EA);
priv->nar |= ADM8211_NAR_ST | ADM8211_NAR_SR; priv->nar |= ADM8211_NAR_ST | ADM8211_NAR_SR;
break; break;
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
priv->nar &= ~ADM8211_NAR_PR; priv->nar &= ~ADM8211_NAR_PR;
priv->nar |= ADM8211_NAR_EA | ADM8211_NAR_ST | ADM8211_NAR_SR; priv->nar |= ADM8211_NAR_EA | ADM8211_NAR_ST | ADM8211_NAR_SR;
...@@ -777,7 +777,7 @@ static void adm8211_update_mode(struct ieee80211_hw *dev) ...@@ -777,7 +777,7 @@ static void adm8211_update_mode(struct ieee80211_hw *dev)
if (priv->pdev->revision >= ADM8211_REV_BA) if (priv->pdev->revision >= ADM8211_REV_BA)
priv->soft_rx_crc = 1; priv->soft_rx_crc = 1;
break; break;
case IEEE80211_IF_TYPE_MNTR: case NL80211_IFTYPE_MONITOR:
priv->nar &= ~(ADM8211_NAR_EA | ADM8211_NAR_ST); priv->nar &= ~(ADM8211_NAR_EA | ADM8211_NAR_ST);
priv->nar |= ADM8211_NAR_PR | ADM8211_NAR_SR; priv->nar |= ADM8211_NAR_PR | ADM8211_NAR_SR;
break; break;
...@@ -1410,11 +1410,11 @@ static int adm8211_add_interface(struct ieee80211_hw *dev, ...@@ -1410,11 +1410,11 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
struct ieee80211_if_init_conf *conf) struct ieee80211_if_init_conf *conf)
{ {
struct adm8211_priv *priv = dev->priv; struct adm8211_priv *priv = dev->priv;
if (priv->mode != IEEE80211_IF_TYPE_MNTR) if (priv->mode != NL80211_IFTYPE_MONITOR)
return -EOPNOTSUPP; return -EOPNOTSUPP;
switch (conf->type) { switch (conf->type) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
priv->mode = conf->type; priv->mode = conf->type;
break; break;
default: default:
...@@ -1437,7 +1437,7 @@ static void adm8211_remove_interface(struct ieee80211_hw *dev, ...@@ -1437,7 +1437,7 @@ static void adm8211_remove_interface(struct ieee80211_hw *dev,
struct ieee80211_if_init_conf *conf) struct ieee80211_if_init_conf *conf)
{ {
struct adm8211_priv *priv = dev->priv; struct adm8211_priv *priv = dev->priv;
priv->mode = IEEE80211_IF_TYPE_MNTR; priv->mode = NL80211_IFTYPE_MONITOR;
} }
static int adm8211_init_rings(struct ieee80211_hw *dev) static int adm8211_init_rings(struct ieee80211_hw *dev)
...@@ -1556,7 +1556,7 @@ static int adm8211_start(struct ieee80211_hw *dev) ...@@ -1556,7 +1556,7 @@ static int adm8211_start(struct ieee80211_hw *dev)
ADM8211_CSR_WRITE(IER, ADM8211_IER_NIE | ADM8211_IER_AIE | ADM8211_CSR_WRITE(IER, ADM8211_IER_NIE | ADM8211_IER_AIE |
ADM8211_IER_RCIE | ADM8211_IER_TCIE | ADM8211_IER_RCIE | ADM8211_IER_TCIE |
ADM8211_IER_TDUIE | ADM8211_IER_GPTIE); ADM8211_IER_TDUIE | ADM8211_IER_GPTIE);
priv->mode = IEEE80211_IF_TYPE_MNTR; priv->mode = NL80211_IFTYPE_MONITOR;
adm8211_update_mode(dev); adm8211_update_mode(dev);
ADM8211_CSR_WRITE(RDR, 0); ADM8211_CSR_WRITE(RDR, 0);
...@@ -1571,7 +1571,7 @@ static void adm8211_stop(struct ieee80211_hw *dev) ...@@ -1571,7 +1571,7 @@ static void adm8211_stop(struct ieee80211_hw *dev)
{ {
struct adm8211_priv *priv = dev->priv; struct adm8211_priv *priv = dev->priv;
priv->mode = IEEE80211_IF_TYPE_INVALID; priv->mode = NL80211_IFTYPE_UNSPECIFIED;
priv->nar = 0; priv->nar = 0;
ADM8211_CSR_WRITE(NAR, 0); ADM8211_CSR_WRITE(NAR, 0);
ADM8211_CSR_WRITE(IER, 0); ADM8211_CSR_WRITE(IER, 0);
...@@ -1896,7 +1896,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev, ...@@ -1896,7 +1896,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
priv->tx_power = 0x40; priv->tx_power = 0x40;
priv->lpf_cutoff = 0xFF; priv->lpf_cutoff = 0xFF;
priv->lnags_threshold = 0xFF; priv->lnags_threshold = 0xFF;
priv->mode = IEEE80211_IF_TYPE_INVALID; priv->mode = NL80211_IFTYPE_UNSPECIFIED;
/* Power-on issue. EEPROM won't read correctly without */ /* Power-on issue. EEPROM won't read correctly without */
if (pdev->revision >= ADM8211_REV_BA) { if (pdev->revision >= ADM8211_REV_BA) {
...@@ -1986,7 +1986,7 @@ static int adm8211_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -1986,7 +1986,7 @@ static int adm8211_suspend(struct pci_dev *pdev, pm_message_t state)
struct ieee80211_hw *dev = pci_get_drvdata(pdev); struct ieee80211_hw *dev = pci_get_drvdata(pdev);
struct adm8211_priv *priv = dev->priv; struct adm8211_priv *priv = dev->priv;
if (priv->mode != IEEE80211_IF_TYPE_INVALID) { if (priv->mode != NL80211_IFTYPE_UNSPECIFIED) {
ieee80211_stop_queues(dev); ieee80211_stop_queues(dev);
adm8211_stop(dev); adm8211_stop(dev);
} }
...@@ -2004,7 +2004,7 @@ static int adm8211_resume(struct pci_dev *pdev) ...@@ -2004,7 +2004,7 @@ static int adm8211_resume(struct pci_dev *pdev)
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev); pci_restore_state(pdev);
if (priv->mode != IEEE80211_IF_TYPE_INVALID) { if (priv->mode != NL80211_IFTYPE_UNSPECIFIED) {
adm8211_start(dev); adm8211_start(dev);
ieee80211_wake_queues(dev); ieee80211_wake_queues(dev);
} }
......
...@@ -1008,7 +1008,7 @@ struct ath5k_hw { ...@@ -1008,7 +1008,7 @@ struct ath5k_hw {
enum ath5k_int ah_imr; enum ath5k_int ah_imr;
enum ieee80211_if_types ah_op_mode; enum nl80211_iftype ah_op_mode;
enum ath5k_power_mode ah_power_mode; enum ath5k_power_mode ah_power_mode;
struct ieee80211_channel ah_current_channel; struct ieee80211_channel ah_current_channel;
bool ah_turbo; bool ah_turbo;
...@@ -1117,7 +1117,7 @@ extern void ath5k_hw_detach(struct ath5k_hw *ah); ...@@ -1117,7 +1117,7 @@ extern void ath5k_hw_detach(struct ath5k_hw *ah);
/* Reset Functions */ /* Reset Functions */
extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial); extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial);
extern int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, struct ieee80211_channel *channel, bool change_channel); extern int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, struct ieee80211_channel *channel, bool change_channel);
/* Power management functions */ /* Power management functions */
extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration); extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration);
......
...@@ -124,7 +124,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) ...@@ -124,7 +124,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
/* /*
* HW information * HW information
*/ */
ah->ah_op_mode = IEEE80211_IF_TYPE_STA; ah->ah_op_mode = NL80211_IFTYPE_STATION;
ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT; ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT;
ah->ah_turbo = false; ah->ah_turbo = false;
ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
......
...@@ -507,7 +507,7 @@ ath5k_pci_probe(struct pci_dev *pdev, ...@@ -507,7 +507,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
sc->iobase = mem; /* So we can unmap it on detach */ sc->iobase = mem; /* So we can unmap it on detach */
sc->cachelsz = csz * sizeof(u32); /* convert to bytes */ sc->cachelsz = csz * sizeof(u32); /* convert to bytes */
sc->opmode = IEEE80211_IF_TYPE_STA; sc->opmode = NL80211_IFTYPE_STATION;
mutex_init(&sc->lock); mutex_init(&sc->lock);
spin_lock_init(&sc->rxbuflock); spin_lock_init(&sc->rxbuflock);
spin_lock_init(&sc->txbuflock); spin_lock_init(&sc->txbuflock);
...@@ -1377,8 +1377,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc) ...@@ -1377,8 +1377,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi); ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
if (ret) if (ret)
return ret; return ret;
if (sc->opmode == IEEE80211_IF_TYPE_AP || if (sc->opmode == NL80211_IFTYPE_AP ||
sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) { sc->opmode == NL80211_IFTYPE_MESH_POINT) {
/* /*
* Always burst out beacon and CAB traffic * Always burst out beacon and CAB traffic
* (aifs = cwmin = cwmax = 0) * (aifs = cwmin = cwmax = 0)
...@@ -1386,7 +1386,7 @@ ath5k_beaconq_config(struct ath5k_softc *sc) ...@@ -1386,7 +1386,7 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
qi.tqi_aifs = 0; qi.tqi_aifs = 0;
qi.tqi_cw_min = 0; qi.tqi_cw_min = 0;
qi.tqi_cw_max = 0; qi.tqi_cw_max = 0;
} else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
/* /*
* Adhoc mode; backoff between 0 and (2 * cw_min). * Adhoc mode; backoff between 0 and (2 * cw_min).
*/ */
...@@ -1714,7 +1714,7 @@ ath5k_tasklet_rx(unsigned long data) ...@@ -1714,7 +1714,7 @@ ath5k_tasklet_rx(unsigned long data)
/* let crypto-error packets fall through in MNTR */ /* let crypto-error packets fall through in MNTR */
if ((rs.rs_status & if ((rs.rs_status &
~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) ||
sc->opmode != IEEE80211_IF_TYPE_MNTR) sc->opmode != NL80211_IFTYPE_MONITOR)
goto next; goto next;
} }
accept: accept:
...@@ -1777,7 +1777,7 @@ accept: ...@@ -1777,7 +1777,7 @@ accept:
ath5k_debug_dump_skb(sc, skb, "RX ", 0); ath5k_debug_dump_skb(sc, skb, "RX ", 0);
/* check beacons in IBSS mode */ /* check beacons in IBSS mode */
if (sc->opmode == IEEE80211_IF_TYPE_IBSS) if (sc->opmode == NL80211_IFTYPE_ADHOC)
ath5k_check_ibss_tsf(sc, skb, &rxs); ath5k_check_ibss_tsf(sc, skb, &rxs);
__ieee80211_rx(sc->hw, skb, &rxs); __ieee80211_rx(sc->hw, skb, &rxs);
...@@ -1892,7 +1892,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf) ...@@ -1892,7 +1892,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
ds = bf->desc; ds = bf->desc;
flags = AR5K_TXDESC_NOACK; flags = AR5K_TXDESC_NOACK;
if (sc->opmode == IEEE80211_IF_TYPE_IBSS && ath5k_hw_hasveol(ah)) { if (sc->opmode == NL80211_IFTYPE_ADHOC && ath5k_hw_hasveol(ah)) {
ds->ds_link = bf->daddr; /* self-linked */ ds->ds_link = bf->daddr; /* self-linked */
flags |= AR5K_TXDESC_VEOL; flags |= AR5K_TXDESC_VEOL;
/* /*
...@@ -1941,8 +1941,8 @@ ath5k_beacon_send(struct ath5k_softc *sc) ...@@ -1941,8 +1941,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n"); ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n");
if (unlikely(bf->skb == NULL || sc->opmode == IEEE80211_IF_TYPE_STA || if (unlikely(bf->skb == NULL || sc->opmode == NL80211_IFTYPE_STATION ||
sc->opmode == IEEE80211_IF_TYPE_MNTR)) { sc->opmode == NL80211_IFTYPE_MONITOR)) {
ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL); ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL);
return; return;
} }
...@@ -2116,9 +2116,9 @@ ath5k_beacon_config(struct ath5k_softc *sc) ...@@ -2116,9 +2116,9 @@ ath5k_beacon_config(struct ath5k_softc *sc)
sc->bmisscount = 0; sc->bmisscount = 0;
sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
if (sc->opmode == IEEE80211_IF_TYPE_STA) { if (sc->opmode == NL80211_IFTYPE_STATION) {
sc->imask |= AR5K_INT_BMISS; sc->imask |= AR5K_INT_BMISS;
} else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
/* /*
* In IBSS mode we use a self-linked tx descriptor and let the * In IBSS mode we use a self-linked tx descriptor and let the
* hardware send the beacons automatically. We have to load it * hardware send the beacons automatically. We have to load it
...@@ -2323,7 +2323,7 @@ ath5k_intr(int irq, void *dev_id) ...@@ -2323,7 +2323,7 @@ ath5k_intr(int irq, void *dev_id)
* transmission time) in order to detect wether * transmission time) in order to detect wether
* automatic TSF updates happened. * automatic TSF updates happened.
*/ */
if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { if (sc->opmode == NL80211_IFTYPE_ADHOC) {
/* XXX: only if VEOL suppported */ /* XXX: only if VEOL suppported */
u64 tsf = ath5k_hw_get_tsf64(ah); u64 tsf = ath5k_hw_get_tsf64(ah);
sc->nexttbtt += sc->bintval; sc->nexttbtt += sc->bintval;
...@@ -2553,7 +2553,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -2553,7 +2553,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
ath5k_debug_dump_skb(sc, skb, "TX ", 1); ath5k_debug_dump_skb(sc, skb, "TX ", 1);
if (sc->opmode == IEEE80211_IF_TYPE_MNTR) if (sc->opmode == NL80211_IFTYPE_MONITOR)
ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n"); ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n");
/* /*
...@@ -2688,9 +2688,9 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, ...@@ -2688,9 +2688,9 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
sc->vif = conf->vif; sc->vif = conf->vif;
switch (conf->type) { switch (conf->type) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
case IEEE80211_IF_TYPE_MNTR: case NL80211_IFTYPE_MONITOR:
sc->opmode = conf->type; sc->opmode = conf->type;
break; break;
default: default:
...@@ -2761,7 +2761,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -2761,7 +2761,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
} }
if (conf->changed & IEEE80211_IFCC_BEACON && if (conf->changed & IEEE80211_IFCC_BEACON &&
vif->type == IEEE80211_IF_TYPE_IBSS) { vif->type == NL80211_IFTYPE_ADHOC) {
struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
if (!beacon) { if (!beacon) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -2880,17 +2880,17 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, ...@@ -2880,17 +2880,17 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
/* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */
if (sc->opmode == IEEE80211_IF_TYPE_MNTR) if (sc->opmode == NL80211_IFTYPE_MONITOR)
rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
if (sc->opmode != IEEE80211_IF_TYPE_STA) if (sc->opmode != NL80211_IFTYPE_STATION)
rfilt |= AR5K_RX_FILTER_PROBEREQ; rfilt |= AR5K_RX_FILTER_PROBEREQ;
if (sc->opmode != IEEE80211_IF_TYPE_AP && if (sc->opmode != NL80211_IFTYPE_AP &&
sc->opmode != IEEE80211_IF_TYPE_MESH_POINT && sc->opmode != NL80211_IFTYPE_MESH_POINT &&
test_bit(ATH_STAT_PROMISC, sc->status)) test_bit(ATH_STAT_PROMISC, sc->status))
rfilt |= AR5K_RX_FILTER_PROM; rfilt |= AR5K_RX_FILTER_PROM;
if (sc->opmode == IEEE80211_IF_TYPE_STA || if (sc->opmode == NL80211_IFTYPE_STATION ||
sc->opmode == IEEE80211_IF_TYPE_IBSS) { sc->opmode == NL80211_IFTYPE_ADHOC) {
rfilt |= AR5K_RX_FILTER_BEACON; rfilt |= AR5K_RX_FILTER_BEACON;
} }
...@@ -2995,7 +2995,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw) ...@@ -2995,7 +2995,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw)
* in IBSS mode we need to update the beacon timers too. * in IBSS mode we need to update the beacon timers too.
* this will also reset the TSF if we call it with 0 * this will also reset the TSF if we call it with 0
*/ */
if (sc->opmode == IEEE80211_IF_TYPE_IBSS) if (sc->opmode == NL80211_IFTYPE_ADHOC)
ath5k_beacon_update_timers(sc, 0); ath5k_beacon_update_timers(sc, 0);
else else
ath5k_hw_reset_tsf(sc->ah); ath5k_hw_reset_tsf(sc->ah);
...@@ -3010,7 +3010,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -3010,7 +3010,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
ath5k_debug_dump_skb(sc, skb, "BC ", 1); ath5k_debug_dump_skb(sc, skb, "BC ", 1);
if (sc->opmode != IEEE80211_IF_TYPE_IBSS) { if (sc->opmode != NL80211_IFTYPE_ADHOC) {
ret = -EIO; ret = -EIO;
goto end; goto end;
} }
......
...@@ -113,7 +113,7 @@ struct ath5k_softc { ...@@ -113,7 +113,7 @@ struct ath5k_softc {
struct ieee80211_channel channels[ATH_CHAN_MAX]; struct ieee80211_channel channels[ATH_CHAN_MAX];
struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
enum ieee80211_if_types opmode; enum nl80211_iftype opmode;
struct ath5k_hw *ah; /* Atheros HW */ struct ath5k_hw *ah; /* Atheros HW */
struct ieee80211_supported_band *curband; struct ieee80211_supported_band *curband;
......
...@@ -52,26 +52,26 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah) ...@@ -52,26 +52,26 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
ATH5K_TRACE(ah->ah_sc); ATH5K_TRACE(ah->ah_sc);
switch (ah->ah_op_mode) { switch (ah->ah_op_mode) {
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA | pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA |
(ah->ah_version == AR5K_AR5210 ? (ah->ah_version == AR5K_AR5210 ?
AR5K_STA_ID1_NO_PSPOLL : 0); AR5K_STA_ID1_NO_PSPOLL : 0);
beacon_reg |= AR5K_BCR_ADHOC; beacon_reg |= AR5K_BCR_ADHOC;
break; break;
case IEEE80211_IF_TYPE_AP: case NL80211_IFTYPE_AP:
case IEEE80211_IF_TYPE_MESH_POINT: case NL80211_IFTYPE_MESH_POINT:
pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA | pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
(ah->ah_version == AR5K_AR5210 ? (ah->ah_version == AR5K_AR5210 ?
AR5K_STA_ID1_NO_PSPOLL : 0); AR5K_STA_ID1_NO_PSPOLL : 0);
beacon_reg |= AR5K_BCR_AP; beacon_reg |= AR5K_BCR_AP;
break; break;
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
(ah->ah_version == AR5K_AR5210 ? (ah->ah_version == AR5K_AR5210 ?
AR5K_STA_ID1_PWR_SV : 0); AR5K_STA_ID1_PWR_SV : 0);
case IEEE80211_IF_TYPE_MNTR: case NL80211_IFTYPE_MONITOR:
pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
(ah->ah_version == AR5K_AR5210 ? (ah->ah_version == AR5K_AR5210 ?
AR5K_STA_ID1_NO_PSPOLL : 0); AR5K_STA_ID1_NO_PSPOLL : 0);
...@@ -649,7 +649,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval) ...@@ -649,7 +649,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
* Set the additional timers by mode * Set the additional timers by mode
*/ */
switch (ah->ah_op_mode) { switch (ah->ah_op_mode) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
if (ah->ah_version == AR5K_AR5210) { if (ah->ah_version == AR5K_AR5210) {
timer1 = 0xffffffff; timer1 = 0xffffffff;
timer2 = 0xffffffff; timer2 = 0xffffffff;
......
...@@ -399,7 +399,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) ...@@ -399,7 +399,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
/* /*
* Main reset function * Main reset function
*/ */
int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
struct ieee80211_channel *channel, bool change_channel) struct ieee80211_channel *channel, bool change_channel)
{ {
struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
......
...@@ -140,7 +140,7 @@ static int ath_key_config(struct ath_softc *sc, ...@@ -140,7 +140,7 @@ static int ath_key_config(struct ath_softc *sc,
struct ath9k_keyval hk; struct ath9k_keyval hk;
const u8 *mac = NULL; const u8 *mac = NULL;
int ret = 0; int ret = 0;
enum ieee80211_if_types opmode; enum nl80211_iftype opmode;
memset(&hk, 0, sizeof(hk)); memset(&hk, 0, sizeof(hk));
...@@ -179,14 +179,14 @@ static int ath_key_config(struct ath_softc *sc, ...@@ -179,14 +179,14 @@ static int ath_key_config(struct ath_softc *sc,
*/ */
if (is_broadcast_ether_addr(addr)) { if (is_broadcast_ether_addr(addr)) {
switch (opmode) { switch (opmode) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
/* default key: could be group WPA key /* default key: could be group WPA key
* or could be static WEP key */ * or could be static WEP key */
mac = NULL; mac = NULL;
break; break;
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
break; break;
case IEEE80211_IF_TYPE_AP: case NL80211_IFTYPE_AP:
break; break;
default: default:
ASSERT(0); ASSERT(0);
...@@ -1147,13 +1147,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, ...@@ -1147,13 +1147,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
return -ENOBUFS; return -ENOBUFS;
switch (conf->type) { switch (conf->type) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
ic_opmode = ATH9K_M_STA; ic_opmode = ATH9K_M_STA;
break; break;
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
ic_opmode = ATH9K_M_IBSS; ic_opmode = ATH9K_M_IBSS;
break; break;
case IEEE80211_IF_TYPE_AP: case NL80211_IFTYPE_AP:
ic_opmode = ATH9K_M_HOSTAP; ic_opmode = ATH9K_M_HOSTAP;
break; break;
default: default:
...@@ -1275,7 +1275,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -1275,7 +1275,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
/* TODO: Need to decide which hw opmode to use for multi-interface /* TODO: Need to decide which hw opmode to use for multi-interface
* cases */ * cases */
if (vif->type == IEEE80211_IF_TYPE_AP && if (vif->type == NL80211_IFTYPE_AP &&
ah->ah_opmode != ATH9K_M_HOSTAP) { ah->ah_opmode != ATH9K_M_HOSTAP) {
ah->ah_opmode = ATH9K_M_HOSTAP; ah->ah_opmode = ATH9K_M_HOSTAP;
ath9k_hw_setopmode(ah); ath9k_hw_setopmode(ah);
...@@ -1287,8 +1287,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -1287,8 +1287,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
if ((conf->changed & IEEE80211_IFCC_BSSID) && if ((conf->changed & IEEE80211_IFCC_BSSID) &&
!is_zero_ether_addr(conf->bssid)) { !is_zero_ether_addr(conf->bssid)) {
switch (vif->type) { switch (vif->type) {
case IEEE80211_IF_TYPE_STA: case NL80211_IFTYPE_STATION:
case IEEE80211_IF_TYPE_IBSS: case NL80211_IFTYPE_ADHOC:
/* Update ratectrl about the new state */ /* Update ratectrl about the new state */
ath_rate_newstate(sc, avp); ath_rate_newstate(sc, avp);
...@@ -1333,8 +1333,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, ...@@ -1333,8 +1333,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
} }
if ((conf->changed & IEEE80211_IFCC_BEACON) && if ((conf->changed & IEEE80211_IFCC_BEACON) &&