diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath9k/hw.c | 369 |
1 files changed, 186 insertions, 183 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index 63d0ead1c41..0dd11ee3b31 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -335,40 +335,40 @@ static void ath9k_hw_set_defaults(struct ath_hal *ah) | |||
335 | { | 335 | { |
336 | int i; | 336 | int i; |
337 | 337 | ||
338 | ah->ah_config.ath_hal_dma_beacon_response_time = 2; | 338 | ah->ah_config.dma_beacon_response_time = 2; |
339 | ah->ah_config.ath_hal_sw_beacon_response_time = 10; | 339 | ah->ah_config.sw_beacon_response_time = 10; |
340 | ah->ah_config.ath_hal_additional_swba_backoff = 0; | 340 | ah->ah_config.additional_swba_backoff = 0; |
341 | ah->ah_config.ath_hal_6mb_ack = 0x0; | 341 | ah->ah_config.ack_6mb = 0x0; |
342 | ah->ah_config.ath_hal_cwmIgnoreExtCCA = 0; | 342 | ah->ah_config.cwm_ignore_extcca = 0; |
343 | ah->ah_config.ath_hal_pciePowerSaveEnable = 0; | 343 | ah->ah_config.pcie_powersave_enable = 0; |
344 | ah->ah_config.ath_hal_pcieL1SKPEnable = 0; | 344 | ah->ah_config.pcie_l1skp_enable = 0; |
345 | ah->ah_config.ath_hal_pcieClockReq = 0; | 345 | ah->ah_config.pcie_clock_req = 0; |
346 | ah->ah_config.ath_hal_pciePowerReset = 0x100; | 346 | ah->ah_config.pcie_power_reset = 0x100; |
347 | ah->ah_config.ath_hal_pcieRestore = 0; | 347 | ah->ah_config.pcie_restore = 0; |
348 | ah->ah_config.ath_hal_pcieWaen = 0; | 348 | ah->ah_config.pcie_waen = 0; |
349 | ah->ah_config.ath_hal_analogShiftReg = 1; | 349 | ah->ah_config.analog_shiftreg = 1; |
350 | ah->ah_config.ath_hal_htEnable = 1; | 350 | ah->ah_config.ht_enable = 1; |
351 | ah->ah_config.ath_hal_ofdmTrigLow = 200; | 351 | ah->ah_config.ofdm_trig_low = 200; |
352 | ah->ah_config.ath_hal_ofdmTrigHigh = 500; | 352 | ah->ah_config.ofdm_trig_high = 500; |
353 | ah->ah_config.ath_hal_cckTrigHigh = 200; | 353 | ah->ah_config.cck_trig_high = 200; |
354 | ah->ah_config.ath_hal_cckTrigLow = 100; | 354 | ah->ah_config.cck_trig_low = 100; |
355 | ah->ah_config.ath_hal_enableANI = 0; | 355 | ah->ah_config.enable_ani = 0; |
356 | ah->ah_config.ath_hal_noiseImmunityLvl = 4; | 356 | ah->ah_config.noise_immunity_level = 4; |
357 | ah->ah_config.ath_hal_ofdmWeakSigDet = 1; | 357 | ah->ah_config.ofdm_weaksignal_det = 1; |
358 | ah->ah_config.ath_hal_cckWeakSigThr = 0; | 358 | ah->ah_config.cck_weaksignal_thr = 0; |
359 | ah->ah_config.ath_hal_spurImmunityLvl = 2; | 359 | ah->ah_config.spur_immunity_level = 2; |
360 | ah->ah_config.ath_hal_firStepLvl = 0; | 360 | ah->ah_config.firstep_level = 0; |
361 | ah->ah_config.ath_hal_rssiThrHigh = 40; | 361 | ah->ah_config.rssi_thr_high = 40; |
362 | ah->ah_config.ath_hal_rssiThrLow = 7; | 362 | ah->ah_config.rssi_thr_low = 7; |
363 | ah->ah_config.ath_hal_diversityControl = 0; | 363 | ah->ah_config.diversity_control = 0; |
364 | ah->ah_config.ath_hal_antennaSwitchSwap = 0; | 364 | ah->ah_config.antenna_switch_swap = 0; |
365 | 365 | ||
366 | for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { | 366 | for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { |
367 | ah->ah_config.ath_hal_spurChans[i][0] = AR_NO_SPUR; | 367 | ah->ah_config.spurchans[i][0] = AR_NO_SPUR; |
368 | ah->ah_config.ath_hal_spurChans[i][1] = 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 | static inline void ath9k_hw_override_ini(struct ath_hal *ah, | 374 | static inline void ath9k_hw_override_ini(struct ath_hal *ah, |
@@ -458,7 +458,7 @@ static void ath9k_hw_analog_shift_rmw(struct ath_hal *ah, | |||
458 | 458 | ||
459 | REG_WRITE(ah, reg, regVal); | 459 | REG_WRITE(ah, reg, regVal); |
460 | 460 | ||
461 | if (ah->ah_config.ath_hal_analogShiftReg) | 461 | if (ah->ah_config.analog_shiftreg) |
462 | udelay(100); | 462 | udelay(100); |
463 | 463 | ||
464 | return; | 464 | return; |
@@ -1001,7 +1001,7 @@ void ath9k_hw_setrxfilter(struct ath_hal *ah, u32 bits) | |||
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | bool ath9k_hw_setcapability(struct ath_hal *ah, | 1003 | bool ath9k_hw_setcapability(struct ath_hal *ah, |
1004 | enum hal_capability_type type, | 1004 | enum ath9k_capability_type type, |
1005 | u32 capability, | 1005 | u32 capability, |
1006 | u32 setting, | 1006 | u32 setting, |
1007 | int *status) | 1007 | int *status) |
@@ -1010,7 +1010,7 @@ bool ath9k_hw_setcapability(struct ath_hal *ah, | |||
1010 | u32 v; | 1010 | u32 v; |
1011 | 1011 | ||
1012 | switch (type) { | 1012 | switch (type) { |
1013 | case HAL_CAP_TKIP_MIC: | 1013 | case ATH9K_CAP_TKIP_MIC: |
1014 | if (setting) | 1014 | if (setting) |
1015 | ahp->ah_staId1Defaults |= | 1015 | ahp->ah_staId1Defaults |= |
1016 | AR_STA_ID1_CRPT_MIC_ENABLE; | 1016 | AR_STA_ID1_CRPT_MIC_ENABLE; |
@@ -1018,7 +1018,7 @@ bool ath9k_hw_setcapability(struct ath_hal *ah, | |||
1018 | ahp->ah_staId1Defaults &= | 1018 | ahp->ah_staId1Defaults &= |
1019 | ~AR_STA_ID1_CRPT_MIC_ENABLE; | 1019 | ~AR_STA_ID1_CRPT_MIC_ENABLE; |
1020 | return true; | 1020 | return true; |
1021 | case HAL_CAP_DIVERSITY: | 1021 | case ATH9K_CAP_DIVERSITY: |
1022 | v = REG_READ(ah, AR_PHY_CCK_DETECT); | 1022 | v = REG_READ(ah, AR_PHY_CCK_DETECT); |
1023 | if (setting) | 1023 | if (setting) |
1024 | v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; | 1024 | v |= AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; |
@@ -1026,13 +1026,13 @@ bool ath9k_hw_setcapability(struct ath_hal *ah, | |||
1026 | v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; | 1026 | v &= ~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV; |
1027 | REG_WRITE(ah, AR_PHY_CCK_DETECT, v); | 1027 | REG_WRITE(ah, AR_PHY_CCK_DETECT, v); |
1028 | return true; | 1028 | return true; |
1029 | case HAL_CAP_MCAST_KEYSRCH: | 1029 | case ATH9K_CAP_MCAST_KEYSRCH: |
1030 | if (setting) | 1030 | if (setting) |
1031 | ahp->ah_staId1Defaults |= AR_STA_ID1_MCAST_KSRCH; | 1031 | ahp->ah_staId1Defaults |= AR_STA_ID1_MCAST_KSRCH; |
1032 | else | 1032 | else |
1033 | ahp->ah_staId1Defaults &= ~AR_STA_ID1_MCAST_KSRCH; | 1033 | ahp->ah_staId1Defaults &= ~AR_STA_ID1_MCAST_KSRCH; |
1034 | return true; | 1034 | return true; |
1035 | case HAL_CAP_TSF_ADJUST: | 1035 | case ATH9K_CAP_TSF_ADJUST: |
1036 | if (setting) | 1036 | if (setting) |
1037 | ahp->ah_miscMode |= AR_PCU_TX_ADD_TSF; | 1037 | ahp->ah_miscMode |= AR_PCU_TX_ADD_TSF; |
1038 | else | 1038 | else |
@@ -1161,7 +1161,7 @@ void ath9k_hw_set11nmac2040(struct ath_hal *ah, enum ath9k_ht_macmode mode) | |||
1161 | u32 macmode; | 1161 | u32 macmode; |
1162 | 1162 | ||
1163 | if (mode == ATH9K_HT_MACMODE_2040 && | 1163 | if (mode == ATH9K_HT_MACMODE_2040 && |
1164 | !ah->ah_config.ath_hal_cwmIgnoreExtCCA) | 1164 | !ah->ah_config.cwm_ignore_extcca) |
1165 | macmode = AR_2040_JOINED_RX_CLEAR; | 1165 | macmode = AR_2040_JOINED_RX_CLEAR; |
1166 | else | 1166 | else |
1167 | macmode = 0; | 1167 | macmode = 0; |
@@ -1214,9 +1214,9 @@ static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid, | |||
1214 | ah->ah_tpScale = ATH9K_TP_SCALE_MAX; | 1214 | ah->ah_tpScale = ATH9K_TP_SCALE_MAX; |
1215 | 1215 | ||
1216 | ahp->ah_atimWindow = 0; | 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 | ahp->ah_antennaSwitchSwap = | 1218 | ahp->ah_antennaSwitchSwap = |
1219 | ah->ah_config.ath_hal_antennaSwitchSwap; | 1219 | ah->ah_config.antenna_switch_swap; |
1220 | 1220 | ||
1221 | ahp->ah_staId1Defaults = AR_STA_ID1_CRPT_MIC_ENABLE; | 1221 | ahp->ah_staId1Defaults = AR_STA_ID1_CRPT_MIC_ENABLE; |
1222 | ahp->ah_beaconInterval = 100; | 1222 | ahp->ah_beaconInterval = 100; |
@@ -1371,13 +1371,13 @@ static u16 ath9k_hw_eeprom_get_spur_chan(struct ath_hal *ah, | |||
1371 | 1371 | ||
1372 | DPRINTF(ah->ah_sc, ATH_DBG_ANI, | 1372 | DPRINTF(ah->ah_sc, ATH_DBG_ANI, |
1373 | "Getting spur idx %d is2Ghz. %d val %x\n", | 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 | case SPUR_DISABLE: | 1377 | case SPUR_DISABLE: |
1378 | break; | 1378 | break; |
1379 | case SPUR_ENABLE_IOCTL: | 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 | DPRINTF(ah->ah_sc, ATH_DBG_ANI, | 1381 | DPRINTF(ah->ah_sc, ATH_DBG_ANI, |
1382 | "Getting spur val from new loc. %d\n", spur_val); | 1382 | "Getting spur val from new loc. %d\n", spur_val); |
1383 | break; | 1383 | break; |
@@ -2094,7 +2094,7 @@ static void ath9k_hw_ani_attach(struct ath_hal *ah) | |||
2094 | ath9k_enable_mib_counters(ah); | 2094 | ath9k_enable_mib_counters(ah); |
2095 | } | 2095 | } |
2096 | ahp->ah_aniPeriod = ATH9K_ANI_PERIOD; | 2096 | ahp->ah_aniPeriod = ATH9K_ANI_PERIOD; |
2097 | if (ah->ah_config.ath_hal_enableANI) | 2097 | if (ah->ah_config.enable_ani) |
2098 | ahp->ah_procPhyErr |= HAL_PROCESS_ANI; | 2098 | ahp->ah_procPhyErr |= HAL_PROCESS_ANI; |
2099 | } | 2099 | } |
2100 | 2100 | ||
@@ -2504,13 +2504,13 @@ static void ath9k_ani_reset(struct ath_hal *ah) | |||
2504 | ATH9K_RX_FILTER_PHYERR); | 2504 | ATH9K_RX_FILTER_PHYERR); |
2505 | if (ah->ah_opmode == ATH9K_M_HOSTAP) { | 2505 | if (ah->ah_opmode == ATH9K_M_HOSTAP) { |
2506 | ahp->ah_curani->ofdmTrigHigh = | 2506 | ahp->ah_curani->ofdmTrigHigh = |
2507 | ah->ah_config.ath_hal_ofdmTrigHigh; | 2507 | ah->ah_config.ofdm_trig_high; |
2508 | ahp->ah_curani->ofdmTrigLow = | 2508 | ahp->ah_curani->ofdmTrigLow = |
2509 | ah->ah_config.ath_hal_ofdmTrigLow; | 2509 | ah->ah_config.ofdm_trig_low; |
2510 | ahp->ah_curani->cckTrigHigh = | 2510 | ahp->ah_curani->cckTrigHigh = |
2511 | ah->ah_config.ath_hal_cckTrigHigh; | 2511 | ah->ah_config.cck_trig_high; |
2512 | ahp->ah_curani->cckTrigLow = | 2512 | ahp->ah_curani->cckTrigLow = |
2513 | ah->ah_config.ath_hal_cckTrigLow; | 2513 | ah->ah_config.cck_trig_low; |
2514 | } | 2514 | } |
2515 | ath9k_ani_restart(ah); | 2515 | ath9k_ani_restart(ah); |
2516 | return; | 2516 | return; |
@@ -2870,7 +2870,7 @@ static bool ath9k_hw_set_gpio(struct ath_hal *ah, u32 gpio, | |||
2870 | 2870 | ||
2871 | static u32 ath9k_hw_gpio_get(struct ath_hal *ah, u32 gpio) | 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 | return 0xffffffff; | 2874 | return 0xffffffff; |
2875 | 2875 | ||
2876 | if (AR_SREV_9280_10_OR_LATER(ah)) { | 2876 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
@@ -2947,7 +2947,7 @@ static u32 ath9k_hw_ini_fixup(struct ath_hal *ah, | |||
2947 | static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | 2947 | static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) |
2948 | { | 2948 | { |
2949 | struct ath_hal_5416 *ahp = AH5416(ah); | 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 | u16 capField = 0, eeval; | 2951 | u16 capField = 0, eeval; |
2952 | 2952 | ||
2953 | eeval = ath9k_hw_get_eeprom(ahp, EEP_REG_0); | 2953 | eeval = ath9k_hw_get_eeprom(ahp, EEP_REG_0); |
@@ -2970,12 +2970,12 @@ static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | |||
2970 | ah->ah_currentRD); | 2970 | ah->ah_currentRD); |
2971 | } | 2971 | } |
2972 | 2972 | ||
2973 | pCap->halWirelessModes = 0; | 2973 | pCap->wireless_modes = 0; |
2974 | eeval = ath9k_hw_get_eeprom(ahp, EEP_OP_MODE); | 2974 | eeval = ath9k_hw_get_eeprom(ahp, EEP_OP_MODE); |
2975 | 2975 | ||
2976 | if (eeval & AR5416_OPFLAGS_11A) { | 2976 | if (eeval & AR5416_OPFLAGS_11A) { |
2977 | pCap->halWirelessModes |= ATH9K_MODE_SEL_11A | | 2977 | pCap->wireless_modes |= ATH9K_MODE_SEL_11A | |
2978 | ((!ah->ah_config.ath_hal_htEnable | 2978 | ((!ah->ah_config.ht_enable |
2979 | || (eeval & AR5416_OPFLAGS_N_5G_HT20)) ? 0 | 2979 | || (eeval & AR5416_OPFLAGS_N_5G_HT20)) ? 0 |
2980 | : (ATH9K_MODE_SEL_11NA_HT20 | | 2980 | : (ATH9K_MODE_SEL_11NA_HT20 | |
2981 | ((eeval & AR5416_OPFLAGS_N_5G_HT40) ? 0 | 2981 | ((eeval & AR5416_OPFLAGS_N_5G_HT40) ? 0 |
@@ -2983,9 +2983,9 @@ static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | |||
2983 | ATH9K_MODE_SEL_11NA_HT40MINUS)))); | 2983 | ATH9K_MODE_SEL_11NA_HT40MINUS)))); |
2984 | } | 2984 | } |
2985 | if (eeval & AR5416_OPFLAGS_11G) { | 2985 | if (eeval & AR5416_OPFLAGS_11G) { |
2986 | pCap->halWirelessModes |= | 2986 | pCap->wireless_modes |= |
2987 | ATH9K_MODE_SEL_11B | ATH9K_MODE_SEL_11G | | 2987 | ATH9K_MODE_SEL_11B | ATH9K_MODE_SEL_11G | |
2988 | ((!ah->ah_config.ath_hal_htEnable | 2988 | ((!ah->ah_config.ht_enable |
2989 | || (eeval & AR5416_OPFLAGS_N_2G_HT20)) ? 0 | 2989 | || (eeval & AR5416_OPFLAGS_N_2G_HT20)) ? 0 |
2990 | : (ATH9K_MODE_SEL_11NG_HT20 | | 2990 | : (ATH9K_MODE_SEL_11NG_HT20 | |
2991 | ((eeval & AR5416_OPFLAGS_N_2G_HT40) ? 0 | 2991 | ((eeval & AR5416_OPFLAGS_N_2G_HT40) ? 0 |
@@ -2993,79 +2993,82 @@ static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | |||
2993 | ATH9K_MODE_SEL_11NG_HT40MINUS)))); | 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 | if ((ah->ah_isPciExpress) | 2997 | if ((ah->ah_isPciExpress) |
2998 | || (eeval & AR5416_OPFLAGS_11A)) { | 2998 | || (eeval & AR5416_OPFLAGS_11A)) { |
2999 | pCap->halRxChainMask = | 2999 | pCap->rx_chainmask = |
3000 | ath9k_hw_get_eeprom(ahp, EEP_RX_MASK); | 3000 | ath9k_hw_get_eeprom(ahp, EEP_RX_MASK); |
3001 | } else { | 3001 | } else { |
3002 | pCap->halRxChainMask = | 3002 | pCap->rx_chainmask = |
3003 | (ath9k_hw_gpio_get(ah, 0)) ? 0x5 : 0x7; | 3003 | (ath9k_hw_gpio_get(ah, 0)) ? 0x5 : 0x7; |
3004 | } | 3004 | } |
3005 | 3005 | ||
3006 | if (!(AR_SREV_9280(ah) && (ah->ah_macRev == 0))) | 3006 | if (!(AR_SREV_9280(ah) && (ah->ah_macRev == 0))) |
3007 | ahp->ah_miscMode |= AR_PCU_MIC_NEW_LOC_ENA; | 3007 | ahp->ah_miscMode |= AR_PCU_MIC_NEW_LOC_ENA; |
3008 | 3008 | ||
3009 | pCap->halLow2GhzChan = 2312; | 3009 | pCap->low_2ghz_chan = 2312; |
3010 | pCap->halHigh2GhzChan = 2732; | 3010 | pCap->high_2ghz_chan = 2732; |
3011 | 3011 | ||
3012 | pCap->halLow5GhzChan = 4920; | 3012 | pCap->low_5ghz_chan = 4920; |
3013 | pCap->halHigh5GhzChan = 6100; | 3013 | pCap->high_5ghz_chan = 6100; |
3014 | 3014 | ||
3015 | pCap->halCipherCkipSupport = false; | 3015 | pCap->hw_caps &= ~ATH9K_HW_CAP_CIPHER_CKIP; |
3016 | pCap->halCipherTkipSupport = true; | 3016 | pCap->hw_caps |= ATH9K_HW_CAP_CIPHER_TKIP; |
3017 | pCap->halCipherAesCcmSupport = true; | 3017 | pCap->hw_caps |= ATH9K_HW_CAP_CIPHER_AESCCM; |
3018 | 3018 | ||
3019 | pCap->halMicCkipSupport = false; | 3019 | pCap->hw_caps &= ~ATH9K_HW_CAP_MIC_CKIP; |
3020 | pCap->halMicTkipSupport = true; | 3020 | pCap->hw_caps |= ATH9K_HW_CAP_MIC_TKIP; |
3021 | pCap->halMicAesCcmSupport = true; | 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 = | 3025 | if (ah->ah_config.ht_enable) |
3026 | ah->ah_config.ath_hal_htEnable ? true : false; | 3026 | pCap->hw_caps |= ATH9K_HW_CAP_HT; |
3027 | pCap->halGTTSupport = true; | 3027 | else |
3028 | pCap->halVEOLSupport = true; | 3028 | pCap->hw_caps &= ~ATH9K_HW_CAP_HT; |
3029 | pCap->halBssIdMaskSupport = true; | 3029 | |
3030 | pCap->halMcastKeySrchSupport = false; | 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 | if (capField & AR_EEPROM_EEPCAP_MAXQCU) | 3035 | if (capField & AR_EEPROM_EEPCAP_MAXQCU) |
3033 | pCap->halTotalQueues = | 3036 | pCap->total_queues = |
3034 | MS(capField, AR_EEPROM_EEPCAP_MAXQCU); | 3037 | MS(capField, AR_EEPROM_EEPCAP_MAXQCU); |
3035 | else | 3038 | else |
3036 | pCap->halTotalQueues = ATH9K_NUM_TX_QUEUES; | 3039 | pCap->total_queues = ATH9K_NUM_TX_QUEUES; |
3037 | 3040 | ||
3038 | if (capField & AR_EEPROM_EEPCAP_KC_ENTRIES) | 3041 | if (capField & AR_EEPROM_EEPCAP_KC_ENTRIES) |
3039 | pCap->halKeyCacheSize = | 3042 | pCap->keycache_size = |
3040 | 1 << MS(capField, AR_EEPROM_EEPCAP_KC_ENTRIES); | 3043 | 1 << MS(capField, AR_EEPROM_EEPCAP_KC_ENTRIES); |
3041 | else | 3044 | else |
3042 | pCap->halKeyCacheSize = AR_KEYTABLE_SIZE; | 3045 | pCap->keycache_size = AR_KEYTABLE_SIZE; |
3043 | 3046 | ||
3044 | pCap->halFastCCSupport = true; | 3047 | pCap->hw_caps |= ATH9K_HW_CAP_FASTCC; |
3045 | pCap->halNumMRRetries = 4; | 3048 | pCap->num_mr_retries = 4; |
3046 | pCap->halTxTrigLevelMax = MAX_TX_FIFO_THRESHOLD; | 3049 | pCap->tx_triglevel_max = MAX_TX_FIFO_THRESHOLD; |
3047 | 3050 | ||
3048 | if (AR_SREV_9280_10_OR_LATER(ah)) | 3051 | if (AR_SREV_9280_10_OR_LATER(ah)) |
3049 | pCap->halNumGpioPins = AR928X_NUM_GPIO; | 3052 | pCap->num_gpio_pins = AR928X_NUM_GPIO; |
3050 | else | 3053 | else |
3051 | pCap->halNumGpioPins = AR_NUM_GPIO; | 3054 | pCap->num_gpio_pins = AR_NUM_GPIO; |
3052 | 3055 | ||
3053 | if (AR_SREV_9280_10_OR_LATER(ah)) { | 3056 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
3054 | pCap->halWowSupport = true; | 3057 | pCap->hw_caps |= ATH9K_HW_CAP_WOW; |
3055 | pCap->halWowMatchPatternExact = true; | 3058 | pCap->hw_caps |= ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT; |
3056 | } else { | 3059 | } else { |
3057 | pCap->halWowSupport = false; | 3060 | pCap->hw_caps &= ~ATH9K_HW_CAP_WOW; |
3058 | pCap->halWowMatchPatternExact = false; | 3061 | pCap->hw_caps &= ~ATH9K_HW_CAP_WOW_MATCHPATTERN_EXACT; |
3059 | } | 3062 | } |
3060 | 3063 | ||
3061 | if (AR_SREV_9160_10_OR_LATER(ah) || AR_SREV_9100(ah)) { | 3064 | if (AR_SREV_9160_10_OR_LATER(ah) || AR_SREV_9100(ah)) { |
3062 | pCap->halCSTSupport = true; | 3065 | pCap->hw_caps |= ATH9K_HW_CAP_CST; |
3063 | pCap->halRtsAggrLimit = ATH_AMPDU_LIMIT_MAX; | 3066 | pCap->rts_aggr_limit = ATH_AMPDU_LIMIT_MAX; |
3064 | } else { | 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 | ah->ah_rfsilent = ath9k_hw_get_eeprom(ahp, EEP_RF_SILENT); | 3073 | ah->ah_rfsilent = ath9k_hw_get_eeprom(ahp, EEP_RF_SILENT); |
3071 | if (ah->ah_rfsilent & EEP_RFSILENT_ENABLED) { | 3074 | if (ah->ah_rfsilent & EEP_RFSILENT_ENABLED) { |
@@ -3074,9 +3077,9 @@ static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | |||
3074 | ahp->ah_polarity = | 3077 | ahp->ah_polarity = |
3075 | MS(ah->ah_rfsilent, EEP_RFSILENT_POLARITY); | 3078 | MS(ah->ah_rfsilent, EEP_RFSILENT_POLARITY); |
3076 | 3079 | ||
3077 | ath9k_hw_setcapability(ah, HAL_CAP_RFSILENT, 1, true, | 3080 | ath9k_hw_setcapability(ah, ATH9K_CAP_RFSILENT, 1, true, |
3078 | NULL); | 3081 | NULL); |
3079 | pCap->halRfSilentSupport = true; | 3082 | pCap->hw_caps |= ATH9K_HW_CAP_RFSILENT; |
3080 | } | 3083 | } |
3081 | 3084 | ||
3082 | if ((ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) || | 3085 | if ((ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) || |
@@ -3084,32 +3087,32 @@ static bool ath9k_hw_fill_cap_info(struct ath_hal *ah) | |||
3084 | (ah->ah_macVersion == AR_SREV_VERSION_9160) || | 3087 | (ah->ah_macVersion == AR_SREV_VERSION_9160) || |
3085 | (ah->ah_macVersion == AR_SREV_VERSION_9100) || | 3088 | (ah->ah_macVersion == AR_SREV_VERSION_9100) || |
3086 | (ah->ah_macVersion == AR_SREV_VERSION_9280)) | 3089 | (ah->ah_macVersion == AR_SREV_VERSION_9280)) |
3087 | pCap->halAutoSleepSupport = false; | 3090 | pCap->hw_caps &= ~ATH9K_HW_CAP_AUTOSLEEP; |
3088 | else | 3091 | else |
3089 | pCap->halAutoSleepSupport = true; | 3092 | pCap->hw_caps |= ATH9K_HW_CAP_AUTOSLEEP; |
3090 | 3093 | ||
3091 | if (AR_SREV_9280(ah)) | 3094 | if (AR_SREV_9280(ah)) |
3092 | pCap->hal4kbSplitTransSupport = false; | 3095 | pCap->hw_caps &= ~ATH9K_HW_CAP_4KB_SPLITTRANS; |
3093 | else | 3096 | else |
3094 | pCap->hal4kbSplitTransSupport = true; | 3097 | pCap->hw_caps |= ATH9K_HW_CAP_4KB_SPLITTRANS; |
3095 | 3098 | ||
3096 | if (ah->ah_currentRDExt & (1 << REG_EXT_JAPAN_MIDBAND)) { | 3099 | if (ah->ah_currentRDExt & (1 << REG_EXT_JAPAN_MIDBAND)) { |
3097 | pCap->halRegCap = | 3100 | pCap->reg_cap = |
3098 | AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | | 3101 | AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | |
3099 | AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN | | 3102 | AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN | |
3100 | AR_EEPROM_EEREGCAP_EN_KK_U2 | | 3103 | AR_EEPROM_EEREGCAP_EN_KK_U2 | |
3101 | AR_EEPROM_EEREGCAP_EN_KK_MIDBAND; | 3104 | AR_EEPROM_EEREGCAP_EN_KK_MIDBAND; |
3102 | } else { | 3105 | } else { |
3103 | pCap->halRegCap = | 3106 | pCap->reg_cap = |
3104 | AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | | 3107 | AR_EEPROM_EEREGCAP_EN_KK_NEW_11A | |
3105 | AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN; | 3108 | AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN; |
3106 | } | 3109 | } |
3107 | 3110 | ||
3108 | pCap->halRegCap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND; | 3111 | pCap->reg_cap |= AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND; |
3109 | 3112 | ||
3110 | pCap->halNumAntCfg5GHz = | 3113 | pCap->num_antcfg_5ghz = |
3111 | ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_5GHZ); | 3114 | ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_5GHZ); |
3112 | pCap->halNumAntCfg2GHz = | 3115 | pCap->num_antcfg_2ghz = |
3113 | ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_2GHZ); | 3116 | ath9k_hw_get_num_ant_config(ahp, HAL_FREQ_BAND_2GHZ); |
3114 | 3117 | ||
3115 | return true; | 3118 | return true; |
@@ -3151,9 +3154,9 @@ static void ath9k_set_power_network_sleep(struct ath_hal *ah, int setChip) | |||
3151 | { | 3154 | { |
3152 | REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); | 3155 | REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); |
3153 | if (setChip) { | 3156 | if (setChip) { |
3154 | struct hal_capabilities *pCap = &ah->ah_caps; | 3157 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
3155 | 3158 | ||
3156 | if (!pCap->halAutoSleepSupport) { | 3159 | if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { |
3157 | REG_WRITE(ah, AR_RTC_FORCE_WAKE, | 3160 | REG_WRITE(ah, AR_RTC_FORCE_WAKE, |
3158 | AR_RTC_FORCE_WAKE_ON_INT); | 3161 | AR_RTC_FORCE_WAKE_ON_INT); |
3159 | } else { | 3162 | } else { |
@@ -3262,7 +3265,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, | |||
3262 | 3265 | ||
3263 | ath9k_hw_set_defaults(ah); | 3266 | ath9k_hw_set_defaults(ah); |
3264 | 3267 | ||
3265 | if (ah->ah_config.ath_hal_intrMitigation != 0) | 3268 | if (ah->ah_config.intr_mitigation != 0) |
3266 | ahp->ah_intrMitigation = true; | 3269 | ahp->ah_intrMitigation = true; |
3267 | 3270 | ||
3268 | if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { | 3271 | if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) { |
@@ -3279,18 +3282,18 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, | |||
3279 | goto bad; | 3282 | goto bad; |
3280 | } | 3283 | } |
3281 | 3284 | ||
3282 | if (ah->ah_config.ath_hal_serializeRegMode == SER_REG_MODE_AUTO) { | 3285 | if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { |
3283 | if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { | 3286 | if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { |
3284 | ah->ah_config.ath_hal_serializeRegMode = | 3287 | ah->ah_config.serialize_regmode = |
3285 | SER_REG_MODE_ON; | 3288 | SER_REG_MODE_ON; |
3286 | } else { | 3289 | } else { |
3287 | ah->ah_config.ath_hal_serializeRegMode = | 3290 | ah->ah_config.serialize_regmode = |
3288 | SER_REG_MODE_OFF; | 3291 | SER_REG_MODE_OFF; |
3289 | } | 3292 | } |
3290 | } | 3293 | } |
3291 | DPRINTF(ah->ah_sc, ATH_DBG_RESET, | 3294 | DPRINTF(ah->ah_sc, ATH_DBG_RESET, |
3292 | "%s: ath_hal_serializeRegMode is %d\n", | 3295 | "%s: serialize_regmode is %d\n", |
3293 | __func__, ah->ah_config.ath_hal_serializeRegMode); | 3296 | __func__, ah->ah_config.serialize_regmode); |
3294 | 3297 | ||
3295 | if ((ah->ah_macVersion != AR_SREV_VERSION_5416_PCI) && | 3298 | if ((ah->ah_macVersion != AR_SREV_VERSION_5416_PCI) && |
3296 | (ah->ah_macVersion != AR_SREV_VERSION_5416_PCIE) && | 3299 | (ah->ah_macVersion != AR_SREV_VERSION_5416_PCIE) && |
@@ -3334,7 +3337,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, | |||
3334 | } | 3337 | } |
3335 | 3338 | ||
3336 | if (AR_SREV_9160(ah)) { | 3339 | if (AR_SREV_9160(ah)) { |
3337 | ah->ah_config.ath_hal_enableANI = 1; | 3340 | ah->ah_config.enable_ani = 1; |
3338 | ahp->ah_ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | | 3341 | ahp->ah_ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | |
3339 | ATH9K_ANI_FIRSTEP_LEVEL); | 3342 | ATH9K_ANI_FIRSTEP_LEVEL); |
3340 | } else { | 3343 | } else { |
@@ -3355,7 +3358,7 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, | |||
3355 | INIT_INI_ARRAY(&ahp->ah_iniCommon, ar9280Common_9280_2, | 3358 | INIT_INI_ARRAY(&ahp->ah_iniCommon, ar9280Common_9280_2, |
3356 | ARRAY_SIZE(ar9280Common_9280_2), 2); | 3359 | ARRAY_SIZE(ar9280Common_9280_2), 2); |
3357 | 3360 | ||
3358 | if (ah->ah_config.ath_hal_pcieClockReq) { | 3361 | if (ah->ah_config.pcie_clock_req) { |
3359 | INIT_INI_ARRAY(&ahp->ah_iniPcieSerdes, | 3362 | INIT_INI_ARRAY(&ahp->ah_iniPcieSerdes, |
3360 | ar9280PciePhy_clkreq_off_L1_9280, | 3363 | ar9280PciePhy_clkreq_off_L1_9280, |
3361 | ARRAY_SIZE | 3364 | ARRAY_SIZE |
@@ -3528,16 +3531,16 @@ bool ath9k_get_channel_edges(struct ath_hal *ah, | |||
3528 | u16 flags, u16 *low, | 3531 | u16 flags, u16 *low, |
3529 | u16 *high) | 3532 | u16 *high) |
3530 | { | 3533 | { |
3531 | struct hal_capabilities *pCap = &ah->ah_caps; | 3534 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
3532 | 3535 | ||
3533 | if (flags & CHANNEL_5GHZ) { | 3536 | if (flags & CHANNEL_5GHZ) { |
3534 | *low = pCap->halLow5GhzChan; | 3537 | *low = pCap->low_5ghz_chan; |
3535 | *high = pCap->halHigh5GhzChan; | 3538 | *high = pCap->high_5ghz_chan; |
3536 | return true; | 3539 | return true; |
3537 | } | 3540 | } |
3538 | if ((flags & CHANNEL_2GHZ)) { | 3541 | if ((flags & CHANNEL_2GHZ)) { |
3539 | *low = pCap->halLow2GhzChan; | 3542 | *low = pCap->low_2ghz_chan; |
3540 | *high = pCap->halHigh2GhzChan; | 3543 | *high = pCap->high_2ghz_chan; |
3541 | 3544 | ||
3542 | return true; | 3545 | return true; |
3543 | } | 3546 | } |
@@ -3908,7 +3911,7 @@ void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore) | |||
3908 | if (ah->ah_isPciExpress != true) | 3911 | if (ah->ah_isPciExpress != true) |
3909 | return; | 3912 | return; |
3910 | 3913 | ||
3911 | if (ah->ah_config.ath_hal_pciePowerSaveEnable == 2) | 3914 | if (ah->ah_config.pcie_powersave_enable == 2) |
3912 | return; | 3915 | return; |
3913 | 3916 | ||
3914 | if (restore) | 3917 | if (restore) |
@@ -3929,7 +3932,7 @@ void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore) | |||
3929 | REG_WRITE(ah, AR_PCIE_SERDES, 0x13160820); | 3932 | REG_WRITE(ah, AR_PCIE_SERDES, 0x13160820); |
3930 | REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980560); | 3933 | REG_WRITE(ah, AR_PCIE_SERDES, 0xe5980560); |
3931 | 3934 | ||
3932 | if (ah->ah_config.ath_hal_pcieClockReq) | 3935 | if (ah->ah_config.pcie_clock_req) |
3933 | REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffc); | 3936 | REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffc); |
3934 | else | 3937 | else |
3935 | REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffd); | 3938 | REG_WRITE(ah, AR_PCIE_SERDES, 0x401deffd); |
@@ -3956,8 +3959,8 @@ void ath9k_hw_configpcipowersave(struct ath_hal *ah, int restore) | |||
3956 | 3959 | ||
3957 | REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); | 3960 | REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); |
3958 | 3961 | ||
3959 | if (ah->ah_config.ath_hal_pcieWaen) { | 3962 | if (ah->ah_config.pcie_waen) { |
3960 | REG_WRITE(ah, AR_WA, ah->ah_config.ath_hal_pcieWaen); | 3963 | REG_WRITE(ah, AR_WA, ah->ah_config.pcie_waen); |
3961 | } else { | 3964 | } else { |
3962 | if (AR_SREV_9280(ah)) | 3965 | if (AR_SREV_9280(ah)) |
3963 | REG_WRITE(ah, AR_WA, 0x0040073f); | 3966 | REG_WRITE(ah, AR_WA, 0x0040073f); |
@@ -4690,7 +4693,7 @@ static void ath9k_hw_9280_spur_mitigate(struct ath_hal *ah, | |||
4690 | ath9k_hw_get_channel_centers(ah, chan, ¢ers); | 4693 | ath9k_hw_get_channel_centers(ah, chan, ¢ers); |
4691 | freq = centers.synth_center; | 4694 | freq = centers.synth_center; |
4692 | 4695 | ||
4693 | ah->ah_config.ath_hal_spurMode = SPUR_ENABLE_EEPROM; | 4696 | ah->ah_config.spurmode = SPUR_ENABLE_EEPROM; |
4694 | for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { | 4697 | for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) { |
4695 | cur_bb_spur = ath9k_hw_eeprom_get_spur_chan(ah, i, is2GHz); | 4698 | cur_bb_spur = ath9k_hw_eeprom_get_spur_chan(ah, i, is2GHz); |
4696 | 4699 | ||
@@ -5404,7 +5407,7 @@ ath9k_hw_process_ini(struct ath_hal *ah, | |||
5404 | REG_WRITE(ah, reg, val); | 5407 | REG_WRITE(ah, reg, val); |
5405 | 5408 | ||
5406 | if (reg >= 0x7800 && reg < 0x78a0 | 5409 | if (reg >= 0x7800 && reg < 0x78a0 |
5407 | && ah->ah_config.ath_hal_analogShiftReg) { | 5410 | && ah->ah_config.analog_shiftreg) { |
5408 | udelay(100); | 5411 | udelay(100); |
5409 | } | 5412 | } |
5410 | 5413 | ||
@@ -5418,7 +5421,7 @@ ath9k_hw_process_ini(struct ath_hal *ah, | |||
5418 | REG_WRITE(ah, reg, val); | 5421 | REG_WRITE(ah, reg, val); |
5419 | 5422 | ||
5420 | if (reg >= 0x7800 && reg < 0x78a0 | 5423 | if (reg >= 0x7800 && reg < 0x78a0 |
5421 | && ah->ah_config.ath_hal_analogShiftReg) { | 5424 | && ah->ah_config.analog_shiftreg) { |
5422 | udelay(100); | 5425 | udelay(100); |
5423 | } | 5426 | } |
5424 | 5427 | ||
@@ -5921,7 +5924,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode, | |||
5921 | REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, | 5924 | REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, |
5922 | AR_GPIO_JTAG_DISABLE); | 5925 | AR_GPIO_JTAG_DISABLE); |
5923 | 5926 | ||
5924 | if (ah->ah_caps.halWirelessModes & ATH9K_MODE_SEL_11A) { | 5927 | if (ah->ah_caps.wireless_modes & ATH9K_MODE_SEL_11A) { |
5925 | if (IS_CHAN_5GHZ(chan)) | 5928 | if (IS_CHAN_5GHZ(chan)) |
5926 | ath9k_hw_set_gpio(ah, 9, 0); | 5929 | ath9k_hw_set_gpio(ah, 9, 0); |
5927 | else | 5930 | else |
@@ -5955,7 +5958,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode, | |||
5955 | | macStaId1 | 5958 | | macStaId1 |
5956 | | AR_STA_ID1_RTS_USE_DEF | 5959 | | AR_STA_ID1_RTS_USE_DEF |
5957 | | (ah->ah_config. | 5960 | | (ah->ah_config. |
5958 | ath_hal_6mb_ack ? AR_STA_ID1_ACKCTS_6MB : 0) | 5961 | ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0) |
5959 | | ahp->ah_staId1Defaults); | 5962 | | ahp->ah_staId1Defaults); |
5960 | ath9k_hw_set_operating_mode(ah, opmode); | 5963 | ath9k_hw_set_operating_mode(ah, opmode); |
5961 | 5964 | ||
@@ -5984,7 +5987,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode, | |||
5984 | REG_WRITE(ah, AR_DQCUMASK(i), 1 << i); | 5987 | REG_WRITE(ah, AR_DQCUMASK(i), 1 << i); |
5985 | 5988 | ||
5986 | ahp->ah_intrTxqs = 0; | 5989 | ahp->ah_intrTxqs = 0; |
5987 | for (i = 0; i < ah->ah_caps.halTotalQueues; i++) | 5990 | for (i = 0; i < ah->ah_caps.total_queues; i++) |
5988 | ath9k_hw_resettxqueue(ah, i); | 5991 | ath9k_hw_resettxqueue(ah, i); |
5989 | 5992 | ||
5990 | ath9k_hw_init_interrupt_masks(ah, opmode); | 5993 | ath9k_hw_init_interrupt_masks(ah, opmode); |
@@ -6622,7 +6625,7 @@ ath9k_hw_setantennaswitch(struct ath_hal *ah, | |||
6622 | *antenna_cfgd = true; | 6625 | *antenna_cfgd = true; |
6623 | break; | 6626 | break; |
6624 | case ATH9K_ANT_FIXED_B: | 6627 | case ATH9K_ANT_FIXED_B: |
6625 | if (ah->ah_caps.halTxChainMask > | 6628 | if (ah->ah_caps.tx_chainmask > |
6626 | ATH9K_ANTENNA1_CHAINMASK) { | 6629 | ATH9K_ANTENNA1_CHAINMASK) { |
6627 | *tx_chainmask = ATH9K_ANTENNA1_CHAINMASK; | 6630 | *tx_chainmask = ATH9K_ANTENNA1_CHAINMASK; |
6628 | } | 6631 | } |
@@ -6650,14 +6653,14 @@ void ath9k_hw_setopmode(struct ath_hal *ah) | |||
6650 | } | 6653 | } |
6651 | 6654 | ||
6652 | bool | 6655 | bool |
6653 | ath9k_hw_getcapability(struct ath_hal *ah, enum hal_capability_type type, | 6656 | ath9k_hw_getcapability(struct ath_hal *ah, enum ath9k_capability_type type, |
6654 | u32 capability, u32 *result) | 6657 | u32 capability, u32 *result) |
6655 | { | 6658 | { |
6656 | struct ath_hal_5416 *ahp = AH5416(ah); | 6659 | struct ath_hal_5416 *ahp = AH5416(ah); |
6657 | const struct hal_capabilities *pCap = &ah->ah_caps; | 6660 | const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
6658 | 6661 | ||
6659 | switch (type) { | 6662 | switch (type) { |
6660 | case HAL_CAP_CIPHER: | 6663 | case ATH9K_CAP_CIPHER: |
6661 | switch (capability) { | 6664 | switch (capability) { |
6662 | case ATH9K_CIPHER_AES_CCM: | 6665 | case ATH9K_CIPHER_AES_CCM: |
6663 | case ATH9K_CIPHER_AES_OCB: | 6666 | case ATH9K_CIPHER_AES_OCB: |
@@ -6669,7 +6672,7 @@ ath9k_hw_getcapability(struct ath_hal *ah, enum hal_capability_type type, | |||
6669 | default: | 6672 | default: |
6670 | return false; | 6673 | return false; |
6671 | } | 6674 | } |
6672 | case HAL_CAP_TKIP_MIC: | 6675 | case ATH9K_CAP_TKIP_MIC: |
6673 | switch (capability) { | 6676 | switch (capability) { |
6674 | case 0: | 6677 | case 0: |
6675 | return true; | 6678 | return true; |
@@ -6678,20 +6681,20 @@ ath9k_hw_getcapability(struct ath_hal *ah, enum hal_capability_type type, | |||
6678 | AR_STA_ID1_CRPT_MIC_ENABLE) ? true : | 6681 | AR_STA_ID1_CRPT_MIC_ENABLE) ? true : |
6679 | false; | 6682 | false; |
6680 | } | 6683 | } |
6681 | case HAL_CAP_TKIP_SPLIT: | 6684 | case ATH9K_CAP_TKIP_SPLIT: |
6682 | return (ahp->ah_miscMode & AR_PCU_MIC_NEW_LOC_ENA) ? | 6685 | return (ahp->ah_miscMode & AR_PCU_MIC_NEW_LOC_ENA) ? |
6683 | false : true; | 6686 | false : true; |
6684 | case HAL_CAP_WME_TKIPMIC: | 6687 | case ATH9K_CAP_WME_TKIPMIC: |
6685 | return 0; | 6688 | return 0; |
6686 | case HAL_CAP_PHYCOUNTERS: | 6689 | case ATH9K_CAP_PHYCOUNTERS: |
6687 | return ahp->ah_hasHwPhyCounters ? 0 : -ENXIO; | 6690 | return ahp->ah_hasHwPhyCounters ? 0 : -ENXIO; |
6688 | case HAL_CAP_DIVERSITY: | 6691 | case ATH9K_CAP_DIVERSITY: |
6689 | return (REG_READ(ah, AR_PHY_CCK_DETECT) & | 6692 | return (REG_READ(ah, AR_PHY_CCK_DETECT) & |
6690 | AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV) ? | 6693 | AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV) ? |
6691 | true : false; | 6694 | true : false; |
6692 | case HAL_CAP_PHYDIAG: | 6695 | case ATH9K_CAP_PHYDIAG: |
6693 | return true; | 6696 | return true; |
6694 | case HAL_CAP_MCAST_KEYSRCH: | 6697 | case ATH9K_CAP_MCAST_KEYSRCH: |
6695 | switch (capability) { | 6698 | switch (capability) { |
6696 | case 0: | 6699 | case 0: |
6697 | return true; | 6700 | return true; |
@@ -6705,19 +6708,19 @@ ath9k_hw_getcapability(struct ath_hal *ah, enum hal_capability_type type, | |||
6705 | } | 6708 | } |
6706 | } | 6709 | } |
6707 | return false; | 6710 | return false; |
6708 | case HAL_CAP_TSF_ADJUST: | 6711 | case ATH9K_CAP_TSF_ADJUST: |
6709 | return (ahp->ah_miscMode & AR_PCU_TX_ADD_TSF) ? | 6712 | return (ahp->ah_miscMode & AR_PCU_TX_ADD_TSF) ? |
6710 | true : false; | 6713 | true : false; |
6711 | case HAL_CAP_RFSILENT: | 6714 | case ATH9K_CAP_RFSILENT: |
6712 | if (capability == 3) | 6715 | if (capability == 3) |
6713 | return false; | 6716 | return false; |
6714 | case HAL_CAP_ANT_CFG_2GHZ: | 6717 | case ATH9K_CAP_ANT_CFG_2GHZ: |
6715 | *result = pCap->halNumAntCfg2GHz; | 6718 | *result = pCap->num_antcfg_2ghz; |
6716 | return true; | 6719 | return true; |
6717 | case HAL_CAP_ANT_CFG_5GHZ: | 6720 | case ATH9K_CAP_ANT_CFG_5GHZ: |
6718 | *result = pCap->halNumAntCfg5GHz; | 6721 | *result = pCap->num_antcfg_5ghz; |
6719 | return true; | 6722 | return true; |
6720 | case HAL_CAP_TXPOW: | 6723 | case ATH9K_CAP_TXPOW: |
6721 | switch (capability) { | 6724 | switch (capability) { |
6722 | case 0: | 6725 | case 0: |
6723 | return 0; | 6726 | return 0; |
@@ -6742,13 +6745,13 @@ ath9k_hw_select_antconfig(struct ath_hal *ah, u32 cfg) | |||
6742 | { | 6745 | { |
6743 | struct ath_hal_5416 *ahp = AH5416(ah); | 6746 | struct ath_hal_5416 *ahp = AH5416(ah); |
6744 | struct ath9k_channel *chan = ah->ah_curchan; | 6747 | struct ath9k_channel *chan = ah->ah_curchan; |
6745 | const struct hal_capabilities *pCap = &ah->ah_caps; | 6748 | const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
6746 | u16 ant_config; | 6749 | u16 ant_config; |
6747 | u32 halNumAntConfig; | 6750 | u32 halNumAntConfig; |
6748 | 6751 | ||
6749 | halNumAntConfig = | 6752 | halNumAntConfig = |
6750 | IS_CHAN_2GHZ(chan) ? pCap->halNumAntCfg2GHz : pCap-> | 6753 | IS_CHAN_2GHZ(chan) ? pCap->num_antcfg_2ghz : pCap-> |
6751 | halNumAntCfg5GHz; | 6754 | num_antcfg_5ghz; |
6752 | 6755 | ||
6753 | if (cfg < halNumAntConfig) { | 6756 | if (cfg < halNumAntConfig) { |
6754 | if (!ath9k_hw_get_eeprom_antenna_cfg(ahp, chan, | 6757 | if (!ath9k_hw_get_eeprom_antenna_cfg(ahp, chan, |
@@ -6784,7 +6787,7 @@ bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked) | |||
6784 | { | 6787 | { |
6785 | u32 isr = 0; | 6788 | u32 isr = 0; |
6786 | u32 mask2 = 0; | 6789 | u32 mask2 = 0; |
6787 | struct hal_capabilities *pCap = &ah->ah_caps; | 6790 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
6788 | u32 sync_cause = 0; | 6791 | u32 sync_cause = 0; |
6789 | bool fatal_int = false; | 6792 | bool fatal_int = false; |
6790 | 6793 | ||
@@ -6868,7 +6871,7 @@ bool ath9k_hw_getisr(struct ath_hal *ah, enum ath9k_int *masked) | |||
6868 | } | 6871 | } |
6869 | 6872 | ||
6870 | if (!AR_SREV_9100(ah)) { | 6873 | if (!AR_SREV_9100(ah)) { |
6871 | if (!pCap->halAutoSleepSupport) { | 6874 | if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { |
6872 | u32 isr5 = REG_READ(ah, AR_ISR_S5_S); | 6875 | u32 isr5 = REG_READ(ah, AR_ISR_S5_S); |
6873 | if (isr5 & AR_ISR_S5_TIM_TIMER) | 6876 | if (isr5 & AR_ISR_S5_TIM_TIMER) |
6874 | *masked |= ATH9K_INT_TIM_TIMER; | 6877 | *masked |= ATH9K_INT_TIM_TIMER; |
@@ -6927,7 +6930,7 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints) | |||
6927 | struct ath_hal_5416 *ahp = AH5416(ah); | 6930 | struct ath_hal_5416 *ahp = AH5416(ah); |
6928 | u32 omask = ahp->ah_maskReg; | 6931 | u32 omask = ahp->ah_maskReg; |
6929 | u32 mask, mask2; | 6932 | u32 mask, mask2; |
6930 | struct hal_capabilities *pCap = &ah->ah_caps; | 6933 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
6931 | 6934 | ||
6932 | DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: 0x%x => 0x%x\n", __func__, | 6935 | DPRINTF(ah->ah_sc, ATH_DBG_INTERRUPT, "%s: 0x%x => 0x%x\n", __func__, |
6933 | omask, ints); | 6936 | omask, ints); |
@@ -6965,7 +6968,7 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints) | |||
6965 | mask |= AR_IMR_RXMINTR | AR_IMR_RXINTM; | 6968 | mask |= AR_IMR_RXMINTR | AR_IMR_RXINTM; |
6966 | else | 6969 | else |
6967 | mask |= AR_IMR_RXOK | AR_IMR_RXDESC; | 6970 | mask |= AR_IMR_RXOK | AR_IMR_RXDESC; |
6968 | if (!pCap->halAutoSleepSupport) | 6971 | if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) |
6969 | mask |= AR_IMR_GENTMR; | 6972 | mask |= AR_IMR_GENTMR; |
6970 | } | 6973 | } |
6971 | 6974 | ||
@@ -7002,7 +7005,7 @@ enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, enum ath9k_int ints) | |||
7002 | REG_WRITE(ah, AR_IMR_S2, mask | mask2); | 7005 | REG_WRITE(ah, AR_IMR_S2, mask | mask2); |
7003 | ahp->ah_maskReg = ints; | 7006 | ahp->ah_maskReg = ints; |
7004 | 7007 | ||
7005 | if (!pCap->halAutoSleepSupport) { | 7008 | if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { |
7006 | if (ints & ATH9K_INT_TIM_TIMER) | 7009 | if (ints & ATH9K_INT_TIM_TIMER) |
7007 | REG_SET_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); | 7010 | REG_SET_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); |
7008 | else | 7011 | else |
@@ -7061,11 +7064,11 @@ ath9k_hw_beaconinit(struct ath_hal *ah, | |||
7061 | REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, | 7064 | REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, |
7062 | TU_TO_USEC(next_beacon - | 7065 | TU_TO_USEC(next_beacon - |
7063 | ah->ah_config. | 7066 | ah->ah_config. |
7064 | ath_hal_dma_beacon_response_time)); | 7067 | dma_beacon_response_time)); |
7065 | REG_WRITE(ah, AR_NEXT_SWBA, | 7068 | REG_WRITE(ah, AR_NEXT_SWBA, |
7066 | TU_TO_USEC(next_beacon - | 7069 | TU_TO_USEC(next_beacon - |
7067 | ah->ah_config. | 7070 | ah->ah_config. |
7068 | ath_hal_sw_beacon_response_time)); | 7071 | sw_beacon_response_time)); |
7069 | flags |= | 7072 | flags |= |
7070 | AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; | 7073 | AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN; |
7071 | break; | 7074 | break; |
@@ -7090,7 +7093,7 @@ ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah, | |||
7090 | const struct ath9k_beacon_state *bs) | 7093 | const struct ath9k_beacon_state *bs) |
7091 | { | 7094 | { |
7092 | u32 nextTbtt, beaconintval, dtimperiod, beacontimeout; | 7095 | u32 nextTbtt, beaconintval, dtimperiod, beacontimeout; |
7093 | struct hal_capabilities *pCap = &ah->ah_caps; | 7096 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7094 | 7097 | ||
7095 | REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bs->bs_nexttbtt)); | 7098 | REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bs->bs_nexttbtt)); |
7096 | 7099 | ||
@@ -7133,7 +7136,7 @@ ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah, | |||
7133 | SM((CAB_TIMEOUT_VAL << 3), AR_SLEEP1_CAB_TIMEOUT) | 7136 | SM((CAB_TIMEOUT_VAL << 3), AR_SLEEP1_CAB_TIMEOUT) |
7134 | | AR_SLEEP1_ASSUME_DTIM); | 7137 | | AR_SLEEP1_ASSUME_DTIM); |
7135 | 7138 | ||
7136 | if (pCap->halAutoSleepSupport) | 7139 | if (pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP) |
7137 | beacontimeout = (BEACON_TIMEOUT_VAL << 3); | 7140 | beacontimeout = (BEACON_TIMEOUT_VAL << 3); |
7138 | else | 7141 | else |
7139 | beacontimeout = MIN_BEACON_TIMEOUT_VAL; | 7142 | beacontimeout = MIN_BEACON_TIMEOUT_VAL; |
@@ -7152,7 +7155,7 @@ ath9k_hw_set_sta_beacon_timers(struct ath_hal *ah, | |||
7152 | 7155 | ||
7153 | bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry) | 7156 | bool ath9k_hw_keyisvalid(struct ath_hal *ah, u16 entry) |
7154 | { | 7157 | { |
7155 | if (entry < ah->ah_caps.halKeyCacheSize) { | 7158 | if (entry < ah->ah_caps.keycache_size) { |
7156 | u32 val = REG_READ(ah, AR_KEYTABLE_MAC1(entry)); | 7159 | u32 val = REG_READ(ah, AR_KEYTABLE_MAC1(entry)); |
7157 | if (val & AR_KEYTABLE_VALID) | 7160 | if (val & AR_KEYTABLE_VALID) |
7158 | return true; | 7161 | return true; |
@@ -7164,7 +7167,7 @@ bool ath9k_hw_keyreset(struct ath_hal *ah, u16 entry) | |||
7164 | { | 7167 | { |
7165 | u32 keyType; | 7168 | u32 keyType; |
7166 | 7169 | ||
7167 | if (entry >= ah->ah_caps.halKeyCacheSize) { | 7170 | if (entry >= ah->ah_caps.keycache_size) { |
7168 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7171 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7169 | "%s: entry %u out of range\n", __func__, entry); | 7172 | "%s: entry %u out of range\n", __func__, entry); |
7170 | return false; | 7173 | return false; |
@@ -7202,7 +7205,7 @@ ath9k_hw_keysetmac(struct ath_hal *ah, u16 entry, | |||
7202 | { | 7205 | { |
7203 | u32 macHi, macLo; | 7206 | u32 macHi, macLo; |
7204 | 7207 | ||
7205 | if (entry >= ah->ah_caps.halKeyCacheSize) { | 7208 | if (entry >= ah->ah_caps.keycache_size) { |
7206 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7209 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7207 | "%s: entry %u out of range\n", __func__, entry); | 7210 | "%s: entry %u out of range\n", __func__, entry); |
7208 | return false; | 7211 | return false; |
@@ -7229,7 +7232,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7229 | const struct ath9k_keyval *k, | 7232 | const struct ath9k_keyval *k, |
7230 | const u8 *mac, int xorKey) | 7233 | const u8 *mac, int xorKey) |
7231 | { | 7234 | { |
7232 | const struct hal_capabilities *pCap = &ah->ah_caps; | 7235 | const struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7233 | u32 key0, key1, key2, key3, key4; | 7236 | u32 key0, key1, key2, key3, key4; |
7234 | u32 keyType; | 7237 | u32 keyType; |
7235 | u32 xorMask = xorKey ? | 7238 | u32 xorMask = xorKey ? |
@@ -7237,7 +7240,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7237 | | ATH9K_KEY_XOR) : 0; | 7240 | | ATH9K_KEY_XOR) : 0; |
7238 | struct ath_hal_5416 *ahp = AH5416(ah); | 7241 | struct ath_hal_5416 *ahp = AH5416(ah); |
7239 | 7242 | ||
7240 | if (entry >= pCap->halKeyCacheSize) { | 7243 | if (entry >= pCap->keycache_size) { |
7241 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7244 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7242 | "%s: entry %u out of range\n", __func__, entry); | 7245 | "%s: entry %u out of range\n", __func__, entry); |
7243 | return false; | 7246 | return false; |
@@ -7247,7 +7250,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7247 | keyType = AR_KEYTABLE_TYPE_AES; | 7250 | keyType = AR_KEYTABLE_TYPE_AES; |
7248 | break; | 7251 | break; |
7249 | case ATH9K_CIPHER_AES_CCM: | 7252 | case ATH9K_CIPHER_AES_CCM: |
7250 | if (!pCap->halCipherAesCcmSupport) { | 7253 | if (!(pCap->hw_caps & ATH9K_HW_CAP_CIPHER_AESCCM)) { |
7251 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7254 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7252 | "%s: AES-CCM not supported by " | 7255 | "%s: AES-CCM not supported by " |
7253 | "mac rev 0x%x\n", __func__, | 7256 | "mac rev 0x%x\n", __func__, |
@@ -7259,7 +7262,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7259 | case ATH9K_CIPHER_TKIP: | 7262 | case ATH9K_CIPHER_TKIP: |
7260 | keyType = AR_KEYTABLE_TYPE_TKIP; | 7263 | keyType = AR_KEYTABLE_TYPE_TKIP; |
7261 | if (ATH9K_IS_MIC_ENABLED(ah) | 7264 | if (ATH9K_IS_MIC_ENABLED(ah) |
7262 | && entry + 64 >= pCap->halKeyCacheSize) { | 7265 | && entry + 64 >= pCap->keycache_size) { |
7263 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7266 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7264 | "%s: entry %u inappropriate for TKIP\n", | 7267 | "%s: entry %u inappropriate for TKIP\n", |
7265 | __func__, entry); | 7268 | __func__, entry); |
@@ -7456,9 +7459,9 @@ bool ath9k_hw_settxqueueprops(struct ath_hal *ah, int q, | |||
7456 | const struct ath9k_txq_info *qInfo) | 7459 | const struct ath9k_txq_info *qInfo) |
7457 | { | 7460 | { |
7458 | struct ath_hal_5416 *ahp = AH5416(ah); | 7461 | struct ath_hal_5416 *ahp = AH5416(ah); |
7459 | struct hal_capabilities *pCap = &ah->ah_caps; | 7462 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7460 | 7463 | ||
7461 | if (q >= pCap->halTotalQueues) { | 7464 | if (q >= pCap->total_queues) { |
7462 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", | 7465 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", |
7463 | __func__, q); | 7466 | __func__, q); |
7464 | return false; | 7467 | return false; |
@@ -7499,9 +7502,9 @@ ath9k_hw_gettxqueueprops(struct ath_hal *ah, int q, | |||
7499 | struct ath9k_txq_info *qInfo) | 7502 | struct ath9k_txq_info *qInfo) |
7500 | { | 7503 | { |
7501 | struct ath_hal_5416 *ahp = AH5416(ah); | 7504 | struct ath_hal_5416 *ahp = AH5416(ah); |
7502 | struct hal_capabilities *pCap = &ah->ah_caps; | 7505 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7503 | 7506 | ||
7504 | if (q >= pCap->halTotalQueues) { | 7507 | if (q >= pCap->total_queues) { |
7505 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", | 7508 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", |
7506 | __func__, q); | 7509 | __func__, q); |
7507 | return false; | 7510 | return false; |
@@ -7515,28 +7518,28 @@ ath9k_hw_setuptxqueue(struct ath_hal *ah, enum ath9k_tx_queue type, | |||
7515 | { | 7518 | { |
7516 | struct ath_hal_5416 *ahp = AH5416(ah); | 7519 | struct ath_hal_5416 *ahp = AH5416(ah); |
7517 | struct ath9k_tx_queue_info *qi; | 7520 | struct ath9k_tx_queue_info *qi; |
7518 | struct hal_capabilities *pCap = &ah->ah_caps; | 7521 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7519 | int q; | 7522 | int q; |
7520 | 7523 | ||
7521 | switch (type) { | 7524 | switch (type) { |
7522 | case ATH9K_TX_QUEUE_BEACON: | 7525 | case ATH9K_TX_QUEUE_BEACON: |
7523 | q = pCap->halTotalQueues - 1; | 7526 | q = pCap->total_queues - 1; |
7524 | break; | 7527 | break; |
7525 | case ATH9K_TX_QUEUE_CAB: | 7528 | case ATH9K_TX_QUEUE_CAB: |
7526 | q = pCap->halTotalQueues - 2; | 7529 | q = pCap->total_queues - 2; |
7527 | break; | 7530 | break; |
7528 | case ATH9K_TX_QUEUE_PSPOLL: | 7531 | case ATH9K_TX_QUEUE_PSPOLL: |
7529 | q = 1; | 7532 | q = 1; |
7530 | break; | 7533 | break; |
7531 | case ATH9K_TX_QUEUE_UAPSD: | 7534 | case ATH9K_TX_QUEUE_UAPSD: |
7532 | q = pCap->halTotalQueues - 3; | 7535 | q = pCap->total_queues - 3; |
7533 | break; | 7536 | break; |
7534 | case ATH9K_TX_QUEUE_DATA: | 7537 | case ATH9K_TX_QUEUE_DATA: |
7535 | for (q = 0; q < pCap->halTotalQueues; q++) | 7538 | for (q = 0; q < pCap->total_queues; q++) |
7536 | if (ahp->ah_txq[q].tqi_type == | 7539 | if (ahp->ah_txq[q].tqi_type == |
7537 | ATH9K_TX_QUEUE_INACTIVE) | 7540 | ATH9K_TX_QUEUE_INACTIVE) |
7538 | break; | 7541 | break; |
7539 | if (q == pCap->halTotalQueues) { | 7542 | if (q == pCap->total_queues) { |
7540 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, | 7543 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, |
7541 | "%s: no available tx queue\n", __func__); | 7544 | "%s: no available tx queue\n", __func__); |
7542 | return -1; | 7545 | return -1; |
@@ -7602,10 +7605,10 @@ ath9k_hw_set_txq_interrupts(struct ath_hal *ah, | |||
7602 | bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q) | 7605 | bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q) |
7603 | { | 7606 | { |
7604 | struct ath_hal_5416 *ahp = AH5416(ah); | 7607 | struct ath_hal_5416 *ahp = AH5416(ah); |
7605 | struct hal_capabilities *pCap = &ah->ah_caps; | 7608 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7606 | struct ath9k_tx_queue_info *qi; | 7609 | struct ath9k_tx_queue_info *qi; |
7607 | 7610 | ||
7608 | if (q >= pCap->halTotalQueues) { | 7611 | if (q >= pCap->total_queues) { |
7609 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", | 7612 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", |
7610 | __func__, q); | 7613 | __func__, q); |
7611 | return false; | 7614 | return false; |
@@ -7634,12 +7637,12 @@ bool ath9k_hw_releasetxqueue(struct ath_hal *ah, u32 q) | |||
7634 | bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q) | 7637 | bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q) |
7635 | { | 7638 | { |
7636 | struct ath_hal_5416 *ahp = AH5416(ah); | 7639 | struct ath_hal_5416 *ahp = AH5416(ah); |
7637 | struct hal_capabilities *pCap = &ah->ah_caps; | 7640 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
7638 | struct ath9k_channel *chan = ah->ah_curchan; | 7641 | struct ath9k_channel *chan = ah->ah_curchan; |
7639 | struct ath9k_tx_queue_info *qi; | 7642 | struct ath9k_tx_queue_info *qi; |
7640 | u32 cwMin, chanCwMin, value; | 7643 | u32 cwMin, chanCwMin, value; |
7641 | 7644 | ||
7642 | if (q >= pCap->halTotalQueues) { | 7645 | if (q >= pCap->total_queues) { |
7643 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", | 7646 | DPRINTF(ah->ah_sc, ATH_DBG_QUEUE, "%s: invalid queue num %u\n", |
7644 | __func__, q); | 7647 | __func__, q); |
7645 | return false; | 7648 | return false; |
@@ -7739,10 +7742,10 @@ bool ath9k_hw_resettxqueue(struct ath_hal *ah, u32 q) | |||
7739 | | AR_Q_MISC_CBR_INCR_DIS1 | 7742 | | AR_Q_MISC_CBR_INCR_DIS1 |
7740 | | AR_Q_MISC_CBR_INCR_DIS0); | 7743 | | AR_Q_MISC_CBR_INCR_DIS0); |
7741 | value = (qi->tqi_readyTime | 7744 | value = (qi->tqi_readyTime |
7742 | - (ah->ah_config.ath_hal_sw_beacon_response_time - | 7745 | - (ah->ah_config.sw_beacon_response_time - |
7743 | ah->ah_config.ath_hal_dma_beacon_response_time) | 7746 | ah->ah_config.dma_beacon_response_time) |
7744 | - | 7747 | - |
7745 | ah->ah_config.ath_hal_additional_swba_backoff) * | 7748 | ah->ah_config.additional_swba_backoff) * |
7746 | 1024; | 7749 | 1024; |
7747 | REG_WRITE(ah, AR_QRDYTIMECFG(q), | 7750 | REG_WRITE(ah, AR_QRDYTIMECFG(q), |
7748 | value | AR_Q_RDYTIMECFG_EN); | 7751 | value | AR_Q_RDYTIMECFG_EN); |
@@ -8131,14 +8134,14 @@ ath9k_hw_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds, | |||
8131 | u32 size, u32 flags) | 8134 | u32 size, u32 flags) |
8132 | { | 8135 | { |
8133 | struct ar5416_desc *ads = AR5416DESC(ds); | 8136 | struct ar5416_desc *ads = AR5416DESC(ds); |
8134 | struct hal_capabilities *pCap = &ah->ah_caps; | 8137 | struct ath9k_hw_capabilities *pCap = &ah->ah_caps; |
8135 | 8138 | ||
8136 | ads->ds_ctl1 = size & AR_BufLen; | 8139 | ads->ds_ctl1 = size & AR_BufLen; |
8137 | if (flags & ATH9K_RXDESC_INTREQ) | 8140 | if (flags & ATH9K_RXDESC_INTREQ) |
8138 | ads->ds_ctl1 |= AR_RxIntrReq; | 8141 | ads->ds_ctl1 |= AR_RxIntrReq; |
8139 | 8142 | ||
8140 | ads->ds_rxstatus8 &= ~AR_RxDone; | 8143 | ads->ds_rxstatus8 &= ~AR_RxDone; |
8141 | if (!pCap->halAutoSleepSupport) | 8144 | if (!(pCap->hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) |
8142 | memset(&(ads->u), 0, sizeof(ads->u)); | 8145 | memset(&(ads->u), 0, sizeof(ads->u)); |
8143 | return true; | 8146 | return true; |
8144 | } | 8147 | } |