Commit Graph

181 Commits

Author SHA1 Message Date
sam
0cf0aadbe3 enable rx of control frames when in monitor mode
Submitted by:	Andrea Bittau <a.bittau@cs.ucl.ac.uk>
MFC after:	1 week
2006-06-26 04:31:36 +00:00
sam
68b8da02bb Close race in handling mcast traffic when operating as an ap with
stations in power save: add a new q where mcast frames are stashed
and on beacon update (at DTIM) move frames from the mcast q to the
cabq and start it.  This ensures the cabq is only manipulated in
one place.

Sponsored by:	Hobnob
MFC after:	2 weeks
2006-06-26 03:10:45 +00:00
sam
d87b5b9740 new stats
MFC after:	1 month
2006-06-23 18:48:08 +00:00
sam
f03871f354 bandaid type coercion for ia64
Submitted by:	marcel
2006-06-07 20:37:14 +00:00
sam
0a619128b1 move hal bus+tag externalization to the bus glue code where it belongs;
this is a noop on all current freebsd architectures

MFC after:	1 month
2006-06-05 17:51:20 +00:00
sam
c35d17efe0 add missed calls to bpf_peers_present 2006-06-02 23:14:40 +00:00
csjp
2c4f67981e Fix the following bpf(4) race condition which can result in a panic:
(1) bpf peer attaches to interface netif0
	(2) Packet is received by netif0
	(3) ifp->if_bpf pointer is checked and handed off to bpf
	(4) bpf peer detaches from netif0 resulting in ifp->if_bpf being
	    initialized to NULL.
	(5) ifp->if_bpf is dereferenced by bpf machinery
	(6) Kaboom

This race condition likely explains the various different kernel panics
reported around sending SIGINT to tcpdump or dhclient processes. But really
this race can result in kernel panics anywhere you have frequent bpf attach
and detach operations with high packet per second load.

Summary of changes:

- Remove the bpf interface's "driverp" member
- When we attach bpf interfaces, we now set the ifp->if_bpf member to the
  bpf interface structure. Once this is done, ifp->if_bpf should never be
  NULL. [1]
- Introduce bpf_peers_present function, an inline operation which will do
  a lockless read bpf peer list associated with the interface. It should
  be noted that the bpf code will pickup the bpf_interface lock before adding
  or removing bpf peers. This should serialize the access to the bpf descriptor
  list, removing the race.
- Expose the bpf_if structure in bpf.h so that the bpf_peers_present function
  can use it. This also removes the struct bpf_if; hack that was there.
- Adjust all consumers of the raw if_bpf structure to use bpf_peers_present

Now what happens is:

	(1) Packet is received by netif0
	(2) Check to see if bpf descriptor list is empty
	(3) Pickup the bpf interface lock
	(4) Hand packet off to process

From the attach/detach side:

	(1) Pickup the bpf interface lock
	(2) Add/remove from bpf descriptor list

Now that we are storing the bpf interface structure with the ifnet, there is
is no need to walk the bpf interface list to locate the correct bpf interface.
We now simply look up the interface, and initialize the pointer. This has a
nice side effect of changing a bpf interface attach operation from O(N) (where
N is the number of bpf interfaces), to O(1).

[1] From now on, we can no longer check ifp->if_bpf to tell us whether or
    not we have any bpf peers that might be interested in receiving packets.

In collaboration with:	sam@
MFC after:	1 month
2006-06-02 19:59:33 +00:00
sam
7426faf73e quiet tindexbox complaints about passing BUS_SPACE_MAXADDR as
a bus_size_t to bus_dma_tag_create; when PAE is enabled this
does not work

Cluebat by:	scottl
MFC after:	2 weeks
2006-05-08 20:11:09 +00:00
sam
2355351333 force type coercion for bus tag+handle when calling ath_hal_attach
to ensure we match the type signature; we cannot assume HAL_BUS_TAG
and HAL_BUS_HANDLE correspond to bus_space_tag_t and bus_space_handle_t
(should probably do this for HAL_SOFTC too but leave that for now)

MFC after:	1 month
2006-05-06 23:23:39 +00:00
sam
75ca9e9398 correct type
MFC after:	2 weeks
2006-05-05 03:21:13 +00:00
sam
bae88d22bb intercept public safety channels and do explicit mapping of freq->ieee
channel number since we're not ready at the net80211 layer to deal with them;
note this mapping has to match what's done in ieee80211_mhz2ieee

MFC after:	3 days
2006-04-26 16:02:36 +00:00
sam
26db75884a honor fixed tx antenna when sending beacon frames
Submitted by:	Michael Stevens (from netbsd)
MFC after:	1 week
2006-04-25 22:52:28 +00:00
sam
9f1a3cb412 Improve ath_draintxq debug info: dump the packet as well
as the descriptor and handle the beacon q like other q's

MFC after:	1 month
2006-04-16 18:24:27 +00:00
sam
6ecdb098d3 Unbreak cabq handling: check the s/w q, not the h/w q as the frames
have not been passed to the h/w yet.  This remedies watchdog timeout
of buffered multicast frames in hostap mode.

While here eliminate an extraneous check; ieee80211_beacon_update sets
the tim bit based on ncabq != 0 so there's no reason to check it too.

Noticed by:	Christophe Prevotaux
2006-04-16 18:14:01 +00:00
sam
96f86dcf07 o add opt_ath.h enable tweaking various config parameters for the driver
without modifying the source code
o default debug msgs and diag support to off

