Updating the atheroswifi driver to the FreeBSD HEAD svn rev 211330 (from 204100)
|Reported by:||jstressman||Owned by:||nobody|
DISCLAIMER: This absolutely needs review and additional work, but it compiles and works for me at least as well as the previous ath revision (minus the hard-locks so far).
It still has trouble thinking there are almost constant media changes which seem to reset the connection and basically cripple WebPositive after the first partial webpage load so that it won't work any further... but I can leave a running ping on Google.com that will go nonstop (for at least as long as I let it run... 20 minutes maybe?) without dropping any packets. So I'm not sure what the problem is. But that's a problem for another ticket.
Ported over the ath driver as of 211330 from FreeBSD-HEAD http://svn.freebsd.org/viewvc/base/head/sys/dev/ath/
This is svn diff'ed against Haiku hrev38867
This doesn't do anything about porting over the raw 211330 FBSD revision into the haiku/vendor tree either, so someone would need to take care of that as well.
I just wanted to try to alleviate my own hard lock problems and get ball rolling on updating to the latest fixes and thought I'd share. :)
Below are pretty much all the relevant changes between our last port of 204100 and the current 211330.
Please note http://svn.freebsd.org/viewvc/base?view=revision&sortby=date&revision=207472 where 2 other files are changed setting a specific define for certain circumstances that I didn't do anything with.
head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Revision 204521 Modified Mon Mar 1 17:04:19 2010 UTC (7 months ago) by rpaulo Properly setup the TX FIFO threshold for AR5416 based chipsets, including the AR9285. This seems to fix some users's problems. head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Revision 204579 Modified Tue Mar 2 12:59:42 2010 UTC (7 months ago) by rpaulo Couple of suggestions from Sam regarding latest commit: o rename the new variables to comply with the naming scheme o move the new variables to an AR5212 specific struct o use ahp when available o revert to previous ts_flags check /head/sys/dev/ath/ath_hal/ah_internal.h Revision 204645 Modified Wed Mar 3 17:42:39 2010 UTC (6 months, 4 weeks ago) by rpaulo Introduce ath_hal_setInterrupts(), a macro for ah_setInterrupts(). /head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Revision 206420 Modified Fri Apr 9 13:58:54 2010 UTC (5 months, 3 weeks ago) by rpaulo Setup the correct RX/TX chainmask when we play with the antenna settings. head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Revision 208711 Modified Tue Jun 1 15:33:10 2010 UTC (4 months ago) by rpaulo Bring in a couple of fixes from the Linux ath9k related to chip hangs. While there, try to make the register write pattern look like what's done by ath9k. /head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Revision 208642 Modified Sat May 29 16:10:07 2010 UTC (4 months ago) by rpaulo Don't shadow the global variable 'version'. /head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Revision 208643 Modified Sat May 29 16:11:51 2010 UTC (4 months ago) by rpaulo Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. /head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Revision 208644 Modified Sat May 29 16:14:02 2010 UTC (4 months ago) by rpaulo Due to the way HALDEBUG() is defined, we need to add curly brackets when using it as a sole if clause instruction. While there, fix 'const static' typo. /head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Revision 208703 Modified Tue Jun 1 14:37:11 2010 UTC (4 months ago) by rpaulo Fix an off by one in ar9285SetPowerCalTable(). /head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Revision 208712 Modified Tue Jun 1 15:47:57 2010 UTC (4 months ago) by rpaulo Rewrite ar9285SetBoardValues() to match what ath9k does and fix out of bounds reads. /head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Revision 209548 Modified Sun Jun 27 10:17:11 2010 UTC (3 months ago) by rpaulo Fix typo introduced in previous revision. /head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Revision 209541 Modified Sat Jun 26 20:59:10 2010 UTC (3 months ago) by rpaulo Fix the AR_SREV_MERLIN_20_OR_LATER() check. /head/sys/dev/ath/ath_hal/ar5416/ar5416_cal_iq.c Revision 211306 Modified Sat Aug 14 15:28:15 2010 UTC (6 weeks, 6 days ago) by adrian Fix the calibration logic to correctly clamp the calculated coefficient. Obtained from: OpenWRT r22123, 521-ath9k_iqcal_fix.patch head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Revision 211307 Modified Sat Aug 14 15:29:21 2010 UTC (6 weeks, 6 days ago) by adrian Merge in a fix for the power/(gain?) calculation. Apply it to both the 5416/9160 and 9285 code paths. Obtained from: OpenWRT r22123, 522-ath9k_pwrcal_fix.patch /head/sys/dev/ath/ath_hal/ar5416/ar9160.ini Revision 211309 Modified Sat Aug 14 15:48:18 2010 UTC (6 weeks, 6 days ago) by adrian A local addition, not imported from ath9k. AR_PHY_CALMODE is explicitly reset on interface reset for other chipsets; this commit also sets it for the AR9160. Revision 211308 Modified Sat Aug 14 15:46:18 2010 UTC (6 weeks, 6 days ago) by adrian * Merge in AR9160 initval updates from Linux-2.6.34. * Grab the AR_PHY_CCA and AR_PHY_EXT_CCA initvals from Linux wireless-testing. Obtained from: Linux-2.6.34 Revision 206496 Modified Mon Apr 12 13:46:20 2010 UTC (5 months, 2 weeks ago) by rpaulo Remove svn:executable prop. /head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Revision 211330 Modified Sun Aug 15 11:40:53 2010 UTC (6 weeks, 5 days ago) by adrian Fix indenting/whitespace issues introduced by me. Revision 211328 Modified Sun Aug 15 11:32:05 2010 UTC (6 weeks, 5 days ago) by adrian The comment is misleading - that register setting seems to kick off the initial chip NF cal. Revision 211214 Modified Thu Aug 12 08:39:54 2010 UTC (7 weeks, 1 day ago) by adrian * Fix indentation * Restore comment erroneously deleted from the previous commit Revision 211211 Modified Thu Aug 12 06:20:54 2010 UTC (7 weeks, 1 day ago) by adrian Loading the NF CCA values may take longer than expected to occur. If it does, don't then try reprogramming the NF "cap" values (ie what values are the "maximum" value the NF can be) - instead, just leave the current CCA value as the NF cap. This was inspired by some similar work from ath9k. It isn't a 100% complete solution (as there may be some reason where a high NF CCA/cap is written, causing the baseband to stop thinking it is able to transmit, leading to stuck beacon and interface reset) which I'll investigate and look at fixing in a later commit. Obtained from: Linux Revision 211210 Modified Thu Aug 12 06:14:26 2010 UTC (7 weeks, 1 day ago) by adrian Use ar5212IsNFCalInProgress() to check for NF calibration progress. Revision 211209 Modified Thu Aug 12 06:12:39 2010 UTC (7 weeks, 1 day ago) by adrian Fix indentation. Revision 211208 Modified Thu Aug 12 06:11:44 2010 UTC (7 weeks, 1 day ago) by adrian Ensure that the correct rxchainmask is used when doing calibration in the AR5416 and later chipsets. ath_hal_calibrateN() calls the HAL calibrateN function with rxchainmask=0x1. This is not necessarily the case for AR5416 and later chipsets. Revision 211207 Modified Thu Aug 12 06:08:36 2010 UTC (7 weeks, 1 day ago) by adrian Internal NF calibration should not occur in parallel with any other calibration. Ensure that the NF calibration completes before continuing with the rest of the calibration setup process. /head/sys/dev/ath/ath_hal/ah_internal.h /head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Revision 204645 Modified Wed Mar 3 17:42:39 2010 UTC (6 months, 4 weeks ago) by rpaulo Introduce ath_hal_setInterrupts(), a macro for ah_setInterrupts(). /head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Revision 207472 Modified Sat May 1 16:36:14 2010 UTC (5 months ago) by imp The Atheros AR71xx CPUs, when paired with the AR5212 parts, has a bug that generates a fatal bus trap. Normally, the chips are setup to do 128 byte DMA bursts, but when on this CPU, they can only safely due 4-byte DMA bursts due to this bug. Details of the exact nature of the bug are sketchy, but some can be found at https://forum.openwrt.org/viewtopic.php?pid=70060 on pages 4, 5 and 6. There's a small performance penalty associated with this workaround, so it is only enabled when needed on the Atheros AR71xx platforms. Unfortunately, this condition is impossible to detect at runtime without MIPS specific ifdefs. Rather than cast an overly-broad net like Linux/OpenWRT dues (which enables this workaround all the time on MIPS32 platforms), we put this option in the kernel for just the affected machines. Sam didn't like this aspect of the patch when he reviewed it, and I'd love to hear sane proposals on how to fix it :) See also http://svn.freebsd.org/viewvc/base?view=revision&sortby=date&revision=207472 as there are other associated changes in: /head/sys/conf/NOTES /head/sys/conf/options head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Revision 211206 Modified Thu Aug 12 06:06:14 2010 UTC (7 weeks, 1 day ago) by adrian Add a couple of functions to check NF calibration progress / completion.