Commit Graph

638 Commits

Author SHA1 Message Date
sam
4eebc1cf81 don't say "ac WME_AC_BE"; remove "ac" 2009-05-02 20:28:55 +00:00
sam
4516027a2f promote ieee80211_seq typedef 2009-05-02 20:25:22 +00:00
sam
d477cb337f o dump tx/rx seq#'s for qos tid's
o improve check for when to dump rx ampdu state
2009-05-02 20:21:21 +00:00
sam
ad817259cc whitespace 2009-05-02 20:18:18 +00:00
sam
81f398305a 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
thompsa
ed7c3176b9 Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB
and firmware based drivers to roll their own code to defer the chip programming
for state changes, scan requests, channel changes and mcast/promisc updates.
When a driver callback completes the hardware state is now guaranteed to have
been updated and is in sync with net80211 layer.

This nukes around 1300 lines of code from the wireless device drivers making
them more readable and less race prone.

The net80211 layer has been updated as follows
 - all state/channel changes are serialised on the taskqueue.
 - ieee80211_new_state() always queues and can now be called from any context
 - scanning runs from a single taskq function and executes to completion. driver
   callbacks are synchronous so the channel, phy mode and rx filters are
   guaranteed to be set in hardware before probe request frames are
   transmitted.

Help and contributions from Sam Leffler.

