summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Importing pfSense patches net80211HEAD.tgz and conf.file.ieee80211.diff"Renato Botelho2016-02-221-1/+1
| | | | This reverts commit 6ee75bdd7bf7c20359dd6e38c243586cb062edea.
* Importing pfSense patches net80211HEAD.tgz and conf.file.ieee80211.diffRenato Botelho2015-08-171-1/+1
|
* Begin adding support to explicitly set the current chainmask.adrian2013-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now the only way to set the chainmask is to set the hardware configured chainmask through capabilities. This is fine for forcing the chainmask to be something other than what the hardware is capable of (eg to reduce TX/RX to one connected antenna) but it does change what the HAL hardware chainmask configuration is. For operational mode changes, it (may?) make sense to separately control the TX/RX chainmask. Right now it's done as part of ar5416_reset.c - ar5416UpdateChainMasks() calculates which TX/RX chainmasks to enable based on the operating mode. (1 for legacy and whatever is supported for 11n operation.) But doing this in the HAL is suboptimal - the driver needs to know the currently configured chainmask in order to correctly enable things for each TX descriptor. This is currently done by overriding the chainmask config in the ar5416 TX routines but this has to disappear - the AR9300 HAL support requires the driver to dynamically set the TX chainmask based on the TX power and TX rate in order to meet mini-PCIe slot power requirements. So: * Introduce a new HAL method to set the operational chainmask variables; * Introduce null methods for the previous generation chipsets; * Add new driver state to record the current chainmask separate from the hardware configured chainmask. Part #2 of this will involve disabling ar5416UpdateChainMasks() and moving it into the driver; as well as properly programming the TX chainmask based on the currently configured HAL chainmask. Tested: * AR5416, STA mode - both legacy (11a/11bg) and 11n rates - verified that AR_SELFGEN_MASK (the chainmask used for self-generated frames like ACKs and RTSes) is correct, as well as the TX descriptor contents is correct.
* Implement a HAL method to set a 64 bit TSF value.adrian2012-11-231-0/+1
| | | | TODO: implement it (and test) for the AR5210/AR5211.
* HAL updates!adrian2012-10-311-1/+23
| | | | | | | | | | | | | * Add some more ANI spur immunity levels. * For AR5111 radios attached to an AR5212, limit the 5GHz channels that are available. A later revision of the AR5111 supports the 4.9GHz PSB channels but right now there's no check in place for the radio revision. If someone wants PSB support on AR5212+AR5111 radios then please let me know and I'll add the relevant version check. Obtained from: Qualcomm Atheros
* Add default values for the NumTxMaps capability.adrian2012-08-241-0/+1
|
* Add the method to fetch the default DFS parameters for the AR5212 PHY.adrian2012-08-241-0/+1
| | | | | | I need to check whether new parameters were added for the AR5413 NIC. PR: kern/170904
* Flesh out the multi-rate retry capability.adrian2012-07-281-0/+1
| | | | | | | | The existing method for testing for MRR is to call the "SetupXTXDesc" HAL method and see if it returns AH_TRUE or AH_FALSE. This capability explicitly lists what number of multi-rate attempts are possible. "1" means "one rate attempt supported".
* Break out the TX descriptor link field into HAL methods.adrian2012-07-191-0/+3
| | | | | | | | | | | | | | | | The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy chips: * The RX DMA descriptors don't have a ds_link field; * The TX DMA descriptors have a ds_link field however at a different offset. This is a reimplementation based on what the reference driver and ath9k does. A subsequent commit will enable it in the TX and beacon paths. Obtained from: Linux ath9k, Qualcomm Atheros
* oops - ath_hal_disablepcie is actually destined for another purpose,adrian2012-05-251-3/+4
| | | | | | | not to disable the PCIe PHY in prepration for reset. Extend the enablepci method to have a "poweroff" flag, which if equal to true means the hardware is about to go to sleep.
* Change the MIB cycle count API to return HAL_BOOL, rather than uint32_t,adrian2012-05-011-2/+3
| | | | | | | to return whether it was successful. Add placeholder (blank) methods for previous chips, for both it and the 11n extension channel busy call.
* Radar API related fixes.adrian2012-01-301-0/+7
| | | | | | | | | | | | * For legacy NICs, the combined RSSI should be used. For earlier AR5416 NICs, use control chain 0 RSSI rather than combined RSSI. For AR5416 > version 2.1, use the combined RSSI again. * Add in a missing AR5212 HAL method (get11nextbusy) which may be called by radar code. This serves no functional change for what's currently in FreeBSD.
* Fix a corner case in the HAL debugging changes, where ah was NULL.adrian2011-09-301-2/+2
| | | | | | | | | | | | | Although I tried to fix this earlier by introducing HALDEBUG_G(), it turns out there seem to be other cases where the pointer value is still NULL. * Fix DO_HALDEBUG() and the HALDEBUG macro to check whether ah is NULL before deferencing it * Remove HALDEBUG_G() as it's no longer needed This is hopefully a merge candidate for 9.0-RELEASE as enabling debugging at startup could result in a kernel panic.
* Update the TSF and next-TBTT methods to work for the AR5416 and later NICs.adrian2011-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another commit in a series of TDMA support fixes for the 11n NICs. * Move ath_hal_getnexttbtt() into the HAL; write methods for it. This returns a timer value in TSF, rather than TU. * Move ath_hal_getcca() and ath_hal_setcca() into the HAL too, where they likely now belong. * Create a new HAL capability: HAL_CAP_LONG_RXDESC_TSF. The pre-11n NICs write 15 bit TSF snapshots into the RX descriptor; the AR5416 and later write 32 bit TSF snapshots into the RX descriptor. * Use the new capability to choose between 15 and 31 bit TSF adjustment functions in ath_extend_tsf(). * Write ar5416GetTsf64() and ar5416SetTsf64() methods. ar5416GetTsf64() tries to compensate for TSF changes at the 32 bit boundary. According to yin, this fixes the TDMA beaconing on 11n chipsets and TDMA stations can now associate/talk, but there are still issues with traffic stability which need to be investigated. The ath_hal_extendtsf() function is also used in RX packet timestamping; this may improve adhoc mode on the 11n chipsets. It also will affect the timestamps seen in radiotap frames. Submitted by: Kang Yin Su <cantona@cantona.net> Approved by: re (kib)
* Add another HAL method - ah_isFastClockEnabled - which returns AH_TRUEadrian2011-08-081-0/+1
| | | | | | | | | | | if 5ghz fast clock is enabled in the current operating mode. It's slightly dirty, but it's part of the reference HAL and used by the (currently closed-source) radar event code to map radar pulses back to microsecond durations. Obtained from: Atheros Approved by: re (kib, blanket)
* Re-introduce a global ath_hal_debug again for now, whilst I figure out whatadrian2011-06-231-2/+2
| | | | | | | | | | | | to do about the few cases where the HAL state isn't available (regdomain) or isn't yet setup (probe/attach.) The global ath_hal_debug now affects all instances of the HAL. This also restores the ability for probe/attach debugging to work; as the sysctl tree may not be attached at that point. Users can just set the global "hw.ath.hal.debug" to a suitable value to enable probe/attach related debugging.
* Flesh out a new HAL method to fetch the radar PHY error frame information.adrian2011-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | For the AR5211/AR5212, this is apparently a one byte pulse duration counter value. It is only coded up here for the AR5212 as I don't have any AR5211-series hardware to test it on. This information was extracted from the Madwifi DFS branch along with some local additions. Please note - all this does is extract out the radar event duration, it in no way reflects the presence of a radar. Further code is needed to take a set of radar events and filter them to extract out correct radar pulse trains (and ignore other events.) For further information, please see: http://wiki.freebsd.org/dev/ath_hal%284%29/RadarDetection This includes references to the relevant patents which describe what is going on. Obtained from: Madwifi
* Bring over the relevant registers to use when implementing the quiet timeadrian2011-06-031-0/+1
| | | | | | | | | portion of 802.11h. The AR5212 code has been brought over as a reference, it's currently untested. Obtained from: Atheros
* Add some missing DFS chipset functionality to the FreeBSD HAL.adrian2011-06-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Please note - this doesn't in any way constitute a full DFS implementation, it merely adds the relevant capability bits and radar detection threshold register access. The particulars: * Add new capability bits outlining what the DFS capabilities are of the various chipsets. * Add HAL methods to set and get the radar related register values. * Add AR5212 and AR5416+ DFS radar related register value routines. * Add a missing HAL phy error code that's related to radar event processing. * Add HAL_PHYERR_PARAM, a data type that encapsulates the radar register values. The AR5212 routines are just for completeness. The AR5416 routines are a super-set of those; I may later on do a drive-by pass to tidy up duplicate code. Obtained from: Linux, Atheros
* The ANI control for the AR5416 and later chips was calling ar5212AniControl(),adrian2011-05-241-0/+3
| | | | | | | | | | which did AR5212 specific initialisation. This would cause some slight silliness when enabling/disabling ANI. Just to be completely correct - and to ensure the phy error mask/RX filter register isn't incorrectly played with - make the ANI control function a method, have it set appropriately for AR5212/AR5416, and call that from the ANI control interface.
* Add a HAL capability bit for supporting self-linked RX descriptors and ↵adrian2011-04-041-0/+1
| | | | | | | | | | | | | | | | | | | disable it for the 11n chipsets. From the ath9k source: == 11N: we can no longer afford to self link the last descriptor. MAC acknowledges BA status as long as it copies frames to host buffer (or rx fifo). This can incorrectly acknowledge packets to a sender if last desc is self-linked. == Since this is useful for pre-AR5416 chips that communicate PHY errors via error frames rather than by on-chip counters, leave the support in there, but disable it for AR5416 and later.
* There's apparently a bug with Merlin (AR9280) and later chipsets whereadrian2011-02-081-0/+2
| | | | | | | | | | | | putting descriptors (not buffers) across a 4k page boundary can cause issues. I've not seen it in production myself but it apparently can cause problems. So, in preparation for addressing this workaround, (re)-expose the particular HAL capability bit which marks whether the chipset has support for cross-4k- boundary transactions or not. A subsequent commit will modify the descriptor allocation to avoid allocating descriptor entries that straddle a 4k page boundary.
* ANI changes #1 - split out the ANI polling from the RxMonitor hook.adrian2011-01-211-1/+2
| | | | | | | | | | The rxmonitor hook is called on each received packet. This can get very, very busy as the tx/rx/chanbusy registers are thus read each time a packet is received. Instead, shuffle out the true per-packet processing which is needed and move the rest of the ANI processing into a periodic event which runs every 100ms by default.
* Include the initial support for external EEPROMs.adrian2011-01-201-1/+2
| | | | | | | | | | | | | | The AR9100 at least doesn't have an external serial EEPROM attached to the MAC; it instead stores the calibration data in the normal system flash. I believe earlier parts can do something similar but I haven't experienced it first-hand. This commit introduces an eepromdata pointer into the API but doesn't at all commit to using it. A future commit will include the glue needed to allow the AR9100 support code to use this data pointer as the EEPROM.
* Add a new HAL method to retrieve the completion schedule. It setsadrian2011-01-201-0/+1
| | | | | | | | | | | the completion schedule from the hardware and returns AH_TRUE if the hardware supports multi-rate retries (AR5212 and above); and returns AH_FALSE if the hardware doesn't support multi-rate retries. The sample rate module directly reads the TX completion descriptor and extracts the TX schedule information from that. It will be updated in a future commit to instead use this method to determine the completion schedule.
* Couple of suggestions from Sam regarding latest commit:rpaulo2010-03-021-3/+3
| | | | | | | 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
* Properly setup the TX FIFO threshold for AR5416 based chipsets,rpaulo2010-03-011-0/+3
| | | | | | including the AR9285. This seems to fix some users's problems. Submitted by: Jorge Boncompte [DTI2] <jorge at dti2.net>
* Add HAL_RX_FILTER_BSSID support (to disable bssid match):sam2009-06-271-4/+8
| | | | | | | | | | | o add HAL_CAP_BSSIDMATCH to identify parts that have the support for disabling bssid match o honor capability for set/get rx filter o use HAL_CAP_BSSIDMATCH in driver to decide whether to use the bssid match disable or fall back to promisc mode Reviewed by: rpaulo Approved by: re (rwatson)
* add TBTT interrupt support; this was added in Griffin so consumers shouldsam2009-05-191-0/+2
| | | | | | check HAL_CAP_INTRMASK before using it NB: didn't test 11n parts yet so supported only for 5212-class parts
* add HAL_CAP_INTRMASK to return the set of interrupts supported by the devicesam2009-05-191-0/+7
|
* purge hal abi support; now that the hal is merged w/ the driversam2009-03-191-1/+0
| | | | | | we cannot be out of sync MFC after: 1 week
* Add PCIE power control api:sam2009-02-241-34/+46
| | | | | | | | | | | | o add ah_configPCIE and ah_disablePCIE for drivers to configure PCIE power save operation (modeled after ath9k, may need changes) o add private state flag to indicate if device is PCIE (replaces private hack in 5212 code) o add serdes programming ini bits for 5416 and later parts and setup for each part (5416 and 9160 logic hand-crafted from existing routines); 5212 remains open-coded but is now hooked in via ah_configPCIE o add PCIE workaround gunk o add ar5416AttachPCIE for iodomatic code used by 5416 and later parts
* remove private copies of gpio methods that were needed when the halsam2009-02-231-5/+0
| | | | was an independent entity
* Overhaul regulatory support:sam2009-01-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o remove HAL_CHANNEL; convert the hal to use net80211 channels; this mostly involves mechanical changes to variable names and channel attribute macros o gut HAL_CHANNEL_PRIVATE as most of the contents are now redundant with the net80211 channel available o change api for ath_hal_init_channels: no more reglass id's, no more outdoor indication (was a noop), anM contents o add ath_hal_getchannels to have the hal construct a channel list without altering runtime state; this is used to retrieve the calibration list for the device in ath_getradiocaps o add ath_hal_set_channels to take a channel list and regulatory data from above and construct internal state to match (maps frequencies for 900MHz cards, setup for CTL lookups, etc) o compact the private channel table: we keep one private channel per frequency instead of one per HAL_CHANNEL; this gives a big space savings and potentially improves ani and calibration by sharing state (to be seen; didn't see anything in testing); a new config option AH_MAXCHAN controls the table size (default to 96 which was chosen to be ~3x the largest expected size) o shrink ani state and change to mirror private channel table (one entry per frequency indexed by ic_devdata) o move ani state flags to private channel state o remove country codes; use net80211 definitions instead o remove GSM regulatory support; it's no longer needed now that we pass in channel lists from above o consolidate ADHOC_NO_11A attribute with DISALLOW_ADHOC_11A o simplify initial channel list construction based on the EEPROM contents; we preserve country code support for now but may want to just fallback to a WWR sku and dispatch the discovered country code up to user space so the channel list can be constructed using the master regdomain tables o defer to net80211 for max antenna gain o eliminate sorting of internal channel table; now that we use ic_devdata as an index, table lookups are O(1) o remove internal copy of the country code; the public one is sufficient o remove AH_SUPPORT_11D conditional compilation; we always support 11d o remove ath_hal_ispublicsafetysku; not needed any more o remove ath_hal_isgsmsku; no more GSM stuff o move Conformance Test Limit (CTL) state from private channel to a lookup using per-band pointers cached in the private state block o remove regulatory class id support; was unused and belongs in net80211 o fix channel list construction to set IEEE80211_CHAN_NOADHOC, IEEE80211_CHAN_NOHOSTAP, and IEEE80211_CHAN_4MSXMIT o remove private channel flags CHANNEL_DFS and CHANNEL_4MS_LIMIT; these are now set in the constructed net80211 channel o store CHANNEL_NFCREQUIRED (Noise Floor Required) channel attribute in one of the driver-private flag bits of the net80211 channel o move 900MHz frequency mapping into the hal; the mapped frequency is stored in the private channel and used throughout the hal (no more mapping in the driver and/or net80211) o remove ath_hal_mhz2ieee; it's no longer needed as net80211 does the calculation and available in the net80211 channel o change noise floor calibration logic to work with compacted private channel table setup; this may require revisiting as we no longer can distinguish channel attributes (e.g. 11b vs 11g vs turbo) but since the data is used only to calculate status data we can live with it for now o change ah_getChipPowerLimits internal method to operate on a single channel instead of all channels in the private channel table o add ath_hal_gethwchannel to map a net80211 channel to a h/w frequency (always the same except for 900MHz channels) o add HAL_EEBADREG and HAL_EEBADCC status codes to better identify regulatory problems o remove CTRY_DEBUG and CTRY_DEFAULT enum's; these come from net80211 now o change ath_hal_getwirelessmodes to really return wireless modes supported by the hardware (was previously applying regulatory constraints) o return channel interference status with IEEE80211_CHANSTATE_CWINT (should change to a callback so hal api's can take const pointers) o remove some #define's no longer needed with the inclusion of <net80211/_ieee80211.h> Sponsored by: Carlson Wireless
* import ath halsam2008-12-011-0/+870
OpenPOWER on IntegriCloud