Commit Graph

38 Commits

Author SHA1 Message Date
Sam Leffler
86e07743eb add tx99 hooks
MFC after:	2 weeks
2006-02-09 21:28:11 +00:00
Sam Leffler
ffa2cab632 move hal statistics to softc; the per-node stats are overkill, they're
only used when operating in station mode

MFC after:	2 weeks
2006-02-09 21:23:44 +00:00
Sam Leffler
8b5341de05 honor net80211 mcast tx rate
MFC after:	2 weeks
2006-02-09 21:15:36 +00:00
Sam Leffler
6f890873fb craft unique names for tx q + buffer mtx's to help with interpreting ktr data
MFC after:	2 weeks
2006-02-09 21:09:26 +00:00
Sam Leffler
e2d787fa61 allow the size of tx+rx buffer pools to be tuned
MFC after:	2 weeks
2006-02-09 21:03:25 +00:00
Sam Leffler
be61348037 lower try count on mgt (and ctl) frames to avoid clogging the tx queue
and loading the bss when operating in ap mode under load; adjust recognition
of multi-rate retry to match

MFC after:	2 weeks
2006-02-09 20:57:48 +00:00
Sam Leffler
55f63772e8 move mgt frame tx rate responsibility from the rate control modules
to the driver; this avoids redundant logic and will be necessary
for future additions

MFC after:	2 weeks
2006-02-09 20:49:55 +00:00
Sam Leffler
7b0c77eca9 Update monitoring support:
o record tsf in tx+rx frames
o switch from raw rssi to dbm for signal data and record both
  signal and noise floor data (hacked for now to assume a fixed
  noise floor; is correct with new hal)
o add monpass sysctl to control which rx'd frames are passed
  up with errors; especially useful to see frames with CRC errors
o mark 'd packets w/ a CRC error with radiotap's BADFCS flag

Also add placeholder code for calibrating the noise floor when
using newer hals.

Reviewed by:	avatar
MFC after:	1 week
2006-01-09 17:13:20 +00:00
Sam Leffler
de66ac4427 nuke special handling to extend cts when bursting; it was race prone
MFC after:	7 days
2005-11-15 05:49:02 +00:00
Sam Leffler
c1225b52f6 Split crypto tx+rx key indices and add a key index -> node mapping table:
Crypto changes:
o change driver/net80211 key_alloc api to return tx+rx key indices; a
  driver can leave the rx key index set to IEEE80211_KEYIX_NONE or set
  it to be the same as the tx key index (the former disables use of
  the key index in building the keyix->node mapping table and is the
  default setup for naive drivers by null_key_alloc)
o add cs_max_keyid to crypto state to specify the max h/w key index a
  driver will return; this is used to allocate the key index mapping
  table and to bounds check table loookups
o while here introduce ieee80211_keyix (finally) for the type of a h/w
  key index
o change crypto notifiers for rx failures to pass the rx key index up
  as appropriate (michael failure, replay, etc.)

Node table changes:
o optionally allocate a h/w key index to node mapping table for the
  station table using the max key index setting supplied by drivers
  (note the scan table does not get a map)
o defer node table allocation to lateattach so the driver has a chance
  to set the max key id to size the key index map
o while here also defer the aid bitmap allocation
o add new ieee80211_find_rxnode_withkey api to find a sta/node entry
  on frame receive with an optional h/w key index to use in checking
  mapping table; also updates the map if it does a hash lookup and the
  found node has a rx key index set in the unicast key; note this work
  is separated from the old ieee80211_find_rxnode call so drivers do
  not need to be aware of the new mechanism
o move some node table manipulation under the node table lock to close
  a race on node delete
o add ieee80211_node_delucastkey to do the dirty work of deleting
  unicast key state for a node (deletes any key and handles key map
  references)

Ath driver:
o nuke private sc_keyixmap mechansim in favor of net80211 support
o update key alloc api

These changes close several race conditions for the ath driver operating
in ap mode.  Other drivers should see no change.  Station mode operation
for ath no longer uses the key index map but performance tests show no
noticeable change and this will be fixed when the scan table is eliminated
with the new scanning support.

Tested by:	Michal Mertl, avatar, others
Reviewed by:	avatar, others
MFC after:	2 weeks
2005-08-08 18:46:36 +00:00
Sam Leffler
c59005e9c8 o fix setup of sc_diversity; the hal does not give us reliable
status after attach, only after a reset
o when setting diversity via the sysctl don't update sc_diversity
  until we know the hal requested worked
