aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/main.c
diff options
context:
space:
mode:
authorColin McCabe <colin@cozybit.com>2008-12-01 16:38:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 09:35:47 -0500
commitd97809dbbf1b8a6df79c82be75fa0cababec783b (patch)
treeeadd628167157a49384b7c7297ac3fbabd325863 /drivers/net/wireless/ath9k/main.c
parent33fd8195529d74c0fe23cddd1c76fe7e03bbd324 (diff)
ath9k: Replace ath9k_opmode with nl80211_iftype
This patch kills ath9k's ath9k_opmode enum by replacing it with nl80211_iftype. Signed-off-by: Colin McCabe <colin@cozybit.com> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath9k/main.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index ac37605d65af..3d7111e9b8d8 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -754,13 +754,17 @@ static int ath_key_config(struct ath_softc *sc,
754 754
755 /* 755 /*
756 * Strategy: 756 * Strategy:
757 * For _M_STA mc tx, we will not setup a key at all since we never 757 * For STA mc tx, we will not setup a key at
758 * tx mc. 758 * all since we never tx mc.
759 * _M_STA mc rx, we will use the keyID. 759 *
760 * for _M_IBSS mc tx, we will use the keyID, and no macaddr. 760 * For STA mc rx, we will use the keyID.
761 * for _M_IBSS mc rx, we will alloc a slot and plumb the mac of the 761 *
762 * peer node. BUT we will plumb a cleartext key so that we can do 762 * For ADHOC mc tx, we will use the keyID, and no macaddr.
763 * perSta default key table lookup in software. 763 *
764 * For ADHOC mc rx, we will alloc a slot and plumb the mac of
765 * the peer node.
766 * BUT we will plumb a cleartext key so that we can do
767 * per-Sta default key table lookup in software.
764 */ 768 */
765 if (is_broadcast_ether_addr(addr)) { 769 if (is_broadcast_ether_addr(addr)) {
766 switch (opmode) { 770 switch (opmode) {
@@ -861,7 +865,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
861 DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d\n", bss_conf->aid); 865 DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d\n", bss_conf->aid);
862 866
863 /* New association, store aid */ 867 /* New association, store aid */
864 if (avp->av_opmode == ATH9K_M_STA) { 868 if (avp->av_opmode == NL80211_IFTYPE_STATION) {
865 sc->sc_curaid = bss_conf->aid; 869 sc->sc_curaid = bss_conf->aid;
866 ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid, 870 ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid,
867 sc->sc_curaid); 871 sc->sc_curaid);
@@ -1373,7 +1377,8 @@ static int ath_init(u16 devid, struct ath_softc *sc)
1373 goto bad; 1377 goto bad;
1374 1378
1375 /* default to MONITOR mode */ 1379 /* default to MONITOR mode */
1376 sc->sc_ah->ah_opmode = ATH9K_M_MONITOR; 1380 sc->sc_ah->ah_opmode = NL80211_IFTYPE_MONITOR;
1381
1377 1382
1378 /* Setup rate tables */ 1383 /* Setup rate tables */
1379 1384
@@ -1938,8 +1943,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
1938 * Note we only do this (at the moment) for station mode. 1943 * Note we only do this (at the moment) for station mode.
1939 */ 1944 */
1940 if (ath9k_hw_phycounters(sc->sc_ah) && 1945 if (ath9k_hw_phycounters(sc->sc_ah) &&
1941 ((sc->sc_ah->ah_opmode == ATH9K_M_STA) || 1946 ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) ||
1942 (sc->sc_ah->ah_opmode == ATH9K_M_IBSS))) 1947 (sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC)))
1943 sc->sc_imask |= ATH9K_INT_MIB; 1948 sc->sc_imask |= ATH9K_INT_MIB;
1944 /* 1949 /*
1945 * Some hardware processes the TIM IE and fires an 1950 * Some hardware processes the TIM IE and fires an
@@ -1948,7 +1953,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
1948 * enable the TIM interrupt when operating as station. 1953 * enable the TIM interrupt when operating as station.
1949 */ 1954 */
1950 if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && 1955 if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
1951 (sc->sc_ah->ah_opmode == ATH9K_M_STA) && 1956 (sc->sc_ah->ah_opmode == NL80211_IFTYPE_STATION) &&
1952 !sc->sc_config.swBeaconProcess) 1957 !sc->sc_config.swBeaconProcess)
1953 sc->sc_imask |= ATH9K_INT_TIM; 1958 sc->sc_imask |= ATH9K_INT_TIM;
1954 1959
@@ -2064,7 +2069,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2064{ 2069{
2065 struct ath_softc *sc = hw->priv; 2070 struct ath_softc *sc = hw->priv;
2066 struct ath_vap *avp = (void *)conf->vif->drv_priv; 2071 struct ath_vap *avp = (void *)conf->vif->drv_priv;
2067 int ic_opmode = 0; 2072 enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED;
2068 2073
2069 /* Support only vap for now */ 2074 /* Support only vap for now */
2070 2075
@@ -2073,13 +2078,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2073 2078
2074 switch (conf->type) { 2079 switch (conf->type) {
2075 case NL80211_IFTYPE_STATION: 2080 case NL80211_IFTYPE_STATION:
2076 ic_opmode = ATH9K_M_STA; 2081 ic_opmode = NL80211_IFTYPE_STATION;
2077 break; 2082 break;
2078 case NL80211_IFTYPE_ADHOC: 2083 case NL80211_IFTYPE_ADHOC:
2079 ic_opmode = ATH9K_M_IBSS; 2084 ic_opmode = NL80211_IFTYPE_ADHOC;
2080 break; 2085 break;
2081 case NL80211_IFTYPE_AP: 2086 case NL80211_IFTYPE_AP:
2082 ic_opmode = ATH9K_M_HOSTAP; 2087 ic_opmode = NL80211_IFTYPE_AP;
2083 break; 2088 break;
2084 default: 2089 default:
2085 DPRINTF(sc, ATH_DBG_FATAL, 2090 DPRINTF(sc, ATH_DBG_FATAL,
@@ -2093,7 +2098,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2093 avp->av_opmode = ic_opmode; 2098 avp->av_opmode = ic_opmode;
2094 avp->av_bslot = -1; 2099 avp->av_bslot = -1;
2095 2100
2096 if (ic_opmode == ATH9K_M_HOSTAP) 2101 if (ic_opmode == NL80211_IFTYPE_AP)
2097 ath9k_hw_set_tsfadjust(sc->sc_ah, 1); 2102 ath9k_hw_set_tsfadjust(sc->sc_ah, 1);
2098 2103
2099 sc->sc_vaps[0] = conf->vif; 2104 sc->sc_vaps[0] = conf->vif;
@@ -2127,8 +2132,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
2127 del_timer_sync(&sc->sc_ani.timer); 2132 del_timer_sync(&sc->sc_ani.timer);
2128 2133
2129 /* Reclaim beacon resources */ 2134 /* Reclaim beacon resources */
2130 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP || 2135 if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP ||
2131 sc->sc_ah->ah_opmode == ATH9K_M_IBSS) { 2136 sc->sc_ah->ah_opmode == NL80211_IFTYPE_ADHOC) {
2132 ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq); 2137 ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq);
2133 ath_beacon_return(sc, avp); 2138 ath_beacon_return(sc, avp);
2134 } 2139 }
@@ -2163,7 +2168,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2163 (curchan->band == IEEE80211_BAND_2GHZ) ? 2168 (curchan->band == IEEE80211_BAND_2GHZ) ?
2164 CHANNEL_G : CHANNEL_A; 2169 CHANNEL_G : CHANNEL_A;
2165 2170
2166 if ((sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) && 2171 if ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) &&
2167 (conf->ht.enabled)) { 2172 (conf->ht.enabled)) {
2168 sc->tx_chan_width = (!!conf->ht.sec_chan_offset) ? 2173 sc->tx_chan_width = (!!conf->ht.sec_chan_offset) ?
2169 ATH9K_HT_MACMODE_2040 : ATH9K_HT_MACMODE_20; 2174 ATH9K_HT_MACMODE_2040 : ATH9K_HT_MACMODE_20;
@@ -2202,8 +2207,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
2202 /* TODO: Need to decide which hw opmode to use for multi-interface 2207 /* TODO: Need to decide which hw opmode to use for multi-interface
2203 * cases */ 2208 * cases */
2204 if (vif->type == NL80211_IFTYPE_AP && 2209 if (vif->type == NL80211_IFTYPE_AP &&
2205 ah->ah_opmode != ATH9K_M_HOSTAP) { 2210 ah->ah_opmode != NL80211_IFTYPE_AP) {
2206 ah->ah_opmode = ATH9K_M_HOSTAP; 2211 ah->ah_opmode = NL80211_IFTYPE_STATION;
2207 ath9k_hw_setopmode(ah); 2212 ath9k_hw_setopmode(ah);
2208 ath9k_hw_write_associd(ah, sc->sc_myaddr, 0); 2213 ath9k_hw_write_associd(ah, sc->sc_myaddr, 0);
2209 /* Request full reset to get hw opmode changed properly */ 2214 /* Request full reset to get hw opmode changed properly */
@@ -2258,7 +2263,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
2258 } 2263 }
2259 2264
2260 /* Check for WLAN_CAPABILITY_PRIVACY ? */ 2265 /* Check for WLAN_CAPABILITY_PRIVACY ? */
2261 if ((avp->av_opmode != ATH9K_M_STA)) { 2266 if ((avp->av_opmode != NL80211_IFTYPE_STATION)) {
2262 for (i = 0; i < IEEE80211_WEP_NKID; i++) 2267 for (i = 0; i < IEEE80211_WEP_NKID; i++)
2263 if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) 2268 if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i))
2264 ath9k_hw_keysetmac(sc->sc_ah, 2269 ath9k_hw_keysetmac(sc->sc_ah,