Commit Graph

462 Commits

Author SHA1 Message Date
Sam Leffler
8ab663f305 kill unused OS_GETUPTIME 2009-05-08 00:15:27 +00:00
Sam Leffler
ab06fdf2a5 optimize ath_tx_findrix: there's no need to walk the rates table as
sc_rixmap is an inverse map

NB: could eliminate the check for an invalid rate by filling in 0 for
    invalid entries but the rate control modules use it to identify
    bogus rates so leave it for now
2009-05-07 00:35:32 +00:00
Sam Leffler
a8962181ad o cleanup checks for which vap combinations are permitted and what to
use for ic_opmode
o fixes the case where creating ahdemo+wds vaps caused ic_opmode to be
  set to hostap
2009-05-06 23:49:55 +00:00
Sam Leffler
a00b852cab add support for the Beacon Not Ready (BNR) interrupt
(available on 5211 and later)
2009-05-06 23:09:26 +00:00
Sam Leffler
04f19fd699 make superg/fast-frames state dynamically-allocated (and indirect off
the com structure instead of embedded); this reduces the overhead when
not configured and reduces visibility of the contents
2009-05-02 20:16:55 +00:00
Sam Leffler
19ea87c42b o eliminate a << in calculating the tx time for turbo mode by pre-multiplying
data in the phy tables
o correct the ctrl rate indices in the 5212 turbog phy table
2009-04-13 21:01:08 +00:00
Sam Leffler
e40b6ab1cf don't use caddr_t to match ieee80211_dump_pkt type; supplying the correct
one costs nothing
2009-04-13 20:58:47 +00:00
Sam Leffler
040972a18b o fix dynamic slave-side tdma slot length updating: we need to re-setup the
burst length in the tx q's
o remove re-config of the beaconq on update; it's not needed
2009-04-13 20:57:34 +00:00
Sam Leffler
5e86169a67 add a debug msg for when a fixed transmit rate is not applied because
it's not found in the sta's negotiated rate set
2009-04-13 20:54:08 +00:00
Sam Leffler
89047529ac remove reference to sc_tdmabintcnt; it was removed in r190848 2009-04-13 03:20:21 +00:00
Sam Leffler
dd015656a7 check the method pointer before invoking ah_eepromDetach as it can
be null if attach work fails before hooking up the eeprom support

Obtained from:	madwifi
2009-04-09 16:53:59 +00:00
Sam Leffler
293d484820 remove unused struct member 2009-04-08 16:12:28 +00:00
Sam Leffler
339ccfb391 Hoist 802.11 encapsulation up into net80211:
o call ieee80211_encap in ieee80211_start so frames passed down to drivers
  are already encapsulated
o remove ieee80211_encap calls in drivers
o fixup wi so it recreates the 802.3 head it requires from the 802.11
  header contents
o move fast-frame aggregation from ath to net80211 (conditional on
  IEEE80211_SUPPORT_SUPERG):
  - aggregation is now done in ieee80211_start; it is enabled when the
    packets/sec exceeds ieee80211_ffppsmin (net.wlan.ffppsmin) and frames
    are held on a staging queue according to ieee80211_ffagemax
    (net.wlan.ffagemax) to wait for a frame to combine with
  - drivers must call back to age/flush the staging queue (ath does this
    on tx done, at swba, and on rx according to the state of the tx queues
    and/or the contents of the staging queue)
  - remove fast-frame-related data structures from ath
  - add ieee80211_ff_node_init and ieee80211_ff_node_cleanup to handle
    per-node fast-frames state (we reuse 11n tx ampdu state)
o change ieee80211_encap calling convention to include an explicit vap
  so frames coming through a WDS vap are recognized w/o setting M_WDS

With these changes any device able to tx/rx 3Kbyte+ frames can use fast-frames.

Reviewed by:	thompsa, rpaulo, avatar, imp, sephe
2009-03-30 21:53:27 +00:00
Sam Leffler
584f7327f1 Remove ATH_SUPPORT_TDMA and use IEEE80211_SUPPORT_TDMA instead. It
doesn't make much sense to configure driver support w/o net80211.
Note this means ath now depends on opt_wlan.h.
2009-03-30 19:23:49 +00:00
Sam Leffler
29aca94080 Eliminate ic_myaddr so changing the mac address of a device works correctly:
o remove ic_myaddr from ieee80211com
o change ieee80211_ifattach to take the mac address of the physical device
  and use that to setup the lladdr.
