summaryrefslogtreecommitdiffstats
path: root/sys/net80211
Commit message (Collapse)AuthorAgeFilesLines
* [net80211] correctly (i hope, wow) do a ticks comparison to limit A-MPDU ↵adrian2016-04-101-1/+1
| | | | | | | | | | | | attempts I was seeing the stack constantly attempt to renegotiate A-MPDU TX even after 3 failures. My hunch is that the direct ticks comparison is failing around the ticks wrap-around point. This failure shouldn't /really/ happen normally, but it turns out being the IBSS master node on FreeBSD doesn't quite setup 11n right, so negotiating A-MPDU TX fails.
* [net80211] unconditionally do A-MPDU RX aging.adrian2016-04-101-12/+2
| | | | | | | | | | | | | It's 2016 and vendors (including us!) still have 802.11n TX/RX sequence handling bugs. It's suboptimal, but I'd rather see us default to handling things in a sensible way. So, just delete the #ifdef'ed code for now. I'll leave the option in so it doesn't break existing configurations. This all started because I've started getting reports about urtwn not working after I enabled 802.11n support, and it's because the ARM kernel configs don't include A-MPDU RX aging.
* [net80211] log the node pointer when calling ht node init/cleanupadrian2016-04-091-6/+7
| | | | | | | | This makes it easier to track which node is having what done do it during normal use. This is likely the eighth time I've done this since I started doing net80211 development, so I think it's about time I just committed it.
* [net80211] add back in the ff/superg node init call that I accidentallyadrian2016-04-091-0/+8
| | | | | | deleted. It's mostly a no-op right now, so it shouldn't have changed behaviour.
* Try to unbreak the build: the 'vap' variable is only used if ieee80211bz2016-04-091-1/+1
| | | | debugging compile is on.
* [net80211] print out the channel type (eg a, b, g, n) when creatingadrian2016-04-091-2/+3
| | | | an IBSS network.
* [net8021] Pull out the ibss check code into a public function.adrian2016-04-092-15/+30
| | | | | | | | | | | | The ath(4) driver now sees beacons and management frames for different BSSIDs in IBSS mode, which is a problem when you're in a very busy IBSS environment. So, expose this function so drivers can use it to check if the current RX node is actually for a BSS we need to pay attention to or not. PR: kern/208644 Sponsored by: Eva Automation. Inc.
* [net80211] revert part of r282405 in order to restore IBSS behaviour.adrian2016-04-091-4/+1
| | | | | | | | | | | | | | | | This prevents nodes being created for peers on BSSes that are not our own. (Ie, same channel, IBSS, but different BSS.) The "IBSS merge" thing was fixed by me enabling "see all beacons" in the ath(4) driver a few months ago. Trouble is, we now need the filtering again. Tested: * ath(4), IBSS, on a very busy IBSS channel with lots (> 15) IBSS networks. PR: kern/208643 Sponsored by: Eva Automation, Inc.
* [net80211] missed commit from last one - always cleanup superg state.adrian2016-04-061-2/+6
|
* [net80211] Initial A-MSDU support for testing / evaluationadrian2016-04-066-72/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A-MSDU is another 11n aggregation mechanism where multiple ethernet frames get LLC encapsulated (so they have a length field), padded, and put in a single MPDU (802.11 MAC frame.) This means it gets sent out as a single frame, with a single seqno, it's acked as one frame, etc. It turns out that, hah, atheros fast frames is almost but not quite like this, so I'm reusing all of the current superg/fast-frames stuff in order to actually transmit A-MSDU. Yes, this means that A-MSDU frames are also only aggregated two at a time, so it's not necessarily a huge win, but it's better than nothing. This doesn't do anything by default - the driver needs to say it does A-MSDU as well as set the AMSDU software TX capability so this code path gets exercised. For now, the only driver that enables this is urtwn. I'll enable it for rsu at some point soon. Tested: * Add an amsdu encap path to aggregate two frames, same as the fast-frames path. * Always do the superg init/teardown and node init/teardown stuff, regardless of whether the nodes are doing fast-frames (the ATH capability stuff.) That way we can reuse it for amsdu. * Don't do AMSDU for multicast/broadcast and EAPOL frames. * If we're doing A-MPDU, then don't bother doing FF/A-MSDU. We can likely do both together, but I don't want to change behaviour. * Teach the fast frames approx txtime logic to support the 11n rates. But, since we don't currently have a full "current rate" support, assume it's HT20, long-gi, etc. That way we overshoot on the TX time estimation, so we're always inside the requirements. (And we only aggregate two frames for now, so we're not really going to exceed that.) * Drop the maximum FF age default down to 2ms, otherwise we end up with some very annoyingly large latencies. TODO: * We only aggregate two ethernet frames, so I'm not checking the max A-MSDU size. But when it comes time to support >2 frames, we should obey that. Tested: * urtwn(4)
* [net80211] rename 11n rate macros into a useful spotadrian2016-04-052-1/+9
| | | | | | | | | * begin moving the 11n macros out of ieee80211_phy.c and into a header so they can be used elsewhere. * rename some of them into the IEEE80211_* namespace. * convert HT_RC_2_MCS() to work with three-stream rates.
* [net80211] note that M_FF will soon mean "fast-frames" or "A-MSDU."adrian2016-04-051-1/+1
|
* [net80211] Add a new capability flag to indicate that the stack shouldadrian2016-04-051-0/+1
| | | | | | | | | | do software A-MSDU encapsulation. Right now there's AMSDU TX/RX capability bits and they're mostly unused, however I'd like to maintain those as the general configuration, not also "please software encap AMSDU." For platforms that can do A-MSDU in firmware (iwn, iwm, etc) then their init paths can read this flag to configure A-MSDU.
* net80211: copy MAC address into iv_myaddr[] instead of aliasing it.avos2016-04-052-3/+4
| | | | | | | Since IF_LLADDR() returns a non-constant pointer to the MAC address preserve a copy of it in iv_myaddr. PR: 208505
* [net80211] add amsdu and fast frames encap failure counters in the ioctladrian2016-04-041-1/+4
| | | | | | | definition. The code to set these will come in a subsequent commit (when I start fleshing out A-MSDU support.)
* [net80211] migrate the time_* macros to ieee80211_* namespace.adrian2016-03-308-18/+18
| | | | | | | It turns out that these will clash very annoyingly with the linux macros in the linuxkpi layer, so let the wookie^Wlinux win. The only user that I can find is ath(4), so fix it there too.
* [net80211] Add fields to decode uAPSD fields.adrian2016-03-301-0/+21
| | | | | | | | It turns out that madwifi actually has the basics for uAPSD implemented but it was never ported to FreeBSD. I may eventually port most of the pieces; I'll see how it goes! Obtained from: Madwifi
* net80211: fix panic for DWDS vapsavos2016-03-261-0/+3
| | | | | | | Since r248069, TX IC lock must obtained before calling ieee80211_encap() and/or ieee80211_parent_xmitpkt(). Tested with: Intel 3945BG.
* [net80211] add missing static declarations.adrian2016-03-221-3/+3
| | | | | Submitted by: Sascha Wildner <saw@online.de> Obtained from: dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5)
* net80211: enable software beacon miss timer in SLEEP stateavos2016-03-212-17/+24
| | | | | | | Tested with WUSB54GC, STA mode (w/ power saving enabled) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5545
* net80211: add missing SLEEP -> AUTH state transition for station mode.avos2016-03-211-1/+2
| | | | | Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5269
* [net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164adrian2016-03-191-0/+33
| | | | This .. seems inconsistently transmitted from various vendors.
* [net80211] IE 127 is not MESHEXTCAP, just EXTCAP.adrian2016-03-182-3/+4
| | | | | It's not a mesh extended capabilities; it's just extended capabilities. This is from 802.11-2012 8.4.2.29 (Extended Capabilities element.)
* Add initial 802.11ac IEs and fields.adrian2016-03-181-0/+112
| | | | | | | | | | | This is a subset of what's in the linux 802.11ac implementation. I've verified that the bits that mention an 802.11ac draft are still the same in 802.11ac-2013 and noted it accordingly. This is for the most part one big no-op. Obtained from: 802.11ac-2013.pdf
* [net80211] Add some more missing IEs.adrian2016-03-171-0/+13
| | | | | | There are a /lot/ more missing; I'll chase these down over time. Obtained from: 802.11-2012 standard
* Add initial VHT IE's and action codes.adrian2016-03-161-0/+6
| | | | Yes, there's more to 802.11ac than this.
* [net80211] Begin implementing rate control module stats.adrian2016-03-163-0/+83
| | | | | | | | | | | | * Implement a new ratectl method, which defaults to returning nothing; * Add a top level sysctl (net.wlan.X.rate_stats) to extract it; * Add ratectl info for the 'amrr' module. Tested: * urtwn(4), STA mode Differential Revision: https://reviews.freebsd.org/D5630
* class -> i_class. Thanks C++.adrian2016-03-141-1/+1
| | | | Noticed by: jbeich@
* [net80211] handle unlisted information elements.adrian2016-03-142-0/+79
| | | | | | | This displays the IE names in ifconfig but it doesn't yet decode things. Submitted by: Idwer Vollering <vidwer@gmail.com> Differential Revision: https://reviews.freebsd.org/D3782
* net80211: fix possible overflow in IEEE80211_TU_TO_TICKS()avos2016-03-041-1/+1
| | | | | | | | For hz=1000 any number, greater than 4194 causes integer overflow; this change casts the number to uint64_t before operating with it. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5268
* net80211: drop <smth> -> INIT state transition warning (STA mode only)avos2016-03-031-1/+1
| | | | | | | | This warning is irrelevant, since user can execute 'ifconfig wlan0 down' (or turn off card via rfkill switch) at any time. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5511
* Use m_catpkt(9) to avoid a possible use-after-free in ieee80211_defrag().markj2016-03-021-3/+1
| | | | | | | | | | m is not guaranteed to be valid after m_cat() returns. The effects of this are most noticeable when INVARIANTS is enabled, since m's header length field is given a value of 0xdeadc0de by the trash dtor. Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5497
* net80211: eliminate copy-paste nearby ieee80211_check_rxseq()avos2016-03-016-93/+26
| | | | | Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4043
* Fix !IEEE80211_DEBUG build.glebius2016-02-291-6/+6
|
* net80211: do not enforce promiscuous mode for AP scanavos2016-02-291-3/+0
| | | | | | | | | | | | | Drivers should set their own filters via ic_scan_start()/ic_scan_end() callbacks; and we don't need frames other than beacons or probe responses. (Note: this was a noop since r287197 due to promiscuous mode with bridge workaround) Tested with Intel 3945BG, RTL8188EU and WUSB54GC in HOSTAP mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5474
* net80211: fix scanning after D5145 (PR 197498 related)avos2016-02-291-6/+23
| | | | | | | | | | | | | | | | | | | - In case, when we are doing <smth> -> INIT (FEXT_REINIT) -> <smth2> state transition, cancel_scan() may be called in the first transition. Reenqueue second state transition, so things will be executed in order. - Discard any AUTH+ state transition request when INIT -> SCAN transition is not done. - Allow to track discarded state transitions via 'state' debugging category. Tested with: * RTL8188EU, HOSTAP mode. * RTL8188CUS, STA mode. * Intel 3945BG, IBSS and STA modes. PR: 197498 Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5482
* net80211: cleanup ieee80211_scan_sw.cavos2016-02-291-22/+22
| | | | | | | | Make it look more consistently. No functional changes. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5152
* net80211: refactor scan_signal()avos2016-02-291-26/+28
| | | | | | | | | | | | - Pass scan state and additional internal flags as a parameters. - Add locked version. Tested with: * Intel 3945BG, STA mode. * RTL8188EU, STA mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5148
* net80211: wakeup scan_start() task when null data frame was actuallyavos2016-02-292-6/+16
| | | | | | | | | | | | | | | transmitted - Use M_TXCB mechanism to report about null data frame transmission. - Increase timeout from 1 to 10 ms (the previous one may be not enough for non-empty queue). Tested with: * Intel 3945BG, STA mode. * RTL8188CUS, STA mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5147
* net80211: split scan_task() (#3) (into scan_start() andavos2016-02-291-92/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | scan_curchan_task() functions) (This part should fix the problem, described in https://lists.freebsd.org/pipermail/freebsd-wireless/2016-January/006420.html) - Rename ss_scan_task into ss_scan_start (better describes it's current purpose) - Utilize taskqueue_*_timeout() functions instead of current mechanism: * reschedule scan_curchan_task() via taskqueue_enqueue_timeout() for every 'maxdwell' msecs (will replace infinite loop + sleeping for 'maxdwell' period via cv_wait()); * rerun the task immediately when an external event occurs (instead of waking it up via cv_signal()) Also, use mtx_sleep() to wait for null frame transmission (allows to drop conditional variable). Tested with: * Intel 3945BG, STA mode; * RTL8188EU, STA mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5145
* net80211: split scan_task() (#2) (add scan_end() function)avos2016-02-291-2/+15
| | | | | | | | | Tested with: * Intel 3945BG, STA mode. * RTL8188EU, IBSS mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5143
* net80211: split scan_task() (#1) (replace 'done' label with scan_done()avos2016-02-291-8/+26
| | | | | | | | | | | function) Tested with: * Intel 3945BG, STA mode. * RTL8188EU, IBSS mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5142
* net80211: utilize ss_scanend variable from scan_state structureavos2016-02-291-8/+9
| | | | | Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5140
* net80211: reduce code verbosity in scan_task() (ieee80211_scan_sw.c)avos2016-02-291-19/+18
| | | | | | | Add local *ss_priv variable (no functional changes) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5139
* net80211: reduce code duplication between ieee80211_swscan_cancel_scan()avos2016-02-291-32/+14
| | | | | | | | | | | and ieee80211_swscan_cancel_anyscan() Tested with: * Intel 3945BG, STA mode. * RTL8188EU, HOSTAP mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5133
* net80211: fix a comment for TX lockavos2016-02-281-1/+1
| | | | | Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5476
* net80211: remove redundant locking.avos2016-02-281-4/+4
| | | | | | | | | | | All callers of ieee80211_promisc()/ieee80211_allmulti() (ieee80211_vap_detach(), ieee80211_ioctl(), ap_start() and ap_end()) already hold the com_lock while calling them. Tested with RTL8188EU, STA mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5475
* net80211: fix 'taskqueue_drain with non-sleepable locks held' warningavos2016-02-281-3/+9
| | | | | | | Do not run ieee80211_waitfor_parent() when it's not needed. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5446
* net80211: fix 'uma_zalloc_arg: zone "32" with non-sleepable locks held'avos2016-02-261-6/+9
| | | | | | | | when 'sysctl net.wlan.devices' is executed. PR: 207497 Submitted by: glebius Approved by: adrian (mentor)
* net80211: fix TIM cleanup.avos2016-02-231-1/+0
| | | | | | | | | | | | Remove duplicate 'ni->ni_associd = 0' assignment from ieee80211_node_leave(), since it breaks iv_set_tim() in ic->ic_node_cleanup() (associd is cleared right after this call). Tested with RTL8188EU (HOSTAP mode) and WUSB54GC (STA mode, with powersaving enabled). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5398
OpenPOWER on IntegriCloud