summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve the heuristic which selects 5GHz APs over 2GHz APs.stsp2017-07-191-4/+18
| | | | | | | | | | | | | | | | | | The previous code wasn't quite right: it didn't account for the fact that some drivers don't set ic_max_rssi, and it compared 5GHz APs to a threshold relative to the max RSSI, rather than comparing RSSI on 5GHz relative to RSSI on 2GHz. This heuristic is only used by SCANNALLBAND drivers: iwn(4), iwm(4), wpi(4) In the future the AP selection heuristic should be made more intelligent, e.g. it should take BSS load information in beacons into account. Another open problem is inconsistent representation of RSSI measurement values throughout our drivers and stack. Help is welcome! For now, this hopefully improves AP selection at busy airports. ok sthen@ deraadt@
* Add sizes for free for the RSN IEs. Rewrite ieee80211_save_ie() slightlytb2017-06-041-2/+2
| | | | | | to make it more readable. help, many explanations and ok stsp
* Add a few sizes to free().tb2017-06-031-6/+6
| | | | Input, help & ok stsp
* In 11n hostap mode, dynamically adjust HT protection settings based onstsp2017-03-041-32/+38
| | | | | | the presence of non-HT nodes in the node cache. OpenBSD 11n APs will now disable HT protection if it is not necessary. ok mpi@
* Fix 11b clients sending bogus ratesets in association requests. The commonstsp2017-02-031-1/+7
| | | | | | rateset with the AP is calculated only after the association response was received, which is too late. Fix rates when an AP is selected after a scan. ok mpi@ tb@
* Remove global counters from struct ieee80211com which track the number ofstsp2017-02-021-37/+94
| | | | | | | | | | | | | | | | | | | | | | | | | associated nodes with particular properties: 11b-only ("non-ERP") nodes, nodes requiring long slot time, nodes using WPA, nodes not supporting 11n, nodes currently dozing in powersave state, and nodes with a pending group key update confirmation. These counters weren't properly maintained. There are bugs in the stack where these counters and actual node properties got out of sync. This is exposed by panics which are supposed to help us catch such bugs. But these panics don't provide real clues. Instead of maintaining global counters forcing us to hunt refcounting bugs, count nodes with the property in question on demand, by iterating over all nodes and checking their state. This is cheap since we'll never have more than 100 nodes cached, and none of the cases where we need such information is in a performance critical path. Prevents panics in hostap mode reported by Lauri Tirkkonen on bugs@ last year (https://marc.info/?l=openbsd-bugs&m=147513817930489&w=2) and also encountered by my 11n APs ("panic: bogus non-HT station count 0"). tested by Lauri, tb@, and myself ok mpi@ tb@
* Reset block ack state and cancel related timeouts when a HT node disassociates.stsp2017-01-161-1/+2
| | | | | | | The existing code (from damien@) already took care of freeing related buffers but because block ack state was not reset we were still trying to use these buffers if the node sent another A-MPDU. This problem only affects 11n hostap. Fixes kernel crash reported by Timo Myyra on bugs@
* When a HT node leaves or reassociates as a non-HT node,stsp2017-01-091-1/+24
| | | | | | | | | | clear HT capabilities stored in its node cache object. A node may switch from 11n mode to 11a/b/g mode. If we don't clear HT capabilities from the cache the node will be mistaken as 11n-capable after reassociation. ok phessler@ mpi@
* Make the net80211 stack send EDCA parameters to the driver in hostap mode.stsp2017-01-091-1/+18
| | | | | | Fixes problems with timing of frame transmissions which caused packet loss. tested by myself and tb@ ok phessler@ mpi@ tb@
* Manage the HT protection setting if acting as hostap with 11n enabled.stsp2017-01-091-2/+30
| | | | | | | | | | | For now we flip-flop only between non-member protection and non-HT protection. Running a HT network without protection would require monitoring environmental conditions (e.g. foreign beacons) which make HT protection necessary. The ic_update_htprot driver function becomes optional because it won't be needed by all drivers. Only call it if the driver has set a function pointer. ok tb@
* The point of ieee80211_node_leave() is to place the node in COLLECT state.stsp2017-01-091-1/+4
| | | | | Return early and do nothing if the node is already in COLLECT state upon entry to this function.
* When acting as hostap, negotiate HT before calling the driver's ic_newassoc()stsp2017-01-091-5/+5
| | | | | function, not afterwards. Drivers now know whether a joining node supports HT which helps with setting up state such as which Tx rate to use.
* Complete our half-done implementation of TKIP countermeasures in hostap mode.stsp2016-12-171-1/+3
| | | | | | | | | | The previous code would disable the AP until next reboot upon MIC failure. Instead, disable the AP for 60 seconds, as required by the 802.11 standard. I randomly added a bit of time (up to 120 seconds total) just because we can. Problem reported by Mathy Vanhoef, thanks! ok deraadt@ random input reyk@
* move from RB macros to the RBT functions.dlg2016-09-151-20/+20
| | | | shaves about 5k off an amd64 GENERIC.MP kernel
* If a wireless device or driver scans all bands at once give 5GHz APsstsp2016-08-171-7/+18
| | | | | a slight priority in cases where good matches exist in either band. ok sthen@
* Add a wireless driver capability flag for devices which scan 2GHz and 5GHzstsp2016-05-211-6/+9
| | | | | bands in a single scan offload request. This will be used by iwm(4) soon. ok kettenis@, earlier version ok phessler@
* In hostap mode, don't re-use association IDs (AIDs) of nodes which arestsp2016-05-181-7/+3
| | | | | | | | | | | | | | | | | | | | | | | still lingering in the node cache. This could cause an AID to be assigned twice, once to a newly associated node and once to a different node in COLLECT cache state (i.e. marked for future eviction from the node cache). Drivers (e.g. rt2860) may use AIDs to keep track of nodes in firmware tables and get confused when AIDs aren't unique across the node cache. The symptom observed with rt2860 were nodes stuck at 1 Mbps Tx rate since the duplicate AID made the driver perform Tx rate (AMRR) accounting on the wrong node object. To find out if a node is associated we now check the node's cache state, rather than comparing the node's AID against zero. An AID is assigned when a node associates and it lasts until the node is eventually purged from the node cache (previously, the AID was made available for re-use when the node was placed in COLLECT state). There is no need to be stingy with AIDs since the number of possible AIDs exceeds the maximum number of nodes in the cache. Problem found by Nathanael Rensen. Fix written by Nathanael and myself. Tested by Nathanael. Comitting now to get this change tested across as many drivers as possible.
* Call if_enqueue() and if_start() instead of dereferencing the ifpmpi2016-04-121-2/+2
| | | | | | | | | | | pointers. These functions have been introduced to abstract some of the MP- safeness^Wmadness and should be use everywhere. Prodded by a comment from jsg@. ok mikeb@, stsp@
* Restore assignment of ic_curmode that was accidentally removed whengerhard2016-03-031-1/+3
| | | | | | | moving the ERP code to post-assoc phase. Fixes iwi(4) fatal firmware errors. ok stsp@, sobrado@
* Honour ERP protection on 2 GHz channels in 11n mode, as done for 11g.stsp2016-01-251-3/+7
| | | | ok millert@
* Don't try to interpret htprot data if the last beacon didn't contain such data.stsp2016-01-251-3/+5
| | | | ok mpi@ millert@
* Make the A-MPDU reordering buffer more resilient against APs which dropstsp2016-01-071-3/+5
| | | | | | | | | | | | | some subframes or let the sequence number jump up by more than 1 (hard to tell which it is). We decrease the BA inactivity timeout for quicker recovery from stalled BA sessions, and add a new timeout which keeps track of gaps in the subframe sequence number space due to dropped frames. Gaps expire after 500 msec, the same value FreeBSD uses for their implementation of this workaround. And Linux uses this trick, too. This should fix network stalls some people have been seeing in 11n mode. ok deraadt@
* Remove the IEEE80211_NO_HT macro. Reduces ifdef spaghetti, enables 11n modestsp2016-01-051-23/+1
| | | | | in bsd.rd, and might uncover some bugs. Suggested by tedu@ and deraadt@. ok sthen@ jasper@ deraadt@
* While configuring ERP we need to know if we're in 11a or 11g mode so onlystsp2016-01-041-9/+1
| | | | | configure ERP once we are sure about our operation mode against the AP. ok sthen jasper kettenis deraadt mpi
* unnoccupied->unoccupiedsthen2015-12-181-2/+2
|
* Finish support for receiving 11n A-MPDUs.stsp2015-12-121-1/+36
| | | | | | | | | | | | | | The initial implementation was added by damien@ years ago. Summary of the changes made in this commit: - In ieee80211_input(), process A-MPDUs before duplicate detection. - Don't forget to set ba->ba_ni in ieee80211_recv_addba_req() so we don't crash in ieee80211_rx_ba_timeout(). - In ieee80211_recv_addba_req(), tweak the logic to deny BlockAck requests if the driver has no callback for doing so. - Implement ieee80211_ba_del() which cleans up BlockAck state. - Increase the minimum and maximum lifetime for BlockAck agrements. ok mpi@
* No need to include <net/if_arp.h>mpi2015-11-241-2/+1
| | | | | | | | | This header is only needed because <netinet/if_ether.h> declares a structure that needs it. But it turns out that <net/if.h> already includes it as workaround. A proper solution would be to stop declarting "struct ether_arp" there. But no driver should need this header.
* Parse 11n HT capabilities and operational info from association responsestsp2015-11-151-1/+2
| | | | | | | frames, negotiate HT with the AP, and move the interface into or out of 11n mode accordingly. If running as AP negotiate HT with nodes joining the BSS. ok deraadt mpi kettenis guenther
* Extend struct ieee80211_node with fields for 11n STA HT capabilities andstsp2015-11-151-1/+56
| | | | | | | | | | | | HT operational information sent by 11n APs. These fields reflect the structure of elements in management frames so that IEEE80211_HTCAP* and IEEE80211_HTOP* macros designed to operate on frame elements can be used directly to read or set the fields. Populate nodes with HT information received in probe responses, probe requests, and association requests. ok deraadt mpi phessler kettenis guenther
* replace the ifqueues in net80211 with mbuf_queues.dlg2015-11-041-13/+8
| | | | | | | | the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw had its own queue for beacons. tested by mpi@ and jmc@ ok mpi@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-3/+2
| | | | ok stsp mpi
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-6/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* unifdef some more INET. v4 4life.tedu2014-12-231-3/+1
|
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Remove cached 802.11 nodes in IEEE80211_STA_CACHE state (these are nodessthen2014-09-121-1/+16
| | | | | | which have been seen but which haven't otherwise interacted with us), fixing a problem where old cached nodes are seen when doing a scan. From Marcin Piotr Pawlowski, feedback stsp@ ok kspillner@ dcoppa@
* use nitems() instead of various local constructsjasper2014-08-081-4/+2
| | | | ok stsp@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-6/+6
| | | | after discussions with beck deraadt kettenis.
* Reset txrate array index after changing a node's rate list.stsp2013-12-011-1/+3
| | | | | | Should prevent "bogus xmit rate %d setup" panics, which I ran into again in IBSS mode. ok kettenis
* Remove unneeded include.mpi2013-11-211-2/+1
| | | | ok deraadt@
* Make ieee80211_set_tim() available from outside of ieee80211_node.cclaudio2013-03-241-2/+1
| | | | | so drivers like acx(4) can use that function directly instead of reimplementing the function again. Requested by kettenis@ long time ago.
* Fix DPRINTF() format string treating n->ni_refcnt, which is unsigned, as signed.stsp2012-11-071-2/+2
| | | | diff from dhill; ok kettenis reyk
* Clear the powersave flag and purge queued packets when a node leaves the APkettenis2012-10-101-2/+10
| | | | | | | | | (either by disassociating or by timeout). Fixes (most) remaining issues with power saving. From Nathanael Rensen. ok claudio@, krw@, sthen@
* Point an interface directly to its bridgeport configuration, insteadcamield2012-10-051-5/+5
| | | | | | | | | | of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
* Nuke M_80211_NODE #define which mapped to M_DEVBUF and use M_DEVBUF directly.stsp2012-09-201-5/+3
| | | | ok henning
* Set up ni_savedq for the initial BSS node such that it can actually be usedkettenis2012-08-251-1/+4
| | | | | | | to store multicast frames when one of the associated stations is in power saving mode. ok stsp@
* Fix possible panic while switching from STA mode into hostap/ibss modes.stsp2012-08-171-1/+2
| | | | | | | | | ieee80211_create_ibss() resets the set of supported rates but failed to update the index into the rate set array accordingly. If the rate configured during STA operation didn't belong to the newly configured rate set the system ran into an assertion ("bogus xmit rate %u setup") while trying to create the IBSS. ok fgsch@
* Print messages about nodes purged from the node cache if hostap/ibss modes arestsp2012-07-181-3/+4
| | | | compiled in and the interface is in debug mode. ok sthen
* Move increment of ic_nnodes closer to where the node is actually insertedstsp2012-07-161-3/+26
| | | | | | into the cache. Make sure we're at IPL_NET while incrementing/decrementing ic_nnodes. Add a debug message that warns about possible node leaks. All of this affects hostap mode only.
* Tweak node cache eviction strategy when the cache is full: kick off new nodesstsp2012-07-131-4/+12
| | | | | | | | in AUTH state that weren't active during the cache wait interval rather than keeping them for the entire cache timeout interval. Fixes association failures in noisy RF environments. Tested by edd and myself with a slow soekris suffering from RF noise with about of 50 interrupts per second on ral0. ok deraadt