Commit Graph

292 Commits

Author SHA1 Message Date
Sam Leffler
0553a01f53 mark tx/rx descriptors COHERENT; we do not sync changes so on
architectures like arm this is necessary

MFC after:	1 month
2006-11-24 22:45:26 +00:00
Sam Leffler
10b6de5e58 correct diag request to fetch isr state on fatal interrupts
MFC after:	1 week
2006-10-09 23:45:26 +00:00
Sam Leffler
3fe92528af o move ath hal os glue code from the hal to the driver: this code was
part of the hal distribution early on when the hal was built for
  each os but it's been portable for a long time so move the os-specific
  code out (and off the vendor branch)
o correct the copyright on ah_osdep.?; it was mistakenly given a
  restricted license and not a dual-bsd/gpl license
o remove the module api definition as it was never used
o fixup include paths for move of ah_osdep.h

MFC after:	2 weeks
2006-09-18 16:49:15 +00:00
Sam Leffler
5901d2d38a Add support for newer parts that do not require separate keycache
entries for tx+rx mic keys.  This requires a newer hal, but works
fine with the current hal in cvs.

MFC after:	2 weeks
2006-09-18 16:26:19 +00:00
Sam Leffler
a7ee023101 remove stub radar support; it's never been used and future
hal's will not include the calls (due to redesign)

MFC after:	1 week
2006-09-18 16:16:02 +00:00
Warner Losh
1a3c917f9d while (0); -> while (0) in multi-line macros 2006-08-17 22:50:33 +00:00
Sam Leffler
6bf62dd1de o add noise floor to stats
o include current tx rate in stats so athstats gets a consistent
  snapshot and doesn't have to make an extra ioctl
o record tx rate for raw frames

MFC after:	3 weeks
2006-08-10 16:31:37 +00:00
Sam Leffler
05680ab622 check return value of ath_tx_dmasetup
Noticed by:	yongari
2006-08-08 16:42:01 +00:00
Sam Leffler
664443d053 raw 802.11 packet transmit support
Joint work with:	Andrea Bittau <a.bittau@cs.ucl.ac.uk>
2006-08-05 05:07:17 +00:00
Sam Leffler
d95eaaf3ed add missing \n's
Submitted by:	avatar@
MFC after:	1 week
2006-07-26 04:09:04 +00:00
Sam Leffler
f3af83f7cf check tim is present in the beacon before defer'ing the mcast buffer bit;
insures we don't do this when operating in adhoc mode

