summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
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
2015-11-15Parse 11n HT capabilities and operational info from association responseStefan Sperling
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
2015-11-15IEEE80211_MODE_MAX has been raised to include 11n mode so make sure thatStefan Sperling
ieee80211_media_init doesn't index its rates array beyond turbo mode.
2015-11-15Extend struct ieee80211_node with fields for 11n STA HT capabilities andStefan Sperling
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
2015-11-15Fix CCMP (WPA2) in preparation for 11n. This code didn't handle QoSStefan Sperling
frames correctly but QoS frames are required for 11n A-MPDU aggregation and 11n STAs are required to use CCMP instead of WEP or TKIP ciphers. The QoS bit in FC0 is part of AAD (additional authentication data) but was being masked unconditionally. The FC1 order bit is masked to 0 in AAD if a data frame contains a QoS control field but this code was looking for HT control fields instead. Add an XXX comment about another bit which must be set if SPP (signaling and payload protected) A-MSDUs are supported. Neither Linux nor FreeBSD seem to set this bit, and we don't support SPP A-MSDUs yet so a comment seems good enough for now. ok deraadt mpi kettenis guenther helpful hints from mikeb
2015-11-15Declare 802.11n mode and channel flags. Tweak 11n related fields in structStefan Sperling
ieee80211com and move them inside #ifndef IEEE80211_NO_HT without breaking the build in rsu(4) for RAMDISK_CD. Also declare 11n protection modes and MCS count. ok deraadt mpi kettenis guenther
2015-11-08Handle additional RSN element group ciphers.Stefan Sperling
ok mpi@
2015-11-08Update section and table numbers inside comments in the RSN code toStefan Sperling
the 802.11-2012 standard. ok mpi@
2015-11-04replace the ifqueues in net80211 with mbuf_queues.David Gwynne
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@
2015-10-17Spell all "unexpected mode %u" panics in lower case, not just one of them.Stefan Sperling
2015-10-12the pattr argument to IFQ_ENQUEUE is unused, so let's get rid of it.David Gwynne
also the comment above IFQ_ENQUEUE that says the pattr argument is unused. ok mpi@
2015-10-10Add macros for A-MPDU and MCS data, both found in HT capabilities element.Stefan Sperling
typo fix + ok sthen@
2015-10-05Revert if_oqdrops accounting changes done in kernel, per request from mpi@.Masao Uebayashi
(Especially adding IF_DROP() after IFQ_ENQUEUE() was completely wrong because IFQ_ENQUEUE() already does it. Oops.) After this revert, the situation becomes: - if_snd.ifq_drops is incremented in either IFQ_ENQUEUE() or IF_DROP(), but it is not shown to userland, and - if_data.ifi_oqdrops is shown to userland, but it is not incremented by anyone.
2015-10-05Count IFQ_ENQUEUE() failure as output drop.Masao Uebayashi
mpi@ prefers checking IFQ_ENQUEUE() error, and this matches that. OK dlg@
2015-09-27Add ieee80211_channel_init(), factored out from ieee80211_ifattach().Stefan Sperling
Will be used by iwm(4) soon. ok kettenis@
2015-09-16Make code in ieee80211_send_4way_msg3() more readable and make sure a localStefan Sperling
variable is initialized to NULL in the WPA case. No functional change. Pointed out by Maxime Villard's brainy code scanner. ok claudio@ zhuk@
2015-09-11Make room for media types of the future. Extend the ifmedia word to 64 bits.Stefan Sperling
This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and grows struct ifmediareq. Old ifconfig and dhclient binaries can still assign addresses, however the 'media' subcommand stops working. Recompiling ifconfig and dhclient with new headers before a reboot should not be necessary unless in very special circumstances where non-default media settings must be used to get link and console access is not available. There may be some MD fallout but that will be cleared up later. ok deraadt miod with help and suggestions from several sharks attending l2k15
2015-07-15m_freem() can handle NULL, do not check for this condition beforehands.Theo de Raadt
ok stsp mpi
2015-07-14In ieee80211.h update references to standard sections to 802.11-2012.Stefan Sperling
Add missing element IDs (and remove some non-standard ones), action field categories and values, some 11n related stuff, and other small things. Use the same element ID symbolic names as FreeBSD where applicable as suggested by millert. ok mpi millert
2015-06-30Rename if_output() into if_enqueue() to avoid confusion with commentsMartin Pieuchot
talking about (*ifp->if_output)(). ok claudio@, dlg@
2015-06-24Increment if_ipackets in if_input().Martin Pieuchot
Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
2015-05-26Use if_output() instead of rerolling it.Martin Pieuchot
ok stsp@
2015-04-08add a #define for IEEE80211_ELEMID_CSA, 802.11h-2003 Channel Switch AnnouncementStuart Henderson
ok stsp@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@