Reviewed by:	sam
2009-05-02 15:14:18 +00:00
sam
74c9f27fa6 revert wip 2009-05-01 21:31:39 +00:00
sam
3a2e64d1c4 Store the tx seq# of an 802.11 frame in the mbuf pkthdr; this will be
used for s/w retransmit schemes that want to access this information
w/o the overhead of decoding the raw frame.  Note this also allows
drivers to record this information w/o writing the frame when the seq#
is obtained through an out-of-band mechanism (e.g. when a h/w assigned
seq# is reported in a descriptor on tx done notification).

Reviewed by:	sephe, avatar
2009-04-27 17:39:41 +00:00
sam
506d007c7d add IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-address
encapsulation when relaying frames; this reduces the cost of the test and
enables use for situations other than "sta vap + dwds"
2009-04-26 23:11:22 +00:00
sam
b56ccf5e16 don't depend on includes to get definitions of struct ieee80211_tx_ampdu
and ieee80211_rx_ampdu; these should've been part of r191552
2009-04-26 23:04:35 +00:00
sam
fb7b0175d4 hoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
where it was meant all along (the code was in encap because ampdu was
implemented pre vaps)
2009-04-26 23:02:17 +00:00
sam
1cf86a6fd3 allow drivers to hook ampdu rx start/stop 2009-04-26 22:54:51 +00:00
sam
5ae5b364bd improvements:
o formatting
o more rx ampdu state
o tdma state
o show ifnet names
o show auth policy name
2009-04-26 22:49:25 +00:00
sam
10e49ed157 stash the node pointer in the mbuf before doing ff aggregration so this
is done in only one place
2009-04-26 22:45:21 +00:00
sam
cebcd508aa whitespace 2009-04-26 22:44:23 +00:00
sam
1e44d091e1 print both fc bytes when hitting a protocol version mismatch 2009-04-26 21:50:21 +00:00
sam
4af5d5056b add iv_recv_ctl method to allow hooking rx ctl frame handling 2009-04-26 21:46:04 +00:00
sam
3469cff523 don't fragment ampdu aggregates 2009-04-26 21:37:02 +00:00
sam
be423d2c6c uniformly mark mbufs that pass through the tx path with M_MCAST; drivers
can now use this flag instead of inspecting the contents
2009-04-26 21:34:53 +00:00
sam
76742bacd9 o add missing 802.3 bpf tap
o add 802.11 bpf tap to output path now that it's removed from ieee80211_encap
2009-04-26 21:21:48 +00:00
sam
7ecbe20bd8 add missing DLT_IEEE802_11 tap 2009-04-26 21:21:07 +00:00
sam
ebd2a0d424 add missing part of r191537 that should have read: hoist DLT_IEEE802_11
bpf tap from ieee80211_encap up to ieee80211_start
2009-04-26 21:16:29 +00:00
sam
702857b7a5 fix comment 2009-04-26 21:13:18 +00:00
sam
cc37518d09 add missing DLT_IEEE802_11 bpf tap in ieee80211_start 2009-04-26 21:12:19 +00:00
sam
092ebe6161 fixup ieee80211_output handling:
o correct bpf handling, send 'em to the right tap
o do accouting
o mark mbufs holding multicast frames
2009-04-26 21:11:12 +00:00
sam
4ce505aeb1 o use shared code to handle bpf tap and mbuf cleanup
o swap conditional order to put the cheapest first
2009-04-26 21:03:29 +00:00
sam
3bb993c3f7 correct bssid reporting for wds vaps 2009-04-26 20:55:31 +00:00
rpaulo
cf18038563 Remove spurious 'or'. 2009-04-23 22:08:44 +00:00
kmacy
24b38efdce Change if_output to take a struct route as its fourth argument in order
to allow passing a cached struct llentry * down to L2

Reviewed by:	rwatson
2009-04-16 20:30:28 +00:00
sam
6d34de197a setup turboA/G fixed rate parameters too; this is needed, in particular,
for turboG operation
2009-04-13 20:53:12 +00:00
sam
551510597c correct debug printf 2009-04-13 20:50:51 +00:00
sam
4d60456d40 check correct address for a bssid mtch 2009-04-13 20:50:07 +00:00
sam
6cc0d23c65 fix txparms setup for 108G sta's: ieee80211_iserp_rateset does not
identify a station operating in turbo-boost mode because it has a
pure ofdm rate set; add an explicit check for the channel type
instead of depending on IEEE80211_NODE_ERP being set
2009-04-13 20:45:29 +00:00
sam
be075a28da o add a capability for drivers that require 802.3 encapsulation of
frames passed down through the transmit path
o mark ndis requiring 802.3 encap'd frames

Reviewed by:	"Paul B. Mahol" <onemda@gmail.com>, thompsa
2009-04-08 16:19:50 +00:00
sam
dabf12094d fix whitespace 2009-04-03 20:46:32 +00:00
sam
cde6991b73 o update dwds mcast handling after hoisting ieee80211_encap: frames need
to be encapsulated before dispatching to the driver
o eliminate M_WDS now that we call ieee80211_encap directly and can supply
  the wds vap to indicate a 4-address frame should be created
2009-04-03 18:00:19 +00:00
sam
ec9a1dd6fa 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
rpaulo
138715ea93 Fix typo in comment. 2009-03-30 21:46:50 +00:00
rpaulo
b9ca081080 MFP mesh11s:
Add mesh debugging bit replacing the now deprecated RADKEYS.
2009-03-30 21:41:06 +00:00
sam
f7c50ce1e4 o add ic_rt to track the rate table for the current channel; this enables
calculation of packet transmit times to do things like check txop limits
o remove equivalent driver code and convert to use net80211 state
2009-03-29 21:17:08 +00:00
sam
59153db3b7 toggling fast-frames requires clocking the state machine 2009-03-29 21:00:27 +00:00
sam
7edd0aa8ef 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
37e13d2174 o move tdma+superg protocol defs out of public view
o add #ifdef _KERNEL to superg+tdma include files so they can be used
  by user code to get the protocol defs
2009-03-26 21:29:03 +00:00
sam
382385b98b Fix enough bits so that fast frames work again:
o include ath ie in beacon frames
o fix probe response check for including ath ie
o add ieee80211_add_athcap shorthand for ap-side ie additions
2009-03-26 19:13:11 +00:00
sam
9ca2b364da dynamic turbo mode is only implemented in sta mode; don't enable it
for other operating modes based on the capability
2009-03-26 19:07:56 +00:00
sam
bea67b16d2 need to adjust htinfo offset when csa is inserted 2009-03-26 19:06:00 +00:00
sam
3eec009b3e adjust tdma ie offset when beacon frame contents changes 2009-03-26 19:04:11 +00:00
sam
185450a1c5 shuffle code so things build w/o INVARIANTS or IEEE80211_SUPPORT_SUPERG
Prodded by:	several
2009-03-25 03:02:03 +00:00
sam
901cb82d34 hide linker set stuff from user space 2009-03-24 21:02:19 +00:00
sam
88b91b235f split Atheros SuperG support out into it's own file that's included only
with a new IEEE80211_SUPPORT_SUPERG option
2009-03-24 20:39:08 +00:00
sam
da77f06ea9 add linker sets for get/set ioctl handlers so optional net80211
code is isolated
2009-03-24 17:57:48 +00:00
sam
31a3addbde use IEEE80211_SUPPORT_TDMA option to control whether code is
configured; this allows us to remove an #ifdef
2009-03-24 17:22:10 +00:00
rpaulo
85fe22317e Remove leftover comment because we now use a flag to check for associd.
Discussed with:	sam
2009-03-19 18:45:37 +00:00
rpaulo
12a4427816 Fix typo in comment. 2009-03-19 18:34:58 +00:00
rpaulo
24d921c8b2 Use plural in a comment. No functional change. 2009-03-18 21:33:28 +00:00
sam
2235508d5e rate limit printfs for invalid tdma ie contents; probably want this to
be less than 1/sec
2009-03-18 19:38:39 +00:00
sam
8bfd160665 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
9b33d4c5ea add the desired channel to the scan list if not already present and
compatible with other scan controls
2009-03-04 22:05:25 +00:00
ed
322413c46c Add memmove() to the kernel, making the kernel compile with Clang.
When copying big structures, LLVM generates calls to memmove(), because
it may not be able to figure out whether structures overlap. This caused
linker errors to occur. memmove() is now implemented using bcopy().
Ideally it would be the other way around, but that can be solved in the
future. On ARM we don't do add anything, because it already has
memmove().

Discussed on:	arch@
Reviewed by:	rdivacky
2009-02-28 16:21:25 +00:00
bz
df2be82cec For all files including net/vnet.h directly include opt_route.h and
net/route.h.

Remove the hidden include of opt_route.h and net/route.h from net/vnet.h.

We need to make sure that both opt_route.h and net/route.h are included
before net/vnet.h because of the way MRT figures out the number of FIBs
from the kernel option. If we do not, we end up with the default number
of 1 when including net/vnet.h and array sizes are wrong.

This does not change the list of files which depend on opt_route.h
but we can identify them now more easily.
2009-02-27 14:12:05 +00:00
sam
317670e209 change tdma slave behaviour: if the channel is locked don't do bmiss handling
(so no scanning/roaming)

Reviewed by:	Chris Anderson
2009-02-22 18:48:54 +00:00
sam
f2445982b7 display min/max dwell times in msecs in debug msgs 2009-02-22 18:46:36 +00:00
sam
6b0a7363d7 mark nodes created by way of neighbor discovery need to be marked as ERP
so they get the correct tx parameters setup by node_settxparms
2009-02-20 23:05:05 +00:00
sam
2ac5c35cb5 o reset aggressive mode flag; it was being left set after marking an
interface down
o only allow the first vap to initialize shared wme parameters
2009-02-20 21:57:05 +00:00
sam
ba5dbdcdd9 misc cleanup of wme parameter setting 2009-02-20 21:55:23 +00:00
sam
c5cc4a3059 use 1/2 and 1/4 rate phy types to simplify txtime calculation 2009-02-19 17:44:23 +00:00
sam
ac3671600d Add modes for 1/2 and 1/4-width channels so we have separate roaming
and xmit parameters.  This makes it possible to use tdma on fractional
channels.
o add IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER; note these are
  band-agnostic (may need revisiting)
o setup all default rates in ic_sup_rates instead of doing it only
  for active modes; we need these to calculate the default tx parameters
  which are not recalculated after a regulatory update (can't just
  recalculate after installing a new channel list because we might
  clobber user settings)
o remove special case code in ieee80211_get_suprates; this is now
  a candidate for an inline or removal
o add various entries for new modes (roaming+tx params, wme, rate
  mapping, scan set setup, country ie construction, tdma, basic rates)

Note these modes are intentionally not visible through if_media.
2009-02-19 05:21:54 +00:00
sam
c56d117735 o looseen abi dependencies on IEEE80211_MODE_MAX by accepting smaller
parameters for IEEE80211_IOC_ROAM and IEEE80211_IOC_TXPARAMS; this
  lets us add more modes and still have old apps work
o consolidate loops to remote assumptions about mode ordering
2009-02-19 05:03:10 +00:00
sam
ea09029f59 use c99 initializers 2009-02-19 04:52:03 +00:00
sam
6865ea1cbd o consolidate loops to eliminate assumptions about ordering of modes
o replace 0x80 by IEEE80211_RATE_MCS
2009-02-19 04:46:09 +00:00
sam
e092563f43 Change country ie construction to simplify forthcoming changes:
o use c99 initializer for skipflags
o calculate band flags instead of statically listing them in the table
2009-02-19 04:44:18 +00:00
sam
fe861a3d8d use c99 initializer 2009-02-19 04:40:47 +00:00
sam
3f5ab4a07f simplify setting up the roaming parameters; writing default parameters only
for active modes hasn't turned out to be useful so just define a const table
and copy it in place
2009-02-19 04:37:44 +00:00
sam
396490ec3e check ptr against NULL 2009-02-19 04:34:22 +00:00
sam
8f46eec090 instead of special casing lookups for the 11na/g legacy rate set, just
install the rates once when creating the com structure
2009-02-19 04:33:36 +00:00
sam
64a0820609 add phy types for 1/2 and 1/4-rate modes 2009-02-19 04:19:58 +00:00
sam
9705c5de71 remove ic_stats; it was intended to accumulate stats from vaps as they
were reaped but was never used and is inaccessible
2009-02-13 05:31:18 +00:00
sam
c96b4defec strip M_FRAG & co mbufs coming down from ip_output, these flags are
re-used within net80211 to mark 802.11 frags so allowing them to
leak through to the driver caused packets to be dropped in ath
2009-02-13 05:26:04 +00:00
sam
cf2094a543 o replace ieee80211_node_reclaim by individual operations to release the
references to iv_bss and the sta table; this is equivalent and causes
  direct reclaim of the old bss node when any references in packets inflight
  are reclaimed (previously the old node would sit in the bss table until
  the inactivity processing reclaimed it)
o remove ieee80211_node_reclaim now that it's only use is gone

Reviewed by:	avatar, cbzimmer
2009-02-12 23:34:58 +00:00
thompsa
251dd2ca41 Add a ieee80211_waitfor_parent() function that will wait for all deferred
parent interface tasks to complete. This had been added to the ioctl path but
it is also need elsewhere like detach so its safe to teardown.

Reported by:	Hans Petter Selasky
Submitted by:	sam
2009-02-12 18:57:18 +00:00
sam
c1e92bfb20 improve key index map reclaim debug msg 2009-02-11 18:40:09 +00:00
sam
e5e720dbeb oops, fix octal escape sequence 2009-02-11 18:39:20 +00:00
sam
b24d0a6db9 remove bogus reference reclaim on the slave-side bss node on beacon miss 2009-02-11 17:30:36 +00:00
sam
6c7b845f46 fix mis-numbering of IEEE80211_MSG_BITS 2009-02-11 17:26:47 +00:00
sam
29a739cb60 when operating as a slave, clear neighbor entries and the peer bss node
on beacon miss

while here, remove a stray pointless write of iv_bmiss_count
2009-02-10 23:52:28 +00:00
sam
78cd28584a clean neighbor entries on beacon miss 2009-02-10 23:51:18 +00:00
sam
2cd78ce2ef correctly fixup iv_des_chan after installing a new channel table; if the
previous channel is now invalid we must set it to IEEE80211_CHAN_ANYC
2009-02-10 01:37:55 +00:00
weongyo
1d31003322 mark M_LASTFRAG at the last fragment.
Reviewed by:	sam
MFC after:	3 weeks
2009-02-09 04:39:16 +00:00
sam
6c8a518fd3 o change _db_show_key to always dump the contents instead of checking
IEEE80211_KEY_DEVKEY
o fix channel power printing (they are signed values)
o add show statab to dump a node table and automatically dump the sta
  table of a com structure with /s
2009-02-05 20:26:53 +00:00
sam
451a1d6071 o add IEEE80211_KEY_BITS for %b printing of wk_flags
o replace hand-rolled code to print wk_flags
o add display of ni_ucastkey in show sta
o fix \n in _db_show_key
2009-02-05 19:20:34 +00:00
sam
a142097876 When crafting a media setting w/ an auto (non-fixed) rate mask out the
turbo option in addition to the mode bits; otherwise if the current
channel is a turbo mode channel we'll form an invalid media setting
and the ifmedia_set operation in vap_attach will panic.

While here use C99-style initialization for an array indexed by mode;
this makes it consistent w/ other usage and avoids breakage if we
should ever change the set of modes.
2009-02-03 22:32:26 +00:00
sam
860ee29713 when promoting an 11b channel to 11g do not accept a ``pure G'' (OFDM only)
channel, only accept a real 11g channel; this fixes a problem where we were
wrongly promoting 11b to a Dynamic Turbo G channel which broke scanning on
channel 6
2009-02-01 22:24:08 +00:00
sam
d134c940ba setup default fixed rates for static turbo and 11n;
the 11n rates are pure guess
2009-01-29 23:12:06 +00:00
sam
49cefc1300 set ni_txparms for static turbo mode 2009-01-29 23:11:18 +00:00
sam
5fee012a8e setup default rate set for static turbo mode 2009-01-29 23:09:12 +00:00
sam
2c8d272b5e add an assert to verify the number of channels returned by ic_getradiocaps
correlates with the size of the channel array passed down

might want to promote this to be always present to catch for driver errors
2009-01-28 18:39:23 +00:00
sam
dce44e3d8e change null_getradiocaps to return the actual count of channels instead
of the true number; otherwise the caller may use the count to do things
with the data it should not (e.g. sort the channel table)
2009-01-28 18:37:46 +00:00
sam
76e17e88af Extend channel definition with:
o max antenna gain
o driver private opaque data

Note this grows the size of a channel to 16 bytes; which makes the
default channel table 4Kbytes (up from 3Kbytes).
2009-01-27 23:48:13 +00:00
sam
43289e8c91 fix comment 2009-01-27 23:43:20 +00:00
sam
da982ab4bb Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
  arrays instead of a fixed (compile-time) value; we do this in a way
  that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
  to hold MAXCHAN entries (1536); this, for example, allows the kernel
  to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
2009-01-27 23:42:14 +00:00