o replace all references to ic_myaddr in drivers by IF_LLADDR
o related cleanups (e.g. kill dead code)

PR:		kern/133178
Reviewed by:	thompsa, rpaulo
2009-03-29 17:59:14 +00:00
Sam Leffler
aa28501a67 fix build w/ AH_DEBUG 2009-03-24 00:09:35 +00:00
Sam Leffler
c4d3fad2ec purge hal abi support; now that the hal is merged w/ the driver
we cannot be out of sync

MFC after:	1 week
2009-03-19 19:29:10 +00:00
Sam Leffler
2bc3ce7732 Minor cleanups of tdma protocol handling:
o break out version-related code to simplify rev'ing the protocol
o add parameter validation macros so checks that appear multiple places
  are consistent (and easy to change)
o add protocol version check when looking for a scan candidate
o improve scan debug output format
o rewrite beacon update handling to calculate a bitmask of changed values
  and pass that down through the driver callback so drivers can optimize work
o do slot bounds check before use when parsing received beacons
2009-03-18 19:28:17 +00:00
Sam Leffler
4a948799c2 preliminary ar9280 support:
o add 9280 attach that sets up ini, cal, etc.
o new rf backend for 9280 and later parts
o split ini setup and spur mitigation support out to methods
  and provide 9280-specific support
o minor fixups to shared code to handle 9280-specific work

Obtained from:	Atheros (ini values and some code)
2009-03-12 18:18:28 +00:00
Sam Leffler
d9bde68623 add asserts 2009-03-12 00:09:29 +00:00
Sam Leffler
2e986da5f1 replace if_watchdog w/ private callout; probably can merge this with the
calibration work sometime in the future
2009-03-09 23:10:19 +00:00
Sam Leffler
dfc86af7d7 remove ar9160Detach; it does nothing 2009-03-09 23:04:06 +00:00
Warner Losh
155a83e87a remove now-redunant cardbus attachment. 2009-03-09 13:23:54 +00:00
Sam Leffler
9c859a041a add a sysctl to ena/dis frobbing cca 2009-03-05 00:15:43 +00:00
Sam Leffler
92a0357875 fix typo's 2009-02-24 15:43:42 +00:00
Sam Leffler
811b1001aa move attach debug msg to the rf backend 2009-02-24 01:16:40 +00:00
Sam Leffler
44834ea4f7 Add PCIE power control api:
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
2009-02-24 01:07:06 +00:00
Sam Leffler
40ce424605 Fill in gpio support for 5416 and later parts:
o add output mux support
o gpio pin count is chip-dependent
o 9280 and 9285 do input handling different
o hookup gpio interrupts
o no need to save/restore soft led state around reset
2009-02-24 00:33:08 +00:00
Sam Leffler
a0a2aa7916 misc fixups, mostly for code not compiled yet 2009-02-24 00:29:32 +00:00
Sam Leffler
869ff02ebe 5416 and later parts mux the gpio outputs; extend the api to include
a signal type that's used to select the appropriate mux
2009-02-24 00:12:16 +00:00
Sam Leffler
f396f37ed1 move eeprom attach above first reset as the reset code checks the
eeprom contents for 9280 and later parts
2009-02-24 00:03:14 +00:00
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
d497b6a449 remove private support for IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER
now that net80211 has them
2009-02-19 05:22:40 +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
3fc21fed93 add SIOCZATHSTATS ioctl to zero driver statistics 2009-02-13 05:38:03 +00:00
Sam Leffler
36c6be9ab4 add driver stat to count tx drops due to insufficient frag buffers 2009-02-13 05:30:22 +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
59fbb2570a don't do phantom beacon miss checking for s/w beacon miss handling,
this can mistakenly drop events that cause the s/w bmiss timer to
never get re-armed
2009-02-10 23:48:29 +00:00
Sam Leffler
330528331c mark the CLR key installed for open auth stations such that it is reclaimed
when net80211 tears down station state; without this we leak keycache slots
2009-02-10 19:27:50 +00:00
Sam Leffler
a32ac9d3a9 add hw.ath.bstuck to control the stuck beacon threshold 2009-02-10 19:26:42 +00:00
Sam Leffler
054d7b6979 on resume ah_curchan may be NULL if no channel change has been done;
workaround this by passing net80211's channel as we know it'll never
be null

