summaryrefslogtreecommitdiffstats
path: root/sys/net80211
Commit message (Collapse)AuthorAgeFilesLines
* net80211 + drivers: hide size of 'bands' array behind a macro.avos2016-04-291-0/+1
| | | | | Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'. No functional changes.
* net80211: provide a set of ieee80211_add_channel*() functionsavos2016-04-293-92/+292
| | | | | | | | | | | | | | | | | | | This change adds few methods for net80211 channel table setup: - ieee80211_add_channel() - ieee80211_add_channel_ht40() (primarily for drivers, that parse EEPROM to get channel list - they will allow to hide implementation details). - ieee80211_add_channel_list_2ghz() - ieee80211_add_channel_list_5ghz() (mostly as a replacement for ieee80211_init_channels() - they will allow to specify non-default channel list; may be used in ic_getradiocaps()). Tested with wpi(4) (add_channel) and rum(4) (add_channel_list_2ghz). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6124
* [net80211] fix indenting.adrian2016-04-281-2/+2
| | | | Sponsored by: Eva Automation, Inc.
* [net80211] handle action frames in adhoc mode from the node that created the ↵adrian2016-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | BSS. We don't have a separate bss node; instead we dup the first node we saw and turn that into the BSS node. This means that action frames from that node would be rejected. So, check that the node is the bss node /and/ the MAC doesn't match ni_macaddr. That's the "right" way for now to verify it's an unknown node. This fixes handling action frames in adhoc mode, which includes negotiating 11n aggregation via ADDBA/DELBA. This by itself isn't enough to correctly create 11n adhoc networks; but it is required for aggregation to be negotiated. Tested: * AR9380, 11n adhoc mode * broadcom 11ac adhoc (vendor platform) Sponsored by: Eva Automation, Inc.
* [net80211] add the STBC ioctl support.adrian2016-04-261-0/+32
| | | | This adds configurable STBC TX and RX support.
* [net80211] add STBC capability flags to iv_flags_ht.adrian2016-04-261-0/+12
| | | | | | | | | | | | | This is in preparation for exposing configuring STBC flags up to ifconfig so STBC TX/RX can be configured at runtime. * Set the FHT_STBC flags for TX/RX if the HT capabilitiex exist * Clear the RX STBC HT capability flag when creating a HTCAP IE, so we only announce it if it's configured in the FHT flags. Tested: * AR9331 (carambola2), AP/STA modes
* [net80211] add an ioctl for LDPC configuration.adrian2016-04-261-0/+1
|
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-1/+1
| | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
* net80211: refresh comments for ieee80211_scan_next() andavos2016-04-212-10/+14
| | | | | | | | | ieee80211_scan_done(). Refresh comments that reference scan_next() method (does not exist since r191746) + fix spelling of 'current'. Differential Revision: https://reviews.freebsd.org/D5137
* net80211: enable promiscuous mode state change for non-monitor/ahdemo modesavos2016-04-212-14/+20
| | | | | | | | | | | | | | | - Allow to enable/disable promiscuous mode when: * interface is not a member of bridge, or; * request was issued by user (ifconfig wlan0 promisc), or; * interface is in MONITOR or AHDEMO mode. - Drop local workarounds in mwl(4) and malo(4). Tested with: - Intel 3945BG, STA mode; - RTL8188CUS, MONITOR mode; Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5472
* net80211: hide subtype mask & shift in function call.avos2016-04-2012-38/+33
| | | | | | | | | | Hide subtype mask/shift (which is used for index calculation in ieee80211_mgt_subtype_name[] array) in function call. Tested with RTL8188CUS, STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D5369
* net80211: provide descriptions for reason codesavos2016-04-208-18/+163
| | | | | | | | | Add text description for deauth/disassoc/etc reason codes in addition to 'reason: <number>' string. Reviewed by: adrian Obtained from: IEEE Std 802.11-2012, 8.4.1.7 "Reason Code field" Differential Revision: https://reviews.freebsd.org/D5367
* net80211 (trivial, noop): remove duplicate check from hostap_recv_mgmt()avos2016-04-201-5/+6
| | | | Differential Revision: https://reviews.freebsd.org/D5483
* net80211: replace internal LE_READ_*/LE_WRITE_* macro with systemavos2016-04-2010-102/+66
| | | | | | | | | | | | | | | | | le*dec / le*enc functions. Replace net80211 specific macros with system-wide bytestream encoding/decoding functions: - LE_READ_2 -> le16dec - LE_READ_4 -> le32dec - LE_WRITE_2 -> le16enc - LE_WRITE_4 -> le32enc + drop ieee80211_input.h include, where it was included for these operations only. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6030
* net80211: do not reschedule scan_curchan_task() if the scan was canceled.avos2016-04-191-1/+4
| | | | | | This should fix possible use-after-free in the scheduled task. PR: 208605
* [net80211] put in a comment about the not-quite-correctness of A-MPDU ↵adrian2016-04-181-0/+8
| | | | | | | | | | | | | | | | | parameters. Although we correctly (now!) calculate the right A-MPDU parameters, the ioctl() has some faulty logic for choosing which to display. The BSS params are what were advertised to us, and we would have chosen the lower of theirs/ours when advertising the HT bits back at them. So, we /should/ track and fix that so we display the correct A-MPDU density and size. However, since I'm a forgetful type, and I don't want to have to re-learn that this is wrong, drop in a comment so I or someone else fixes it. Or, when I discover this again in 4 years, I don't have to go digging too much to remember.
* [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
|
OpenPOWER on IntegriCloud