Submitted by:	avatar@
MFC after:	1 week
2006-07-26 03:48:41 +00:00
Sam Leffler
6f48c95642 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 Leffler
622b3fd21c 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 Leffler
30db812aa9 new stats
MFC after:	1 month
2006-06-23 18:48:08 +00:00
Sam Leffler
465c8d6787 bandaid type coercion for ia64
Submitted by:	marcel
2006-06-07 20:37:14 +00:00
Sam Leffler
f9fc583f17 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 Leffler
ff046a6c6b add missed calls to bpf_peers_present 2006-06-02 23:14:40 +00:00
Christian S.J. Peron
16d878cc99 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 Leffler
6ccb8ea780 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 Leffler
34e2d6230c 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 Leffler
1b409765cf correct type
MFC after:	2 weeks
2006-05-05 03:21:13 +00:00
Sam Leffler
ae2734b68c 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 Leffler
df4d04af01 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 Leffler
4a3ac3fc61 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 Leffler
2af90c547b 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 Leffler
a585a9a1bc 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 Leffler
d0d425bf53 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 Leffler
ebecf80294 backout 1.136 until we can resolve report that it causes output to stall 2006-02-27 17:20:23 +00:00
Sam Leffler
8fe92b6cf6 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 Leffler
1d89d44f74 drop softc lock around copyin/copyout
MFC after:	2 weeks
2006-02-15 18:36:52 +00:00
Sam Leffler
d2f6ed153d fix build w/o AR_DEBUG
MFC after:	2 weeks
2006-02-15 18:35:09 +00:00
Sam Leffler
7a4c5ed92c improve tx/rx buf printing routines
MFC after:	2 weeks
2006-02-15 18:31:04 +00:00
Sam Leffler
9760f8aeb9 add missing bit from 1.130 2006-02-15 18:24:22 +00:00
Sam Leffler
16c8acaab5 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 Leffler
e2815d6951 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 Leffler
c66c48cba2 fixup comments 2006-02-15 18:15:49 +00:00
Sam Leffler
1539af1ef5 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 Leffler
aaba14d7b2 fix comment and whitespace 2006-02-13 18:40:53 +00:00
Sam Leffler
fdb05e3c89 fix merge botch (duplicate processing of cabq for old cards) 2006-02-13 18:23:32 +00:00
Sam Leffler
bd5a9920c2 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 Leffler
e35a02a97d pad for future statistics
MFC after:	2 weeks
2006-02-09 22:37:33 +00:00
Sam Leffler
f9748b9d0d 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 Leffler
b2792ff681 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 Leffler
80d939bfba 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 Leffler
2c27b2f635 only start the cab queue if there are frames to send
MFC after:	2 weeks
2006-02-09 22:14:11 +00:00
Sam Leffler
370572d951 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 Leffler
d7736e139e 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 Leffler
0bbf544158 use a private task queue thread
MFC after:	2 weeks
2006-02-09 21:48:51 +00:00
Sam Leffler
7a04dc27c1 add adhoc demo mode support
MFC after:	2 weeks
2006-02-09 21:42:53 +00:00
Sam Leffler
17f3f177e4 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 Leffler
6c4612b94d cleanup rate setup
MFC after:	2 weeks
2006-02-09 21:31:48 +00:00
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
913a1ba103 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 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
b91bf513f3 sync with latest code in madwifi
Obtained from:	madwifi
MFC after:	2 weeks
2006-02-09 20:40:28 +00:00
Sam Leffler
b99190971f track bmiss threshold change from time to frame count 2006-01-23 20:58:05 +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
0ae09ec575 bandaid inconsistent state handling: the rate index map may be
stale when called to reset rate control state causing us to
pickup an invalid index, check for this and skip 'em (things
will eventually get fixed up so this is not harmful)
2005-11-15 05:47:20 +00:00
Ruslan Ermilov
4a0d6638b3 - Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
  through ifp anyway.  IF_LLADDR() works faster, and all (except
  one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
  and drop the IFP2ENADDR() macro; all users have been converted
  to use IF_LLADDR() instead.
2005-11-11 16:04:59 +00:00
Ruslan Ermilov
c4c6f08f68 Fix "struct ifnet" leak on detach. 2005-09-16 10:09:23 +00:00
Sam Leffler
6ee571b27a correct CTS duration calculation; SIFS+ACK should use the xmit rate not
the rate for CTS

MFC after:	3 days
Obtained from:	Atheros
2005-08-12 23:11:44 +00:00
Sam Leffler
b5c9941514 Clarify/fix handling of the current channel:
o add ic_curchan and use it uniformly for specifying the current
  channel instead of overloading ic->ic_bss->ni_chan (or in some
  drivers ic_ibss_chan)
o add ieee80211_scanparams structure to encapsulate scanning-related
  state captured for rx frames
o move rx beacon+probe response frame handling into separate routines
o change beacon+probe response handling to treat the scan table
  more like a scan cache--look for an existing entry before adding
  a new one; this combined with ic_curchan use corrects handling of
  stations that were previously found at a different channel
o move adhoc neighbor discovery by beacon+probe response frames to
  a new ieee80211_add_neighbor routine

Reviewed by:	avatar
Tested by:	avatar, Michal Mertl
MFC after:	2 weeks
2005-08-10 16:22:30 +00:00
Robert Watson
13f4c340ae Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days
2005-08-09 10:20: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
Robert Watson
13b203d0d7 Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.

Problem reported by:	Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after:		1 week
2005-08-03 00:18:35 +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
4866e6c248 o move ath_sysctlattach down so variables it depends on are setup
o use any fixed tx antenna for beacons transmitted in adhoc mode

Submitted by:	David Young
MFC after:	3 days
2005-07-23 05:34:29 +00:00
Sam Leffler
e996233220 simplify ic_newassoc callback
MFC after:	3 days
2005-07-22 17:57:16 +00:00
Sam Leffler
641b4d0b2d simplify ieee80211_ibss_merge api
MFC after:	3 days
2005-07-22 17:54:40 +00:00
Sam Leffler
2c39b32c94 diff reduction against p4: define IEEE80211_FIXED_RATE_NONE and use
it instead of -1
2005-07-22 16:50:18 +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
8371372b25 Change station mode beacon timer setup to insure the calculated
nextTbtt is always ahead of the h/w TSF.

Reviewed by:	avatar
2005-06-09 04:10:01 +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
b50c8bde99 restore led state on resume
Submitted by:	markus
2005-06-02 03:18:55 +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
15f139756b fix size_to_bin
Obtained from:	madwifi
2005-04-02 18:56:50 +00:00
Sam Leffler
a4d8dd103e nuke unintentional use of HAL_BOOL type 2005-04-02 18:54:30 +00:00
Sam Leffler
fe234894e5 reclaim mbufs in failure cases
Submitted by:	Tai-hwa Liang
2005-03-31 16:39:18 +00:00
Sam Leffler
a8d7e0f6ab close unlikely race
Submitted by:	Michael Wong
2005-03-30 20:30:48 +00:00
Sam Leffler
a7073e8b96 correct comment 2005-03-30 20:29:02 +00:00
Sam Leffler
43e9cf7c9e o fix bug where rate wouldn't lift off lowest setting when operating as
an ap in 11g with protection enabled
o correct rate selection when operating in 11g with protection when no
  packets have been sent yet (from John Bicket)
o track api change to get first descriptor and use it to collect the frame
  length for calculating the state bin
o add more debugging and shuffle some existing debugging to give more info
o bump version to distinguish bug fixes
2005-03-30 20:20:49 +00:00
Sam Leffler
22233301a3 rev rate control api to pass the both the first+last tx descriptors
to the rate control module for tx complete processing; this enables
rate control algorithms to extract the packet length for xmits that
require multiple descriptors
2005-03-30 20:17:18 +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
Tai-hwa Liang
33d7d80c82 Fixing kernel build on amd64 machines.
Reviewed by:	sam (mentor)
2005-03-30 02:33:33 +00:00
Sam Leffler
03ed599a2a extend the timestamp from the rx descriptor to calculate the tsf to
use when checking for an ibss merge
2005-03-29 22:16:49 +00:00
Sam Leffler
019b966921 forgot to merge this bit from p4 2005-03-29 21:06:28 +00:00
Sam Leffler
f0fd5e07bb sync rates for any associated stations or neighbors on state transition 2005-03-29 21:00:50 +00:00
Sam Leffler
b467935a06 simplify callback 2005-03-29 20:59:49 +00:00
Sam Leffler
99d258fdc5 replace m_defrag with something more suitable 2005-03-29 20:54:31 +00:00
Sam Leffler
eb9883565a fix braino introduced when converting from madwifi 2005-03-20 01:55:02 +00:00
Sam Leffler
57a4a75853 eliminate mid-block variable decls 2005-03-20 01:27:33 +00:00
Sam Leffler
b276305606 version 1.1 (with cleanups)
Submitted by:	John Bicket
2005-03-19 21:04:53 +00:00
Tai-hwa Liang
4e860beeb1 Adding missing module dependency. This should fix the undefined symbol
error(ath_hal_computetxtime) during module loading.

Reviewed by:	sam (mentor)
2005-03-11 16:15:43 +00:00
Sam Leffler
fa20c23401 SampleRate rate control algorithm for the ath driver
Submitted by:	John Bicket
2005-03-11 01:39:57 +00:00
Sam Leffler
0c97ab9691 reclaim mbuf chain when ieee80211_crypto_encap fails
Noticed by:	David Young
2005-03-08 17:01:03 +00:00
Warner Losh
53ee71735f Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +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
f818612b1b beacon handling fixups for adhoc mode:
o don't reclaim any previous beacon state in ath_beacon_alloc; do it
  explicitly in ath_newstate
o reference count the node held in the beacon frame state block
o process ibss merge more intelligently; let the state machine do the
  right thing instead of explicitly setting the new bssi id
o explicitly stop tx dma before doing beacon setup to handle the ibss
  merge case
2005-01-24 20:05:03 +00:00
Sam Leffler
f9e6219b15 switch to use bus_dmamap_load_mbuf_sg 2005-01-24 19:51:59 +00:00
Sam Leffler
4bacf7c1f3 o correct beacon interval calculation; the internal setting is in TU's not ms
o replace the private macro to convert MS->TU with the common one
2005-01-24 19:45:59 +00:00
Sam Leffler
acc4f7f50c statically allocate the station/neighbor node table; the deferred
allocation scheme introduced a race condition during device state
transitions
2005-01-24 19:32:10 +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
aab26fb481 add missing statistic 2005-01-18 19:33:06 +00:00
Sam Leffler
4c24deac20 disable interrupts when transitioning to INIT state so we don't rx frames 2005-01-18 19:31:31 +00:00
Sam Leffler
f6b8ec160d replace hand-rolled code to compact an mbuf chain with m_defrag; this is
suboptimal but needed for fast frames which won't fit in a single cluster
2005-01-18 19:28:49 +00:00
Sam Leffler
80d2765fe2 setup the beacon xmit queue to not interrupt; we don't use them and
they make the led's flash unnecessarily in adhoc mode
2005-01-18 19:10:17 +00:00
Sam Leffler
3e50ec2c95 better led blinking 2005-01-18 19:03:04 +00:00
Sam Leffler
0a1b94c44c add paren's so we can supply a|b as a debug mask 2005-01-18 18:11:04 +00:00
Sam Leffler
0b19ce1eb7 o disable pci retry timeout to avoid problems when operating in C3 state
(fix imported from madwifi by Takanori Watanabe)
o eliminate save/restore of pci registers handled by the system
o eliminate duplicate zero of the softc (noted by njl)
o consolidate common code

MFC after:	1 week
2005-01-18 18:08:16 +00:00
Sam Leffler
1f1d781074 bump copyright for 2005 2004-12-31 22:42:38 +00:00
Sam Leffler
a614e0762d correct some typos
Submitted by:	Tai-hwa Liang
2004-12-31 20:35:05 +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
0ab4040a27 for parts that require split keycache entries report the
the index of the first entry on a mic error so we're
consistent with parts that don't have split keycache
2004-12-31 20:21:31 +00:00
Sam Leffler
a6c992f43c Correct beacon timer setup logic:
o lintval is in ms; must convert to TU's for passing to the hal
o roundup to calculate nexttbtt (should look at current tsf and pull the
  calculated nextbtt forward but this'll do for now)
o don't or- in HAL_BEACON_RESET_TSF when doing station timer setup; this
  is not needed and messes up the sleep timer calcs, though it's unclear
  if it mattered as the hal masks these values before use

Submitted by:	Thorsten von Eicken
2004-12-31 20:20:02 +00:00
Sam Leffler
0eb68df4c5 no need to sweep the tx q's for node references in ath_node_free; we know
there are none since we're only called when the ref count goes to zero
2004-12-31 20:13:58 +00:00
Sam Leffler
d77367bf5a cleanup some assertions 2004-12-31 20:11:23 +00:00
Peter Wemm
063896020b Like on the ath_rate_onoe component, make this compile on amd64. Convert
pointers to an integer via uintptr_t.

Fix an apparent bug that caused a compile failure.
ieee80211_iterate_nodes() takes ic->ic_sta as its first argument on the
onoe module.  It had just 'ic' here in the same context, which was a
mismatched argument.
2004-12-15 02:32:27 +00:00
Peter Wemm
6891c875c2 Make this amd64-clean. sizeof is long on amd64, so things that do a printf
of a sizeof, need to use %z to get the correct type on all our platforms.
Also, convert integers<->pointers via uintptr_t.

(I think Sam's instructions were for me to commit this.  If I
 misunderstood, then I apologize in advance.)
2004-12-15 02:25:21 +00:00
Sam Leffler
c42a7b7e25 Update with last year of work. 2004-12-08 17:34:36 +00:00
Sam Leffler
05f1e03f00 Transmit rate control modules for the ath driver. 2004-12-08 17:32:02 +00:00
Sam Leffler
e383b24041 Add missing bit of last if_start workaround: mark scan callout
MPSAFE only debug_mpsafenet is 1 so callbacks to send management
frames hold Giant; this is another bandaid on the path to removing Giant.
2004-08-08 17:10:54 +00:00
Sam Leffler
b5f4adb32e Pickup Giant in ath_rx_proc and when handling a beacon miss in order to
satisfy the assertion in if_start.
2004-08-07 00:45:05 +00:00
Max Laier
154b8df2ed Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by:	Vaidas Damosevicius (an, ath, wi)
		Roman Divacky (vr)
Submitted by:	yongari (hme)
2004-08-01 23:58:04 +00:00
Sam Leffler
710da3ec44 use correct malloc type to allocate struct ieee80211_node's
Noticed by:	phk
2004-04-05 04:42:42 +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
1e77407972 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 00:06:23 +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
59f32d6b38 add new statistics
Obtained from:	madwifi
2004-04-02 23:55:45 +00:00
Sam Leffler
fdd758d4d1 check more quickly (and directly) if an interrupt is pending; this reduces
work done in ath_intr when the irq is shared

Obtained from:	madwifi
2004-04-02 23:49:15 +00:00
Sam Leffler
b28b465391 cleanup descriptor allocation if attach fails
Obtained from:	madwifi
2004-04-02 23:47:39 +00:00
Sam Leffler
01e7e035e0 remove use IEEE80211_C_RCVMGT 2004-04-02 23:37:00 +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
Matthew N. Dodd
f7f2bd753e Don't announce MAC addresses twice.
(ieee80211_ifattach() calls ether_ifattach().)
2004-03-20 19:57:47 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Peter Wemm
3031063498 Make this compile on amd64.
"I'll cope" by:  sam
2004-02-06 00:10:54 +00:00
Sam Leffler
23428eafa0 When draining the tx queue reclaim any node references held in packets.
This fixes a problem when operating as an AP where clients would get
stuck in the node table because the reference count never went to zero.
2004-01-07 19:16:49 +00:00
Sam Leffler
a9c0425768 When ath_hal_stoptxdma returns an error dma is still likely stopped
so don't just stop trying to send a beacon frame or we'll be more likely
to lose sync.  This only seems to happen on some older chips.
2004-01-07 19:11:11 +00:00
Sam Leffler
7bbf937701 use ath_reset instead of ath_init when recovering from a watchdog timeout:
resetting the hardware is sufficient, no need to reset the 802.11 fsm
2004-01-07 19:07:41 +00:00
Sam Leffler
f3be79561f make hw.ath.debug a tunable 2004-01-07 19:05:35 +00:00
Sam Leffler
8c0370b75d make hw.ath.outdoor and hw.ath.countrycode tunables 2004-01-07 19:04:42 +00:00