Submitted by:	trasz
2009-02-10 19:25:11 +00:00
Sam Leffler
41576ce6db consolidate conditional code 2009-02-10 19:23:25 +00:00
Sam Leffler
c2e344594e count stuck beacon events 2009-02-07 05:34:41 +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
3267a60cbd Minor packet drop improvements:
o change tdma packet drop msg when ack required to ATH_DEBUG_TDMA
  (ATH_DEBUG_XMIT is too noisy)
o add a debug msg for raw packet drop due to interface down/invalid
o add stats for these two cases
o explain how another drop case is handled
2009-02-05 21:02:40 +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
5fe9f04492 change ic_getradiocaps driver callback to include the max # channels
so callers know the size of the array passed down
2009-01-27 23:19:36 +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
8d91de92ee don't run the calibration code if scanning, we won't be on the home channel 2009-01-23 03:15:28 +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
10ad9a77f3 TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
  existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
  conceivable other devices might be capable of this too in which case
  they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
  configure, new statistics in athstats, and new debug mask bits

While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.

Sponsored by:	Intel
2009-01-08 17:12:47 +00:00
Sam Leffler
5f82a460f8 correct fixed rate handling; the rixmap was changed a while back
to be indexed by the ieee rate code
2009-01-07 23:30:26 +00:00
Sam Leffler
50666d87db remove the ath_rate module dependency; it's all bundled 2009-01-06 01:58:45 +00:00
Sam Leffler
34b8d7d479 remove module glue, it's not used any more 2009-01-06 01:36:36 +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
9d6b29a668 honor IEEE80211_BPF_CRYPTO for raw xmit; fixes shared key auth in sta mode
PR:		kern/129022
2008-12-07 19:29:11 +00:00
Sam Leffler
2dc7fcc48f New periodic calibration scheme needed for 11n parts that have
multiple algorithms and potentially collect multiple samples.
Instead of a single calibration interval we now have short and long
intervals; the long interval roughly corresponds to the previous
single interval.  The short interval is used to speedup collection
of samples and happens much quicker.  We make calls using the short
interval until we're told the calibration work is complete at which
point we fallback to the long interval.  In addition there is a
much longer reset interval used to flush all calibration state and
cause everthing to start anew.

With these changes you can also disable calibration entirely by
setting the long interval to zero.
2008-12-07 19:26:34 +00:00
Sam Leffler
3364462355 Switch to ath hal source code. Note this removes the ath_hal
module; the ath module now brings in the hal support.  Kernel
config files are almost backwards compatible; supplying

device ath_hal

gives you the same chip support that the binary hal did but you
must also include

options AH_SUPPORT_AR5416

to enable the extended format descriptors used by 11n parts.
It is now possible to control the chip support included in a
build by specifying exactly which chips are to be supported
in the config file; consult ath_hal(4) for information.
2008-12-01 16:53:01 +00:00
Sam Leffler
1477970585 import ath hal 2008-12-01 16:43:08 +00:00
Sam Leffler
fe7432d7f0 cover up sun4v namespace pollution 2008-11-30 21:59:44 +00:00
Sam Leffler
c1565b61d0 Major overhaul:
o eliminate private state indexed by 802.11 rate codes; use the hal's
  rate tables directly to get the same info
o calculate a mask of operational rates to optimize lookups and checks
  (instead of using for loops and similar)
o optimize size bin operations
o ignore rates marked as "do not use" in the hal phy tables
o fix bug that caused upshifting to break in 11g once the rate dropped
  below 11Mb/s
o add more intelligent multi-rate tx schedules
o add support for 1/2 and 1/4 width channels
o add dev.ath.X.sample_stats sysctl to dump runtime statistics to the console
  (needs to go up to a user app)