MFC after:	3 days
2006-04-03 18:14:02 +00:00
sam
24275d6640 correct ni_txrate when using a fixed rate; fixes current rate reporting
MFC after:	3 days
2006-03-09 00:28:44 +00:00
sam
4056fdd24c backout 1.136 until we can resolve report that it causes output to stall 2006-02-27 17:20:23 +00:00
sam
b77a109287 fix a race whereby a tx descriptor might get reused before the hardware
is finished with it; this may only occur when the tx queue is setup as
dba-gated but since the fix is cheap apply it to all queues

while here make the queue depth signed for use in assertions

Reviewed by:	apatti
MFC after:	2 weeks
2006-02-24 23:10:08 +00:00
sam
538bfdf89a drop softc lock around copyin/copyout
MFC after:	2 weeks
2006-02-15 18:36:52 +00:00
sam
d07dceee8c fix build w/o AR_DEBUG
MFC after:	2 weeks
2006-02-15 18:35:09 +00:00
sam
4157fa8fcb improve tx/rx buf printing routines
MFC after:	2 weeks
2006-02-15 18:31:04 +00:00
sam
953c718551 add missing bit from 1.130 2006-02-15 18:24:22 +00:00
sam
d5150c5954 o handle fatal errors directly instead of via the task queue
o temporarily dump some h/w state for diagnosis; this will be
  removed once some issues are resolved

MFC after:	2 weeks
2006-02-15 18:23:03 +00:00
sam
bb3f45c5b8 use ath_hal_gettxintrtxqs so we only process h/w tx
queues that have an interrupt pending

MFC after:	2 weeks
2006-02-15 18:17:53 +00:00
sam
45fecb1f8a fixup comments 2006-02-15 18:15:49 +00:00
sam
7804458943 close race between ath_tx_start and ath_tx_processq
Reviewed by:	apatti
MFC after:	1 week
2006-02-15 18:12:24 +00:00
sam
fb9447d31f fix comment and whitespace 2006-02-13 18:40:53 +00:00
sam
a75c71b5e1 fix merge botch (duplicate processing of cabq for old cards) 2006-02-13 18:23:32 +00:00
sam
9c662a12a0 Update for rev 0.9.16.16 hal:
o add dfs+radar hooks; DFS is presently disabled in the hal
o channel and mode handling changes
o various api changes
o be more aggressive about iq calibration settling so ap mode
  operation is better immediately after startup
o rfkill/rfsilent sysctl support
o tpc ack/cts sysctl support

MFC after:	2 weeks
2006-02-10 19:07:08 +00:00
sam
6322cc1d1c pad for future statistics
MFC after:	2 weeks
2006-02-09 22:37:33 +00:00
sam
d80257d0e9 Minor tx path cleanups:
o assume all data frames have been classified so there's no need
  to check if QoS is being used, just fetch the wme priority from
  the mbuf
o fix double counting of noack frames
o fix nearby comment

MFC after:	2 weeks
2006-02-09 22:34:34 +00:00
sam
a3586317ec correct handling of mbuf allocation failure when replenishing the rx list
(leave a printf for the moment, need to make a debug msg)

Obtained from:	atheros
MFC after:	2 weeks
2006-02-09 22:29:23 +00:00
sam
9bdd11bfc8 Beacon timer setup fixes:
o pull nexttbtt forward in adhoc mode too
o resync beacon timers on joining a bss or ibss as the tstamp we
  collected while scanning is almost certainly out of date

Note we may need to refine the ibss mode check in ath_recv_mgmt.

Reviewed by:	avatar, dyoung
Obtained from:	atheros
MFC after:	2 weeks
2006-02-09 22:21:53 +00:00
sam
bfe5f0c5b4 only start the cab queue if there are frames to send
MFC after:	2 weeks
2006-02-09 22:14:11 +00:00
sam
f6921a07f1 debug fixups: reduce noise msgs, report channel flags on reset failure,
mark data+link fields in descriptor dumps

MFC after:	2 weeks
2006-02-09 22:12:28 +00:00
sam
e8f5bd3491 Phantom beacon miss workaround: track the tsf of the last received
frame and if we get a beacon miss interrupt ignore it if we've received
a frame within the beacon miss interval.  This should never trigger
and the handling at the net80211 layer should likewise deal with this
but it doesn't hurt and can suppress extranous probe request frames.
Note that we can legtimately get a bmiss when under heavy load.

MFC after:	2 weeks
2006-02-09 22:03:26 +00:00
sam
6c147e8e5a use a private task queue thread
MFC after:	2 weeks
2006-02-09 21:48:51 +00:00
sam
487bf4aa9e add adhoc demo mode support
MFC after:	2 weeks
2006-02-09 21:42:53 +00:00
sam
adc88bdfe9 make regdomain sysctl r/w in case it's possible to do this in the future
MFC after:	2 weeks
2006-02-09 21:36:00 +00:00
sam
4b29e4588a cleanup rate setup
MFC after:	2 weeks
2006-02-09 21:31:48 +00:00
sam
c815be8735 add tx99 hooks
MFC after:	2 weeks
2006-02-09 21:28:11 +00:00
sam
7a2418b50b 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
b53010b6e0 lookup the protection tx rate index in the rate tables
instead of using a known value

MFC after:	2 weeks
2006-02-09 21:17:28 +00:00
sam
937f302be0 honor net80211 mcast tx rate
MFC after:	2 weeks
2006-02-09 21:15:36 +00:00
sam
2aec8f9312 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
a2c8f3b1ef allow the size of tx+rx buffer pools to be tuned
MFC after:	2 weeks
2006-02-09 21:03:25 +00:00
sam
63dd123dea 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
8d85928f66 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
2b11f252e8 sync with latest code in madwifi
Obtained from:	madwifi
MFC after:	2 weeks
2006-02-09 20:40:28 +00:00
sam
fed7f4fefb track bmiss threshold change from time to frame count 2006-01-23 20:58:05 +00:00