aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 18:01:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:23 -0400
commit05c914fe330fa8e1cc67870dc0d3809dfd96c107 (patch)
treedf53bcab47335f3361c09478d6b1447b7d298536 /drivers/net/wireless/ath5k
parent96dd22ac06b0dbfb069fdf530c72046a941e9694 (diff)
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>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r--drivers/net/wireless/ath5k/ath5k.h4
-rw-r--r--drivers/net/wireless/ath5k/attach.c2
-rw-r--r--drivers/net/wireless/ath5k/base.c50
-rw-r--r--drivers/net/wireless/ath5k/base.h2
-rw-r--r--drivers/net/wireless/ath5k/pcu.c12
-rw-r--r--drivers/net/wireless/ath5k/reset.c2
6 files changed, 36 insertions, 36 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h
index 4c0211798a7a..20018869051d 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -1008,7 +1008,7 @@ struct ath5k_hw {
1008 1008
1009 enum ath5k_int ah_imr; 1009 enum ath5k_int ah_imr;
1010 1010
1011 enum ieee80211_if_types ah_op_mode; 1011 enum nl80211_iftype ah_op_mode;
1012 enum ath5k_power_mode ah_power_mode; 1012 enum ath5k_power_mode ah_power_mode;
1013 struct ieee80211_channel ah_current_channel; 1013 struct ieee80211_channel ah_current_channel;
1014 bool ah_turbo; 1014 bool ah_turbo;
@@ -1117,7 +1117,7 @@ extern void ath5k_hw_detach(struct ath5k_hw *ah);
1117 1117
1118/* Reset Functions */ 1118/* Reset Functions */
1119extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial); 1119extern int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial);
1120extern int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, struct ieee80211_channel *channel, bool change_channel); 1120extern int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, struct ieee80211_channel *channel, bool change_channel);
1121/* Power management functions */ 1121/* Power management functions */
1122extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration); 1122extern int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration);
1123 1123
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c
index 0eb2511fe147..153c4111fabe 100644
--- a/drivers/net/wireless/ath5k/attach.c
+++ b/drivers/net/wireless/ath5k/attach.c
@@ -124,7 +124,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
124 /* 124 /*
125 * HW information 125 * HW information
126 */ 126 */
127 ah->ah_op_mode = IEEE80211_IF_TYPE_STA; 127 ah->ah_op_mode = NL80211_IFTYPE_STATION;
128 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT; 128 ah->ah_radar.r_enabled = AR5K_TUNE_RADAR_ALERT;
129 ah->ah_turbo = false; 129 ah->ah_turbo = false;
130 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; 130 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 85260c39aa2b..e09ed2ce6753 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -507,7 +507,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
507 507
508 sc->iobase = mem; /* So we can unmap it on detach */ 508 sc->iobase = mem; /* So we can unmap it on detach */
509 sc->cachelsz = csz * sizeof(u32); /* convert to bytes */ 509 sc->cachelsz = csz * sizeof(u32); /* convert to bytes */
510 sc->opmode = IEEE80211_IF_TYPE_STA; 510 sc->opmode = NL80211_IFTYPE_STATION;
511 mutex_init(&sc->lock); 511 mutex_init(&sc->lock);
512 spin_lock_init(&sc->rxbuflock); 512 spin_lock_init(&sc->rxbuflock);
513 spin_lock_init(&sc->txbuflock); 513 spin_lock_init(&sc->txbuflock);
@@ -1377,8 +1377,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
1377 ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi); 1377 ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
1378 if (ret) 1378 if (ret)
1379 return ret; 1379 return ret;
1380 if (sc->opmode == IEEE80211_IF_TYPE_AP || 1380 if (sc->opmode == NL80211_IFTYPE_AP ||
1381 sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) { 1381 sc->opmode == NL80211_IFTYPE_MESH_POINT) {
1382 /* 1382 /*
1383 * Always burst out beacon and CAB traffic 1383 * Always burst out beacon and CAB traffic
1384 * (aifs = cwmin = cwmax = 0) 1384 * (aifs = cwmin = cwmax = 0)
@@ -1386,7 +1386,7 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
1386 qi.tqi_aifs = 0; 1386 qi.tqi_aifs = 0;
1387 qi.tqi_cw_min = 0; 1387 qi.tqi_cw_min = 0;
1388 qi.tqi_cw_max = 0; 1388 qi.tqi_cw_max = 0;
1389 } else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 1389 } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
1390 /* 1390 /*
1391 * Adhoc mode; backoff between 0 and (2 * cw_min). 1391 * Adhoc mode; backoff between 0 and (2 * cw_min).
1392 */ 1392 */
@@ -1714,7 +1714,7 @@ ath5k_tasklet_rx(unsigned long data)
1714 /* let crypto-error packets fall through in MNTR */ 1714 /* let crypto-error packets fall through in MNTR */
1715 if ((rs.rs_status & 1715 if ((rs.rs_status &
1716 ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || 1716 ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) ||
1717 sc->opmode != IEEE80211_IF_TYPE_MNTR) 1717 sc->opmode != NL80211_IFTYPE_MONITOR)
1718 goto next; 1718 goto next;
1719 } 1719 }
1720accept: 1720accept:
@@ -1777,7 +1777,7 @@ accept:
1777 ath5k_debug_dump_skb(sc, skb, "RX ", 0); 1777 ath5k_debug_dump_skb(sc, skb, "RX ", 0);
1778 1778
1779 /* check beacons in IBSS mode */ 1779 /* check beacons in IBSS mode */
1780 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) 1780 if (sc->opmode == NL80211_IFTYPE_ADHOC)
1781 ath5k_check_ibss_tsf(sc, skb, &rxs); 1781 ath5k_check_ibss_tsf(sc, skb, &rxs);
1782 1782
1783 __ieee80211_rx(sc->hw, skb, &rxs); 1783 __ieee80211_rx(sc->hw, skb, &rxs);
@@ -1892,7 +1892,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
1892 ds = bf->desc; 1892 ds = bf->desc;
1893 1893
1894 flags = AR5K_TXDESC_NOACK; 1894 flags = AR5K_TXDESC_NOACK;
1895 if (sc->opmode == IEEE80211_IF_TYPE_IBSS && ath5k_hw_hasveol(ah)) { 1895 if (sc->opmode == NL80211_IFTYPE_ADHOC && ath5k_hw_hasveol(ah)) {
1896 ds->ds_link = bf->daddr; /* self-linked */ 1896 ds->ds_link = bf->daddr; /* self-linked */
1897 flags |= AR5K_TXDESC_VEOL; 1897 flags |= AR5K_TXDESC_VEOL;
1898 /* 1898 /*
@@ -1941,8 +1941,8 @@ ath5k_beacon_send(struct ath5k_softc *sc)
1941 1941
1942 ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n"); 1942 ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "in beacon_send\n");
1943 1943
1944 if (unlikely(bf->skb == NULL || sc->opmode == IEEE80211_IF_TYPE_STA || 1944 if (unlikely(bf->skb == NULL || sc->opmode == NL80211_IFTYPE_STATION ||
1945 sc->opmode == IEEE80211_IF_TYPE_MNTR)) { 1945 sc->opmode == NL80211_IFTYPE_MONITOR)) {
1946 ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL); 1946 ATH5K_WARN(sc, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL);
1947 return; 1947 return;
1948 } 1948 }
@@ -2116,9 +2116,9 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2116 sc->bmisscount = 0; 2116 sc->bmisscount = 0;
2117 sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); 2117 sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
2118 2118
2119 if (sc->opmode == IEEE80211_IF_TYPE_STA) { 2119 if (sc->opmode == NL80211_IFTYPE_STATION) {
2120 sc->imask |= AR5K_INT_BMISS; 2120 sc->imask |= AR5K_INT_BMISS;
2121 } else if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2121 } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
2122 /* 2122 /*
2123 * In IBSS mode we use a self-linked tx descriptor and let the 2123 * In IBSS mode we use a self-linked tx descriptor and let the
2124 * hardware send the beacons automatically. We have to load it 2124 * hardware send the beacons automatically. We have to load it
@@ -2323,7 +2323,7 @@ ath5k_intr(int irq, void *dev_id)
2323 * transmission time) in order to detect wether 2323 * transmission time) in order to detect wether
2324 * automatic TSF updates happened. 2324 * automatic TSF updates happened.
2325 */ 2325 */
2326 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2326 if (sc->opmode == NL80211_IFTYPE_ADHOC) {
2327 /* XXX: only if VEOL suppported */ 2327 /* XXX: only if VEOL suppported */
2328 u64 tsf = ath5k_hw_get_tsf64(ah); 2328 u64 tsf = ath5k_hw_get_tsf64(ah);
2329 sc->nexttbtt += sc->bintval; 2329 sc->nexttbtt += sc->bintval;
@@ -2553,7 +2553,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2553 2553
2554 ath5k_debug_dump_skb(sc, skb, "TX ", 1); 2554 ath5k_debug_dump_skb(sc, skb, "TX ", 1);
2555 2555
2556 if (sc->opmode == IEEE80211_IF_TYPE_MNTR) 2556 if (sc->opmode == NL80211_IFTYPE_MONITOR)
2557 ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n"); 2557 ATH5K_DBG(sc, ATH5K_DEBUG_XMIT, "tx in monitor (scan?)\n");
2558 2558
2559 /* 2559 /*
@@ -2688,9 +2688,9 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
2688 sc->vif = conf->vif; 2688 sc->vif = conf->vif;
2689 2689
2690 switch (conf->type) { 2690 switch (conf->type) {
2691 case IEEE80211_IF_TYPE_STA: 2691 case NL80211_IFTYPE_STATION:
2692 case IEEE80211_IF_TYPE_IBSS: 2692 case NL80211_IFTYPE_ADHOC:
2693 case IEEE80211_IF_TYPE_MNTR: 2693 case NL80211_IFTYPE_MONITOR:
2694 sc->opmode = conf->type; 2694 sc->opmode = conf->type;
2695 break; 2695 break;
2696 default: 2696 default:
@@ -2761,7 +2761,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2761 } 2761 }
2762 2762
2763 if (conf->changed & IEEE80211_IFCC_BEACON && 2763 if (conf->changed & IEEE80211_IFCC_BEACON &&
2764 vif->type == IEEE80211_IF_TYPE_IBSS) { 2764 vif->type == NL80211_IFTYPE_ADHOC) {
2765 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); 2765 struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
2766 if (!beacon) { 2766 if (!beacon) {
2767 ret = -ENOMEM; 2767 ret = -ENOMEM;
@@ -2880,17 +2880,17 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
2880 2880
2881 /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */ 2881 /* XXX move these to mac80211, and add a beacon IFF flag to mac80211 */
2882 2882
2883 if (sc->opmode == IEEE80211_IF_TYPE_MNTR) 2883 if (sc->opmode == NL80211_IFTYPE_MONITOR)
2884 rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON | 2884 rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
2885 AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM; 2885 AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
2886 if (sc->opmode != IEEE80211_IF_TYPE_STA) 2886 if (sc->opmode != NL80211_IFTYPE_STATION)
2887 rfilt |= AR5K_RX_FILTER_PROBEREQ; 2887 rfilt |= AR5K_RX_FILTER_PROBEREQ;
2888 if (sc->opmode != IEEE80211_IF_TYPE_AP && 2888 if (sc->opmode != NL80211_IFTYPE_AP &&
2889 sc->opmode != IEEE80211_IF_TYPE_MESH_POINT && 2889 sc->opmode != NL80211_IFTYPE_MESH_POINT &&
2890 test_bit(ATH_STAT_PROMISC, sc->status)) 2890 test_bit(ATH_STAT_PROMISC, sc->status))
2891 rfilt |= AR5K_RX_FILTER_PROM; 2891 rfilt |= AR5K_RX_FILTER_PROM;
2892 if (sc->opmode == IEEE80211_IF_TYPE_STA || 2892 if (sc->opmode == NL80211_IFTYPE_STATION ||
2893 sc->opmode == IEEE80211_IF_TYPE_IBSS) { 2893 sc->opmode == NL80211_IFTYPE_ADHOC) {
2894 rfilt |= AR5K_RX_FILTER_BEACON; 2894 rfilt |= AR5K_RX_FILTER_BEACON;
2895 } 2895 }
2896 2896
@@ -2995,7 +2995,7 @@ ath5k_reset_tsf(struct ieee80211_hw *hw)
2995 * in IBSS mode we need to update the beacon timers too. 2995 * in IBSS mode we need to update the beacon timers too.
2996 * this will also reset the TSF if we call it with 0 2996 * this will also reset the TSF if we call it with 0
2997 */ 2997 */
2998 if (sc->opmode == IEEE80211_IF_TYPE_IBSS) 2998 if (sc->opmode == NL80211_IFTYPE_ADHOC)
2999 ath5k_beacon_update_timers(sc, 0); 2999 ath5k_beacon_update_timers(sc, 0);
3000 else 3000 else
3001 ath5k_hw_reset_tsf(sc->ah); 3001 ath5k_hw_reset_tsf(sc->ah);
@@ -3010,7 +3010,7 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
3010 3010
3011 ath5k_debug_dump_skb(sc, skb, "BC ", 1); 3011 ath5k_debug_dump_skb(sc, skb, "BC ", 1);
3012 3012
3013 if (sc->opmode != IEEE80211_IF_TYPE_IBSS) { 3013 if (sc->opmode != NL80211_IFTYPE_ADHOC) {
3014 ret = -EIO; 3014 ret = -EIO;
3015 goto end; 3015 goto end;
3016 } 3016 }
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h
index 1549b63d6138..9d0b728928e3 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -113,7 +113,7 @@ struct ath5k_softc {
113 struct ieee80211_channel channels[ATH_CHAN_MAX]; 113 struct ieee80211_channel channels[ATH_CHAN_MAX];
114 struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; 114 struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
115 u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES]; 115 u8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
116 enum ieee80211_if_types opmode; 116 enum nl80211_iftype opmode;
117 struct ath5k_hw *ah; /* Atheros HW */ 117 struct ath5k_hw *ah; /* Atheros HW */
118 118
119 struct ieee80211_supported_band *curband; 119 struct ieee80211_supported_band *curband;
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c
index 5a896d1e2a2b..c77cee2a5582 100644
--- a/drivers/net/wireless/ath5k/pcu.c
+++ b/drivers/net/wireless/ath5k/pcu.c
@@ -52,26 +52,26 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
52 ATH5K_TRACE(ah->ah_sc); 52 ATH5K_TRACE(ah->ah_sc);
53 53
54 switch (ah->ah_op_mode) { 54 switch (ah->ah_op_mode) {
55 case IEEE80211_IF_TYPE_IBSS: 55 case NL80211_IFTYPE_ADHOC:
56 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA | 56 pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_DESC_ANTENNA |
57 (ah->ah_version == AR5K_AR5210 ? 57 (ah->ah_version == AR5K_AR5210 ?
58 AR5K_STA_ID1_NO_PSPOLL : 0); 58 AR5K_STA_ID1_NO_PSPOLL : 0);
59 beacon_reg |= AR5K_BCR_ADHOC; 59 beacon_reg |= AR5K_BCR_ADHOC;
60 break; 60 break;
61 61
62 case IEEE80211_IF_TYPE_AP: 62 case NL80211_IFTYPE_AP:
63 case IEEE80211_IF_TYPE_MESH_POINT: 63 case NL80211_IFTYPE_MESH_POINT:
64 pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA | 64 pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
65 (ah->ah_version == AR5K_AR5210 ? 65 (ah->ah_version == AR5K_AR5210 ?
66 AR5K_STA_ID1_NO_PSPOLL : 0); 66 AR5K_STA_ID1_NO_PSPOLL : 0);
67 beacon_reg |= AR5K_BCR_AP; 67 beacon_reg |= AR5K_BCR_AP;
68 break; 68 break;
69 69
70 case IEEE80211_IF_TYPE_STA: 70 case NL80211_IFTYPE_STATION:
71 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | 71 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
72 (ah->ah_version == AR5K_AR5210 ? 72 (ah->ah_version == AR5K_AR5210 ?
73 AR5K_STA_ID1_PWR_SV : 0); 73 AR5K_STA_ID1_PWR_SV : 0);
74 case IEEE80211_IF_TYPE_MNTR: 74 case NL80211_IFTYPE_MONITOR:
75 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA | 75 pcu_reg |= AR5K_STA_ID1_DEFAULT_ANTENNA |
76 (ah->ah_version == AR5K_AR5210 ? 76 (ah->ah_version == AR5K_AR5210 ?
77 AR5K_STA_ID1_NO_PSPOLL : 0); 77 AR5K_STA_ID1_NO_PSPOLL : 0);
@@ -649,7 +649,7 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
649 * Set the additional timers by mode 649 * Set the additional timers by mode
650 */ 650 */
651 switch (ah->ah_op_mode) { 651 switch (ah->ah_op_mode) {
652 case IEEE80211_IF_TYPE_STA: 652 case NL80211_IFTYPE_STATION:
653 if (ah->ah_version == AR5K_AR5210) { 653 if (ah->ah_version == AR5K_AR5210) {
654 timer1 = 0xffffffff; 654 timer1 = 0xffffffff;
655 timer2 = 0xffffffff; 655 timer2 = 0xffffffff;
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index d260fba0180f..f5c3de890cdb 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -399,7 +399,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
399/* 399/*
400 * Main reset function 400 * Main reset function
401 */ 401 */
402int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, 402int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
403 struct ieee80211_channel *channel, bool change_channel) 403 struct ieee80211_channel *channel, bool change_channel)
404{ 404{
405 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 405 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;