o export more tuning knobs via sysctls (still a couple of magic constants)
2008-11-30 19:06:35 +00:00
Sam Leffler
a7ace8438c sync w/ p4 branch 2008-11-30 18:56:41 +00:00
Sam Leffler
459bc4f0dd some of the 11n parts can hang under certain conditions without
necessary workarounds, add code to detect these hangs and distinguish
them from other events; note this code is only invoked for anomalous
conditions and (at the moment) is a noop because the hang detection
code is in a new hal that's coming shortly
2008-11-30 18:34:27 +00:00
Sam Leffler
1b15625c19 add frequency mapping for the Zcomax GZ-901 2008-11-30 18:27:10 +00:00
Sam Leffler
6902009e2a print the extended tx/rx descriptor for 5416 and later parts 2008-11-24 01:34:56 +00:00
Sam Leffler
9c4fc1e8a2 nuke special handling of RXORN interrupt; the hal marks the FATAL
bit in the interrupt status when RXORN is hit and the chip requires
a reset so our special handling was causing useless resets
2008-11-24 01:31:10 +00:00
Sam Leffler
d6f57961a8 Fix checks for fast frames negotiation. ni_ath_flags holds the
capabilities reported by the ap.  These need to be cross-checked
against the local configuration in the vap.  Previously we were
only checking the ap capabilities which meant that if an ap reported
it was ff-capable but we were not setup to use them we'd try to do
ff aggregation and drop the frame.

There are a number of problems to be fixed here but applying this
fix immediately as the problem causes all traffic to stop (and has
not workaround).

Reported by:	Ashish Shukla
2008-10-30 16:22:04 +00:00
Sam Leffler
411373ebc6 prepare for a new hal 2008-10-27 18:30:33 +00:00
Sam Leffler
46d4d74c94 o With the addition of HT rates the set of h/w codes has a much wider range
making the use of sc_hwmap to do direct mapping impractical.  Switch to
  indexing by the rate index instead of the rate code and adjust associated
  state and logic appropriately.  This has several benefits including
  simplification of the led code.
o fix radiotap capture of HT rates
o fix conditional compilation of HT radiotap support to be based on the
  hal having 5416 support; not the ABI version as hal builds may or may
  not include 5416 support
2008-10-27 18:22:44 +00:00
Sam Leffler
26041a143b prefer #define to naked constant 2008-10-27 18:05:26 +00:00
Sam Leffler
180f268d4d fix handling of HT rates; these overlap legacy rates and need to be
marked as MCS in the inverse mapping table
2008-10-27 18:02:47 +00:00
Sam Leffler
dd2a574e16 add hack to deal with Ubiquiti XR9 cards, they have a different mapping
between 900MHz and 2.4GHz frequencies than SR9 cards; they are distinguished
by different country codes
2008-10-27 18:00:43 +00:00
Sam Leffler
7b916f8948 install bssid for ahdemo mode too 2008-10-27 17:54:17 +00:00
Sam Leffler
5d61b5e8f0 fix comment 2008-10-27 17:53:34 +00:00
Sam Leffler
74eca0c26f correct callback status parameter; only indicate success when an ACK was
received
2008-10-27 17:52:41 +00:00
Sam Leffler
84784be1ae Fixup statistics:
o update tx rssi data only when an ACK was received
o return tx rssi from sampled data instead of the last frame
o track noise floor
o return rx rssi and noise floor (was broken)
2008-10-27 17:51:24 +00:00
Sam Leffler
ad80c0aa34 update the sta inactivity timer only if we actually received an ACK 2008-10-27 17:43:23 +00:00
Sam Leffler
96abcb94d7 Regdomain fixups:
o pass country code, outdoor indication, and ecm mode into the hal
  when requesting a channel list
o add a console msg when regulatory setup fails
o add placeholder code to map between Atheros sku's and 802.11 sku's
  that handles only the debug country code used to unlock the full
  channel list (to be used only for debugging)
o fix multiple instances of mismapping the 802.11 location to the
  outdoor indication (anywhere may be outdoor also)