o while here eliminate sc_hasdiversity and sc_hastpc; just query
  the hal each time since these are the only places we need to know

MFC after:	3 days
2005-07-24 05:11:39 +00:00
Sam Leffler
8f40943151 only invoke ath_rate_tx_complete to update rate control state when the
frame being sent is to be ack'd and hasn't been filtered by the h/w;
this insures we don't pass in tx descriptors that have no meaningful
state (e.g. mcast/bcast frames are not acked and so have no tx retry
counts)

Approved by:	re (scottl)
Obtained from:	Atheros
2005-07-07 00:04:50 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
Sam Leffler
0f2e86fb2a Set the correct IFS parameters for the beacon tx queue
when operating in ap and adhoc modes.
2005-06-07 00:12:40 +00:00
Sam Leffler
e8fd88a37b Misc keycache changes:
o purge ath_initkeytable; it's not needed
o add multicast key search support for supporting multiple group keys
  (disabled for now; requires updated hal)
o create keycache entry for stations using open auth so they get h/w
  antenna management support
o add keycache -> node mapping table; eliminates mac-based lookup in
  the net80211 layer
2005-06-06 16:39:21 +00:00
Sam Leffler
8ca623d734 honor new IEEE80211_KEY_GROUP key flag
Reviewed by:	Tai-hwa Liang
2005-04-12 17:56:43 +00:00
Sam Leffler
31640eb774 use frame type returned by ieee80211_input to drive softled code
instead of monitoring the input packet count
2005-04-04 02:34:15 +00:00
Sam Leffler
c4c3cb462d o extend cts to cover packet burst when operating in 11g w/ protection
o check current channel parameters, not shadow state, for acm policy
  on data frames
2005-03-30 20:13:08 +00:00
Sam Leffler
d3be6f5b0c Fixup radiotap handling of FCS and QoS frames per discussion with David Young:
o mark rx frames including FCS in the payload with the
  IEEE80211_RADIOTAP_F_FCS flag
o remove hack to copy 802.11 headers with padding out of line; instead mark
  the frames with IEEE80211_RADIOTAP_F_DATAPAD and require applications to
  do the work
o split precalculated radiotap flags into tx+rx now that they can be different

Note the full usefulness of these changes depends on updates to applications
that process radiotap data.
2005-01-24 20:31:24 +00:00
Sam Leffler
c4dc6d1307 adjust tx buffer allocation based on empirical testing:
o increase the max per-frame tx descriptor count and the number of tx
  buffers for forthcoming fast frame support
o correct the max scatter/gather count; it cannot be larger than the
  max(tx,rx,beacon) descriptor counts
2005-01-18 19:42:17 +00:00
Sam Leffler
3e50ec2c95 better led blinking 2005-01-18 19:03:04 +00:00
Sam Leffler
1f1d781074 bump copyright for 2005 2004-12-31 22:42:38 +00:00
Sam Leffler
16b4851a16 Radiotap fixups:
o catch one place where we were not using ath_chan_change to
  switch channels; this fixes a problem where the channel
  settings were not being correctly reported in captured packets
o return unique channel identification in the channel flags;
  ethereal gets confused if you return merged flags (e.g. ofdm,
  cck, and 2Ghz) (this is workaround and should be removed if
  we can ever cleanup radiotap consumers)
o correct short/long preamble flag state for rx and treat tx
  the same--use a new hwflags array that gives us the data
  based on the h/w rate index/cookie
o add gross hack to handle radiotap capture of frames that
  come in with hardware padding; should be replaced by a
  flag in the radiotap header and more smarts in the apps
  that decode radiotap data
2004-12-31 20:32:40 +00:00
Sam Leffler
c42a7b7e25 Update with last year of work. 2004-12-08 17:34:36 +00:00
Sam Leffler
f61dd564dd do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work

Obtained from:	madwifi
2004-04-03 03:33:02 +00:00
Sam Leffler
babe2453bd transmit beacon frames directly instead of defering them to a swi; there
was too much delay

Obtained from:	madwifi
2004-04-03 00:02:17 +00:00
Sam Leffler
cb344d958a update copyright notice for 2004 2004-04-02 23:57:10 +00:00
Sam Leffler
2f1ad18b34 radiotap updates:
o force little-endian byte order for header
o pad header to 32-bit boundary to guard against applications that assume
  packet data alignment
