Commit Graph

242 Commits

Author SHA1 Message Date
Sam Leffler
d61d829fd6 attach methods don't need to be public, make 'em static 2009-02-23 23:58:37 +00:00
Sam Leffler
3f1c613044 5416 and later parts get the radio rev differently; add ar5416GetRadioRev
to do it the right way
2009-02-23 23:54:08 +00:00
Sam Leffler
0f5578c15d remove private copies of gpio methods that were needed when the hal
was an independent entity
2009-02-23 23:48:17 +00:00
Sam Leffler
498657cff2 print mac+rf part names; drop the printing 2ghz rf stuff (might come back) 2009-02-23 23:41:12 +00:00
Sam Leffler
dc6592f82e correct SIFS setting; there is a 2usec adjustment between the calculated
value and what the hardware requires (based on inspection of INI values)

Submitted by:	Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
2009-02-20 22:06:58 +00:00
Sam Leffler
9731c399d5 don't adjust core clk conversions for 1/2 and 1/4 rate channels; the
mac runs at full speed so doing this breaks conversion for ifs parameters

Submitted by:	Felix Fietkau <nbd@openwrt.org>
2009-02-20 22:05:08 +00:00
Sam Leffler
17e45e1934 Cleanup ath_hal_computetxtime's handling of 1/2 and 1/4-width channels:
o mark phy type to indicate 1/2 or 1/4-rate operation
o use phy type instead of channel attributes to identify 1/2 and 1/4-rate
  operation
o general cleanup of code including move phy constants to ah_internal.h

Eventually this code should go away and we should use the net0211 equivalents.
2009-02-19 04:24:22 +00:00
Sam Leffler
1a15e29ab4 add HAL_DIAG_SETREGS to write registers via the diag api 2009-02-19 04:15:14 +00:00
Sam Leffler
86b3d17f30 whitespace 2009-02-19 04:10:51 +00:00
Sam Leffler
a4f7ec0929 Recognize AR5212_AR2317_REV2 in ar5312Probe()
Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-13 01:50:04 +00:00
Sam Leffler
4a7019252b fix both instances of name
Pointy hat:	sam
2009-02-11 22:34:22 +00:00
Sam Leffler
d34b671cda fix typo in AH_CHIP definition
Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-11 22:18:03 +00:00
Sam Leffler
71a3564e5f gcc 4.3.2 examines getLowerUpperIndex() and concludes that it's not
guaranteed to initialize its two last arguments.  Therefore, there is a
warning in the subsequent caller ar5416FillVpdTable(), which doesn't
initialize those arguments.

Change getLowerUpperIndex() to assign values to indexL and indexR even
in the case of assertion failure.

Submitted by:	Pavel Roskin <proski@gnu.org>
2009-02-11 22:15:37 +00:00
Sam Leffler
41576ce6db consolidate conditional code 2009-02-10 19:23:25 +00:00
Sam Leffler
b2e73ce955 fix 11n channel construction 2009-02-07 01:54:57 +00:00
Sam Leffler
58ae70168f add macro for future regulatory mods 2009-02-07 01:53:44 +00:00
Sam Leffler
506c6a3a3d add PSB channels to the calibration list 2009-02-06 00:48:56 +00:00
Sam Leffler
e25b0c1528 eliminate gainFCorrection; just have ar5212GetGainFCorrection return
the calculated value as it's only used in one place
2009-02-05 21:13:31 +00:00
Sam Leffler
5b1e30afaa improve IQ cal debug msgs; in particular don't scare people by screaming
"MISGATED IQ CAL!" when it's not
2009-02-05 20:56:33 +00:00
Sam Leffler
4d5c4f2a67 fill in ar5212ResetCalValid; reset the IQ valid flag on the channel
so IQ calibration will be started on the next periodic cal
2009-02-05 20:51:53 +00:00
Sam Leffler
3b00bfe121 style 2009-02-05 20:49:13 +00:00
Sam Leffler
5c5b75f94f replace r/w idiom with OS_REG_SET_BIT (to match other code) 2009-02-05 20:48:30 +00:00
Sam Leffler
50d5ad0e42 fix compilation w/ AH_DEBUG 2009-02-03 19:00:56 +00:00
Sam Leffler
8216b39e2b o make SAVE_CCK slightly less error prone by always writing the _flag
value used later by RESTORE_CCK
o swap arg order in RESTORE_CCK to slightly reduce cost
2009-02-02 16:56:58 +00:00
Sam Leffler
55a2313ad2 restore variable initialization removed in r187831; this broke
the horrible SAVE/RESTORE_CCK macros used by swan/nala cards to
implement 11b using 11g
2009-02-02 16:55:57 +00:00
Sam Leffler
59efa8b517 Overhaul regulatory support:
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
2009-01-28 18:00:22 +00:00
Sam Leffler
8698ea65aa fix return status handling by ar5XXXReset; this is the reason the
driver sometimes reports reset failed w/ status 0
2009-01-23 05:33:48 +00:00
Sam Leffler
b2edeea7fb correct typo that left programmed sifs time in the slot time
(to be applied on subsequent resets)

Submitted by:	Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
2009-01-21 02:53:00 +00:00
Sam Leffler
5e36f05822 export PSB frequencies 2009-01-16 20:44:45 +00:00
Sam Leffler
694be3e533 On some platforms touching the bb registers when the phy is powered
down will cause a fault.  Check the phy power state before possibly
reading from the bb, this can happen as ar5212Reset intentionally
calls ar5212GetRfgain before bringing the bb out of reset (but we
do it here and not in the caller to guard against other possible uses).
2009-01-13 05:50:22 +00:00
Sam Leffler
af945736cf Correct 5212 ani support so that max noise immunity, spur immunity, and
step levels are used.

Noticed by:	Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
Reviewed by:	rpaulo
2008-12-19 18:33:53 +00:00
Sam Leffler
0f1a6e3482 fix ini setup
Submitted by:	Jiri Fojtasek <jiri.fojtasek@hlohovec.net>
2008-12-15 00:29:26 +00:00
Sam Leffler
7978748b83 o remove dead code
o fix AH_RF macro expansion to be as intended (worked before unintentionally)

Obtained from:	netbsd
2008-12-13 03:50:31 +00:00
Sam Leffler
dc798229e4 remove dead code
Obtained from:	netbsd
2008-12-13 03:49:01 +00:00
Sam Leffler
aed75e9d0a add const
Obtained from:	netbsd
2008-12-13 03:48:33 +00:00
Sam Leffler
128ae9780b fix static const order
Obtained from:	netbsd
2008-12-13 03:47:42 +00:00
Sam Leffler
009e2f111c fix static const order
Obtained from:	netbsd
2008-12-13 03:45:54 +00:00
Sam Leffler
0a39558b33 remove duplicate case
Obtained from:	netbsd
2008-12-13 03:45:00 +00:00
Sam Leffler
995172ec6c remove conflicting decl
Obtained from:	netbsd
2008-12-13 03:44:44 +00:00
Sam Leffler
13f209a354 add missing break
Coverity ID:	4159
2008-12-11 04:03:50 +00:00
Sam Leffler
eef5acf25e add missing break
Coverity ID:	4151
2008-12-11 04:03:13 +00:00
Sam Leffler
1477970585 import ath hal 2008-12-01 16:43:08 +00:00