2008-10-27 17:41:32 +00:00
Sam Leffler
033022a93b add regdomain debug msgs 2008-10-27 17:35:09 +00:00
Sam Leffler
577eaa6032 add sys.dev.ath.X.intmit knob to enable/disable ANI
(the intmit name is historical)
2008-10-27 17:22:46 +00:00
Sam Leffler
3297be131d shuffle debug setup to simplify debugging events during attach 2008-10-27 17:19:39 +00:00
Sam Leffler
80c07f2369 rename bf_flags to bf_txflags in preparation for the addition of flags
separate from the tx descriptor flags currently recorded
2008-10-27 17:16:46 +00:00
Sam Leffler
47db982fc9 use the ic's opmode instead of our hal equivalent to check for adhoc mode;
they are always the same
2008-10-27 17:14:39 +00:00
Sam Leffler
4b54a23144 intercept IEEE80211_IOC_TXPOWER and service tx power changes immediately 2008-10-27 17:12:41 +00:00
Sam Leffler
ec9ee5e727 move complaints about bad rate codes up a level so we can print
the h/w rate code and other useful info
2008-10-27 17:10:21 +00:00
Sam Leffler
c62362cbec remove driver-private equivalent of ni_txparms; it's now superfluous 2008-10-27 17:03:24 +00:00
Sam Leffler
1eb911a5cc now that the new association callback is used when joining a bss we can
eliminate the ath_rate_newassoc callback and associated code
2008-10-27 16:58:06 +00:00
Sam Leffler
e66b0905fc o use the new association callback to notify the driver when joining a bss
in sta and adhoc modes; this should've been done forever ago as most all
  drivers use this hook to set per-station transmit parameters such as for
  tx rate control
o adjust drivers to remove explicit calls to the driver newassoc method
2008-10-27 16:46:50 +00:00
Sam Leffler
1e63cecbbc fix static key wep; r183248 caused drivers to be called for keys to be
assigned to slots in the global key table but ath_key_alloc was not
updated to handle that
2008-10-19 21:34:49 +00:00
Sam Leffler
e6e547d57b Crypto api changes:
o don't use the key index to identify when the driver has been
  asked to allocate a key slot, use an explicit flag; allows
  drivers to force s/w fallback for entries in the global table
o change callback api to allocate driver resources for a crypto key:
  - de-const the key parameter so drivers can muck with the flags
  - on callback failure don't automatically try to setup s/w crypto;
    instead the driver must now mark the key entry for s/w crypto and
    the caller will re-attach the cipher module

NB: api change permits drivers more control over fallback to s/w
    crypto (e.g. based on a limited number of h/w key slots)
2008-09-21 23:16:19 +00:00
Sam Leffler
3627e32112 fix compilation on 64-bit platform w/ ATH_DEBUG 2008-09-21 00:30:33 +00:00
Sam Leffler
90dce2467e fix memory smash on lp64 platforms; mostly noticeable in user mode
as being unable to associate
2008-09-21 00:28:54 +00:00
Rui Paulo
3a6fcf1067 Update for new HAL.
Reviewed by:	sam
2008-09-09 16:21:25 +00:00
Sam Leffler
38c208f876 Change the calling convention for ic_node_alloc to deal with
some longstanding issues:
o pass the vap since it's now the "coin of the realm" and required
  to do things like set initial tx parameters in private node
  state for use prior to association
o pass the mac address as cards that maintain outboard station
  tables require this to create an entry (e.g. in ibss mode)
o remove the node table reference, we only have one node table
  and it's unlikely this will change so this is not needed to
  find the com structure
2008-06-07 18:38:02 +00:00
Sam Leffler
faaedb30ca 5416 and similar chips grew another region in the pci clock domain
where register accesses do not pass through the byte-lane hardware;
extend the register op macros to deal with this

MFC after:	1 week
2008-05-31 22:44:06 +00:00
Sam Leffler
e387d629b8 correct rx radiotap channel flags construction for 11n frames 2008-05-29 00:14:35 +00:00
Sam Leffler
d3ac945bb4 Cleanup power handling and fix suspend/resume:
o do not put the chip into full sleep in ath_stop as it gains
  nothing and causes many parts to hang in ath_detach because we
  may touch the chip during vap teardown; this may also fix issues
  with unloading the module
o add a note in ath_detach to explain ath_hal_detach puts the
  chip in low power mode; this is useful to know as it means
  unloading the module will place a pci device in the lowest
  possible power state
