Add initial ar9300 HAL support for the spectral scan mode.
This commit is contained in:
parent
b23a1998d8
commit
204c8e00de
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291642
@ -1058,6 +1058,8 @@ contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \
|
||||
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
|
||||
contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \
|
||||
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
|
||||
contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c optional ath_hal | ath_ar9300 \
|
||||
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
|
||||
contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \
|
||||
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
|
||||
contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \
|
||||
|
@ -224,6 +224,14 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah)
|
||||
ah->ah_isFastClockEnabled = ar9300_is_fast_clock_enabled;
|
||||
ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy;
|
||||
|
||||
/* Spectral Scan Functions */
|
||||
ah->ah_spectralConfigure = ar9300_configure_spectral_scan;
|
||||
ah->ah_spectralGetConfig = ar9300_get_spectral_params;
|
||||
ah->ah_spectralStart = ar9300_start_spectral_scan;
|
||||
ah->ah_spectralStop = ar9300_stop_spectral_scan;
|
||||
ah->ah_spectralIsEnabled = ar9300_is_spectral_enabled;
|
||||
ah->ah_spectralIsActive = ar9300_is_spectral_active;
|
||||
|
||||
/* Key cache functions */
|
||||
ah->ah_getKeyCacheSize = ar9300_get_key_cache_size;
|
||||
ah->ah_resetKeyCacheEntry = ar9300_reset_key_cache_entry;
|
||||
|
@ -17,7 +17,7 @@
|
||||
#define ATH_ANT_DIV_COMB 1 /* Antenna combining */
|
||||
#define ATH_SUPPORT_RAW_ADC_CAPTURE 0 /* Raw ADC capture support */
|
||||
#define ATH_TRAFFIC_FAST_RECOVER 0 /* XXX not sure yet */
|
||||
#define ATH_SUPPORT_SPECTRAL 0 /* Spectral scan support */
|
||||
#define ATH_SUPPORT_SPECTRAL 1 /* Spectral scan support */
|
||||
#define ATH_BT_COEX 1 /* Enable BT Coex code */
|
||||
#define ATH_PCIE_ERROR_MONITOR 0 /* ??? */
|
||||
#define ATH_SUPPORT_CRDC 0 /* ??? */
|
||||
|
@ -15,12 +15,14 @@
|
||||
*/
|
||||
#include "opt_ah.h"
|
||||
|
||||
#ifdef AH_SUPPORT_AR9300
|
||||
//#ifdef AH_SUPPORT_AR9300
|
||||
|
||||
#include "ah.h"
|
||||
#include "ah_desc.h"
|
||||
#include "ah_internal.h"
|
||||
|
||||
#include "ar9300_freebsd_inc.h"
|
||||
|
||||
#include "ar9300/ar9300phy.h"
|
||||
#include "ar9300/ar9300.h"
|
||||
#include "ar9300/ar9300reg.h"
|
||||
@ -310,7 +312,7 @@ ar9300_configure_spectral_scan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
|
||||
u_int32_t val, i;
|
||||
struct ath_hal_9300 *ahp = AH9300(ah);
|
||||
HAL_BOOL asleep = ahp->ah_chip_full_sleep;
|
||||
int16_t nf_buf[NUM_NF_READINGS];
|
||||
int16_t nf_buf[HAL_NUM_NF_READINGS];
|
||||
|
||||
if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
|
||||
ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
|
||||
@ -319,7 +321,7 @@ ar9300_configure_spectral_scan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
|
||||
ar9300_prep_spectral_scan(ah);
|
||||
|
||||
if (ss->ss_spectral_pri) {
|
||||
for (i = 0; i < NUM_NF_READINGS; i++) {
|
||||
for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
|
||||
nf_buf[i] = NOISE_PWR_DBM_2_INT(ss->ss_nf_cal[i]);
|
||||
}
|
||||
ar9300_load_nf(ah, nf_buf);
|
||||
@ -392,11 +394,17 @@ void
|
||||
ar9300_get_spectral_params(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
|
||||
{
|
||||
u_int32_t val;
|
||||
HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan;
|
||||
HAL_CHANNEL_INTERNAL *chan = NULL;
|
||||
const struct ieee80211_channel *c;
|
||||
int i, ichain, rx_chain_status;
|
||||
struct ath_hal_9300 *ahp = AH9300(ah);
|
||||
HAL_BOOL asleep = ahp->ah_chip_full_sleep;
|
||||
|
||||
c = AH_PRIVATE(ah)->ah_curchan;
|
||||
if (c != NULL)
|
||||
chan = ath_hal_checkchannel(ah, c);
|
||||
|
||||
// XXX TODO: just always wake up all chips?
|
||||
if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
|
||||
ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
|
||||
}
|
||||
@ -414,7 +422,7 @@ ar9300_get_spectral_params(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
|
||||
|
||||
if (chan != NULL) {
|
||||
rx_chain_status = OS_REG_READ(ah, AR_PHY_RX_CHAINMASK) & 0x7;
|
||||
for (i = 0; i < NUM_NF_READINGS; i++) {
|
||||
for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
|
||||
ichain = i % 3;
|
||||
if (rx_chain_status & (1 << ichain)) {
|
||||
ss->ss_nf_cal[i] =
|
||||
@ -550,14 +558,16 @@ u_int32_t ar9300_get_spectral_config(struct ath_hal *ah)
|
||||
int16_t ar9300_get_ctl_chan_nf(struct ath_hal *ah)
|
||||
{
|
||||
int16_t nf;
|
||||
#if 0
|
||||
struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
|
||||
#endif
|
||||
|
||||
if ( (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
|
||||
/* Noise floor calibration value is ready */
|
||||
nf = MS(OS_REG_READ(ah, AR_PHY_CCA_0), AR_PHY_MINCCA_PWR);
|
||||
} else {
|
||||
/* NF calibration is not done, return nominal value */
|
||||
nf = ahpriv->nfp->nominal;
|
||||
nf = AH9300(ah)->nfp->nominal;
|
||||
}
|
||||
if (nf & 0x100) {
|
||||
nf = (0 - ((nf ^ 0x1ff) + 1));
|
||||
@ -568,14 +578,16 @@ int16_t ar9300_get_ctl_chan_nf(struct ath_hal *ah)
|
||||
int16_t ar9300_get_ext_chan_nf(struct ath_hal *ah)
|
||||
{
|
||||
int16_t nf;
|
||||
#if 0
|
||||
struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
|
||||
#endif
|
||||
|
||||
if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
|
||||
/* Noise floor calibration value is ready */
|
||||
nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR);
|
||||
} else {
|
||||
/* NF calibration is not done, return nominal value */
|
||||
nf = ahpriv->nfp->nominal;
|
||||
nf = AH9300(ah)->nfp->nominal;
|
||||
}
|
||||
if (nf & 0x100) {
|
||||
nf = (0 - ((nf ^ 0x1ff) + 1));
|
||||
@ -583,6 +595,6 @@ int16_t ar9300_get_ext_chan_nf(struct ath_hal *ah)
|
||||
return nf;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* ATH_SUPPORT_SPECTRAL */
|
||||
//#endif
|
||||
|
||||
|
@ -131,7 +131,7 @@ SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
|
||||
SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
|
||||
SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c
|
||||
SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c
|
||||
SRCS+= ar9300_power.c ar9300_timer.c
|
||||
SRCS+= ar9300_power.c ar9300_timer.c ar9300_spectral.c
|
||||
|
||||
# NB: rate control is bound to the driver by symbol names so only pick one
|
||||
.if ${ATH_RATE} == "sample"
|
||||
|
Loading…
Reference in New Issue
Block a user