Commit Graph

620 Commits

Author SHA1 Message Date
sam
cd33effd48 reserve node flag bits for a-msdu tx/rx 2009-06-05 23:37:57 +00:00
sam
c14d36ee7e reserve ioc's for Greenfield and STBC 2009-06-05 23:36:48 +00:00
sam
c8a6c918cd correct status code returned for ht capability mismatch on assoc/reassoc 2009-06-05 23:21:29 +00:00
sam
71242dd2b2 o correct/add action frame categories
o add IEEE80211_STATUS_MISSING_HT_CAPS, added in 11n D3.0 spec
2009-06-05 23:20:41 +00:00
sam
ef7ab5a79a add tid param to ieee80211_notify_replay_failure to get the correct rsc 2009-06-05 23:10:30 +00:00
rwatson
e5889b5723 Fix spelling of MAC check for 8.x version of MAC Framework, not noticed due
to a lack of an opt_mac.h include, which I won't add for now as options MAC
will soon move to opt_global.h.

Spotted by:	pjd
2009-06-05 13:55:33 +00:00
sam
e673d3b5e9 o station mode channel switch support
o IEEE80211_IOC_CHANSWITCH fixups:
  - restrict to hostap vaps
  - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap
    or to a vap w/o 11h enabled
  - interpret count of 0 to mean cancel the current CSA

Reviewed by:	rpaulo, avatar
2009-06-04 15:57:38 +00:00
sam
eb121f1d68 When a channel switch is done to a channel with different operating
characteristics force the stations to re-associate so protocol state
is re-initialized.  Note that for 11h/DFS this is irrelevant as channel
changes are never cross-band.

Reviewed by:	ctlaw
2009-06-03 23:33:09 +00:00
sam
b4921daa19 After a channel switch mark associated stations so they will immediately
be probed as inactive; this more quickly weeds out stations that don't
follow to the new channel.
2009-06-03 23:30:25 +00:00
weongyo
81faf87a47 calls callout_drain(9) to un-schedule a scan timer to prevent a page
fault in softclock.

Submitted by:	sam
Reviewed by:	jhb, sam (original version), thompsa
2009-06-03 04:10:22 +00:00
sam
8eb6b29558 remove another vestige of the null if_softc on detach hack 2009-06-02 20:51:59 +00:00
sam
72f8358403 fix typo 2009-06-02 20:48:12 +00:00
sam
6e92f3bfaa partially fix mode setting; this no longer returns an error but still
needs to handle the case where the vap is up+running

Noticed by:	"Paul B. Mahol" <onemda@gmail.com>
2009-06-02 20:00:43 +00:00
sam
9bb9aeed7f move if_detach to the top of ieee80211_ifdetach to close various races
Reviewed by:	jhb
2009-06-02 18:55:27 +00:00
sam
879660c802 Remove hack used to deal with ifnet teardown now that if_detach and the
bridge do a better job.
o move ether_ifdetach to the top of ieee80211_detach
o do not clear if_softc at the top of ieee80211_detach; we no longer need
  this because we are safeguarded against calls coming back through if_ioctl
o simplify the bpf tracker now that we don't null if_softc

This also fixes an issue where having a bpf consumer active when a vap
is destroyed would cause a crash because bpf referenced free'd memory.

Reviewed by:	imp
2009-06-02 16:57:27 +00:00
sam
35d42ca22f Fix monitor mode vaps to work as intended:
o track # bpf taps on monitor mode vaps instead of # monitor mode vaps
o spam monitor mode taps on tx/rx
o fix ieee80211_radiotap_rx_all to dispatch frames only if the vap is up
o while here print radiotap (and superg) state in show com
2009-06-02 00:33:28 +00:00
sam
cab175ca2d don't dispatch frames to vap's not running 2009-06-02 00:06:39 +00:00
sam
2060c551f6 count packets 2009-06-02 00:04:10 +00:00
sam
d54138ae87 pad data structures to enable integration of future features w/o abi breakage 2009-06-01 16:36:28 +00:00
sam
edb66515a0 distribute sysctl decls so global variables can be made static 2009-05-30 20:11:23 +00:00
sam
2609044366 o assert TDMA_MAXSLOTS is 2 so noone tries to blindly increase it
o add safety belt in vdetach for failed state block allocation
o fix dynamic change to tdma config; ERESTART may not result in
  kicking the state machine so we need to explicitly mark the
  beacon for update

Sponsored by:
2009-05-30 19:57:31 +00:00
sam
a025c3b40e add ieee80211_isratevalid 2009-05-29 23:39:16 +00:00
sam
c16474afa0 Fix handling of devices w/o radiotap support:
o do not attach DLT_IEEE802_11_RADIO unless both tx and rx headers are
  present; this is assumed in the capture code paths
o verify the above with asserts in ieee80211_radiotap_{rx,tx}
o add missing checks for active taps before calling ieee80211_radiotap_rx
2009-05-25 16:38:47 +00:00
sam
1dcc1a56a6 do internal bpf tracking only for radiotap DLT's 2009-05-25 16:35:31 +00:00
sam
803ffe40e1 Prepare to distribute sysctl code to reduce global definitions:
o expose net.wlan sysctl node
o expose ieee80211_sysctl_msecs_ticks

Reviewed by:	rpaulo, thompsa
2009-05-20 20:18:01 +00:00
sam
68f7a1034a Overhaul monitor mode handling:
o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO
  and remove explicit bpf support from wireless drivers; drivers now
  use ieee80211_radiotap_attach to setup shared data structures that
  hold the radiotap header for each packet tx/rx
o remove rx timestamp from the rx path; it was used only by the tdma support
  for debugging and was mostly useless due to it being 32-bits and mostly
  unavailable
o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and
  per-com state when there are active taps
o track the number of monitor mode vaps
o use bpf tap and monitor mode vap state to decide when to collect radiotap
  state and dispatch frames; drivers no longer explicitly directly check
  bpf state or use bpf calls to tap frames
o handle radiotap state updates on channel change in net80211; drivers
  should not do this (unless they bypass net80211 which is almost always
  a mistake)
o update various drivers to be more consistent/correct in handling radiotap
o update ral to include TSF in radiotap'd frames
o add promisc mode callback to wi

Reviewed by:	cbzimmer, rpaulo, thompsa
2009-05-20 20:00:40 +00:00
sam
0ed2b1e0b5 add block ack frame id 2009-05-18 19:02:55 +00:00
sam
03b3bbecf2 add missing type for SYSCTL_PROC items; w/o a type you can view the value
but not change it
2009-05-14 16:25:57 +00:00
sam
4d4f58ad66 correct handling of ctl frames: the sender's address is always i_addr2 for
frames we should expect to process (old code was trying to handle frames
we should never see--like ACK)

Reviewed by:	thompsa, cbzimmer
2009-05-14 16:23:24 +00:00
thompsa
aae9005ac3 Cancel the scan when going to INIT state. Should do this for other states here
too as once the protocol newstate handler runs the scan has always ended.
2009-05-10 02:21:19 +00:00
zec
d78a1b1a82 Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)
2009-05-05 10:56:12 +00:00
thompsa
3222e9c2cd Relax the condition for printing the lost state transition message. The new
state will be set before the EXT_STATEWAIT flag is cleared and its ok to
transition again at that point.
2009-05-03 18:29:04 +00:00
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