o leave an #ifdef notyet marker for powering down the chip when
  a device is marked down; we can't do that until we handle all
  the ways the driver may be entered and touch the chip
o fix resume by reloading the h/w key cache as it's been clobbered
  (for pci) by the socket being powered off; for station mode we
  directly stop+init the chip and then simulate a beacon miss to
  get the upper layers sync'd up; for other configs we must brute
  force stop+start the vaps so they go through the state machine
2008-05-29 00:10:48 +00:00
Sam Leffler
71b8507770 close a race on detach by reordering bpfdetach and taskqueue_free 2008-05-28 23:55:11 +00:00
Sam Leffler
4df6277969 send EAPOL frames at the same rate used for mgt frames 2008-05-28 23:41:40 +00:00
Sam Leffler
c43feede8b Minor cleanup of vap create work:
o add IEEE80211_C_STA capability to indicate sta mode is supported
  (was previously assumed) and mark drivers as capable
o add ieee80211_opcap array to map an opmode to the equivalent capability bit
o move IEEE80211_C_OPMODE definition to where capabilities are defined so it's
  clear it should be kept in sync (on future additions)
o check device capabilities in clone create before trying to create a vap;
  this makes driver checks unneeded
o make error codes return on failed clone request unique
o temporarily add console printfs on clone request failures to aid in
  debugging; these will move under DIAGNOSTIC or similar before release
2008-05-12 00:15:30 +00:00
Sam Leffler
72d9df0aa4 o unbreak handling of TKIP tx-only keys for splitmic chips
o yank compat support for hal's older than 0.9.20.3; leave a
  CTASSERT in place just in case
2008-05-03 21:55:02 +00:00
Sam Leffler
ca8769184c add back sysctl's to display the regdomain and country code from eeprom;
useful for debugging
2008-05-03 21:52:05 +00:00
Andrew Thompson
31a8c1edd8 Unify all the wifi *_ioctl routines
- Limit grabbing the lock to SIOCSIFFLAGS.
 - Move ieee80211_start_all() to SIOCSIFFLAGS.
 - Remove SIOCSIFMEDIA as it is not useful.
 - Limit ether_ioctl to only SIOCGIFADDR. SIOCSIFADDR and SIOCSIFMTU have no
   affect as there is no input/output path in the vap parent.  The vap code
   will handle the reinit of the mac address changes.
 - Split off ndis_ioctl_80211 as it was getting too different to wired devices.

This fixes a copyout while locked and a lock recursion.

Reviewed by:		sam
2008-05-01 04:55:00 +00:00
Sam Leffler
00389c7060 remove old code to handle mcast address changes; this is all done through
net80211 and pushed into the driver through non-ioctl callbacks
2008-04-30 17:00:32 +00:00
Sam Leffler
7de3bc26a5 restore the hal's channel list when doing getradiocaps so it's in sync with
the 802.11 layer's list
2008-04-27 22:03:56 +00:00
Sam Leffler
b032f27c36 Multi-bss (aka vap) support for 802.11 devices.
Note this includes changes to all drivers and moves some device firmware
loading to use firmware(9) and a separate module (e.g. ral).  Also there
no longer are separate wlan_scan* modules; this functionality is now
bundled into the wlan module.

Supported by:	Hobnob and Marvell
Reviewed by:	many
Obtained from:	Atheros (some bits)
2008-04-20 20:35:46 +00:00
Sam Leffler
c28953b424 (finally) add the hal status to the diagnostic generated after
a failed ath_hal_reset call

MFC after:	3 days
2008-03-22 16:27:47 +00:00
Sam Leffler
eeb76a1889 promote ath_defrag to m_collapse (and retire private+unused
m_collapse from cxgb)

Reviewed by:	pyun, jhb, kmacy
MFC after:	2 weeks
2008-01-17 21:25:09 +00:00
Kevin Lo
e3e2d9bf7c - Use pci_enable_busmaster() to turn on busmaster.
- Don't test memory/port status and emit an error message; the PCI bus
  will do this.

