summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_input.c
Commit message (Collapse)AuthorAgeFilesLines
* Print out the bogus beacon interval.adrian2012-02-281-1/+2
|
* Add 802.11h quiet time element support into net80211.adrian2011-11-081-0/+3
| | | | | | | | | | | | This supports both station and hostap modes: * Station mode quiet time element support listens to quiet time IE's and modifies the local quiet time configuration as appropriate; * Hostap mode both obeys the locally configured quiet time period and includes it in beacon frames so stations also can obey as needed. Submitted by: Himali Patel <himali.patel@sibridgetech.com> Sponsored by: Sibridge Technologies
* Add initial support for MIMO statistics to net80211.adrian2011-04-081-1/+46
| | | | | | | | | | | | | | | | | | This introduces struct ieee80211_rx_stats - which stores the various kinds of RX statistics which a MIMO and non-MIMO 802.11 device can export. It also fleshes out the mimo export to userland (node_getmimoinfo()). It assumes that MIMO radios (for now) export both ctl and ext channels. Non-11n MIMO radios are possible (and I believe Atheros made at least one), so if that chipset support is added, extra flags to the struct ieee80211_rx_stats can be added to extend this support. Two new input functions have been added - ieee80211_input_mimo() and ieee80211_input_mimo_all() - which MIMO-aware devices can call with MIMO specific statistics. 802.11 devices calling the non-MIMO input functions will still function.
* Add a new mgmt subtype "ACTION NO ACK" defined in 802.11n-2009, while herebschmidt2011-02-211-1/+0
| | | | | | | | | clean up parts of the *_recv_mgmt() functions. - make sure appropriate counters are bumped and debug messages are printed - order the unhandled subtypes by value and add a few missing ones - fix some whitespace nits - remove duplicate code in adhoc_recv_mgmt() - remove a useless comment, probably left in while c&p
* Constify vap argument of ieee80211_{note,discard}* functions.rpaulo2010-03-311-7/+8
| | | | MFC after: 1 week
* Fix a typo in ifdef mesh support. This would make mesh unworkable ifrpaulo2009-08-171-1/+1
| | | | | | TDMA support was compiled out. Approved by: re (kib)
* More mesh bits, namely:rpaulo2009-07-201-11/+5
| | | | | | | | | | | | | | * bridge support (sam) * handling of errors (sam) * deletion of inactive routing entries * more debug msgs (sam) * fixed some inconsistencies with the spec. * decap is now specific to mesh (sam) * print mesh seq. no. on ifconfig list mesh * small perf. improvements Reviewed by: sam Approved by: re (kib)
* Move code that does payload realigment to a new routine, ieee80211_realign,sam2009-07-181-47/+3
| | | | | | | so it can be reused. While here rewrite the logic to always use a single mbuf. Reviewed by: rpaulo Approved by: re (kib)
* Implementation of the upcoming Wireless Mesh standard, 802.11s, on therpaulo2009-07-111-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
* iv_flags_ext is full, make room by moving HT-related flags to a newsam2009-06-071-1/+1
| | | | iv_flags_ht word
* o station mode channel switch supportsam2009-06-041-0/+12
| | | | | | | | | | 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
* Fix monitor mode vaps to work as intended:sam2009-06-021-3/+5
| | | | | | | 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
* don't dispatch frames to vap's not runningsam2009-06-021-0/+3
|
* Overhaul monitor mode handling:sam2009-05-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* split Atheros SuperG support out into it's own file that's included onlysam2009-03-241-77/+2
| | | | with a new IEEE80211_SUPPORT_SUPERG option
* Use plural in a comment. No functional change.rpaulo2009-03-181-1/+1
|
* TDMA support for long distance point-to-point links using ath devices:sam2009-01-081-1/+5
| | | | | | | | | | | | | | | o add net80211 support for a tdma vap that is built on top of the existing adhoc-demo support o add tdma scheduling of frame transmission to the ath driver; it's conceivable other devices might be capable of this too in which case they can make use of the 802.11 protocol additions etc. o add minor bits to user tools that need to know: ifconfig to setup and configure, new statistics in athstats, and new debug mask bits While the architecture can support >2 slots in a TDMA BSS the current design is intended (and tested) for only 2 slots. Sponsored by: Intel
* convert MALLOC/FREE to malloc/freesam2008-12-181-1/+1
|
* Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 butsam2008-12-151-8/+0
| | | | | | | really was meant to be 256. Adjust usage accordingly and replace bogus usage of this value in checking IEEE channel #'s. NB: this causes an ABI change; ifconfig must be recompiled
* ignore IEEE80211_ELEMID_PWRCNSTR when parsing beacon/probe response framessam2008-10-251-0/+1
| | | | | to avoid counting it as an unknown elemid (we often beacon this so it shows up as a "false positive")
* Revert the removal of the MALLOC and FREE macros from the net80211 code.des2008-10-231-1/+1
| | | | Requested by: sam
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-1/+1
| | | | MFC after: 3 months
* correct decap of of AppleTalk and IPX frames; don't strip the SNAPsam2008-08-021-1/+4
| | | | | | header as they have one natively Submitted by: Chris Zimmermann
* Multi-bss (aka vap) support for 802.11 devices.sam2008-04-201-2874/+376
| | | | | | | | | | | Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits)
* - Correctly handle ALTQ in ieee80211_deliver_data()sephe2008-02-031-2/+6
| | | | | | | - Add comment from sam that ALTQ probably does not work well with WME PR: kern/119548 Approved by: sam (mentor)
* sync 11n support with vap code base; many changes based on interopsam2007-11-021-3/+95
| | | | | | testing with all major vendors MFC after: 1 week
* Miscellaneous fixups to 802.11 defs:sam2007-09-051-1/+1
| | | | | | | | | | | | | o update 11n definitions to D2.0 spec o add IEEE80211_CAPINFO_SPECTRUM_MGMT for DFS support o add CSA ie definition for DFS support o purge some unused definitions o correct 802.11 reason and status codes o correct reason code returned when a sta tries to associate to an ap operating with WPA/RSN but without a WPA/RSN ie Reviewed by: thompsa, avatar Approved by: re (blanket wireless)
* o add M_WEP mbuf flag so drivers can mark frames that are decrypted by thesam2007-09-051-1/+5
| | | | | | | | device and have had the crypto bits stripped from the 802.11 header o strip mbuf flags in the rx path before passing up the stack Reviewed by: thompsa, sephe, avatar Approved by: re (blanket wireless)
* Change the channel number in the scan results struct to be a pointer to thethompsa2007-06-301-6/+7
| | | | | | | | | | | | operating channel and use this in the scan cache rather than directly using ic_curchan. Some firmware cards can only do a full scan and so ic_curchan does not have the correct value. Also add IEEE80211_CHAN2IEEE to directly dereference ic_ieee from the channel to be used in the fast path. Reviewed by: sam, sephe Approved by: re (kensmith)
* Update 802.11 wireless support:sam2007-06-111-262/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o major overhaul of the way channels are handled: channels are now fully enumerated and uniquely identify the operating characteristics; these changes are visible to user applications which require changes o make scanning support independent of the state machine to enable background scanning and roaming o move scanning support into loadable modules based on the operating mode to enable different policies and reduce the memory footprint on systems w/ constrained resources o add background scanning in station mode (no support for adhoc/ibss mode yet) o significantly speedup sta mode scanning with a variety of techniques o add roaming support when background scanning is supported; for now we use a simple algorithm to trigger a roam: we threshold the rssi and tx rate, if either drops too low we try to roam to a new ap o add tx fragmentation support o add first cut at 802.11n support: this code works with forthcoming drivers but is incomplete; it's included now to establish a baseline for other drivers to be developed and for user applications o adjust max_linkhdr et. al. to reflect 802.11 requirements; this eliminates prepending mbufs for traffic generated locally o add support for Atheros protocol extensions; mainly the fast frames encapsulation (note this can be used with any card that can tx+rx large frames correctly) o add sta support for ap's that beacon both WPA1+2 support o change all data types from bsd-style to posix-style o propagate noise floor data from drivers to net80211 and on to user apps o correct various issues in the sta mode state machine related to handling authentication and association failures o enable the addition of sta mode power save support for drivers that need net80211 support (not in this commit) o remove old WI compatibility ioctls (wicontrol is officially dead) o change the data structures returned for get sta info and get scan results so future additions will not break user apps o fixed tx rate is now maintained internally as an ieee rate and not an index into the rate set; this needs to be extended to deal with multi-mode operation o add extended channel specifications to radiotap to enable 11n sniffing Drivers: o ath: add support for bg scanning, tx fragmentation, fast frames, dynamic turbo (lightly tested), 11n (sniffing only and needs new hal) o awi: compile tested only o ndis: lightly tested o ipw: lightly tested o iwi: add support for bg scanning (well tested but may have some rough edges) o ral, ural, rum: add suppoort for bg scanning, calibrate rssi data o wi: lightly tested This work is based on contributions by Atheros, kmacy, sephe, thompsa, mlaier, kevlo, and others. Much of the scanning work was supported by Atheros. The 11n work was supported by Marvell.
* copyright updates:sam2007-06-061-8/+2
| | | | | | | o update to include 2007 o switch back to a 2-clause bsd-only license Reviewed by: onoe
* change ieee80211_fix_rate to take a rate set instead of usingsam2007-03-111-1/+1
| | | | | | ni_rates; this lets us re-use the code to check 11n HT rates MFC after: 2 weeks
* expose IEEE80211_DISCARD, IEEE80211_DISCARD_IE, and IEEE80211_DISCARD_MACsam2007-03-111-33/+3
| | | | | | so they can be used within net80211 but outside ieee80211_input.c MFC after: 2 weeks
* improve debug msg for ie's that are too shortsam2007-03-111-1/+2
| | | | MFC after: 2 weeks
* keep tx/rx seq #'s for non-QoS traffic separate from QoS; stationssam2007-03-111-1/+1
| | | | | | | aren't supposed mix traffic but if they did frames might be mis-handled Obtained from: Atheros MFC after: 2 weeks
* split check for rate set mismatch on assoc req away from checksam2007-03-111-10/+21
| | | | | | for pure 11g mode so we can give meaningful diagnostic msgs MFC after: 2 weeks
* disallow re-associate with a slot time mismatchsam2007-03-111-8/+27
| | | | | Obtained from: Atheros MFC after: 2 weeks
* move __inline before type to appease gcc 4.xsam2007-03-111-5/+5
| | | | Obtained from: netbsd
* discard deauth+disassoc frames that are not destined for us; thesesam2007-03-111-0/+10
| | | | | | | can be received when the interface is in promisc mode Reviewed by: sephe Obtained from: netbsd
* When dispatching frames saved on the power save queue to asam2007-03-071-13/+23
| | | | | | | | | | | | station exiting power save mode prepend them to the driver's send q instead of appending them. This insures the packets are not misordered wrt any packets already q'd for the station. This corrects a problem noticed when using a VoIP phone talking to an ath card in ap mode; the misordered packets caused noise. Submitted by: "J.R. Oldroyd" <jr@opal.com> MFC after: 2 weeks
* clear/reclaim challenge text when switching auth mode and operating as an apsam2007-02-041-0/+9
| | | | Obtained from: Atheros
* Correct several issues with rate set negotiation:sam2007-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | o add IEEE80211_F_JOIN flag to ieee80211_fix_rate to indicate a station is joining a BSS; this is used to control whether or not we over-write the basic rate bit in the calculated rate set o fix ieee80211_fix_rate to honor IEEE80211_F_DODEL when IEEE80211_F_DONEGO is not specified (e.g. when joining an ibss network) o on sta join always delete unusable rates from the negotiated rate set, this was being done only ibss networks but is also needed for 11g bss with mixed stations o on sta join delete unusable rates from the bss node's rate set, not the scan table entry's rate set o when calculating a rate set for new neighbors in an ibss caculate a negotiated rate set so drivers are not presented with rates they should not use Submitted by: Sepherosa Ziehau (w/ modifications) Obtained from: DragonFly MFC after: 1 month
* back out use of LLC_SNAPFRAMELEN now that sizeof(struct llc) isn'tsam2006-12-011-1/+1
| | | | padded on arm
* sizeof(struct llc) includes padding on arm; use LLC_SNAPFRAMELEN for nowsam2006-12-011-1/+1
| | | | | Submitted by: jhay MFC after: 2 weeks
* Move ethernet VLAN tags from mtags to its own mbuf packet header fieldandre2006-09-171-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m_pkthdr.ether_vlan. The presence of the M_VLANTAG flag on the mbuf signifies the presence and validity of its content. Drivers that support hardware VLAN tag stripping fill in the received VLAN tag (containing both vlan and priority information) into the ether_vtag mbuf packet header field: m->m_pkthdr.ether_vtag = vlan_id; /* ntohs()? */ m->m_flags |= M_VLANTAG; to mark the packet m with the specified VLAN tag. On output the driver should check the mbuf for the M_VLANTAG flag to see if a VLAN tag is present and valid: if (m->m_flags & M_VLANTAG) { ... = m->m_pkthdr.ether_vtag; /* htons()? */ ... pass tag to hardware ... } VLAN tags are stored in host byte order. Byte swapping may be necessary. (Note: This driver conversion was mechanic and did not add or remove any byte swapping in the drivers.) Remove zone_mtag_vlan UMA zone and MTAG_VLAN definition. No more tag memory allocation have to be done. Reviewed by: thompsa, yar Sponsored by: TCP/IP Optimization Fundraise 2005
* minor fixups:sam2006-08-101-7/+18
| | | | | | | | | o add some missing stats to the global stat structure o move accounting work for data frame rx into ieee80211_deliver_data o add per-sta stats for rx ucast/mcast frames o set rcvif in ieee80211_deliver_data so callers don't need to MFC after: 2 weeks
* correct ie length check; need to include fixed part of iesam2006-07-161-4/+4
| | | | MFC after: 2 weeks
* tighten invariant on loops used to parse ie's; this ensures we neversam2006-07-161-4/+4
| | | | | | | | touch data outside the packet (previously we might touch 1 byte); it also has the happy side effect of working around broken orinoco/agere firmware that sends malformed association response frames Help by: Vladimir Egorin
* Fix the following bpf(4) race condition which can result in a panic:csjp2006-06-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* use m_dup instead of m_copypacket when doing internal bridgingsam2006-03-071-1/+1
| | | | | | in case packets are modified (e.g. encrypted) MFC after: 1 week
OpenPOWER on IntegriCloud