2004-04-01 00:38:45 +00:00
Sam Leffler
8cec0ab9a8 o track API change for HAL v0.9.6.1
o fix race condition when processing rx descriptors: because we use
  a self-linked descriptor at the end of the rx descriptor list to
  avoid rx overruns (which can easily happen for 5212 parts that enable
  PHY errors) we must carefully check that a descriptor is "done" by
  looking ahead to the next descriptor before believing the done bit
  in the current descriptor (this is all handled in the HAL since the
  rx descriptor format is chip-specific so we need to pass in two
  additional parameters--the physical address of the current descriptor
  and the virtual address of the next descriptor in the list)
o check copyout return status for SIOCGATHSTATS ioctl

Approved by:	re (scottl)
2003-11-29 01:23:59 +00:00
Sam Leffler
f0b2a0beb6 o convert mutex calls to #defines for portability, etc.
o destroy mutex's on detach (was missing)
2003-10-14 22:51:45 +00:00
Sam Leffler
de5af70460 Maintain a history of data associated with received frames and use this to
calculate smoothed signal quality data for each node.

o add a 16-deep history buffer to each driver-private node storage that
  holds rssi and antenna info for received frames
o override the default per-node "get rssi" method to return an average
  rssi value based on samples collected over the last second
o enable beacon reception so even idle systems maintain a running history
  of signal quality

This data may also be useful for improving the rate control algorithm.
Based on work by Tom Marshall <tommy@home.tig-grr.com> for MADWIFI.
2003-09-15 22:34:46 +00:00
Sam Leffler
f6aa038bbe o mark the device capable of short preamble (meaningless for the 5210 but
safe since the 802.11 layer does the right thing for 11a operation)
o select short preamble operation based on the negotiated capabilities; not
  just the local state/capability
o fillin the duration field in the 802.11 header as appropriate
o remove detection of 11g support; no longer needed

Obtained from:	MADWIFI (with modifications)
2003-09-14 22:39:19 +00:00
Sam Leffler
73454c7385 Add support for the experimental radiotap capture format. With this
we no longer need the debugging code to dump packets.
2003-09-05 22:22:49 +00:00
Sam Leffler
0a915fad5d MFp4 changes to fix locking issues and correct reference
count handling of station entries in hostap mode:

Input path:

o driver is now expected to find the node associated with the
  sender of a received frame; use ic_bss if none is located
o driver passes the (referenced) node into ieee80211_input for
  use within the wlan module and is responsible for cleaning up
  on return
o the antenna state is no longer passed up with each frame; this
  is now considered driver-private state and drivers are responsible
  for keeping it in the driver-private part of a node

Output path:

Revamp output path for management frames to eliminate redundant
locking that causes problems and to correct reference counting
bogosity that occurs when stations are timed out due to inactivity
(in AP mode).  On output the refcnt'd node is stashed in the pkthdr's
recvif field (yech) and retrieved by the driver.  This eliminates
an unref/ref scenario and related node table unlock/lock due to the
driver looking up the node.  This is particularly important when
stations are timed out as this causes a lock order reversal that
can result in a deadlock.  As a byproduct we also reduce the overhead
for sending management frames (minimal).  Additional fallout from
this is a change to ieee80211_encap to return a refcn't node for
tieing to the outbound frame.  Node refcnts are not reclaimed until
after a frame is completely processed (e.g. in the tx interrupt
handler).  This is especially important for timed out stations as
this deref will be the final one causing the node entry to be
reclaimed.

Additional semi-related changes:
o replace m_copym use with m_copypacket (optimization)
o add assert to verify ic_bss is never free'd during normal operation
o add comments explaining calling conventions by drivers for frames
  going in each direction
o remove extraneous code that "cannot be executed" (e.g. because
  pointers may never be null)
2003-08-19 22:17:04 +00:00
Sam Leffler
1b1a8e411e maintain a table for mapping hardware rate codes to 802.11 rates for
calculating the rate for each rx'd frame
2003-08-19 21:24:16 +00:00
Sam Leffler
45bbf62fb5 track changes to 802.11 code:
o override new_state method per new model
o use ieee80211_state_name instead of private copy
2003-07-20 21:38:20 +00:00
Sam Leffler
45cabbdc58 o add read-only sysctls to view regulatory domain, country code, and
outdoor use controls
o use sysctl-visible values in setting up channel list
2003-07-13 17:07:25 +00:00
Sam Leffler
5591b2131a Atheros 802.11 driver. Requires Atheros Hardware Access Lay (HAL).
Supported by:	Atheros Comunications
2003-06-23 17:01:19 +00:00