ath9k: Cleanup data structures related to HW capabilities

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by Sujith and committed by John W. Linville 60b67f51 b08cbcd4

+330 -320
+92 -91
drivers/net/wireless/ath9k/ath9k.h
··· 147 147 148 148 #define ATH9K_RXDESC_INTREQ 0x0020 149 149 150 - enum hal_capability_type { 151 - HAL_CAP_CIPHER = 0, 152 - HAL_CAP_TKIP_MIC, 153 - HAL_CAP_TKIP_SPLIT, 154 - HAL_CAP_PHYCOUNTERS, 155 - HAL_CAP_DIVERSITY, 156 - HAL_CAP_PSPOLL, 157 - HAL_CAP_TXPOW, 158 - HAL_CAP_PHYDIAG, 159 - HAL_CAP_MCAST_KEYSRCH, 160 - HAL_CAP_TSF_ADJUST, 161 - HAL_CAP_WME_TKIPMIC, 162 - HAL_CAP_RFSILENT, 163 - HAL_CAP_ANT_CFG_2GHZ, 164 - HAL_CAP_ANT_CFG_5GHZ 150 + enum ath9k_hw_caps { 151 + ATH9K_HW_CAP_CHAN_SPREAD = BIT(0), 152 + ATH9K_HW_CAP_MIC_AESCCM = BIT(1), 153 + ATH9K_HW_CAP_MIC_CKIP = BIT(2), 154 + ATH9K_HW_CAP_MIC_TKIP = BIT(3), 155 + ATH9K_HW_CAP_CIPHER_AESCCM = BIT(4), 156 + ATH9K_HW_CAP_CIPHER_CKIP = BIT(5), 157 + ATH9K_HW_CAP_CIPHER_TKIP = BIT(6), 158 + ATH9K_HW_CAP_VEOL = BIT(7), 159 + ATH9K_HW_CAP_BSSIDMASK = BIT(8), 160 + ATH9K_HW_CAP_MCAST_KEYSEARCH = BIT(9), 161 + ATH9K_HW_CAP_CHAN_HALFRATE = BIT(10), 162 + ATH9K_HW_CAP_CHAN_QUARTERRATE = BIT(11), 163 + ATH9K_HW_CAP_HT = BIT(12), 164 + ATH9K_HW_CAP_GTT = BIT(13), 165 + ATH9K_HW_CAP_FASTCC = BIT(14), 166 + ATH9K_HW_CAP_RFSILENT = BIT(15), 167 + ATH9K_HW_CAP_WOW = BIT(16), 168 + ATH9K_HW_CAP_CST = BIT(17), 169 + ATH9K_HW_CAP_ENHANCEDPM = BIT(18), 170 + ATH9K_HW_CAP_AUTOSLEEP = BIT(19), 171 + ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(20), 172 + ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT = BIT(21), 165 173 }; 166 174 167 - struct hal_capabilities { 168 - u32 halChanSpreadSupport:1, 169 - halChapTuningSupport:1, 170 - halMicAesCcmSupport:1, 171 - halMicCkipSupport:1, 172 - halMicTkipSupport:1, 173 - halCipherAesCcmSupport:1, 174 - halCipherCkipSupport:1, 175 - halCipherTkipSupport:1, 176 - halVEOLSupport:1, 177 - halBssIdMaskSupport:1, 178 - halMcastKeySrchSupport:1, 179 - halTsfAddSupport:1, 180 - halChanHalfRate:1, 181 - halChanQuarterRate:1, 182 - halHTSupport:1, 183 - halGTTSupport:1, 184 - halFastCCSupport:1, 185 - halRfSilentSupport:1, 186 - halWowSupport:1, 187 - halCSTSupport:1, 188 - halEnhancedPmSupport:1, 189 - halAutoSleepSupport:1, 190 - hal4kbSplitTransSupport:1, 191 - halWowMatchPatternExact:1; 192 - u32 halWirelessModes; 193 - u16 halTotalQueues; 194 - u16 halKeyCacheSize; 195 - u16 halLow5GhzChan, halHigh5GhzChan; 196 - u16 halLow2GhzChan, halHigh2GhzChan; 197 - u16 halNumMRRetries; 198 - u16 halRtsAggrLimit; 199 - u8 halTxChainMask; 200 - u8 halRxChainMask; 201 - u16 halTxTrigLevelMax; 202 - u16 halRegCap; 203 - u8 halNumGpioPins; 204 - u8 halNumAntCfg2GHz; 205 - u8 halNumAntCfg5GHz; 175 + enum ath9k_capability_type { 176 + ATH9K_CAP_CIPHER = 0, 177 + ATH9K_CAP_TKIP_MIC, 178 + ATH9K_CAP_TKIP_SPLIT, 179 + ATH9K_CAP_PHYCOUNTERS, 180 + ATH9K_CAP_DIVERSITY, 181 + ATH9K_CAP_TXPOW, 182 + ATH9K_CAP_PHYDIAG, 183 + ATH9K_CAP_MCAST_KEYSRCH, 184 + ATH9K_CAP_TSF_ADJUST, 185 + ATH9K_CAP_WME_TKIPMIC, 186 + ATH9K_CAP_RFSILENT, 187 + ATH9K_CAP_ANT_CFG_2GHZ, 188 + ATH9K_CAP_ANT_CFG_5GHZ 206 189 }; 207 190 208 - struct hal_ops_config { 209 - int ath_hal_dma_beacon_response_time; 210 - int ath_hal_sw_beacon_response_time; 211 - int ath_hal_additional_swba_backoff; 212 - int ath_hal_6mb_ack; 213 - int ath_hal_cwmIgnoreExtCCA; 214 - u8 ath_hal_pciePowerSaveEnable; 215 - u8 ath_hal_pcieL1SKPEnable; 216 - u8 ath_hal_pcieClockReq; 217 - u32 ath_hal_pcieWaen; 218 - int ath_hal_pciePowerReset; 219 - u8 ath_hal_pcieRestore; 220 - u8 ath_hal_analogShiftReg; 221 - u8 ath_hal_htEnable; 222 - u32 ath_hal_ofdmTrigLow; 223 - u32 ath_hal_ofdmTrigHigh; 224 - u32 ath_hal_cckTrigHigh; 225 - u32 ath_hal_cckTrigLow; 226 - u32 ath_hal_enableANI; 227 - u8 ath_hal_noiseImmunityLvl; 228 - u32 ath_hal_ofdmWeakSigDet; 229 - u32 ath_hal_cckWeakSigThr; 230 - u8 ath_hal_spurImmunityLvl; 231 - u8 ath_hal_firStepLvl; 232 - int8_t ath_hal_rssiThrHigh; 233 - int8_t ath_hal_rssiThrLow; 234 - u16 ath_hal_diversityControl; 235 - u16 ath_hal_antennaSwitchSwap; 236 - int ath_hal_serializeRegMode; 237 - int ath_hal_intrMitigation; 191 + struct ath9k_hw_capabilities { 192 + u32 hw_caps; /* ATH9K_HW_CAP_* from ath9k_hw_caps */ 193 + u32 wireless_modes; 194 + u16 total_queues; 195 + u16 keycache_size; 196 + u16 low_5ghz_chan, high_5ghz_chan; 197 + u16 low_2ghz_chan, high_2ghz_chan; 198 + u16 num_mr_retries; 199 + u16 rts_aggr_limit; 200 + u8 tx_chainmask; 201 + u8 rx_chainmask; 202 + u16 tx_triglevel_max; 203 + u16 reg_cap; 204 + u8 num_gpio_pins; 205 + u8 num_antcfg_2ghz; 206 + u8 num_antcfg_5ghz; 207 + }; 208 + 209 + struct ath9k_ops_config { 210 + int dma_beacon_response_time; 211 + int sw_beacon_response_time; 212 + int additional_swba_backoff; 213 + int ack_6mb; 214 + int cwm_ignore_extcca; 215 + u8 pcie_powersave_enable; 216 + u8 pcie_l1skp_enable; 217 + u8 pcie_clock_req; 218 + u32 pcie_waen; 219 + int pcie_power_reset; 220 + u8 pcie_restore; 221 + u8 analog_shiftreg; 222 + u8 ht_enable; 223 + u32 ofdm_trig_low; 224 + u32 ofdm_trig_high; 225 + u32 cck_trig_high; 226 + u32 cck_trig_low; 227 + u32 enable_ani; 228 + u8 noise_immunity_level; 229 + u32 ofdm_weaksignal_det; 230 + u32 cck_weaksignal_thr; 231 + u8 spur_immunity_level; 232 + u8 firstep_level; 233 + int8_t rssi_thr_high; 234 + int8_t rssi_thr_low; 235 + u16 diversity_control; 236 + u16 antenna_switch_swap; 237 + int serialize_regmode; 238 + int intr_mitigation; 238 239 #define SPUR_DISABLE 0 239 240 #define SPUR_ENABLE_IOCTL 1 240 241 #define SPUR_ENABLE_EEPROM 2 ··· 247 246 #define AR_BASE_FREQ_5GHZ 4900 248 247 #define AR_SPUR_FEEQ_BOUND_HT40 19 249 248 #define AR_SPUR_FEEQ_BOUND_HT20 10 250 - int ath_hal_spurMode; 251 - u16 ath_hal_spurChans[AR_EEPROM_MODAL_SPURS][2]; 249 + int spurmode; 250 + u16 spurchans[AR_EEPROM_MODAL_SPURS][2]; 252 251 }; 253 252 254 253 enum ath9k_tx_queue { ··· 816 815 u8 ah_decompMask[ATH9K_DECOMP_MASK_SIZE]; 817 816 u32 ah_flags; 818 817 enum ath9k_opmode ah_opmode; 819 - struct hal_ops_config ah_config; 820 - struct hal_capabilities ah_caps; 818 + struct ath9k_ops_config ah_config; 819 + struct ath9k_hw_capabilities ah_caps; 821 820 int16_t ah_powerLimit; 822 821 u16 ah_maxPowerLevel; 823 822 u32 ah_tpScale; ··· 879 878 }; 880 879 881 880 int ath_hal_getcapability(struct ath_hal *ah, 882 - enum hal_capability_type type, 881 + enum ath9k_capability_type type, 883 882 u32 capability, 884 883 u32 *result); 885 884 const struct ath9k_rate_table *ath9k_hw_getratetable(struct ath_hal *ah, ··· 948 947 bool ath9k_hw_phycounters(struct ath_hal *ah); 949 948 bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry); 950 949 bool ath9k_hw_getcapability(struct ath_hal *ah, 951 - enum hal_capability_type type, 950 + enum ath9k_capability_type type, 952 951 u32 capability, 953 952 u32 *result); 954 953 bool ath9k_hw_setcapability(struct ath_hal *ah, 955 - enum hal_capability_type type, 954 + enum ath9k_capability_type type, 956 955 u32 capability, 957 956 u32 setting, 958 957 int *status);
+6 -4
drivers/net/wireless/ath9k/beacon.c
··· 85 85 86 86 flags = ATH9K_TXDESC_NOACK; 87 87 88 - if (sc->sc_opmode == ATH9K_M_IBSS && ah->ah_caps.halVEOLSupport) { 88 + if (sc->sc_opmode == ATH9K_M_IBSS && 89 + (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 89 90 ds->ds_link = bf->bf_daddr; /* self-linked */ 90 91 flags |= ATH9K_TXDESC_VEOL; 91 92 /* Let hardware handle antenna switching. */ ··· 376 375 list_del(&avp->av_bcbuf->list); 377 376 378 377 if (sc->sc_opmode == ATH9K_M_HOSTAP || 379 - !sc->sc_ah->ah_caps.halVEOLSupport) { 378 + !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 380 379 int slot; 381 380 /* 382 381 * Assign the vap to a beacon xmit slot. As ··· 940 939 * deal with things. 941 940 */ 942 941 intval |= ATH9K_BEACON_ENA; 943 - if (!ah->ah_caps.halVEOLSupport) 942 + if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) 944 943 sc->sc_imask |= ATH9K_INT_SWBA; 945 944 ath_beaconq_config(sc); 946 945 } else if (sc->sc_opmode == ATH9K_M_HOSTAP) { ··· 959 958 * When using a self-linked beacon descriptor in 960 959 * ibss mode load it once here. 961 960 */ 962 - if (sc->sc_opmode == ATH9K_M_IBSS && ah->ah_caps.halVEOLSupport) 961 + if (sc->sc_opmode == ATH9K_M_IBSS && 962 + (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) 963 963 ath_beacon_start_adhoc(sc, 0); 964 964 } 965 965 #undef TSF_TO_TU
+31 -27
drivers/net/wireless/ath9k/core.c
··· 536 536 * sc_chainmask_auto_sel is used for internal global auto-switching 537 537 * enabled/disabled setting 538 538 */ 539 - if (sc->sc_ah->ah_caps.halTxChainMask != ATH_CHAINMASK_SEL_3X3) { 539 + if (sc->sc_ah->ah_caps.tx_chainmask != ATH_CHAINMASK_SEL_3X3) { 540 540 cm->cur_tx_mask = sc->sc_tx_chainmask; 541 541 return cm->cur_tx_mask; 542 542 } ··· 580 580 { 581 581 sc->sc_update_chainmask = 1; 582 582 if (is_ht) { 583 - sc->sc_tx_chainmask = sc->sc_ah->ah_caps.halTxChainMask; 584 - sc->sc_rx_chainmask = sc->sc_ah->ah_caps.halRxChainMask; 583 + sc->sc_tx_chainmask = sc->sc_ah->ah_caps.tx_chainmask; 584 + sc->sc_rx_chainmask = sc->sc_ah->ah_caps.rx_chainmask; 585 585 } else { 586 586 sc->sc_tx_chainmask = 1; 587 587 sc->sc_rx_chainmask = 1; ··· 780 780 ath_stop(sc); 781 781 782 782 /* Initialize chanmask selection */ 783 - sc->sc_tx_chainmask = ah->ah_caps.halTxChainMask; 784 - sc->sc_rx_chainmask = ah->ah_caps.halRxChainMask; 783 + sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask; 784 + sc->sc_rx_chainmask = ah->ah_caps.rx_chainmask; 785 785 786 786 /* Reset SERDES registers */ 787 787 ath9k_hw_configpcipowersave(ah, 0); ··· 832 832 | ATH9K_INT_RXEOL | ATH9K_INT_RXORN 833 833 | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; 834 834 835 - if (ah->ah_caps.halGTTSupport) 835 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_GTT) 836 836 sc->sc_imask |= ATH9K_INT_GTT; 837 837 838 - if (ah->ah_caps.halHTSupport) 838 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) 839 839 sc->sc_imask |= ATH9K_INT_CST; 840 840 841 841 /* ··· 851 851 * that does, if not overridden by configuration, 852 852 * enable the TIM interrupt when operating as station. 853 853 */ 854 - if (ah->ah_caps.halEnhancedPmSupport && sc->sc_opmode == ATH9K_M_STA && 855 - !sc->sc_config.swBeaconProcess) 854 + if ((ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && 855 + (sc->sc_opmode == ATH9K_M_STA) && 856 + !sc->sc_config.swBeaconProcess) 856 857 sc->sc_imask |= ATH9K_INT_TIM; 857 858 /* 858 859 * Don't enable interrupts here as we've not yet built our ··· 1062 1061 ath9k_hw_set_interrupts(ah, sc->sc_imask); 1063 1062 } 1064 1063 if (status & ATH9K_INT_TIM_TIMER) { 1065 - if (!ah->ah_caps.halAutoSleepSupport) { 1064 + if (!(ah->ah_caps.hw_caps & 1065 + ATH9K_HW_CAP_AUTOSLEEP)) { 1066 1066 /* Clear RxAbort bit so that we can 1067 1067 * receive frames */ 1068 1068 ath9k_hw_setrxabort(ah, 0); ··· 1168 1166 sc->sc_ah = ah; 1169 1167 1170 1168 /* Get the chipset-specific aggr limit. */ 1171 - sc->sc_rtsaggrlimit = ah->ah_caps.halRtsAggrLimit; 1169 + sc->sc_rtsaggrlimit = ah->ah_caps.rts_aggr_limit; 1172 1170 1173 1171 /* Get the hardware key cache size. */ 1174 - sc->sc_keymax = ah->ah_caps.halKeyCacheSize; 1172 + sc->sc_keymax = ah->ah_caps.keycache_size; 1175 1173 if (sc->sc_keymax > ATH_KEYMAX) { 1176 1174 DPRINTF(sc, ATH_DBG_KEYCACHE, 1177 1175 "%s: Warning, using only %u entries in %u key cache\n", ··· 1286 1284 goto bad2; 1287 1285 } 1288 1286 1289 - if (ath9k_hw_getcapability(ah, HAL_CAP_CIPHER, 1287 + if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, 1290 1288 ATH9K_CIPHER_TKIP, NULL)) { 1291 1289 /* 1292 1290 * Whether we should enable h/w TKIP MIC. ··· 1294 1292 * report WMM capable, so it's always safe to turn on 1295 1293 * TKIP MIC in this case. 1296 1294 */ 1297 - ath9k_hw_setcapability(sc->sc_ah, HAL_CAP_TKIP_MIC, 0, 1, NULL); 1295 + ath9k_hw_setcapability(sc->sc_ah, ATH9K_CAP_TKIP_MIC, 1296 + 0, 1, NULL); 1298 1297 } 1299 1298 1300 1299 /* ··· 1304 1301 * With split mic keys the number of stations is limited 1305 1302 * to 27 otherwise 59. 1306 1303 */ 1307 - if (ath9k_hw_getcapability(ah, HAL_CAP_CIPHER, 1304 + if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, 1308 1305 ATH9K_CIPHER_TKIP, NULL) 1309 - && ath9k_hw_getcapability(ah, HAL_CAP_CIPHER, 1306 + && ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, 1310 1307 ATH9K_CIPHER_MIC, NULL) 1311 - && ath9k_hw_getcapability(ah, HAL_CAP_TKIP_SPLIT, 1308 + && ath9k_hw_getcapability(ah, ATH9K_CAP_TKIP_SPLIT, 1312 1309 0, NULL)) 1313 1310 sc->sc_splitmic = 1; 1314 1311 1315 1312 /* turn on mcast key search if possible */ 1316 - if (!ath9k_hw_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL)) 1317 - (void)ath9k_hw_setcapability(ah, HAL_CAP_MCAST_KEYSRCH, 1, 1313 + if (!ath9k_hw_getcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL)) 1314 + (void)ath9k_hw_setcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 1, 1318 1315 1, NULL); 1319 1316 1320 1317 sc->sc_config.txpowlimit = ATH_TXPOWER_MAX; 1321 1318 sc->sc_config.txpowlimit_override = 0; 1322 1319 1323 1320 /* 11n Capabilities */ 1324 - if (ah->ah_caps.halHTSupport) { 1321 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { 1325 1322 sc->sc_txaggr = 1; 1326 1323 sc->sc_rxaggr = 1; 1327 1324 } 1328 1325 1329 - sc->sc_tx_chainmask = ah->ah_caps.halTxChainMask; 1330 - sc->sc_rx_chainmask = ah->ah_caps.halRxChainMask; 1326 + sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask; 1327 + sc->sc_rx_chainmask = ah->ah_caps.rx_chainmask; 1331 1328 1332 1329 /* Configuration for rx chain detection */ 1333 1330 sc->sc_rxchaindetect_ref = 0; ··· 1336 1333 sc->sc_rxchaindetect_delta5GHz = 30; 1337 1334 sc->sc_rxchaindetect_delta2GHz = 30; 1338 1335 1339 - ath9k_hw_setcapability(ah, HAL_CAP_DIVERSITY, 1, true, NULL); 1336 + ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); 1340 1337 sc->sc_defant = ath9k_hw_getdefantenna(ah); 1341 1338 1342 1339 ath9k_hw_getmac(ah, sc->sc_myaddr); 1343 - if (ah->ah_caps.halBssIdMaskSupport) { 1340 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) { 1344 1341 ath9k_hw_getbssidmask(ah, sc->sc_bssidmask); 1345 1342 ATH_SET_VAP_BSSID_MASK(sc->sc_bssidmask); 1346 1343 ath9k_hw_setbssidmask(ah, sc->sc_bssidmask); ··· 1558 1555 if (sc->sc_curtxpow != sc->sc_config.txpowlimit) { 1559 1556 ath9k_hw_set_txpowerlimit(ah, sc->sc_config.txpowlimit); 1560 1557 /* read back in case value is clamped */ 1561 - ath9k_hw_getcapability(ah, HAL_CAP_TXPOW, 1, &txpow); 1558 + ath9k_hw_getcapability(ah, ATH9K_CAP_TXPOW, 1, &txpow); 1562 1559 sc->sc_curtxpow = txpow; 1563 1560 } 1564 1561 } ··· 1760 1757 * descriptors that cross the 4K page boundary. Assume 1761 1758 * one skipped descriptor per 4K page. 1762 1759 */ 1763 - if (!(sc->sc_ah->ah_caps.hal4kbSplitTransSupport)) { 1760 + if (!(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_4KB_SPLITTRANS)) { 1764 1761 u32 ndesc_skipped = 1765 1762 ATH_DESC_4KB_BOUND_NUM_SKIPPED(dd->dd_desc_len); 1766 1763 u32 dma_len; ··· 1801 1798 bf->bf_desc = ds; 1802 1799 bf->bf_daddr = DS2PHYS(dd, ds); 1803 1800 1804 - if (!(sc->sc_ah->ah_caps.hal4kbSplitTransSupport)) { 1801 + if (!(sc->sc_ah->ah_caps.hw_caps & 1802 + ATH9K_HW_CAP_4KB_SPLITTRANS)) { 1805 1803 /* 1806 1804 * Skip descriptor addresses which can cause 4KB 1807 1805 * boundary crossing (addr + length) with a 32 dword
+186 -183
drivers/net/wireless/ath9k/hw.c
··· 335 335 { 336 336 int i; 337 337 338 - ah->ah_config.ath_hal_dma_beacon_response_time = 2; 339 - ah->ah_config.ath_hal_sw_beacon_response_time = 10; 340 - ah->ah_config.ath_hal_additional_swba_backoff = 0; 341 - ah->ah_config.ath_hal_6mb_ack = 0x0; 342 - ah->ah_config.ath_hal_cwmIgnoreExtCCA = 0; 343 - ah->ah_config.ath_hal_pciePowerSaveEnable = 0; 344 - ah->ah_config.ath_hal_pcieL1SKPEnable = 0; 345 - ah->ah_config.ath_hal_pcieClockReq = 0; 346 - ah->ah_config.ath_hal_pciePowerReset = 0x100; 347 - ah->ah_config.ath_hal_pcieRestore = 0; 348 - ah->ah_config.ath_hal_pcieWaen = 0; 349 - ah->ah_config.ath_hal_analogShiftReg = 1; 350 - ah->ah_config.ath_hal_htEnable = 1; 351 - ah->ah_config.ath_hal_ofdmTrigLow = 200; 352 - ah->ah_config.ath_hal_ofdmTrigHigh = 500; 353 - ah->ah_config.ath_hal_cckTrigHigh = 200; 354 - ah->ah_config.ath_hal_cckTrigLow = 100; 355 - ah->ah_config.ath_hal_enableANI = 0; 356 - ah->ah_config.ath_hal_noiseImmunityLvl = 4; 357 - ah->ah_config.ath_hal_ofdmWeakSigDet = 1; 358 - ah->ah_config.ath_hal_cckWeakSigThr = 0; 359 - ah->ah_config.ath_hal_spurImmunityLvl = 2; 360 - ah->ah_config.ath_hal_firStepLvl = 0; 361 - ah->ah_config.ath_hal_rssiThrHigh = 40; 362 - ah->ah_config.ath_hal_rssiThrLow = 7; 363 - ah->ah_config.ath_hal_diversityControl = 0; 364 - ah->ah_config.ath_hal_antennaSwitchSwap = 0; 338 + ah->ah_config.dma_beacon_response_time = 2; 339 + ah->ah_config.sw_beacon_response_time = 10; 340 + ah->ah_config.additional_swba_backoff = 0; 341 + ah->ah_config.ack_6mb = 0x0; 342 + ah->ah_config.cwm_ignore_extcca = 0; 343 + ah->ah_config.pcie_powersave_enable = 0; 344 + ah->ah_config.pcie_l1skp_enable = 0; 345 + ah->ah_config.pcie_clock_req = 0; 346 + ah->ah_config.pcie_power_reset = 0x100; 347 + ah->ah_config.pcie_restore = 0; 348 + ah->ah_config.pcie_waen = 0; 349 + ah->ah_config.analog_shiftreg = 1; 350 + ah->ah_config.ht_enable = 1; 351 + ah->ah_config.ofdm_trig_low = 200; 352 + ah->ah_config.ofdm_trig_high = 500; 353 + ah->ah_config.cck_trig_high = 200; 354 + ah->ah_config.cck_trig_low = 100; 355 + ah->ah_config.enable_ani = 0; 356 + ah->ah_config.noise_immunity_level = 4; 357 + ah->ah_config.ofdm_weaksignal_det = 1; 358 + ah->ah_config.cck_weaksignal_thr = 0; 359 + ah->ah_config.spur_immunity_level = 2; 360 + ah->ah_config.firstep_level = 0; 361 + ah->ah_config.rssi_thr_high = 40; 362 + ah->ah_config.rssi_thr_low = 7; 363 + ah->ah_config.diversity_control = 0; 364 + ah->ah_config.antenna_switch_swap = 0; 365 365 366 366 for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { 367 - ah->ah_config.ath_hal_spurChans[i][0] = AR_NO_SPUR; 368 - ah->ah_config.ath_hal_spurChans[i][1] = AR_NO_SPUR; 367 + ah->ah_config.spurchans[i][0] = AR_NO_SPUR; 368 + ah->ah_config.spurchans[i][1] = AR_NO_SPUR; 369 369 } 370 370 371 - ah->ah_config.ath_hal_intrMitigation = 0; 371 + ah->ah_config.intr_mitigation = 0; 372 372 } 373 373 374 374 static inline void ath9k_hw_override_ini(struct ath_hal *ah, ··· 458 458 459 459 REG_WRITE(ah, reg, regVal); 460 460 461 - if (ah->ah_config.ath_hal_analogShiftReg) 461 + if (ah->ah_config.analog_shiftreg) 462 462 udelay(100); 463 463 464 464 return; ··· 1001 1001 } 1002 1002 1003 1003 bool ath9k_hw_setcapability(struct ath_hal *ah, 1004 - enum hal_capability_type type, 1004 + enum ath9k_capability_type type, 1005 1005 u32 capability, 1006 1006 u32 setting, 1007 1007 int *status) ··· 1010 1010 u32 v; 1011 1011 1012 1012 switch (type) { 1013 - case HAL_CAP_TKIP_MIC: 1013 + case ATH9K_CAP_TKIP_MIC: 1014 1014 if (setting) 1015 1015 ahp->ah_staId1Defaults |= 1016 1016 AR_STA_ID1_CRPT_MIC_ENABLE; ··· 1018 1018 ahp->ah_staId1Defaults &= 1019 1019 ~AR_STA_ID1_CRPT_MIC_ENABLE; 1020 1020 return true; 1021 - case HAL_CAP_DIVERSITY: 1021 + case ATH9K_CAP_DIVERSITY: 1022 1022 v = REG_READ(ah, AR_PHY_CCK_DETECT); 1023 1023 if (setting) 1024 1024 v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; ··· 1026 1026 v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; 1027 1027 REG_WRITE(ah, AR_PHY_CCK_DETECT, v); 1028 1028 return true; 1029 - case HAL_CAP_MCAST_KEYSRCH: 1029 + case ATH9K_CAP_MCAST_KEYSRCH: 1030 1030 if (setting) 1031 1031 ahp->ah_staId1Defaults |= AR_STA_ID1_MCAST_KSRCH; 1032 1032 else 1033 1033 ahp->ah_staId1Defaults &= ~AR_STA_ID1_MCAST_KSRCH; 1034 1034 return true; 1035 - case HAL_CAP_TSF_ADJUST: 1035 + case ATH9K_CAP_TSF_ADJUST: 1036 1036 if (setting) 1037 1037 ahp->ah_miscMode |= AR_PCU_TX_ADD_TSF; 1038 1038 else ··· 1161 1161 u32 macmode; 1162 1162 1163 1163 if (mode == ATH9K_HT_MACMODE_2040 && 1164 - !ah->ah_config.ath_hal_cwmIgnoreExtCCA) 1164 + !ah->ah_config.cwm_ignore_extcca) 1165 1165 macmode = AR_2040_JOINED_RX_CLEAR; 1166 1166 else 1167 1167 macmode = 0; ··· 1214 1214 ah->ah_tpScale = ATH9K_TP_SCALE_MAX; 1215 1215 1216 1216 ahp->ah_atimWindow = 0; 1217 - ahp->ah_diversityControl = ah->ah_config.ath_hal_diversityControl; 1217 + ahp->ah_diversityControl = ah->ah_config.diversity_control; 1218 1218 ahp->ah_antennaSwitchSwap = 1219 - ah->ah_config.ath_hal_antennaSwitchSwap; 1219 + ah->ah_config.antenna_switch_swap; 1220 1220 1221 1221 ahp->ah_staId1Defaults = AR_STA_ID1_CRPT_MIC_ENABLE; 1222 1222 ahp->ah_beaconInterval = 100; ··· 1371 1371 1372 1372 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 1373 1373 "Getting spur idx %d is2Ghz. %d val %x\n", 1374 - i, is2GHz, ah->ah_config.ath_hal_spurChans[i][is2GHz]); 1374 + i, is2GHz, ah->ah_config.spurchans[i][is2GHz]); 1375 1375 1376 - switch (ah->ah_config.ath_hal_spurMode) { 1376 + switch (ah->ah_config.spurmode) { 1377 1377 case SPUR_DISABLE: 1378 1378 break; 1379 1379 case SPUR_ENABLE_IOCTL: 1380 - spur_val = ah->ah_config.ath_hal_spurChans[i][is2GHz]; 1380 + spur_val = ah->ah_config.spurchans[i][is2GHz]; 1381 1381 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 1382 1382 "Getting spur val from new loc. %d\n", spur_val); 1383 1383 break; ··· 2094 2094 ath9k_enable_mib_counters(ah); 2095 2095 } 2096 2096 ahp->ah_aniPeriod = ATH9K_ANI_PERIOD; 2097 - if (ah->ah_config.ath_hal_enableANI) 2097 + if (ah->ah_config.enable_ani) 2098 2098 ahp->ah_procPhyErr |= HAL_PROCESS_ANI; 2099 2099 } 2100 2100 ··· 2504 2504 ATH9K_RX_FILTER_PHYERR); 2505 2505 if (ah->ah_opmode == ATH9K_M_HOSTAP) { 2506 2506 ahp->ah_curani->ofdmTrigHigh = 2507 - ah->ah_config.ath_hal_ofdmTrigHigh; 2507 + ah->ah_config.ofdm_trig_high; 2508 2508 ahp->ah_curani->ofdmTrigLow = 2509 - ah->ah_config.ath_hal_ofdmTrigLow; 2509 + ah->ah_config.ofdm_trig_low; 2510 2510 ahp->ah_curani->cckTrigHigh = 2511 - ah->ah_config.ath_hal_cckTrigHigh; 2511 + ah->ah_config.cck_trig_high; 2512 2512 ahp->ah_curani->cckTrigLow = 2513 - ah->ah_config.ath_hal_cckTrigLow; 2513 + ah->ah_config.cck_trig_low; 2514 2514 } 2515 2515 ath9k_ani_restart(ah); 2516 2516 return; ··· 2870 2870 2871 2871 static u32 ath9k_hw_gpio_get(struct ath_hal *ah, u32 gpio) 2872 2872 { 2873 - if (gpio >= ah->ah_caps.halNumGpioPins) 2873 + if (gpio >= ah->ah_caps.num_gpio_pins) 2874 2874 return 0xffffffff; 2875 2875 2876 2876 if (AR_SREV_9280_10_OR_LATER(ah)) { ··· 2947 2947 static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) 2948 2948 { 2949 2949 struct ath_hal_5416 *ahp = AH5416(ah); 2950 - struct hal_capabilities *pCap = &ah->ah_caps; 2950 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 2951 2951 u16 capField = 0, eeval; 2952 2952 2953 2953 eeval = ath9k_hw_get_eeprom(ahp, EEP_REG_0); ··· 2970 2970 ah->ah_currentRD); 2971 2971 } 2972 2972 2973 - pCap->halWirelessModes = 0; 2973 + pCap->wireless_modes = 0; 2974 2974 eeval = ath9k_hw_get_eeprom(ahp, EEP_OP_MODE); 2975 2975 2976 2976 if (eeval & AR5416_OPFLAGS_11A) { 2977 - pCap->halWirelessModes |= ATH9K_MODE_SEL_11A | 2978 - ((!ah->ah_config.ath_hal_htEnable 2977 + pCap->wireless_modes |= ATH9K_MODE_SEL_11A | 2978 + ((!ah->ah_config.ht_enable 2979 2979 || (eeval & AR5416_OPFLAGS_N_5G_HT20)) ? 0 2980 2980 : (ATH9K_MODE_SEL_11NA_HT20 | 2981 2981 ((eeval & AR5416_OPFLAGS_N_5G_HT40) ? 0 ··· 2983 2983 ATH9K_MODE_SEL_11NA_HT40MINUS)))); 2984 2984 } 2985 2985 if (eeval & AR5416_OPFLAGS_11G) { 2986 - pCap->halWirelessModes |= 2986 + pCap->wireless_modes |= 2987 2987 ATH9K_MODE_SEL_11B | ATH9K_MODE_SEL_11G | 2988 - ((!ah->ah_config.ath_hal_htEnable 2988 + ((!ah->ah_config.ht_enable 2989 2989 || (eeval & AR5416_OPFLAGS_N_2G_HT20)) ? 0 2990 2990 : (ATH9K_MODE_SEL_11NG_HT20 | 2991 2991 ((eeval & AR5416_OPFLAGS_N_2G_HT40) ? 0 ··· 2993 2993 ATH9K_MODE_SEL_11NG_HT40MINUS)))); 2994 2994 2995 2995 } 2996 - pCap->halTxChainMask = ath9k_hw_get_eeprom(ahp, EEP_TX_MASK); 2996 + pCap->tx_chainmask = ath9k_hw_get_eeprom(ahp, EEP_TX_MASK); 2997 2997 if ((ah->ah_isPciExpress) 2998 2998 || (eeval & AR5416_OPFLAGS_11A)) { 2999 - pCap->halRxChainMask = 2999 + pCap->rx_chainmask = 3000 3000 ath9k_hw_get_eeprom(ahp, EEP_RX_MASK); 3001 3001 } else { 3002 - pCap->halRxChainMask = 3002 + pCap->rx_chainmask = 3003 3003 (ath9k_hw_gpio_get(ah, 0)) ? 0x5 : 0x7; 3004 3004 } 3005 3005 3006 3006 if (!(AR_SREV_9280(ah) && (ah->ah_macRev == 0))) 3007 3007 ahp->ah_miscMode |= AR_PCU_MIC_NEW_LOC_ENA; 3008 3008 3009 - pCap->halLow2GhzChan = 2312; 3010 - pCap->halHigh2GhzChan = 2732; 3009 + pCap->low_2ghz_chan = 2312; 3010 + pCap->high_2ghz_chan = 2732; 3011 3011 3012 - pCap->halLow5GhzChan = 4920; 3013 - pCap->halHigh5GhzChan = 6100; 3012 + pCap->low_5ghz_chan = 4920; 3013 + pCap->high_5ghz_chan = 6100; 3014 3014 3015 - pCap->halCipherCkipSupport = false; 3016 - pCap->halCipherTkipSupport = true; 3017 - pCap->halCipherAesCcmSupport = true; 3015 + pCap->hw_caps &= ~ATH9K_HW_CAP_CIPHER_CKIP; 3016 + pCap->hw_caps |= ATH9K_HW_CAP_CIPHER_TKIP; 3017 + pCap->hw_caps |= ATH9K_HW_CAP_CIPHER_AESCCM; 3018 3018 3019 - pCap->halMicCkipSupport = false; 3020 - pCap->halMicTkipSupport = true; 3021 - pCap->halMicAesCcmSupport = true; 3019 + pCap->hw_caps &= ~ATH9K_HW_CAP_MIC_CKIP; 3020 + pCap->hw_caps |= ATH9K_HW_CAP_MIC_TKIP; 3021 + pCap->hw_caps |= ATH9K_HW_CAP_MIC_AESCCM; 3022 3022 3023 - pCap->halChanSpreadSupport = true; 3023 + pCap->hw_caps |= ATH9K_HW_CAP_CHAN_SPREAD; 3024 3024 3025 - pCap->halHTSupport = 3026 - ah->ah_config.ath_hal_htEnable ? true : false; 3027 - pCap->halGTTSupport = true; 3028 - pCap->halVEOLSupport = true; 3029 - pCap->halBssIdMaskSupport = true; 3030 - pCap->halMcastKeySrchSupport = false; 3025 + if (ah->ah_config.ht_enable) 3026 + pCap->hw_caps |= ATH9K_HW_CAP_HT; 3027 + else 3028 + pCap->hw_caps &= ~ATH9K_HW_CAP_HT; 3029 + 3030 + pCap->hw_caps |= ATH9K_HW_CAP_GTT; 3031 + pCap->hw_caps |= ATH9K_HW_CAP_VEOL; 3032 + pCap->hw_caps |= ATH9K_HW_CAP_BSSIDMASK; 3033 + pCap->hw_caps &= ~ATH9K_HW_CAP_MCAST_KEYSEARCH; 3031 3034 3032 3035 if (capField & AR_EEPROM_EEPCAP_MAXQCU) 3033 - pCap->halTotalQueues = 3036 + pCap->total_queues = 3034 3037 MS(capField, AR_EEPROM_EEPCAP_MAXQCU); 3035 3038 else 3036 - pCap->halTotalQueues = ATH9K_NUM_TX_QUEUES; 3039 + pCap->total_queues = ATH9K_NUM_TX_QUEUES; 3037 3040 3038 3041 if (capField & AR_EEPROM_EEPCAP_KC_ENTRIES) 3039 - pCap->halKeyCacheSize = 3042 + pCap->keycache_size = 3040 3043 1 << MS(capField, AR_EEPROM_EEPCAP_KC_ENTRIES); 3041 3044 else 3042 - pCap->halKeyCacheSize = AR_KEYTABLE_SIZE; 3045 + pCap->keycache_size = AR_KEYTABLE_SIZE; 3043 3046 3044 - pCap->halFastCCSupport = true; 3045 - pCap->halNumMRRetries = 4; 3046 - pCap->halTxTrigLevelMax = MAX_TX_FIFO_THRESHOLD; 3047 + pCap->hw_caps |= ATH9K_HW_CAP_FASTCC; 3048 + pCap->num_mr_retries = 4; 3049 + pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD; 3047 3050 3048 3051 if (AR_SREV_9280_10_OR_LATER(ah)) 3049 - pCap->halNumGpioPins = AR928X_NUM_GPIO; 3052 + pCap->num_gpio_pins = AR928X_NUM_GPIO; 3050 3053 else 3051 - pCap->halNumGpioPins = AR_NUM_GPIO; 3054 + pCap->num_gpio_pins = AR_NUM_GPIO; 3052 3055 3053 3056 if (AR_SREV_9280_10_OR_LATER(ah)) { 3054 - pCap->halWowSupport = true; 3055 - pCap->halWowMatchPatternExact = true; 3057 + pCap->hw_caps |= ATH9K_HW_CAP_WOW; 3058 + pCap->hw_caps |= ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT; 3056 3059 } else { 3057 - pCap->halWowSupport = false; 3058 - pCap->halWowMatchPatternExact = false; 3060 + pCap->hw_caps &= ~ATH9K_HW_CAP_WOW; 3061 + pCap->hw_caps &= ~ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT; 3059 3062 } 3060 3063 3061 3064 if (AR_SREV_9160_10_OR_LATER(ah) || AR_SREV_9100(ah)) { 3062 - pCap->halCSTSupport = true; 3063 - pCap->halRtsAggrLimit = ATH_AMPDU_LIMIT_MAX; 3065 + pCap->hw_caps |= ATH9K_HW_CAP_CST; 3066 + pCap->rts_aggr_limit = ATH_AMPDU_LIMIT_MAX; 3064 3067 } else { 3065 - pCap->halRtsAggrLimit = (8 * 1024); 3068 + pCap->rts_aggr_limit = (8 * 1024); 3066 3069 } 3067 3070 3068 - pCap->halEnhancedPmSupport = true; 3071 + pCap->hw_caps |= ATH9K_HW_CAP_ENHANCEDPM; 3069 3072 3070 3073 ah->ah_rfsilent = ath9k_hw_get_eeprom(ahp, EEP_RF_SILENT); 3071 3074 if (ah->ah_rfsilent & EEP_RFSILENT_ENABLED) { ··· 3077 3074 ahp->ah_polarity = 3078 3075 MS(ah->ah_rfsilent, EEP_RFSILENT_POLARITY); 3079 3076 3080 - ath9k_hw_setcapability(ah, HAL_CAP_RFSILENT, 1, true, 3077 + ath9k_hw_setcapability(ah, ATH9K_CAP_RFSILENT, 1, true, 3081 3078 NULL); 3082 - pCap->halRfSilentSupport = true; 3079 + pCap->hw_caps |= ATH9K_HW_CAP_RFSILENT; 3083 3080 } 3084 3081 3085 3082 if ((ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) || ··· 3087 3084 (ah->ah_macVersion == AR_SREV_VERSION_9160) || 3088 3085 (ah->ah_macVersion == AR_SREV_VERSION_9100) || 3089 3086 (ah->ah_macVersion == AR_SREV_VERSION_9280)) 3090 - pCap->halAutoSleepSupport = false; 3087 + pCap->hw_caps &= ~ATH9K_HW_CAP_AUTOSLEEP; 3091 3088 else 3092 - pCap->halAutoSleepSupport = true; 3089 + pCap->hw_caps |= ATH9K_HW_CAP_AUTOSLEEP; 3093 3090 3094 3091 if (AR_SREV_9280(ah)) 3095 - pCap->hal4kbSplitTransSupport = false; 3092 + pCap->hw_caps &= ~ATH9K_HW_CAP_4KB_SPLITTRANS; 3096 3093 else 3097 - pCap->hal4kbSplitTransSupport = true; 3094 + pCap->hw_caps |= ATH9K_HW_CAP_4KB_SPLITTRANS; 3098 3095 3099 3096 if (ah->ah_currentRDExt & (1 << REG_EXT_JAPAN_MIDBAND)) { 3100 - pCap->halRegCap = 3097 + pCap->reg_cap = 3101 3098 AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | 3102 3099 AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN | 3103 3100 AR_EEPROM_EEREGCAP_EN_KK_U2 | 3104 3101 AR_EEPROM_EEREGCAP_EN_KK_MIDBAND; 3105 3102 } else { 3106 - pCap->halRegCap = 3103 + pCap->reg_cap = 3107 3104 AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | 3108 3105 AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN; 3109 3106 } 3110 3107 3111 - pCap->halRegCap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND; 3108 + pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND; 3112 3109 3113 - pCap->halNumAntCfg5GHz = 3110 + pCap->num_antcfg_5ghz = 3114 3111 ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_5GHZ); 3115 - pCap->halNumAntCfg2GHz = 3112 + pCap->num_antcfg_2ghz = 3116 3113 ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_2GHZ); 3117 3114 3118 3115 return true; ··· 3154 3151 { 3155 3152 REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); 3156 3153 if (setChip) { 3157 - struct hal_capabilities *pCap = &ah->ah_caps; 3154 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 3158 3155 3159 - if (!pCap->halAutoSleepSupport) { 3156 + if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { 3160 3157 REG_WRITE(ah, AR_RTC_FORCE_WAKE, 3161 3158 AR_RTC_FORCE_WAKE_ON_INT); 3162 3159 } else { ··· 3265 3262 3266 3263 ath9k_hw_set_defaults(ah); 3267 3264 3268 - if (ah->ah_config.ath_hal_intrMitigation != 0) 3265 + if (ah->ah_config.intr_mitigation != 0) 3269 3266 ahp->ah_intrMitigation = true; 3270 3267 3271 3268 if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { ··· 3282 3279 goto bad; 3283 3280 } 3284 3281 3285 - if (ah->ah_config.ath_hal_serializeRegMode == SER_REG_MODE_AUTO) { 3282 + if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { 3286 3283 if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { 3287 - ah->ah_config.ath_hal_serializeRegMode = 3284 + ah->ah_config.serialize_regmode = 3288 3285 SER_REG_MODE_ON; 3289 3286 } else { 3290 - ah->ah_config.ath_hal_serializeRegMode = 3287 + ah->ah_config.serialize_regmode = 3291 3288 SER_REG_MODE_OFF; 3292 3289 } 3293 3290 } 3294 3291 DPRINTF(ah->ah_sc, ATH_DBG_RESET, 3295 - "%s: ath_hal_serializeRegMode is %d\n", 3296 - __func__, ah->ah_config.ath_hal_serializeRegMode); 3292 + "%s: serialize_regmode is %d\n", 3293 + __func__, ah->ah_config.serialize_regmode); 3297 3294 3298 3295 if ((ah->ah_macVersion != AR_SREV_VERSION_5416_PCI) && 3299 3296 (ah->ah_macVersion != AR_SREV_VERSION_5416_PCIE) && ··· 3337 3334 } 3338 3335 3339 3336 if (AR_SREV_9160(ah)) { 3340 - ah->ah_config.ath_hal_enableANI = 1; 3337 + ah->ah_config.enable_ani = 1; 3341 3338 ahp->ah_ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | 3342 3339 ATH9K_ANI_FIRSTEP_LEVEL); 3343 3340 } else { ··· 3358 3355 INIT_INI_ARRAY(&ahp->ah_iniCommon, ar9280Common_9280_2, 3359 3356 ARRAY_SIZE(ar9280Common_9280_2), 2); 3360 3357 3361 - if (ah->ah_config.ath_hal_pcieClockReq) { 3358 + if (ah->ah_config.pcie_clock_req) { 3362 3359 INIT_INI_ARRAY(&ahp->ah_iniPcieSerdes, 3363 3360 ar9280PciePhy_clkreq_off_L1_9280, 3364 3361 ARRAY_SIZE ··· 3531 3528 u16 flags, u16 *low, 3532 3529 u16 *high) 3533 3530 { 3534 - struct hal_capabilities *pCap = &ah->ah_caps; 3531 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 3535 3532 3536 3533 if (flags & CHANNEL_5GHZ) { 3537 - *low = pCap->halLow5GhzChan; 3538 - *high = pCap->halHigh5GhzChan; 3534 + *low = pCap->low_5ghz_chan; 3535 + *high = pCap->high_5ghz_chan; 3539 3536 return true; 3540 3537 } 3541 3538 if ((flags & CHANNEL_2GHZ)) { 3542 - *low = pCap->halLow2GhzChan; 3543 - *high = pCap->halHigh2GhzChan; 3539 + *low = pCap->low_2ghz_chan; 3540 + *high = pCap->high_2ghz_chan; 3544 3541 3545 3542 return true; 3546 3543 } ··· 3911 3908 if (ah->ah_isPciExpress != true) 3912 3909 return; 3913 3910 3914 - if (ah->ah_config.ath_hal_pciePowerSaveEnable == 2) 3911 + if (ah->ah_config.pcie_powersave_enable == 2) 3915 3912 return; 3916 3913 3917 3914 if (restore) ··· 3932 3929 REG_WRITE(ah, AR_PCIE_SERDES, 0x13160820); 3933 3930 REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980560); 3934 3931 3935 - if (ah->ah_config.ath_hal_pcieClockReq) 3932 + if (ah->ah_config.pcie_clock_req) 3936 3933 REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffc); 3937 3934 else 3938 3935 REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffd); ··· 3959 3956 3960 3957 REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); 3961 3958 3962 - if (ah->ah_config.ath_hal_pcieWaen) { 3963 - REG_WRITE(ah, AR_WA, ah->ah_config.ath_hal_pcieWaen); 3959 + if (ah->ah_config.pcie_waen) { 3960 + REG_WRITE(ah, AR_WA, ah->ah_config.pcie_waen); 3964 3961 } else { 3965 3962 if (AR_SREV_9280(ah)) 3966 3963 REG_WRITE(ah, AR_WA, 0x0040073f); ··· 4693 4690 ath9k_hw_get_channel_centers(ah, chan, &centers); 4694 4691 freq = centers.synth_center; 4695 4692 4696 - ah->ah_config.ath_hal_spurMode = SPUR_ENABLE_EEPROM; 4693 + ah->ah_config.spurmode = SPUR_ENABLE_EEPROM; 4697 4694 for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { 4698 4695 cur_bb_spur = ath9k_hw_eeprom_get_spur_chan(ah, i, is2GHz); 4699 4696 ··· 5407 5404 REG_WRITE(ah, reg, val); 5408 5405 5409 5406 if (reg >= 0x7800 && reg < 0x78a0 5410 - && ah->ah_config.ath_hal_analogShiftReg) { 5407 + && ah->ah_config.analog_shiftreg) { 5411 5408 udelay(100); 5412 5409 } 5413 5410 ··· 5421 5418 REG_WRITE(ah, reg, val); 5422 5419 5423 5420 if (reg >= 0x7800 && reg < 0x78a0 5424 - && ah->ah_config.ath_hal_analogShiftReg) { 5421 + && ah->ah_config.analog_shiftreg) { 5425 5422 udelay(100); 5426 5423 } 5427 5424 ··· 5924 5921 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, 5925 5922 AR_GPIO_JTAG_DISABLE); 5926 5923 5927 - if (ah->ah_caps.halWirelessModes & ATH9K_MODE_SEL_11A) { 5924 + if (ah->ah_caps.wireless_modes & ATH9K_MODE_SEL_11A) { 5928 5925 if (IS_CHAN_5GHZ(chan)) 5929 5926 ath9k_hw_set_gpio(ah, 9, 0); 5930 5927 else ··· 5958 5955 | macStaId1 5959 5956 | AR_STA_ID1_RTS_USE_DEF 5960 5957 | (ah->ah_config. 5961 - ath_hal_6mb_ack ? AR_STA_ID1_ACKCTS_6MB : 0) 5958 + ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0) 5962 5959 | ahp->ah_staId1Defaults); 5963 5960 ath9k_hw_set_operating_mode(ah, opmode); 5964 5961 ··· 5987 5984 REG_WRITE(ah, AR_DQCUMASK(i), 1 << i); 5988 5985 5989 5986 ahp->ah_intrTxqs = 0; 5990 - for (i = 0; i < ah->ah_caps.halTotalQueues; i++) 5987 + for (i = 0; i < ah->ah_caps.total_queues; i++) 5991 5988 ath9k_hw_resettxqueue(ah, i); 5992 5989 5993 5990 ath9k_hw_init_interrupt_masks(ah, opmode); ··· 6625 6622 *antenna_cfgd = true; 6626 6623 break; 6627 6624 case ATH9K_ANT_FIXED_B: 6628 - if (ah->ah_caps.halTxChainMask > 6625 + if (ah->ah_caps.tx_chainmask > 6629 6626 ATH9K_ANTENNA1_CHAINMASK) { 6630 6627 *tx_chainmask = ATH9K_ANTENNA1_CHAINMASK; 6631 6628 } ··· 6653 6650 } 6654 6651 6655 6652 bool 6656 - ath9k_hw_getcapability(struct ath_hal *ah, enum hal_capability_type type, 6653 + ath9k_hw_getcapability(struct ath_hal *ah, enum ath9k_capability_type type, 6657 6654 u32 capability, u32 *result) 6658 6655 { 6659 6656 struct ath_hal_5416 *ahp = AH5416(ah); 6660 - const struct hal_capabilities *pCap = &ah->ah_caps; 6657 + const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 6661 6658 6662 6659 switch (type) { 6663 - case HAL_CAP_CIPHER: 6660 + case ATH9K_CAP_CIPHER: 6664 6661 switch (capability) { 6665 6662 case ATH9K_CIPHER_AES_CCM: 6666 6663 case ATH9K_CIPHER_AES_OCB: ··· 6672 6669 default: 6673 6670 return false; 6674 6671 } 6675 - case HAL_CAP_TKIP_MIC: 6672 + case ATH9K_CAP_TKIP_MIC: 6676 6673 switch (capability) { 6677 6674 case 0: 6678 6675 return true; ··· 6681 6678 AR_STA_ID1_CRPT_MIC_ENABLE) ? true : 6682 6679 false; 6683 6680 } 6684 - case HAL_CAP_TKIP_SPLIT: 6681 + case ATH9K_CAP_TKIP_SPLIT: 6685 6682 return (ahp->ah_miscMode & AR_PCU_MIC_NEW_LOC_ENA) ? 6686 6683 false : true; 6687 - case HAL_CAP_WME_TKIPMIC: 6684 + case ATH9K_CAP_WME_TKIPMIC: 6688 6685 return 0; 6689 - case HAL_CAP_PHYCOUNTERS: 6686 + case ATH9K_CAP_PHYCOUNTERS: 6690 6687 return ahp->ah_hasHwPhyCounters ? 0 : -ENXIO; 6691 - case HAL_CAP_DIVERSITY: 6688 + case ATH9K_CAP_DIVERSITY: 6692 6689 return (REG_READ(ah, AR_PHY_CCK_DETECT) & 6693 6690 AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV) ? 6694 6691 true : false; 6695 - case HAL_CAP_PHYDIAG: 6692 + case ATH9K_CAP_PHYDIAG: 6696 6693 return true; 6697 - case HAL_CAP_MCAST_KEYSRCH: 6694 + case ATH9K_CAP_MCAST_KEYSRCH: 6698 6695 switch (capability) { 6699 6696 case 0: 6700 6697 return true; ··· 6708 6705 } 6709 6706 } 6710 6707 return false; 6711 - case HAL_CAP_TSF_ADJUST: 6708 + case ATH9K_CAP_TSF_ADJUST: 6712 6709 return (ahp->ah_miscMode & AR_PCU_TX_ADD_TSF) ? 6713 6710 true : false; 6714 - case HAL_CAP_RFSILENT: 6711 + case ATH9K_CAP_RFSILENT: 6715 6712 if (capability == 3) 6716 6713 return false; 6717 - case HAL_CAP_ANT_CFG_2GHZ: 6718 - *result = pCap->halNumAntCfg2GHz; 6714 + case ATH9K_CAP_ANT_CFG_2GHZ: 6715 + *result = pCap->num_antcfg_2ghz; 6719 6716 return true; 6720 - case HAL_CAP_ANT_CFG_5GHZ: 6721 - *result = pCap->halNumAntCfg5GHz; 6717 + case ATH9K_CAP_ANT_CFG_5GHZ: 6718 + *result = pCap->num_antcfg_5ghz; 6722 6719 return true; 6723 - case HAL_CAP_TXPOW: 6720 + case ATH9K_CAP_TXPOW: 6724 6721 switch (capability) { 6725 6722 case 0: 6726 6723 return 0; ··· 6745 6742 { 6746 6743 struct ath_hal_5416 *ahp = AH5416(ah); 6747 6744 struct ath9k_channel *chan = ah->ah_curchan; 6748 - const struct hal_capabilities *pCap = &ah->ah_caps; 6745 + const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 6749 6746 u16 ant_config; 6750 6747 u32 halNumAntConfig; 6751 6748 6752 6749 halNumAntConfig = 6753 - IS_CHAN_2GHZ(chan) ? pCap->halNumAntCfg2GHz : pCap-> 6754 - halNumAntCfg5GHz; 6750 + IS_CHAN_2GHZ(chan) ? pCap->num_antcfg_2ghz : pCap-> 6751 + num_antcfg_5ghz; 6755 6752 6756 6753 if (cfg < halNumAntConfig) { 6757 6754 if (!ath9k_hw_get_eeprom_antenna_cfg(ahp, chan, ··· 6787 6784 { 6788 6785 u32 isr = 0; 6789 6786 u32 mask2 = 0; 6790 - struct hal_capabilities *pCap = &ah->ah_caps; 6787 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 6791 6788 u32 sync_cause = 0; 6792 6789 bool fatal_int = false; 6793 6790 ··· 6871 6868 } 6872 6869 6873 6870 if (!AR_SREV_9100(ah)) { 6874 - if (!pCap->halAutoSleepSupport) { 6871 + if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { 6875 6872 u32 isr5 = REG_READ(ah, AR_ISR_S5_S); 6876 6873 if (isr5 & AR_ISR_S5_TIM_TIMER) 6877 6874 *masked |= ATH9K_INT_TIM_TIMER; ··· 6930 6927 struct ath_hal_5416 *ahp = AH5416(ah); 6931 6928 u32 omask = ahp->ah_maskReg; 6932 6929 u32 mask, mask2; 6933 - struct hal_capabilities *pCap = &ah->ah_caps; 6930 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 6934 6931 6935 6932 DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: 0x%x => 0x%x\n", __func__, 6936 6933 omask, ints); ··· 6968 6965 mask |= AR_IMR_RXMINTR | AR_IMR_RXINTM; 6969 6966 else 6970 6967 mask |= AR_IMR_RXOK | AR_IMR_RXDESC; 6971 - if (!pCap->halAutoSleepSupport) 6968 + if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) 6972 6969 mask |= AR_IMR_GENTMR; 6973 6970 } 6974 6971 ··· 7005 7002 REG_WRITE(ah, AR_IMR_S2, mask | mask2); 7006 7003 ahp->ah_maskReg = ints; 7007 7004 7008 - if (!pCap->halAutoSleepSupport) { 7005 + if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { 7009 7006 if (ints & ATH9K_INT_TIM_TIMER) 7010 7007 REG_SET_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); 7011 7008 else ··· 7064 7061 REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 7065 7062 TU_TO_USEC(next_beacon - 7066 7063 ah->ah_config. 7067 - ath_hal_dma_beacon_response_time)); 7064 + dma_beacon_response_time)); 7068 7065 REG_WRITE(ah, AR_NEXT_SWBA, 7069 7066 TU_TO_USEC(next_beacon - 7070 7067 ah->ah_config. 7071 - ath_hal_sw_beacon_response_time)); 7068 + sw_beacon_response_time)); 7072 7069 flags |= 7073 7070 AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; 7074 7071 break; ··· 7093 7090 const struct ath9k_beacon_state *bs) 7094 7091 { 7095 7092 u32 nextTbtt, beaconintval, dtimperiod, beacontimeout; 7096 - struct hal_capabilities *pCap = &ah->ah_caps; 7093 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7097 7094 7098 7095 REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bs->bs_nexttbtt)); 7099 7096 ··· 7136 7133 SM((CAB_TIMEOUT_VAL << 3), AR_SLEEP1_CAB_TIMEOUT) 7137 7134 | AR_SLEEP1_ASSUME_DTIM); 7138 7135 7139 - if (pCap->halAutoSleepSupport) 7136 + if (pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP) 7140 7137 beacontimeout = (BEACON_TIMEOUT_VAL << 3); 7141 7138 else 7142 7139 beacontimeout = MIN_BEACON_TIMEOUT_VAL; ··· 7155 7152 7156 7153 bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry) 7157 7154 { 7158 - if (entry < ah->ah_caps.halKeyCacheSize) { 7155 + if (entry < ah->ah_caps.keycache_size) { 7159 7156 u32 val = REG_READ(ah, AR_KEYTABLE_MAC1(entry)); 7160 7157 if (val & AR_KEYTABLE_VALID) 7161 7158 return true; ··· 7167 7164 { 7168 7165 u32 keyType; 7169 7166 7170 - if (entry >= ah->ah_caps.halKeyCacheSize) { 7167 + if (entry >= ah->ah_caps.keycache_size) { 7171 7168 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 7172 7169 "%s: entry %u out of range\n", __func__, entry); 7173 7170 return false; ··· 7205 7202 { 7206 7203 u32 macHi, macLo; 7207 7204 7208 - if (entry >= ah->ah_caps.halKeyCacheSize) { 7205 + if (entry >= ah->ah_caps.keycache_size) { 7209 7206 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 7210 7207 "%s: entry %u out of range\n", __func__, entry); 7211 7208 return false; ··· 7232 7229 const struct ath9k_keyval *k, 7233 7230 const u8 *mac, int xorKey) 7234 7231 { 7235 - const struct hal_capabilities *pCap = &ah->ah_caps; 7232 + const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7236 7233 u32 key0, key1, key2, key3, key4; 7237 7234 u32 keyType; 7238 7235 u32 xorMask = xorKey ? ··· 7240 7237 | ATH9K_KEY_XOR) : 0; 7241 7238 struct ath_hal_5416 *ahp = AH5416(ah); 7242 7239 7243 - if (entry >= pCap->halKeyCacheSize) { 7240 + if (entry >= pCap->keycache_size) { 7244 7241 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 7245 7242 "%s: entry %u out of range\n", __func__, entry); 7246 7243 return false; ··· 7250 7247 keyType = AR_KEYTABLE_TYPE_AES; 7251 7248 break; 7252 7249 case ATH9K_CIPHER_AES_CCM: 7253 - if (!pCap->halCipherAesCcmSupport) { 7250 + if (!(pCap->hw_caps & ATH9K_HW_CAP_CIPHER_AESCCM)) { 7254 7251 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 7255 7252 "%s: AES-CCM not supported by " 7256 7253 "mac rev 0x%x\n", __func__, ··· 7262 7259 case ATH9K_CIPHER_TKIP: 7263 7260 keyType = AR_KEYTABLE_TYPE_TKIP; 7264 7261 if (ATH9K_IS_MIC_ENABLED(ah) 7265 - && entry + 64 >= pCap->halKeyCacheSize) { 7262 + && entry + 64 >= pCap->keycache_size) { 7266 7263 DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, 7267 7264 "%s: entry %u inappropriate for TKIP\n", 7268 7265 __func__, entry); ··· 7459 7456 const struct ath9k_txq_info *qInfo) 7460 7457 { 7461 7458 struct ath_hal_5416 *ahp = AH5416(ah); 7462 - struct hal_capabilities *pCap = &ah->ah_caps; 7459 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7463 7460 7464 - if (q >= pCap->halTotalQueues) { 7461 + if (q >= pCap->total_queues) { 7465 7462 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", 7466 7463 __func__, q); 7467 7464 return false; ··· 7502 7499 struct ath9k_txq_info *qInfo) 7503 7500 { 7504 7501 struct ath_hal_5416 *ahp = AH5416(ah); 7505 - struct hal_capabilities *pCap = &ah->ah_caps; 7502 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7506 7503 7507 - if (q >= pCap->halTotalQueues) { 7504 + if (q >= pCap->total_queues) { 7508 7505 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", 7509 7506 __func__, q); 7510 7507 return false; ··· 7518 7515 { 7519 7516 struct ath_hal_5416 *ahp = AH5416(ah); 7520 7517 struct ath9k_tx_queue_info *qi; 7521 - struct hal_capabilities *pCap = &ah->ah_caps; 7518 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7522 7519 int q; 7523 7520 7524 7521 switch (type) { 7525 7522 case ATH9K_TX_QUEUE_BEACON: 7526 - q = pCap->halTotalQueues - 1; 7523 + q = pCap->total_queues - 1; 7527 7524 break; 7528 7525 case ATH9K_TX_QUEUE_CAB: 7529 - q = pCap->halTotalQueues - 2; 7526 + q = pCap->total_queues - 2; 7530 7527 break; 7531 7528 case ATH9K_TX_QUEUE_PSPOLL: 7532 7529 q = 1; 7533 7530 break; 7534 7531 case ATH9K_TX_QUEUE_UAPSD: 7535 - q = pCap->halTotalQueues - 3; 7532 + q = pCap->total_queues - 3; 7536 7533 break; 7537 7534 case ATH9K_TX_QUEUE_DATA: 7538 - for (q = 0; q < pCap->halTotalQueues; q++) 7535 + for (q = 0; q < pCap->total_queues; q++) 7539 7536 if (ahp->ah_txq[q].tqi_type == 7540 7537 ATH9K_TX_QUEUE_INACTIVE) 7541 7538 break; 7542 - if (q == pCap->halTotalQueues) { 7539 + if (q == pCap->total_queues) { 7543 7540 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, 7544 7541 "%s: no available tx queue\n", __func__); 7545 7542 return -1; ··· 7605 7602 bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q) 7606 7603 { 7607 7604 struct ath_hal_5416 *ahp = AH5416(ah); 7608 - struct hal_capabilities *pCap = &ah->ah_caps; 7605 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7609 7606 struct ath9k_tx_queue_info *qi; 7610 7607 7611 - if (q >= pCap->halTotalQueues) { 7608 + if (q >= pCap->total_queues) { 7612 7609 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", 7613 7610 __func__, q); 7614 7611 return false; ··· 7637 7634 bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q) 7638 7635 { 7639 7636 struct ath_hal_5416 *ahp = AH5416(ah); 7640 - struct hal_capabilities *pCap = &ah->ah_caps; 7637 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 7641 7638 struct ath9k_channel *chan = ah->ah_curchan; 7642 7639 struct ath9k_tx_queue_info *qi; 7643 7640 u32 cwMin, chanCwMin, value; 7644 7641 7645 - if (q >= pCap->halTotalQueues) { 7642 + if (q >= pCap->total_queues) { 7646 7643 DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", 7647 7644 __func__, q); 7648 7645 return false; ··· 7742 7739 | AR_Q_MISC_CBR_INCR_DIS1 7743 7740 | AR_Q_MISC_CBR_INCR_DIS0); 7744 7741 value = (qi->tqi_readyTime 7745 - - (ah->ah_config.ath_hal_sw_beacon_response_time - 7746 - ah->ah_config.ath_hal_dma_beacon_response_time) 7742 + - (ah->ah_config.sw_beacon_response_time - 7743 + ah->ah_config.dma_beacon_response_time) 7747 7744 - 7748 - ah->ah_config.ath_hal_additional_swba_backoff) * 7745 + ah->ah_config.additional_swba_backoff) * 7749 7746 1024; 7750 7747 REG_WRITE(ah, AR_QRDYTIMECFG(q), 7751 7748 value | AR_Q_RDYTIMECFG_EN); ··· 8134 8131 u32 size, u32 flags) 8135 8132 { 8136 8133 struct ar5416_desc *ads = AR5416DESC(ds); 8137 - struct hal_capabilities *pCap = &ah->ah_caps; 8134 + struct ath9k_hw_capabilities *pCap = &ah->ah_caps; 8138 8135 8139 8136 ads->ds_ctl1 = size & AR_BufLen; 8140 8137 if (flags & ATH9K_RXDESC_INTREQ) 8141 8138 ads->ds_ctl1 |= AR_RxIntrReq; 8142 8139 8143 8140 ads->ds_rxstatus8 &= ~AR_RxDone; 8144 - if (!pCap->halAutoSleepSupport) 8141 + if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) 8145 8142 memset(&(ads->u), 0, sizeof(ads->u)); 8146 8143 return true; 8147 8144 }
+3 -3
drivers/net/wireless/ath9k/main.c
··· 1268 1268 sc->rates[IEEE80211_BAND_2GHZ]; 1269 1269 sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ; 1270 1270 1271 - if (sc->sc_ah->ah_caps.halHTSupport) 1271 + if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) 1272 1272 /* Setup HT capabilities for 2.4Ghz*/ 1273 1273 setup_ht_cap(&sc->sbands[IEEE80211_BAND_2GHZ].ht_info); 1274 1274 1275 1275 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 1276 1276 &sc->sbands[IEEE80211_BAND_2GHZ]; 1277 1277 1278 - if (sc->sc_ah->ah_caps.halWirelessModes & ATH9K_MODE_SEL_11A) { 1278 + if (sc->sc_ah->ah_caps.wireless_modes & ATH9K_MODE_SEL_11A) { 1279 1279 sc->sbands[IEEE80211_BAND_5GHZ].channels = 1280 1280 sc->channels[IEEE80211_BAND_5GHZ]; 1281 1281 sc->sbands[IEEE80211_BAND_5GHZ].bitrates = ··· 1283 1283 sc->sbands[IEEE80211_BAND_5GHZ].band = 1284 1284 IEEE80211_BAND_5GHZ; 1285 1285 1286 - if (sc->sc_ah->ah_caps.halHTSupport) 1286 + if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) 1287 1287 /* Setup HT capabilities for 5Ghz*/ 1288 1288 setup_ht_cap(&sc->sbands[IEEE80211_BAND_5GHZ].ht_info); 1289 1289
+1 -1
drivers/net/wireless/ath9k/rc.c
··· 780 780 ar5416_attach_ratetables(asc); 781 781 782 782 /* Save Maximum TX Trigger Level (used for 11n) */ 783 - tx_triglevel_max = ah->ah_caps.halTxTrigLevelMax; 783 + tx_triglevel_max = ah->ah_caps.tx_triglevel_max; 784 784 /* return alias for ath_rate_softc * */ 785 785 return asc; 786 786 }
+2 -2
drivers/net/wireless/ath9k/recv.c
··· 478 478 ath9k_hw_setrxfilter(ah, rfilt); 479 479 480 480 /* configure bssid mask */ 481 - if (ah->ah_caps.halBssIdMaskSupport) 481 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) 482 482 ath9k_hw_setbssidmask(ah, sc->sc_bssidmask); 483 483 484 484 /* configure operational mode */ ··· 1018 1018 PCI_DMA_FROMDEVICE); 1019 1019 1020 1020 /* XXX: Ah! make me more readable, use a helper */ 1021 - if (ah->ah_caps.halHTSupport) { 1021 + if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { 1022 1022 if (ds->ds_rxstat.rs_moreaggr == 0) { 1023 1023 rx_status.rssictl[0] = 1024 1024 ds->ds_rxstat.rs_rssi_ctl0;
+7 -7
drivers/net/wireless/ath9k/regd.c
··· 87 87 { 88 88 u32 regcap; 89 89 90 - regcap = ah->ah_caps.halRegCap; 90 + regcap = ah->ah_caps.reg_cap; 91 91 92 92 if (regcap & AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND) 93 93 return true; ··· 138 138 { 139 139 u32 modesAvail; 140 140 141 - modesAvail = ah->ah_caps.halWirelessModes; 141 + modesAvail = ah->ah_caps.wireless_modes; 142 142 143 143 if ((modesAvail & ATH9K_MODE_SEL_11G) && (!country->allow11g)) 144 144 modesAvail &= ~ATH9K_MODE_SEL_11G; ··· 436 436 return false; 437 437 } 438 438 if ((fband->channelBW == CHANNEL_HALF_BW) && 439 - !ah->ah_caps.halChanHalfRate) { 439 + !(ah->ah_caps.hw_caps & ATH9K_HW_CAP_CHAN_HALFRATE)) { 440 440 DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, 441 441 "%s: Skipping %u half rate channel\n", 442 442 __func__, c); ··· 444 444 } 445 445 446 446 if ((fband->channelBW == CHANNEL_QUARTER_BW) && 447 - !ah->ah_caps.halChanQuarterRate) { 447 + !(ah->ah_caps.hw_caps & ATH9K_HW_CAP_CHAN_QUARTERRATE)) { 448 448 DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY, 449 449 "%s: Skipping %u quarter rate channel\n", 450 450 __func__, c); ··· 529 529 if ((c < 2412) || (c > 2462)) { 530 530 if (rd5GHz.regDmnEnum == MKK1 || 531 531 rd5GHz.regDmnEnum == MKK2) { 532 - u32 regcap = ah->ah_caps.halRegCap; 532 + u32 regcap = ah->ah_caps.reg_cap; 533 533 if (!(regcap & 534 534 (AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN | 535 535 AR_EEPROM_EEREGCAP_EN_KK_U2 | ··· 594 594 595 595 for (i = 0; i < ARRAY_SIZE(j_bandcheck); i++) { 596 596 if (j_bandcheck[i].freqbandbit == b) { 597 - regcap = ah->ah_caps.halRegCap; 597 + regcap = ah->ah_caps.reg_cap; 598 598 if ((j_bandcheck[i].eepromflagtocheck & regcap) == 0) { 599 599 skipband = true; 600 600 } else if ((regcap & AR_EEPROM_EEREGCAP_EN_KK_U2) || ··· 726 726 } 727 727 728 728 if (country == NULL) { 729 - modesAvail = ah->ah_caps.halWirelessModes; 729 + modesAvail = ah->ah_caps.wireless_modes; 730 730 } else { 731 731 modesAvail = ath9k_regd_get_wmodes_nreg(ah, country, &rd5GHz); 732 732 if (!enableOutdoor)
+2 -2
drivers/net/wireless/ath9k/xmit.c
··· 781 781 * let rate series flags determine which rates will actually 782 782 * use RTS. 783 783 */ 784 - if (ah->ah_caps.halHTSupport && bf->bf_isdata) { 784 + if ((ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) && bf->bf_isdata) { 785 785 BUG_ON(!an); 786 786 /* 787 787 * 802.11g protection not needed, use our default behavior ··· 897 897 * For non-HT devices, calculate RTS/CTS duration in software 898 898 * and disable multi-rate retry. 899 899 */ 900 - if (flags && !ah->ah_caps.halHTSupport) { 900 + if (flags && !(ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT)) { 901 901 /* 902 902 * Compute the transmit duration based on the frame 903 903 * size and the size of an ACK frame. We call into the