summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
2016-08-31If a driver reports RSSI in the 20-100 range, convert to a negative value.Stefan Sperling
Fixes dBm values displayed by 'ifconfig scan' with several drivers. ok mpi@ jca@
2016-08-17If a wireless device or driver scans all bands at once give 5GHz APsStefan Sperling
a slight priority in cases where good matches exist in either band. ok sthen@
2016-08-15Expose more 802.11n information to userspace:Stefan Sperling
A flag which indicates whether HT has been negotiated with a node, and the current Tx MCS value we use for a node. This grows struct ieee80211_nodereq. Applications using it must be recompiled. ok mpi@
2016-07-20In net80211, enable RTS for frames above a particular size (currently 512Stefan Sperling
bytes). This is what other OS have been doing for years. In our stack this feature was present but disabled at compile-time by an #ifdef. This is a low risk change because drivers were already required to use RTS whenever the AP set the USE_PROTECTION flag in ERP elements of its beacons. This change allows for reasonable throughput on loaded 11g networks whereas before they were practically unusable. tests and ok phessler@
2016-05-21Add a wireless driver capability flag for devices which scan 2GHz and 5GHzStefan Sperling
bands in a single scan offload request. This will be used by iwm(4) soon. ok kettenis@, earlier version ok phessler@
2016-05-18In hostap mode, don't re-use association IDs (AIDs) of nodes which areStefan Sperling
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.
2016-05-12Fix "comma at end of enumerator list" warningsDavid Coppa
Sure stsp@
2016-05-10make bpf_mtap callers set the M_FILDROP flag if they care about it.David Gwynne
ok mpi@
2016-05-02Fix a corner case of 12-bit arithmetic: also increment the ba_winmissTheo Buehler
counter if sn == 0 and ba_missedsn == 0xfff. ok stsp@
2016-05-02IEEE 802.11 sequence numbers wrap at 12 bit.Stefan Sperling
Fix a case where ieee80211_ba_input() failed to account for that. ok tb@
2016-04-28Rework handling of frames which fall beyond the block ack window.Stefan Sperling
tb@ discovered that we were not following the 802.11-2012 standard correctly for frames which fall within the range [winend, windend+winsize]. This could cause valid frames to be dropped because we moved the window too far ahead. with and ok tb@
2016-04-28Add a net80211 stat counter for block ack window "slides" as opposedStefan Sperling
to "jumps". Will be used soon by refined block ack window handling. netstat needs to be recompiled. With and ok tb@
2016-04-28When a frame which falls into the block ack window is received, clearStefan Sperling
counters that keep track of consecutive frames falling outside the window.
2016-04-28Copy some ieee8021_node HT information to userspace.Stefan Sperling
ifconfig needs to be recompiled. ok mpi@
2016-04-28Reduce block ack gap timeout to 300 msec in order to reduce Rx latency.Stefan Sperling
This value seems to be a sweet spot. testing and ok tb@
2016-04-27Add some stat counters for events related to 802.11n.Stefan Sperling
netstat(1) needs to be recompiled to work with new kernel. ok deraadt mpi
2016-04-15replace m_copym2 with m_dup_pktDavid Gwynne
tested by and ok stsp@
2016-04-12Call if_enqueue() and if_start() instead of dereferencing the ifpMartin Pieuchot
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@
2016-03-22replace ieee80211_align_mbuf with m_dup_pktDavid Gwynne
ok stsp@
2016-03-03Restore assignment of ic_curmode that was accidentally removed whenGerhard Roth
moving the ERP code to post-assoc phase. Fixes iwi(4) fatal firmware errors. ok stsp@, sobrado@
2016-02-12Remove superfluous assignments of 'subtype' in ieee80211_input().Stefan Sperling
Suggested by sthen@ ok tb@
2016-02-11In ieee80211_input(), initialize 'subtype' variable before using it.Stefan Sperling
Should have been part of the QoS "no data" fix. ok tb@
2016-02-11Fix whitespace.Stefan Sperling
2016-02-11Make the heuristic which catches frames with sequence numbers outside theStefan Sperling
current BlockAck window compare against the actual window size, rather than the maximum window size possible. As a result, two consecutive if-blocks now check for the same condition, so merge them.
2016-02-11Trim text in comment.Stefan Sperling
2016-02-11In ieee80211_ba_input(), compute the expression '(sn - ba->ba_winend) & 0xfff'Stefan Sperling
just once, by assigning its value to the 'count' variable earlier and reusing 'count' where this expression was used. No functional change. This just results in better readability.
2016-02-11Don't pass QoS "no data" frames to the A-MPDU reordering logic. Such framesStefan Sperling
will cause major confusion since they don't carry a sequence number. ok mpi@ sthen@
2016-02-09Log frames which fall outside the BlockAack window in dmesg if theStefan Sperling
interface debug flag is set (enabled with: ifconfig iwn0 debug). Shows the frame's sequence number and the current BA window. I'm adding this for diagnosis, just in case it will be needed to make future decisions about tuning the heuristic which works around network stalls caused by such frames.
2016-02-08Stop requiring a BlockAck session timeout (again), and just use it if the APStefan Sperling
is asking for it. This timeout should not be required anymore now that krw@'s hangs are fixed by working around APs which make sequence numbers jump about.
2016-02-08Work around buggy APs which occasionally emit sequence numbers much higherStefan Sperling
than the current 11n BlockAck window. The previous code would be fooled into moving the window forward and then drop packets until their sequence numbers catch up with the new window, which can take several minutes. Fixes traffic stalls observed with Broadcom APs. ok krw@ tb@
2016-02-07Hide some excessive net80211 debug printfs behind ieee80211_debug >= 2.Stefan Sperling
2016-02-05Count A-MPDU subframes with sequence number below the current BA window asStefan Sperling
duplicates rather than input errors. These subframes have either already been received, or the window was moved by the gap timeout which should only happen with buggy APs. Neither condition indicates a severe problem. Perhaps we will introduce a separate counter for this later.
2016-02-05Define EDCA tables for 11n mode. Per 802.11-2012 they are the same asStefan Sperling
the tables for 11a/11g modes. Add a function to append a Microsoft WME parameter element to a frame, using EDCA tables to construct the parameter records. Some 11n AP's I have observed provide this element. None of this code is used yet, so no functional change. I wrote this while debugging BlockAck and then realized it was only needed for hostap mode. Once we support 11n in hostap mode and send A-MPDUs, this code will be needed.
2016-02-05Store ADDBA request and response parameters in the block ack record ofStefan Sperling
ieee80211_node. This way, we can keep track of the ACK policy and echo it back to the AP as required by the standard. And use the correct bit flag for the policy -- this code was confused between BlockAck and ADDBA, both of which have a policy bit but in different places. Fixes apple airport APs. tested by tb@, krw@, sthen@, abieber@, and Henrik Friedrichsen
2016-02-04Restore the BlockAck session timer. It is still required to work aroundStefan Sperling
stalled BA sessions observed with iwn(4). We can revisit this later once the underlying problem in iwn(4) has been found. Prompted by report from krw@, I could reproduce the issue. ok krw@
2016-02-01Stop requiring a BlockAck session timeout. We still honour the timeout ifStefan Sperling
the AP requests it, though I don't think I've ever seen one that does. Per the 802.11-2012 spec a value of zero disables the timeout and some APs seem to have trouble with timeouts forced onto them. Our behaviour now matches Linux in this regard. This gets Apple Airport APs somewhat working in 11n mode but there is still a remaining issue with receiving frames from them. Doesn't seem to hurt any other APs I've tried. ok sthen@ mpi@ millert@
2016-01-25Honour ERP protection on 2 GHz channels in 11n mode, as done for 11g.Stefan Sperling
ok millert@
2016-01-25Don't try to interpret htprot data if the last beacon didn't contain such data.Stefan Sperling
ok mpi@ millert@
2016-01-25Add short comments explaining HT protection modes.Stefan Sperling
2016-01-25Keep track of HT protection settings in beacons and have 11n-capableStefan Sperling
drivers update hardware configuration accordingly. tested by myself, tb@, deraadt@, abieber@ ok mpi@
2016-01-21Fix the timeout value sent in ADDBA request and response frames.Stefan Sperling
ba_timeout_val is in usec so we must divide by TU when copying it to the frame. ok kettenis@ millert@
2016-01-13Fix fallout from turbo mode removal commit: Channel initializationStefan Sperling
was broken and lots of drivers ran into trouble as a result. ok deraadt@
2016-01-12Remove wireless turbo mode support. It is a non-standard extensionStefan Sperling
which only worked with ath(4) devices from a decade ago. Diff tested on ath(4) hardware by me to verify that 11a/b modes still work. ok reyk deraadt chris sthen kettenis
2016-01-07Make the A-MPDU reordering buffer more resilient against APs which dropStefan Sperling
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@
2016-01-06Initialize the A-MPDU parameters field in HT capability elements.Stefan Sperling
ok kettenis@
2016-01-05Remove the IEEE80211_NO_HT macro. Reduces ifdef spaghetti, enables 11n modeStefan Sperling
in bsd.rd, and might uncover some bugs. Suggested by tedu@ and deraadt@. ok sthen@ jasper@ deraadt@
2016-01-04Replace magic shifts and bitmasks used for ADDBA parametersStefan Sperling
with proper names, now that we have the corresponding macros.
2016-01-04Fix another case where the return value of ieee80211_chan2mode() wasStefan Sperling
used for indexing something other than ic_sup_rates. Should have been part of earlier commit.
2016-01-04ADDBA frames have a parameter set which we check against our own capabilitiesStefan Sperling
but we were checking bits in these parameters with the wrong set of bitmasks. Negotiating A-MPDUs with some APs failed because of this bug. ok kettenis@
2016-01-04Fix manual scan while associated in 11a mode. It would only show APs on 5GHz.Stefan Sperling
Problem found by benno@ ok benno@ kettenis@