Commit Graph

638 Commits

Author SHA1 Message Date
rpaulo
ef4801a240 ieee80211_dwds_mcast(): check the correct mbuf ptr after encap. 2009-06-18 21:15:41 +00:00
sam
d971362271 Rev IEEE80211_IOC_STA_INFO abi: ni_flags grew from 16 bits to 32
bits but isi_state did not follow; expand it to 32 bits and pad to
maintain alignment.  Note this is an incompatible change that
requires rebuilding of user applications.

Submitted by:	rpaulo, cbzimmer, avatar
2009-06-13 23:43:00 +00:00
sam
81fd220c2b make implicit pad visible 2009-06-11 17:10:21 +00:00
sam
4c6bb21c7f use negotiated short gi to calculate the tx rate; using the htcaps
does not take into account local state (e.g. manual disable of sgi)
2009-06-11 17:09:39 +00:00
sam
b54b6d28ba When associating to an AP we don't know if HT is negotiated until
we receive the AssocResp, so we can only set ni_txparms properly
at that point.  To make this possible make node_setuptxparms public
as ieee80211_node_setuptxparms.
2009-06-11 04:43:42 +00:00
sam
a5fe9c1c83 protect callouts with the com lock
Prodded by:	jhb
2009-06-09 17:12:19 +00:00
sam
a81cc73a1b add missing calls to ieee80211_dfs_attach/detach 2009-06-09 17:11:41 +00:00
sam
61418971f4 Correct ieee80211_gettid:
o don't increment extracted tid, this was a vestige of IEEE80211_NONQOS_TID
  being defined as 0 (w/ real tid's +1)
o handle 4-address frames (add IEEE80211_IS_DSTODS to check if an 802.11
  header is DSTODS)

Submitted by:	cbzimmer
Reviewed by:	avatar
2009-06-09 16:32:07 +00:00
sam
c73264cfa4 purge dead code 2009-06-08 21:16:06 +00:00
sam
62ee07ea6b fix big-endian machines 2009-06-08 21:15:40 +00:00
bz
b7ff2bdc20 After r193232 rt_tables in vnet.h are no longer indirectly dependent on
the ROUTETABLES kernel option thus there is no need to include opt_route.h
anymore in all consumers of vnet.h and no longer depend on it for module
builds.

Remove the hidden include in flowtable.h as well and leave the two
explicit #includes in ip_input.c and ip_output.c.
2009-06-08 19:57:35 +00:00
sam
9e25fe5922 do not strip M_MORE_DATA on packets coming through ieee80211_start;
frames coming out of the ps q may have this set and removing it
causes the 802.11 header to not indicate more frames follow which can
result in the sta going to sleep and missing them
2009-06-08 03:18:45 +00:00
sam
fd7231d2b0 prefer callout_schedule 2009-06-07 23:16:59 +00:00
sam
ee2d4a84ad use c99-style initializers 2009-06-07 23:16:10 +00:00
sam
f3f59b2ee0 teach ieee80211_classify about ipv6 packets
Reviewed by:	bz, rrs
2009-06-07 22:06:15 +00:00
sam
892cecbd65 add iv_flags_ht and ic_flags_ht 2009-06-07 22:03:25 +00:00
sam
33549e3857 iv_flags_ext is full, make room by moving HT-related flags to a new
iv_flags_ht word
2009-06-07 22:00:22 +00:00
sam
a0e4dc565d o add bits for STBC and Greenfield
o fix some comments
2009-06-06 00:32:15 +00:00
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