Reviewed by: sam
2007-10-23 04:25:43 +00:00
Sam Leffler
1bb9a085eb revert 1.18: the negotiated rate set may not match the hal
rate tables, so using the hal's rateCodeToIndex array
will produce wrong indices for the negotiated rate set

MFC after:	3 days
2007-10-13 22:30:41 +00:00
Sam Leffler
b105a06908 Update beacon handling to sync w/ vap code base:
o add driver callback to handle notification of beacon changes;
  this is required for devices that manage beacon frames themselves
  (devices must override the default handler which does nothing)
o move beacon update-related flags from ieee80211com to the beacon
  offsets storage (or handle however a driver wants)
o expand beacon offsets structure with members needed for 11h/dfs
  and appie's
o change calling convention for ieee80211_beacon_alloc and
  ieee80211_beacon_update
o add overlapping bss support for 11g; requires driver to pass
  beacon frames from overlapping bss up to net80211 which is not
  presently done by any driver
o move HT beacon contents update to a routine in the HT code area

Reviewed by:	avatar, thompsa, sephe
Approved by:	re (blanket wireless)
2007-09-17 19:07:24 +00:00
Sam Leffler
2badb3db3c convert hardware rate codes to IEEE rate codes with a lookup table
instead of a linear search

Reviewed by:	sephe, avatar
Approved by:	re (blanket wireless)
MFC after:	2 weeks
2007-09-17 16:25:02 +00:00
Sam Leffler
0e8c5adf21 bandaid Dynamic Turbo A operation with old hal's: HAL_MODE_108A
does not have a rate table in older hal's so if we scan such a
channel the driver will hit an assertion or crash; for old hal's
fallback to using the static turbo rate table for this mode
(not correct but good enough for now given none of the rate
control algorithms understand how to switch between base+boost)

Approved by:	re (blanket wireless)
2007-09-17 05:16:38 +00:00
Sam Leffler
77d5e06852 fix led blinking in RUN state: the addition of the CAC state moved
IEEE80211_S_RUN and broke the array lookup used to find the LED flags

Approved by:	re (blanket wireless)
2007-09-17 05:12:19 +00:00
Sam Leffler
2b9411e29f Add missing bits that made bg scanning lame:
o update ic_lastdata to reflect time of last outbound frame
o outbound traffic must preempt/cancel bg scanning to avoid delays

This stuff was somehow missed in the initial import.

Reviewed by:	thompsa, avatar, sephe (earlier version)
Approved by:	re (blanket wireless)
2007-09-05 23:00:27 +00:00
Robert Watson
0bf686c125 Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet.  As that
has now been removed, they are no longer required.  Removing them
significantly simplifies error-handling in the socket layer, eliminated
quite a bit of unwinding of locking in error cases.

While here clean up the now unneeded opt_net.h, which previously was used
for the NET_WITH_GIANT kernel option.  Clean up some related gotos for
consistency.

Reviewed by:	bz, csjp
Tested by:	kris
Approved by:	re (kensmith)
2007-08-06 14:26:03 +00:00
Robert Watson
33d2bb9ca3 First in a series of changes to remove the now-unused Giant compatibility
framework for non-MPSAFE network protocols:

- Remove debug_mpsafenet variable, sysctl, and tunable.
- Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force
  debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel.
- Remove logic to automatically flag interrupt handlers as non-MPSAFE if
  debug.mpsafenet is set for an INTR_TYPE_NET handler.
- Remove logic to automatically flag netisr handlers as non-MPSAFE if
  debug.mpsafenet is set.
- Remove references in a few subsystems, including NFS and Cronyx drivers,
  which keyed off debug_mpsafenet to determine various aspects of their own
  locking behavior.
- Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into
  no-op's, as their entire behavior was determined by the value in
  debug_mpsafenet.
- Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE.

Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still
present in subsystems, and will be removed in followup commits.

Reviewed by:	bz, jhb
Approved by:	re (kensmith)
2007-07-27 11:59:57 +00:00
Sam Leffler
d50ea6acfa Process tx callbacks when draining the tx q; this fixes a problem
where a device timeout that occurs with a mgt frame on the tx q
will leave the net80211 layer w/o any way to make progress.

Reviewed by:	thompsa, sephe
Approved by:	re (hrs)
2007-06-24 01:57:20 +00:00