aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
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/base.c
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/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c50
1 files changed, 25 insertions, 25 deletions
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 }