diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/conf/files conf/files --- /home/rpaulo/freebsd/src/sys/conf/files 2009-10-31 14:36:54.000000000 +0000 +++ conf/files 2009-10-31 14:54:20.000000000 +0000 @@ -554,6 +554,9 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/ath_hal/ah_eeprom_v4k.c \ + optional ath_hal | ath_ar9285 \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # ar5210 @@ -600,104 +603,119 @@ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar5212 dev/ath/ath_hal/ar5212/ar5212_ani.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_attach.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_beacon.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_eeprom.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_gpio.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_interrupts.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_keycache.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_misc.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_phy.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_power.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_recv.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_reset.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_rfgain.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_xmit.c \ - optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar5416 (depends on ar5212) dev/ath/ath_hal/ar5416/ar5416_ani.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_attach.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_beacon.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_eeprom.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_gpio.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_interrupts.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_keycache.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_misc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_phy.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_power.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_recv.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_reset.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_xmit.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9160 (depends on ar5416) dev/ath/ath_hal/ar5416/ar9160_attach.c optional ath_hal | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -# ar9280 (depends on ar5416) -dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 \ +# ar9280/ar9285 (depends on ar5416) +dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 | \ + ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ @@ -716,7 +734,7 @@ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar2133.c optional ath_hal | ath_ar5416 | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 \ +dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ Only in /home/rpaulo/freebsd/src/sys/conf: files.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ah_osdep.c dev/ath/ah_osdep.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ah_osdep.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ah_osdep.c 2009-10-24 13:05:02.000000000 +0100 @@ -79,7 +79,7 @@ SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); #ifdef AH_DEBUG -static int ath_hal_debug = 0; +static int ath_hal_debug = 0xffffffff; SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, 0, "Atheros HAL debugging printfs"); TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); Only in /home/rpaulo/freebsd/src/sys/dev/ath: ah_osdep.c.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5212/ar5212_power.c dev/ath/ath_hal/ar5212/ar5212_power.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5212/ar5212_power.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5212/ar5212_power.c 2009-10-24 13:05:02.000000000 +0100 @@ -38,8 +38,8 @@ ar5212SetPowerModeAwake(struct ath_hal *ah, int setChip) { #define AR_SCR_MASK \ - (AR_SCR_SLDUR|AR_SCR_SLE|AR_SCR_SLE|AR_SCR_SLDTP|AR_SCR_SLDWP|\ - AR_SCR_SLEPOL|AR_SCR_MIBIE) + (AR_SCR_SLDUR|AR_SCR_SLE|AR_SCR_SLDTP|AR_SCR_SLDWP|\ + AR_SCR_SLEPOL|AR_SCR_MIBIE|AR_SCR_UNKNOWN) #define POWER_UP_TIME 2000 uint32_t scr, val; int i; diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5212/ar5212reg.h dev/ath/ath_hal/ar5212/ar5212reg.h --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5212/ar5212reg.h 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5212/ar5212reg.h 2009-10-24 13:05:02.000000000 +0100 @@ -700,6 +700,7 @@ #define AR_SCR_SLDWP 0x00080000 /* sleep duration write policy */ #define AR_SCR_SLEPOL 0x00100000 /* sleep policy mode */ #define AR_SCR_MIBIE 0x00200000 /* sleep perf cntrs MIB intr ena */ +#define AR_SCR_UNKNOWN 0x00400000 #define AR_INTPEND_TRUE 0x00000001 /* interrupt pending */ diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416.h dev/ath/ath_hal/ar5416/ar5416.h --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416.h 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416.h 2009-10-24 13:56:42.000000000 +0100 @@ -44,6 +44,7 @@ #define AR5416_CCA_MAX_GOOD_VALUE -85 #define AR5416_CCA_MAX_HIGH_VALUE -62 #define AR5416_CCA_MIN_BAD_VALUE -140 +#define AR9285_CCA_MAX_GOOD_VALUE -118 #define AR5416_SPUR_RSSI_THRESH 40 Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416.h.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c dev/ath/ath_hal/ar5416/ar5416_attach.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c 2009-08-14 22:27:52.000000000 +0100 +++ dev/ath/ath_hal/ar5416/ar5416_attach.c 2009-10-31 14:35:01.000000000 +0000 @@ -352,7 +352,7 @@ } ar5416AniSetup(ah); /* Anti Noise Immunity */ - ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); + ar5416InitNfHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c dev/ath/ath_hal/ar5416/ar5416_cal.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416_cal.c 2009-10-24 13:56:42.000000000 +0100 @@ -173,7 +173,60 @@ ichan = ath_hal_checkchannel(ah, chan); HALASSERT(ichan != AH_NULL); - if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + if (AR_SREV_KITE_10_OR_LATER(ah)) { + /* Clear the carrier leak cal bit */ + OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); + + if (IEEE80211_IS_CHAN_HT20(chan)) { + OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, + AR_PHY_PARALLEL_CAL_ENABLE); + OS_REG_SET_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); + OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_FLTR_CAL); + OS_REG_CLR_BIT(ah, AR_PHY_TPCRG1, + AR_PHY_TPCRG1_PD_CAL_ENABLE); + OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_CAL); + /* Poll for offset calibration complete */ + if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_CAL, 0)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: offset calibration failed to " + "complete in 1ms; noisy environment?\n", + __func__); + return AH_FALSE; + } + OS_REG_CLR_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); + OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, + AR_PHY_PARALLEL_CAL_ENABLE); + } + OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); + + /* Enable Rx Filter Cal */ + OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); + OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_FLTR_CAL); + OS_REG_SET_BIT(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_CAL_ENABLE); + + /* kick off the cal */ + OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); + + /* Poll for offset calibration complete */ + if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_CAL, 0)) { + printf("first cal\n"); + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: offset calibration did not complete in 1ms; " + "noisy environment?\n", __func__); + return AH_FALSE; + } + /* Set the cl cal bit and rerun the cal a 2nd time */ + /* Enable Rx Filter Cal */ + OS_REG_SET_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); + OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); + OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_FLTR_CAL); + } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) { /* Enable Rx Filter Cal */ OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, @@ -205,6 +258,7 @@ /* Calibrate the AGC */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); + printf("second cal\n"); /* Poll for offset calibration complete */ if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -566,9 +620,15 @@ } void -ar5416InitNfHistBuff(struct ar5212NfCalHist *h) +ar5416InitNfHistBuff(struct ath_hal *ah, struct ar5212NfCalHist *h) { int i, j; + int16_t privNF; + + if (AR_SREV_KITE(ah)) + privNF = AR9285_CCA_MAX_GOOD_VALUE; + else + privNF = AR5416_CCA_MAX_GOOD_VALUE; for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) { h[i].currIndex = 0; Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416_cal.c.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h dev/ath/ath_hal/ar5416/ar5416_cal.h --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416_cal.h 2009-10-24 13:56:42.000000000 +0100 @@ -116,5 +116,5 @@ void ar5416AdcGainCalibration(struct ath_hal *ah, uint8_t numChains); void ar5416AdcDcCalCollect(struct ath_hal *ah); void ar5416AdcDcCalibration(struct ath_hal *ah, uint8_t numChains); -void ar5416InitNfHistBuff(struct ar5212NfCalHist *h); +void ar5416InitNfHistBuff(struct ath_hal *ah, struct ar5212NfCalHist *h); #endif /* _ATH_AR5416_CAL_H_ */ Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416_cal.h.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c dev/ath/ath_hal/ar5416/ar5416_gpio.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416_gpio.c 2009-10-24 15:40:54.000000000 +0100 @@ -146,7 +146,9 @@ * Read output value for all gpio's, shift it, * and verify whether the specific bit is set. */ - if (AR_SREV_MERLIN_10_OR_LATER(ah)) + if (AR_SREV_KITE_10_OR_LATER(ah)) + bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR9285_GPIO_IN_VAL); + else if (AR_SREV_MERLIN_10_OR_LATER(ah)) bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR928X_GPIO_IN_VAL); else bits = MS(OS_REG_READ(ah, AR_GPIO_IN_OUT), AR_GPIO_IN_VAL); Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416_gpio.c.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c dev/ath/ath_hal/ar5416/ar5416_reset.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416_reset.c 2009-10-24 13:05:02.000000000 +0100 @@ -477,7 +477,12 @@ * reduce the number of usable entries in PCU TXBUF to avoid * wrap around. */ - OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, AR_PCU_TXBUF_CTRL_USABLE_SIZE); + if (AR_SREV_KITE(ah)) + OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, + AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE); + else + OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, + AR_PCU_TXBUF_CTRL_USABLE_SIZE); } static void Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416_reset.c.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416phy.h dev/ath/ath_hal/ar5416/ar5416phy.h --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416phy.h 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416phy.h 2009-10-24 13:05:02.000000000 +0100 @@ -207,6 +207,9 @@ #define AR_PHY_TPCRG1_PD_GAIN_3 0x00300000 #define AR_PHY_TPCRG1_PD_GAIN_3_S 20 +#define AR_PHY_TPCRG1_PD_CAL_ENABLE 0x00400000 +#define AR_PHY_TPCRG1_PD_CAL_ENABLE_S 22 + #define AR_PHY_VIT_MASK2_M_46_61 0xa3a0 #define AR_PHY_MASK2_M_31_45 0xa3a4 #define AR_PHY_MASK2_M_16_30 0xa3a8 @@ -247,4 +250,5 @@ #define AR_PHY_CL_CAL_CTL 0xA358 /* carrier leak cal control */ #define AR_PHY_CL_CAL_ENABLE 0x00000002 +#define AR_PHY_PARALLEL_CAL_ENABLE 0x00000001 #endif /* _DEV_ATH_AR5416PHY_H_ */ Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416phy.h.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416reg.h dev/ath/ath_hal/ar5416/ar5416reg.h --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar5416reg.h 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar5416reg.h 2009-10-24 13:56:42.000000000 +0100 @@ -472,6 +472,7 @@ #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF #define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 +#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 /* Eeprom defines */ #define AR_EEPROM_STATUS_DATA_VAL 0x0000ffff Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar5416reg.h.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c dev/ath/ath_hal/ar5416/ar9160_attach.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar9160_attach.c 2009-10-24 13:56:42.000000000 +0100 @@ -249,7 +249,7 @@ OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9160AniSetup(ah); /* Anti Noise Immunity */ - ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); + ar5416InitNfHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar9160_attach.c.orig diff -u -I'$FreeBSD' -x .svn -r /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c dev/ath/ath_hal/ar5416/ar9280_attach.c --- /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c 2009-10-31 14:37:00.000000000 +0000 +++ dev/ath/ath_hal/ar5416/ar9280_attach.c 2009-10-24 13:56:42.000000000 +0100 @@ -23,6 +23,7 @@ #include "ah_devid.h" #include "ah_eeprom_v14.h" /* XXX for tx/rx gain */ +#include "ah_eeprom_v4k.h" #include "ar5416/ar9280.h" #include "ar5416/ar5416reg.h" @@ -162,7 +163,10 @@ } ar5416AttachPCIE(ah); - ecode = ath_hal_v14EepromAttach(ah); + if (devid == AR9285_DEVID_PCIE) + ecode = ath_hal_v4kEepromAttach(ah); + else + ecode = ath_hal_v14EepromAttach(ah); if (ecode != HAL_OK) goto bad; @@ -281,7 +285,7 @@ OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9280AniSetup(ah); /* Anti Noise Immunity */ - ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); + ar5416InitNfHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); @@ -301,7 +305,10 @@ ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); OS_DELAY(1000); OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); - OS_REG_WRITE(ah, AR_WA, AR9280_WA_DEFAULT); + if (AR_SREV_KITE(ah)) + OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); + else + OS_REG_WRITE(ah, AR_WA, AR9280_WA_DEFAULT); } } @@ -730,9 +737,12 @@ static const char* ar9280Probe(uint16_t vendorid, uint16_t devid) { - if (vendorid == ATHEROS_VENDOR_ID && - (devid == AR9280_DEVID_PCI || devid == AR9280_DEVID_PCIE)) - return "Atheros 9280"; + if (vendorid == ATHEROS_VENDOR_ID) { + if (devid == AR9280_DEVID_PCI || devid == AR9280_DEVID_PCIE) + return "Atheros 9280"; + else if (devid == AR9285_DEVID_PCIE) + return "Atheros 9285"; + } return AH_NULL; } AH_CHIP(AR9280, ar9280Probe, ar9280Attach); Only in /home/rpaulo/freebsd/src/sys/dev/ath/ath_hal/ar5416: ar9280_attach.c.orig --- /home/rpaulo/freebsd/src/sys/modules/ath/Makefile 2009-10-31 14:37:17.000000000 +0000 +++ modules/ath/Makefile 2009-10-24 13:05:03.000000000 +0100 @@ -82,13 +82,14 @@ # NB: 9160 depends on 5416 but 5416 does not require 9160 # .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5416 -SRCS+= ah_eeprom_v14.c \ +SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \ ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_cal.c \ ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \ ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \ ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_recv.c \ ar5416_reset.c ar5416_xmit.c SRCS+= ar9160_attach.c +SRCS+= ar9280.c ar9280_attach.c # RF backend for 5416 and 9160 SRCS+= ar2133.c @@ -108,5 +109,6 @@ opt_ah.h: echo '#define AH_SUPPORT_AR5416 1' > $@ + echo '#define AH_DEBUG 1' >> $@ .include