summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
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@
2016-01-04Don't return 11n mode from ieee80211_chan2mode() so we can switch intoStefan Sperling
11a and 11b/g mode correctly when the driver supports 11n. And make sure the result of this funtion is only used to index ic_sup_rates. Its stated purpose is to help select a legacy rate. ok sthen jasper kettenis deraadt mpi
2016-01-04While configuring ERP we need to know if we're in 11a or 11g mode so onlyStefan Sperling
configure ERP once we are sure about our operation mode against the AP. ok sthen jasper kettenis deraadt mpi
2016-01-04Skip over 11n mode during scanning to avoid scanning channels more than once.Stefan Sperling
ok sthen jasper kettenis deraadt mpi
2015-12-18unnoccupied->unoccupiedStuart Henderson
2015-12-18Fix out of bounds array access in ieee80211_setbasicrates().Stefan Sperling
found by + ok jsg@
2015-12-16Don't forget about monitor mode while building the ifmedia listStefan Sperling
for 802.11n capable wireless drivers. ok mpi@
2015-12-14In AMRR debug printfs, show ni_txmcs instead of ni_txrate for HT nodes.Stefan Sperling
2015-12-12In the A-MSDU receive code path, add an upper bounds check on A-MSDUStefan Sperling
subframe length and a clean exit at the bottom of the subframe loop. ok mpi@
2015-12-12Flag AP as QoS capable when EDCA or WME information elements occur in beaconsStefan Sperling
or probe responses. Makes 11n negotiation with Linux iwlwifi AP succeed. ok mpi@
2015-12-1211n/HT negotiation fixes:Stefan Sperling
Some APs will not negotiate HT if the vendor-specific WME info element is missing in probe and association requests, so add one. Fix the wrong flag (NODE_HT) being checked to determine whether 11n related elements should be included in management frames. If 11n mode is enabled (F_HTON flag) we can always include 11n related elements in management frames. ok mpi@
2015-12-12Finish support for receiving 11n A-MPDUs.Stefan Sperling
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@
2015-12-05Keep kernel definitions under _KERNEL to unbreak security/wpa_supplicantMartin Pieuchot
because of a missing forward declaration for kernel functions. ok stsp@
2015-11-27correct logic for a IEEE80211_MODE_11N testJonathan Gray
ok stsp@
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.David Gwynne
there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
2015-11-24No need to include <net/if_arp.h>Martin Pieuchot
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.
2015-11-24No need to include <net/if_types.h> for <net/if_vlan_var.h>Martin Pieuchot
2015-11-15Add support for 11n mode to the rate adaptation (AMRR) code.Stefan Sperling
Currently limited to MCS 0-7. For now, drivers must not configure 11n hardware to use MCS other than MCS 0-7, which limits us to 65Mbit/s. MCS 8 and above use MIMO and will require more work in AMRR once we get there. ok deraadt mpi phessler kettenis guenther
2015-11-15Expose 11n mode to the ifmedia layer and introduce the concept of MCS.Stefan Sperling
Make sure 11n features are enabled only if media type is autoselect or 11n. 11n mode uses MCS (modulation & coding scheme) instead of rates like 11a/b/g. This means we'll have to take the current mode into account and decide whether to use a rate or an MCS for transmission. Receiving frames on legacy rates will still work in 11n mode. We just won't be using legacy rates to send data frames to an STA or AP we negotiated 11n features with. My initial plan was to grow the ieee80211_rateset structure and treat MCS just like rates. However, ieee80211_rateset corresponds to rates and xrates elements in management frames and is copied directly into such elements so its size cannot change. Thus, MCS stands on its own and corresponds to elements in management frames related to 11n HT capabilities. ok deraadt mpi phessler kettenis guenther