OpenBSD CVS

CVS log for src/sys/net80211/ieee80211_node.h


[BACK] Up to [local] / src / sys / net80211

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.94 / (download) - annotate - [select for diffs], Sun Mar 20 12:01:58 2022 UTC (2 years, 2 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.93: +2 -1 lines
Diff to previous 1.93 (colored)

Introduce an alternative mechanism for wifi drivers to communicate
the channel on which a frame was received.

ieee80211_inputm() was expecting that ic->ic_bss->ni_chan would correspond
to the channel which is currently being scanned. This dates back to older
devices which are manually tuned to the next channel by the driver during
SCAN->SCAN state transitions.

However, this approach is very awkward for drivers which scan across a
whole range of channels in firmware. Such drivers had an ugly workaround
in place which tweaked ni_chan for each received frame.

Introduce a channel number field in the Rx info struct which drivers
can use to indicate the channel on which a frame was received.
If this field is set, net80211 will use it instead of using the current
channel of ic_bss. Use this new mechanism in all affected drivers.

Tested by jmc@, sthen@, and myself on iwm(4) and iwx(4).
Changes to iwn(4) and bwfm(4) are the same mechanical changes to get rid
of the ni_chan tweak, and are therefore expected to work.

ok sthen@ dlg@

Revision 1.93 / (download) - annotate - [select for diffs], Sat Mar 19 10:25:09 2022 UTC (2 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.92: +27 -2 lines
Diff to previous 1.92 (colored)

Add 11ac/VHT Tx rate adaptation support to net80211.

Based on our existing RA module for 11n.
The main difference is in dealing with 11ac-specific ratesets.
Tx rate selection heuristics remain identical.

Only supports 80MHz channels, for now. 160MHz is left for future work.

ok sthen@

Revision 1.92 / (download) - annotate - [select for diffs], Mon Mar 14 15:07:24 2022 UTC (2 years, 2 months ago) by stsp
Branch: MAIN
Changes since 1.91: +80 -1 lines
Diff to previous 1.91 (colored)

Add initial 802.11ac (VHT) support to net80211.

Add VHT capability and operation IE definitions to ieee80211.h.
Introduce channel flags to identify 80MHz and 160MHz capable channels.

Parse VHT IEs in beacons, announce the driver's VHT capabilities in
probe requests and assoc requests, and hop into 11ac mode after
association to the AP if possible.

Enable VHT by default if the driver announces support for it.

ok claudio@

Revision 1.91 / (download) - annotate - [select for diffs], Wed Jan 12 08:29:27 2022 UTC (2 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.90: +1 -5 lines
Diff to previous 1.90 (colored)

Remove ieee80211_find_node_for_beacon().

The original purpose of ieee80211_find_node_for_beacon() was to avoid
storing duplicate nodes with the same source MAC address in a hash table.
Later on, our node table data structure was changed from a hash table
to an RB tree. The RB tree can only store a single node per MAC address.
However, find_node_for_beacon() was kept regardless, now documented to
serve a different purpose.

Its new purpose is to tell apart different nodes which happen to use
the same MAC address and hence cannot both be stored in the RB tree.
The idea is to filter such duplicate nodes out during a scan. But colliding
nodes are told apart by RSSI and channel, and either may change over time.
So this does not really prevent duplicate MAC addresses from causing issues.

The code which decides which node is "better" can erroneously match an
AP against itself, in case the AP uses a hidden SSID. This caused
workarounds for hidden SSID to pile up over time.
Just a bit further down, the code looks up the same node again and
performs all of the intended node state updates. Simply skipping the
ieee80211_find_node_for_beacon() check makes such state updates work.

ok tobhe@

Revision 1.90 / (download) - annotate - [select for diffs], Fri Dec 3 12:41:36 2021 UTC (2 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.89: +3 -1 lines
Diff to previous 1.89 (colored)

Introduce an optional driver-specific bgscan_done() handler which
allows the driver to take control of the roaming teardown sequence.
This handler allows drivers to ensure that race conditions between
firmware state and net80211 state are avoided, and will be used by
the iwm(4) and iwx(4) drivers soon.

Split the existing roaming teardown sequence into two steps, one step
for tearing down Tx block ack sessions which sends a DELBA frame, and a
second step for flushing Tx rings followed by sending a DEAUTH frame.
We used to queue both frames, expecting to switch APs once both were sent.
Now we effectively expect everything to be sent before we queue a final
DEAUTH frame, and wait for just this frame to be sent before switching.
This already made issues on iwm/iwx less frequent but by itself this was
not enough to close all races for those drivers. It should however help
when adding background scan support to a non-firmware device driver.

Tested, with driver patches:
iwm 8265: Aaron Poffenberger, stsp
iwm 9260: florian
iwm 9560: sthen
iwx ax200: jmc, stsp

Revision 1.89 / (download) - annotate - [select for diffs], Mon Oct 11 09:01:06 2021 UTC (2 years, 8 months ago) by stsp
Branch: MAIN
Changes since 1.88: +20 -2 lines
Diff to previous 1.88 (colored)

Add support for 40MHz channels to net80211 RA.

For the moment we use either the 40MHz rate set or the 20 MHz one,
depending on whether our peer supports 40MHz channels.
If this turns out to be suboptimal we could probe the 40MHz and 20MHz
rate sets separately to detect which one works better.

The same applies to use of the short guard interval (SGI), which is
either always on or off at the moment. Again, probing for this could
be added later if needed.

Revision 1.88 / (download) - annotate - [select for diffs], Sun Apr 25 15:32:21 2021 UTC (3 years, 1 month ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.87: +3 -1 lines
Diff to previous 1.87 (colored)

Implement support for Rx aggregation offload in iwm(9) and iwx(4), and
re-enable de-aggregation of A-MSDUs in net80211 for all drivers capable
of 11n mode. This can provide improved Rx performance if the access point
supports transmission of A-MSDUs nested in A-MDPUs.

iwm(9) 9k and iwx(4) devices de-aggregate A-MSDUs in hardware.
Neither our drivers nor the net80211 stack were prepared to handle this.

Add two Rx-info flags which drivers can use to avoid having subframes which
arrived in the same A-MSDU rejected as duplicates in the net80211 input layer:
IEEE80211_RXI_HWDEC_SAME_PN allows the same CCMP packet number for a series
of subsequent frames. IEEE80211_RXI_SAME_SEQ allows the same 802.11 frame
header sequence number for a series of subsequent of frames.

Handle A-MPDU reordering on iwm 9k and iwx devices, based on code from iwlwifi.
Rx block ack window information is provided by firmware. So far this info was
ignored by drivers and reordering of A-MPDU subframes happened twice: Once in
firmware, and again in net80211.

Tested:
iwm 7260: bcallah, dv
iwm 7265: mpi, trondd, Matthias Schmidt
iwm 8260: bket, Marcus MERIGHI
iwm 8265: stsp, tracey, Uwe Werler
iwm 9260: phessler, matthieu
iwm 9560: stsp, Uwe Werler
iwx ax200: jmc, stsp
iwx ax201: stsp

Revision 1.87 / (download) - annotate - [select for diffs], Tue Jul 21 08:38:59 2020 UTC (3 years, 10 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.86: +8 -1 lines
Diff to previous 1.86 (colored)

Improve processing of lost frames during 802.11 Rx aggregation.

Make ieee80211_input_ba() skip one missing frame at the head of the Rx block
ack (BA) window once the rest of the window has filled up with pending frames.
This avoids having to wait for the BA window gap timeout handler to run in
order to make progress in such situations.

Simplify the BA gap timeout handler by deferring the actual flushing of the
BA window buffer to the regular input path. The timeout handler now simply
advances the BA window across any missing frames at the head of the window,
and if_input() is no longer called from the context of this timeout handler.
The window will be flushed once another frame arrives.

Packet loss under streamy traffic conditions and during Rx bursts is reduced.
Much less stuttering, more stable tcpbench, and easier flight in Minecraft.

tested by phessler@, Martin Vahlensieck, jmc@, Uwe Werler, and myself

Revision 1.86 / (download) - annotate - [select for diffs], Sun May 31 09:11:12 2020 UTC (4 years ago) by stsp
Branch: MAIN
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

Typo in WPA supplicant state machine: RNSA_SUPP_PTKDONE -> RSNA_SUPP_PTKDONE

Revision 1.85 / (download) - annotate - [select for diffs], Wed Jan 15 09:34:27 2020 UTC (4 years, 4 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.84: +2 -1 lines
Diff to previous 1.84 (colored)

If join is connected to an AP, remove the node from the cache so we properly
reconnect to the AP

OK stsp@

Revision 1.84 / (download) - annotate - [select for diffs], Sun Dec 29 13:49:22 2019 UTC (4 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

increase net80211's node cache size; now we can see all APs at 36c3
ok phessler benno

Revision 1.83 / (download) - annotate - [select for diffs], Mon Sep 2 12:54:21 2019 UTC (4 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.82: +12 -3 lines
Diff to previous 1.82 (colored)

Make net80211 expose reasons for association failures to userland and have
ifconfig display them in 'scan' output and on the ieee80211 status line if
the failure is applicable to an already selected AP (e.g. wrong WPA key).

This will hopefully reduce the amount of help requests for what often
turn out to be trivial misconfiguration issues that were previously
hard to diagnose without debug mode.

ifconfig must be recompiled with the new ieee80211_ioctl.h to stay in
sync with the kernel. A full 'make build' will do the right thing!

Very helpful input by mpi@ and deraadt@

Revision 1.82 / (download) - annotate - [select for diffs], Tue Aug 27 14:57:48 2019 UTC (4 years, 9 months ago) by stsp
Branch: MAIN
Changes since 1.81: +3 -1 lines
Diff to previous 1.81 (colored)

Keep ieee80211_node structures cached across scans, rather than
wiping the entire cache every time a scan is triggered.

This has benefits for userland programs trying to look at scan results,
and for drivers which don't get a full view from hardware on every scan.

Nodes will still be evicted from the cache in one of several ways:

Add a new way of timing out inactive nodes which don't send a beacon
within 10 scan iterations, for client mode only. This should get rid
of stale APs if we're scanning for some time in a changing environment.

If we fail to associate a few times, the corresponding node is removed.

If net80211 transitions back to INIT state (e.g. because of a
user-initiated configuration change) all nodes are removed.

When a background scan starts all nodes will be removed. This could be
revisited later but has been intentionally left as-is for now.

Tested by myself, jmc@, benno@, procter@ on iwm(4), athn(4) and ral(4).

Revision 1.81 / (download) - annotate - [select for diffs], Mon Jul 29 10:50:09 2019 UTC (4 years, 10 months ago) by stsp
Branch: MAIN
Changes since 1.80: +11 -1 lines
Diff to previous 1.80 (colored)

Add support for 802.11n Tx aggregation to net80211 and the iwn(4) driver.

In particular, add Tx block ack session management to net80211, with
enough funcionality to support Tx aggregation on devices which perform
A-MPDU subframe scheduling in firmware.
Make use of the iwn(4) firmware Tx scheduler to build A-MPDUs.

net80211's QoS support code is now enabled and used by Tx aggregation.

A-MSDU frames inside A-MPDUs have been tested and work in principle.
For now, this feature is disabled because unfair TCP connection sharing
was observed during testing, where bursts of TCP Ack frames for a single
tcpbench(1) connection arriving in A-MSDUs made other TCP connections stall.
Switch off support for A-MSDUs inside A-MPDUs on the Rx side as well.

Tested on iwn chipsets 1000, 4965, 5100, 5300, 2200, 6200, 6205, 6300
(committed version of tested diff has all debug printfs removed)
tests/ok benno kmos mlarkin kevlo

Revision 1.80 / (download) - annotate - [select for diffs], Fri Mar 1 08:13:11 2019 UTC (5 years, 3 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.79: +5 -3 lines
Diff to previous 1.79 (colored)

Improve handling of HT protection for 'mode 11n' hostap.

Consider the mere presence of HTCAP IEs as indicator of 11n support,
rather than checking advertised Rx MCS. Fixes some devices being
misclassified as 11a/g, causing HT protection to be enabled even
though it is not needed.

Use CTS-to-self frames for HT protection instead of RTS/CTS.

These changes make my athn(4) AR9280 hostap perform much better.

ok phessler@

Revision 1.79 / (download) - annotate - [select for diffs], Tue Feb 19 08:12:30 2019 UTC (5 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.78: +34 -2 lines
Diff to previous 1.78 (colored)

Make ifconfig(8) display whether bwfm(4) firmware is using 802.11ac.
ok patrick@ mpi@

Revision 1.78 / (download) - annotate - [select for diffs], Wed Jan 23 10:08:49 2019 UTC (5 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.77: +56 -1 lines
Diff to previous 1.77 (colored)

Move 802.11n rateset definitions out of MiRA and make them available to
net80211 and drivers in general. Add ratesets for 'short guard interval'
(SGI) rates, and add SGI support to MiRA. SGI is currently only used by
iwm(4), and of course internally by bwfm(4) firmware.
Ratesets for 11n 40 MHz channels and 11ac will come later.
ok mpi@ phessler@

Revision 1.77 / (download) - annotate - [select for diffs], Mon Aug 13 15:19:52 2018 UTC (5 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.76: +4 -1 lines
Diff to previous 1.76 (colored)

Add support for band-steering access points to net80211.

Some access points have a feature called "band steering" where they
will try to push clients from 2 GHz channels to 5 GHz channels.
If a client sends probe-requests on both 2 GHz and 5GHz channels, and
then attempts to authenticate on a 2 GHz channel, such APs will deny
authentication and hope that the client will come back on a 5 GHz channel.

So if we fail to AUTH for any reason, and if there is a different
AP with the same ESSID that we haven't tried yet, try that AP next.
Keep trying until no APs are left, and only then continue scanning.

APs with support for this feature were provided by Mischa Peters.

ok phessler@ mpi@

Revision 1.76 / (download) - annotate - [select for diffs], Tue Aug 7 18:13:14 2018 UTC (5 years, 10 months ago) by stsp
Branch: MAIN
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

Ignore basic MCS set information found in association responses.

Some APs (Aruba 105) send a bogus basic MCS set in assoc responses
which prevents us from enabling 11n support with those APs, while
these APs still behave as if were were an 11n client which renders
the association unusable.

The basic MSC set is already provided in beacons anyway, and the
802.11 2012 standard says the basic MSC set is reserved in frames
other than beacons (see Table 8-130).

ok mpi@

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jul 11 20:18:09 2018 UTC (5 years, 11 months ago) by phessler
Branch: MAIN
Changes since 1.74: +15 -1 lines
Diff to previous 1.74 (colored)

Introduce 'auto-join' to the wifi 802.11 stack.

This allows a system to remember which ESSIDs it wants to connect to, any
relevant security configuration, and switch to it when the network we are
currently connected to is no longer available.

Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions.

example hostname.if:
join home wpakey password
join work wpakey mekmitasdigoat
join open-lounge
join cafe wpakey cafe2018
join "wepnetwork" nwkey "12345"
dhcp
inet6 autoconf
up

OK stsp@ reyk@
and enthusiasm from every hackroom I've been in for the last 3 years

Revision 1.74 / (download) - annotate - [select for diffs], Sat Apr 28 14:49:07 2018 UTC (6 years, 1 month ago) by stsp
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

When starting a background scan, free the nodes table to ensure we
get an up-to-date view of APs around us. In particular, we need to
kick out the AP we are associated to. Otherwise, our current AP might
stay cached if it is turned off while we are scanning, and we could
end up picking a now non-existent but "good looking" AP over and over.

found with and ok phessler@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Feb 6 22:17:03 2018 UTC (6 years, 4 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.72: +5 -5 lines
Diff to previous 1.72 (colored)

convert __inline to inline

no binary change on amd64

Revision 1.72 / (download) - annotate - [select for diffs], Tue Feb 6 22:14:52 2018 UTC (6 years, 4 months ago) by phessler
Branch: MAIN
Changes since 1.71: +12 -1 lines
Diff to previous 1.71 (colored)

convert the test if a node support HT (aka, 11n) into an inline function,
instead of testing some un-obvious bitfield

OK stsp@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Feb 6 09:04:45 2018 UTC (6 years, 4 months ago) by phessler
Branch: MAIN
Changes since 1.70: +34 -37 lines
Diff to previous 1.70 (colored)

remove extern from function prototypes, remove some variable names, and a
left-over kernel malloc feature we don't use.

OK deraadt@

Revision 1.70 / (download) - annotate - [select for diffs], Fri Dec 8 21:16:01 2017 UTC (6 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.69: +7 -1 lines
Diff to previous 1.69 (colored)

Add support for background scanning to net80211 and iwm(4).

The iwm(4) driver will now roam between access points which share an SSID.
Use 'ifconfig iwm0 debug' and 'tail -f /var/log/messages' to watch it do so.

Tested by several people in various iterations.
As usual, let me know if you run into issues.

ok phessler deraadt

Revision 1.60.2.2 / (download) - annotate - [select for diffs], Wed Aug 30 15:08:46 2017 UTC (6 years, 9 months ago) by stsp
Branch: OPENBSD_6_0
Changes since 1.60.2.1: +2 -1 lines
Diff to previous 1.60.2.1 (colored) to branchpoint 1.60 (colored) next main 1.61 (colored)

MFC:
Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

Clear WPA group keys from memory before initiating a key exchange
with an access point. Prevents false positive 'reused group key'
warnings in dmesg when re-associating to the same access point.

(OpenBSD 6.0 errata 041, August 30, 2017)

Revision 1.68.4.1 / (download) - annotate - [select for diffs], Wed Aug 30 15:08:30 2017 UTC (6 years, 9 months ago) by stsp
Branch: OPENBSD_6_1
Changes since 1.68: +2 -1 lines
Diff to previous 1.68 (colored) next main 1.69 (colored)

MFC:
Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

Clear WPA group keys from memory before initiating a key exchange
with an access point. Prevents false positive 'reused group key'
warnings in dmesg when re-associating to the same access point.

(OpenBSD 6.1 errata 027, August 30, 2017)

Revision 1.69 / (download) - annotate - [select for diffs], Thu Aug 17 06:01:05 2017 UTC (6 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.68: +2 -1 lines
Diff to previous 1.68 (colored)

Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

There has been increased public scrutiny of WPA's security recently, so
I am curious to see if anyone is attempting replay attacks in the wild.

ok deraadt

Revision 1.68 / (download) - annotate - [select for diffs], Sun Mar 12 03:13:50 2017 UTC (7 years, 3 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE
Branch point for: OPENBSD_6_1
Changes since 1.67: +3 -1 lines
Diff to previous 1.67 (colored)

Introduce separate fields for supported WPA protocols and AKMs in struct
ieee80211_node. Pass these fields to 'ifconfig scan' instead of giving it
currently configured/enabled settings.
Fixes display of AP WPA capabilities in 'ifconfig scan' while the wifi
interface is not configured to use WPA (my previous commit attempted to
fix the same problem but didn't make it work in all cases).
ok tb@

Revision 1.67 / (download) - annotate - [select for diffs], Sat Mar 4 12:44:27 2017 UTC (7 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.66: +2 -3 lines
Diff to previous 1.66 (colored)

In 11n hostap mode, dynamically adjust HT protection settings based on
the presence of non-HT nodes in the node cache.
OpenBSD 11n APs will now disable HT protection if it is not necessary.
ok mpi@

Revision 1.60.2.1 / (download) - annotate - [select for diffs], Wed Mar 1 20:57:51 2017 UTC (7 years, 3 months ago) by benno
Branch: OPENBSD_6_0
Changes since 1.60: +10 -1 lines
Diff to previous 1.60 (colored)

MFC: Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.
(OpenBSD 5.9 errata 35, Mar 1, 2017)
by and ok stsp@

Revision 1.59.2.1 / (download) - annotate - [select for diffs], Wed Mar 1 20:57:29 2017 UTC (7 years, 3 months ago) by benno
Branch: OPENBSD_5_9
Changes since 1.59: +10 -1 lines
Diff to previous 1.59 (colored) next main 1.60 (colored)

MFC: Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.
(OpenBSD 6.0 errata 18, Mar 1, 2017)
by and ok stsp@

Revision 1.66 / (download) - annotate - [select for diffs], Wed Mar 1 19:28:48 2017 UTC (7 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.65: +10 -1 lines
Diff to previous 1.65 (colored)

Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.

Revision 1.65 / (download) - annotate - [select for diffs], Thu Feb 2 16:47:53 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.64: +6 -2 lines
Diff to previous 1.64 (colored)

Remove global counters from struct ieee80211com which track the number of
associated nodes with particular properties: 11b-only ("non-ERP") nodes,
nodes requiring long slot time, nodes using WPA, nodes not supporting 11n,
nodes currently dozing in powersave state, and nodes with a pending group
key update confirmation.

These counters weren't properly maintained.
There are bugs in the stack where these counters and actual node properties
got out of sync. This is exposed by panics which are supposed to help us
catch such bugs. But these panics don't provide real clues.

Instead of maintaining global counters forcing us to hunt refcounting bugs,
count nodes with the property in question on demand, by iterating over all
nodes and checking their state.
This is cheap since we'll never have more than 100 nodes cached, and none of
the cases where we need such information is in a performance critical path.

Prevents panics in hostap mode reported by Lauri Tirkkonen on bugs@ last
year (https://marc.info/?l=openbsd-bugs&m=147513817930489&w=2) and also
encountered by my 11n APs ("panic: bogus non-HT station count 0").

tested by Lauri, tb@, and myself
ok mpi@ tb@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Jan 9 20:18:59 2017 UTC (7 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (colored)

When a HT node leaves or reassociates as a non-HT node,
clear HT capabilities stored in its node cache object.

A node may switch from 11n mode to 11a/b/g mode.
If we don't clear HT capabilities from the cache the node will
be mistaken as 11n-capable after reassociation.

ok phessler@ mpi@

Revision 1.63 / (download) - annotate - [select for diffs], Wed Sep 21 12:21:27 2016 UTC (7 years, 8 months ago) by stsp
Branch: MAIN
Changes since 1.62: +3 -1 lines
Diff to previous 1.62 (colored)

When processing an ADDBA request, iwm(4) runs a task which sends a
command to the firmware and waits for confirmation. This command can
fail and there was no way we could recover from such an error.

Allow drivers to return EBUSY from their ic_ampdu_rx_start() handler to
tell the stack not to send a confirmation just yet. The stack provides
functions which the driver can call to accept or refuse the request.

There is no functional change yet. This just shuffles code around so
drivers may insert themselves into the process.

ok mpi@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Sep 20 13:24:42 2016 UTC (7 years, 8 months ago) by stsp
Branch: MAIN
Changes since 1.61: +3 -2 lines
Diff to previous 1.61 (colored)

Parse the DTIM count and period advertised in beacons and store them
in the node structure. This should be useful for iwm(4) in the future.
ok phessler@

Revision 1.61 / (download) - annotate - [select for diffs], Thu Sep 15 03:32:48 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.60: +4 -4 lines
Diff to previous 1.60 (colored)

move from RB macros to the RBT functions.

shaves about 5k off an amd64 GENERIC.MP kernel

Revision 1.60 / (download) - annotate - [select for diffs], Thu Apr 28 08:18:10 2016 UTC (8 years, 1 month ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE
Branch point for: OPENBSD_6_0
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

Reduce block ack gap timeout to 300 msec in order to reduce Rx latency.
This value seems to be a sweet spot.
testing and ok tb@

Revision 1.59 / (download) - annotate - [select for diffs], Thu Feb 11 17:15:43 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE
Branch point for: OPENBSD_5_9
Changes since 1.58: +4 -4 lines
Diff to previous 1.58 (colored)

Fix whitespace.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Feb 8 01:00:47 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.57: +1 -4 lines
Diff to previous 1.57 (colored)

Stop requiring a BlockAck session timeout (again), and just use it if the AP
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.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Feb 8 00:54:57 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.56: +7 -1 lines
Diff to previous 1.56 (colored)

Work around buggy APs which occasionally emit sequence numbers much higher
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@

Revision 1.56 / (download) - annotate - [select for diffs], Fri Feb 5 16:07:57 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.55: +5 -1 lines
Diff to previous 1.55 (colored)

Store ADDBA request and response parameters in the block ack record of
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

Revision 1.55 / (download) - annotate - [select for diffs], Thu Feb 4 16:23:40 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.54: +4 -1 lines
Diff to previous 1.54 (colored)

Restore the BlockAck session timer. It is still required to work around
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@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Feb 1 18:43:22 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.53: +1 -4 lines
Diff to previous 1.53 (colored)

Stop requiring a BlockAck session timeout. We still honour the timeout if
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@

Revision 1.53 / (download) - annotate - [select for diffs], Mon Jan 25 15:10:37 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

Don't try to interpret htprot data if the last beacon didn't contain such data.
ok mpi@ millert@

Revision 1.52 / (download) - annotate - [select for diffs], Thu Jan 7 23:22:31 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.51: +9 -4 lines
Diff to previous 1.51 (colored)

Make the A-MPDU reordering buffer more resilient against APs which drop
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@

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jan 5 18:41:16 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.50: +1 -5 lines
Diff to previous 1.50 (colored)

Remove the IEEE80211_NO_HT macro. Reduces ifdef spaghetti, enables 11n mode
in bsd.rd, and might uncover some bugs. Suggested by tedu@ and deraadt@.
ok sthen@ jasper@ deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Sat Dec 12 11:25:46 2015 UTC (8 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

Finish support for receiving 11n A-MPDUs.

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@

Revision 1.49 / (download) - annotate - [select for diffs], Sun Nov 15 12:34:07 2015 UTC (8 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)

Expose 11n mode to the ifmedia layer and introduce the concept of MCS.
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

Revision 1.48 / (download) - annotate - [select for diffs], Sun Nov 15 10:07:03 2015 UTC (8 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.47: +26 -1 lines
Diff to previous 1.47 (colored)

Extend struct ieee80211_node with fields for 11n STA HT capabilities and
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

Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 4 12:12:00 2015 UTC (8 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

replace the ifqueues in net80211 with mbuf_queues.

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@

Revision 1.46 / (download) - annotate - [select for diffs], Fri Sep 12 16:02:40 2014 UTC (9 years, 9 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.45: +2 -1 lines
Diff to previous 1.45 (colored)

Remove cached 802.11 nodes in IEEE80211_STA_CACHE state (these are nodes
which have been seen but which haven't otherwise interacted with us), fixing
a problem where old cached nodes are seen when doing a scan.
From Marcin Piotr Pawlowski, feedback stsp@ ok kspillner@ dcoppa@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Mar 20 13:19:06 2014 UTC (10 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.44: +3 -1 lines
Diff to previous 1.44 (colored)

Do not pull <sys/tree.h> unconditionally in <net/if.h>, only the address
tree and the 80211 nodes need it.

ok henning@, mikeb@

Revision 1.44 / (download) - annotate - [select for diffs], Sun Mar 24 17:01:23 2013 UTC (11 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

Make ieee80211_set_tim() available from outside of ieee80211_node.c
so drivers like acx(4) can use that function directly instead of
reimplementing the function again. Requested by kettenis@ long time ago.

Revision 1.43 / (download) - annotate - [select for diffs], Wed Nov 7 19:41:25 2012 UTC (11 years, 7 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.42: +14 -9 lines
Diff to previous 1.42 (colored)

Make the ieee80211_node_incref() macro a static inline function, as its
siblings already are. And fix return value of ieee80211_node_decref()
which should be unsigned but was signed.
diff originally from dhill; ok kettenis reyk

Revision 1.42 / (download) - annotate - [select for diffs], Sat Jan 21 19:42:16 2012 UTC (12 years, 4 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored)

Implement missing bits of node inactivity accounting in hostap mode.
Small parts of code for this feature were already present but unused.

A node becomes inactive after not sending or receiving a frame within
5 minutes. Inactive cached nodes (not authenticated or associated) are
automatically cleared from the cache once every hour, making room for
new nodes. If the node cache is full and room must be made for a new node,
clean either a cached node (active or inactive), or an inactive
authenticated or associated node.

Also, do not send de-auth frames to nodes which never authenticated,
and only send a de-auth frame once for a given node.
This part was contributed by Steven Chamberlain, thanks!

Tested by myself, krw@, edd@, Steven Chamberlain, and Markus Schatzl.
ok deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Thu Mar 26 20:38:29 2009 UTC (15 years, 2 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.40: +1 -3 lines
Diff to previous 1.40 (colored)

move #define IEEE80211_NO_HT under #ifdef SMALL_KERNEL instead
of defining it unconditionnaly.
although the HT code is not ready yet, making it compile on
GENERIC kernels will help catch regressions/bugs if any.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Mar 26 20:34:54 2009 UTC (15 years, 2 months ago) by damien
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

sync with 802.11w draft 8.0.
the SA Query Transaction Identifier field is now a 16-bit non-negative
counter value instead of a 128-bit random value.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jan 28 18:55:18 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.38: +20 -9 lines
Diff to previous 1.38 (colored)

Block Ack agreements are unidirectional.
Maintain state for both originator and recipient roles separately.
Do not allocate receive reordering buffer in addba_request().
Test the "initiator" bit in incoming DELBA frames and set it appropriately
in outgoing DELBA frames.
Separate callbacks for Tx/Rx too.

no binary change since all this is #ifdef'ed out.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Jan 28 17:15:21 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.37: +6 -6 lines
Diff to previous 1.37 (colored)

In ieee80211_find_node(), roll our own RB_FIND() based on the key (macaddr)
instead of resorting to horrid hacks/casts.
Restore the ieee80211_node structure back to its original state.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jan 26 21:55:58 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.36: +6 -6 lines
Diff to previous 1.36 (colored)

move ni_macaddr field at the top of the ieee80211_node structure.
this way we can avoid putting a full node structure (which is huge)
on the stack in ieee80211_find_node().
this is a bit tricky but the RB_FIND macro wants an "elem" structure,
not a field of "elem".

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jan 26 21:28:55 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (colored)

remove ni_ba field from ieee80211_node structure as it is not used yet.
this reduces memory footprint and avoids a stack usage warning in
ieee80211_find_node() that breaks amd64 build.

pointed out by landry@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jan 26 19:09:41 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.34: +47 -2 lines
Diff to previous 1.34 (colored)

Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:
- implement A-MPDU frames buffering and reordering
- implement A-MSDU decapsulation
- process/send ADDBA Request, ADDBA Response and DELBA action frames
- process Block Ack Request control frames (including MTBAR)
- implement PBAC support (Protected Block Ack)
- add some incomplete HT Capabilities and HT Operation IEs parsing

Add more Management Frame Protection bits based on 802.11w Draft 7.0:
- implement SA Query procedure (both AP and STA)
- cleanup BIP

Fix some bugs:
- fix check for WEP key length that otherwise caused a stack smash in
  ieee80211_wep_encrypt (pointed out by Xavier Santolaria on macppc)
- properly stop EAPOL timeout: fixes a panic that occured in HostAP mode
  when turning the interface down while a 4-way handshake is in progress
  (pointed out by Doughertys)

Did some code cleanup too.

The HT bits are currently not compiled in (IEEE80211_NO_HT is defined)
because they won't be ready until after the next release and I didn't
want to grow the kernel or to inadvertently introduce new bugs.
They are here such that other people can look at the code.
Notice that I had to add an extra parameter to ic_send_mgmt() for
action frames, that is why there are small changes in drivers defining
their own ic_send_mgmt() handler.

Sorry for the not very incremental diff but this has been sitting in
my tree for too long now.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Dec 14 10:17:24 2008 UTC (15 years, 6 months ago) by damien
Branch: MAIN
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

Add an ieee80211_notify_dtim() function that drivers should call after
every DTIM in HostAP mode.
Flushes all group addressed MSDUs buffered at the AP for power management.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Sep 27 15:16:09 2008 UTC (15 years, 8 months ago) by damien
Branch: MAIN
Changes since 1.32: +14 -10 lines
Diff to previous 1.32 (colored)

Initial implementation of PMKSA caching and pre-authentication.
This will be required for future WPA-Enterprise support (802.1X).
Add ieee80211_needs_auth() function (not implemented yet) to
notify the userland 802.1X PACP machine when an 802.1X port
becomes enabled (that is after successfull 802.11 Open System
authentication).
Add SIOCS80211KEYRUN and SIOCS80211KEYAVAIL ioctls so that the
PACP state machine can kick the 802.11 key state machine and
install PMKs obtained from 802.1X (pre-)authentication.

Enable SHA-256 based AKMPs by default while I'm here (TGw).
This uses SHA-256 for key-derivation (instead of SHA1), AES-128-CMAC
for data integrity, and AES Key Wrap for data protection of EAPOL-Key
frames.  An OpenBSD AP will always advertise this capability and an
OpenBSD STA will always prefer SHA-256 based AKMPs over SHA1 based
ones if both are supported by an AP.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Aug 29 12:14:53 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.31: +1 -3 lines
Diff to previous 1.31 (colored)

move code to support Frequency-Hopping spread spectrum (FHSS) PHYs
to the Attic.  nothing uses it in the tree and it is very unlikely
that something will use it one day.
the only driver supporting FHSS PHYs in the tree is ray(4) and it
does not use net80211.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Aug 12 18:22:41 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.30: +10 -6 lines
Diff to previous 1.30 (colored)

process IGTK KDEs in EAPOL-Key frames and install integrity group keys
if MFP was negotiated with the peer (not possible yet).

Revision 1.30 / (download) - annotate - [select for diffs], Sat Aug 2 08:24:15 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

typo in a comment. no binary change.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Aug 2 08:20:16 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.28: +6 -2 lines
Diff to previous 1.28 (colored)

Drop frames that are received unencrypted when WEP is on or when
WPA is on and RX protection for TA is on.
Keep track of the TX/RX protection for each node when WPA is on.

tested by djm@ (ral+wpa), ckuethe@ (ath-noenc) and krw@ (wpi<->ral+wpa).
hints from bluhm@
has been in snaps for a few days.

pointed out by bluhm@ something like 1 year ago but we did not have
the right infrastructure to fix it properly at that time.

ok deraadt@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jul 27 18:24:01 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.27: +8 -1 lines
Diff to previous 1.27 (colored)

sanitize RX path a bit.
make sure drivers pass a contiguous header, check header length earlier.
fix checking of frames sequence number for frames containing an Address 4
field (required for future work).
fix processing of control frames (only pspoll for now).

Revision 1.27 / (download) - annotate - [select for diffs], Mon Apr 21 19:37:18 2008 UTC (16 years, 1 month ago) by damien
Branch: MAIN
Changes since 1.26: +3 -1 lines
Diff to previous 1.26 (colored)

move ieee80211_auth_open() to ieee80211_proto.c
move ieee80211_setup_rates() to ieee80211_node.c
move some prototypes from ieee80211_proto.h to ieee80211_crypto.h

Revision 1.26 / (download) - annotate - [select for diffs], Wed Apr 16 18:32:15 2008 UTC (16 years, 1 month ago) by damien
Branch: MAIN
Changes since 1.25: +23 -16 lines
Diff to previous 1.25 (colored)

Kernel implementation of the 4-way handshake and group-key
handshake protocols (both supplicant and authenticator state
machines) as defined in the IEEE 802.11i standard.

Software implementation of the TKIP (Temporal Key Integrity
Protocol) and CCMP (CTR with CBC-MAC Protocol) protocols.

This diff doesn't implement any of the 802.1X authentication
protocols and thus only PSK authentication (using pre-shared
keys) is currently supported.

In concrete terms, this adds support for WPA-PSK and WPA2-PSK
protocols, both in station and hostap modes.

The following drivers are marked as WPA-capable and should
work:  bwi(4), malo(4), ral(4), iwn(4), wpi(4), ural(4),
rum(4), upgt(4), and zyd(4)

The following options have been added to ifconfig(8):
wpa, wpapsk, wpaprotos, wpaakms, wpaciphers, wpagroupcipher

wpa-psk(8) can be used to generate keys from passphrases.

tested by many@
ok deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Sat Nov 3 14:59:55 2007 UTC (16 years, 7 months ago) by mglocker
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Revert last commit which added ieee80211_rate2plcp() and
ieee80211_plcp2rate() because I've got a late feedback from Damien that
he dislike the implementation method a lot.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 1 22:34:19 2007 UTC (16 years, 7 months ago) by mglocker
Branch: MAIN
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Add ieee80211_rate2plcp() and ieee80211_plcp2rate() functions.

Help and OK reyk@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 27 20:14:21 2007 UTC (16 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.22: +26 -1 lines
Diff to previous 1.22 (colored)

rework ieee80211_recv_4way_msg2() function.
add some RSNA authenticator state machine bits.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Aug 27 18:53:27 2007 UTC (16 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.21: +1 -2 lines
Diff to previous 1.21 (colored)

Checking the MIC early in ieee80211_recv_eapol() does not work for
message 2/4 of the 4-way handshake because the authenticator must
derive the PTK first (the MIC is computed using the KCK).
Move calls to ieee80211_eapol_key_check_mic() - and as a consequence
ieee80211_eapol_key_decrypt() - directly in the
ieee80211_recv_{group,4way}_msg*() functions.
Unconstify the first parameter since checking the MIC modifies the
frame. Remove ni->ni_ptk_ok field while i'm here.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Aug 3 16:51:06 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

add a ni_eapol_desc field to struct ieee80211_node to know whether
a station is using WPA1 or RSN descriptors.
make sure that a station that advertises WPA1 capability in an IE
uses the WPA1 EAPOL-Key descriptor type and not the RSN one.
fix construction of EAPOL-Key frames for WPA1.
i can now successfuly complete a 4-way and group-key handshake
with both a WPA1 and a WPA2 access point.
add some TKIP encapsulation code (no SW crypto yet).

ok deraadt@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Aug 1 15:40:40 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

add generic ieee80211_encrypt() and ieee80211_decrypt() functions that
can handle multiple ciphers (the key to use is determined automatically
by these functions based on the frame's destination address).
add ieee80211_ccmp_encrypt() and ieee80211_ccmp_decrypt().
those two functions only do encapsulation/decapsulation of CCMP frames
for now (they don't do SW crypto). they will help to test things with
drivers that can do HW crypto.
add a ni_pairwise_key field to struct ieee80211_node to actually install
the pairwise transient key.
install the GTK in ic_nw_keys[].

Revision 1.19 / (download) - annotate - [select for diffs], Wed Aug 1 12:32:26 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

PMKID KDE is optionnal in message 1 of the 4-way handshake (at least
when using WPA-PSK).
add a ni_replaycnt_ok flag to struct ieee80211_node to mark the replay
counter as valid.  the replay counter is marked valid only when message
3 of the 4-way handshake is received since message 1 contains no MIC.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jul 28 11:09:03 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.17: +10 -1 lines
Diff to previous 1.17 (colored)

add a couple of fields to the ieee80211_node structure to manage RSN
states. those fields will be put in a separate structure (ieee80211_rsna)
in a future cleanup phase to save some space.

add a ni_port_valid field to manage PAE state.
in pre-RSNA networks, this field will be set to 1 after a successful
open authentication.  in RSNA networks, this field will be set to 1
after a successful 4-way handshake.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 6 18:18:43 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.16: +1 -2 lines
Diff to previous 1.16 (colored)

remove remaining bits for pre-RSNA shared authmode support.
it has been #if 0'd since 3.9 and we have never supported this mode (no
ifconfig option etc...).

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jul 3 19:44:54 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.15: +8 -2 lines
Diff to previous 1.15 (colored)

add a function that builds an RSN IE (ieee80211_add_rsn).

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jun 17 09:05:44 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.14: +4 -1 lines
Diff to previous 1.14 (colored)

keep track of the Tx/Rx sequence numbers for each TID in the
ieee80211_node structure.
add a flag to indicate whether a STA is a QSTA or not.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 16 13:21:44 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

ieee80211_lookup_node() does not exist.
remove prototype in .h and ref in man pages.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 16 13:17:05 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.12: +14 -12 lines
Diff to previous 1.12 (colored)

constify

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 7 20:24:42 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.11: +1 -10 lines
Diff to previous 1.11 (colored)

expand the IEEE80211_NODE_{LOCK,UNLOCK}* macros into their respective
definitions.
remove comments about "lock order reversals" that are specific to freebsd.

ok reyk@ jsg@ mglocker@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jun 6 19:31:07 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.10: +1 -5 lines
Diff to previous 1.10 (colored)

The license permits us to redistribute this code under the BSD or the GPLv2.
Choose the BSD license so that future enhancements will be BSD-only.

ok jsg@ reyk@ deraadt@

Revision 1.10 / (download) - annotate - [select for diffs], Sun Nov 26 11:14:23 2006 UTC (17 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.9: +5 -1 lines
Diff to previous 1.9 (colored)

do not have each net80211 driver define its own rates structures.  if they use
the standard rates, use some defined by net80211 itself.  kernel shrinks a bit
ok jsg mglocker

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 18 18:39:41 2006 UTC (17 years, 11 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.8: +4 -1 lines
Diff to previous 1.8 (colored)

Improve 802.11b/g interoperability and move toward better compliance
with IEEE Std 802.11g-2003 standard:

- add ERP Information Element in probe responses and beacons
- keep track of the number of associated non-ERP STAs and non-short slot
  time capable STAs in the BSS
- enable use of RTS/CTS or CTS-to-self protection when required by the BSS
- add a ic_updateslot() callback to notify drivers of slot time changes
- cleanup computation of mgmt frames sizes in ieee80211_output.c
- nuke unnecessary <sys/cdefs.h> includes
- remove an unused macro (LOGICALLY_EQUAL) while i'm here

From {free,net}bsd, with additional fixes.

ok brad@, reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Sep 13 12:11:03 2005 UTC (18 years, 9 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.7: +10 -10 lines
Diff to previous 1.7 (colored)

replace the node hash table with a red-black tree. this fixes some
bugs in the node table (like duplicate nodes in hostap mode), we get
rid of possible hash collisions, and it simplifies the code.

tested by many, ok damien@, jsg@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Sep 8 13:24:53 2005 UTC (18 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.6: +7 -7 lines
Diff to previous 1.6 (colored)

mostly knf

ok jsg@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Sep 8 08:36:12 2005 UTC (18 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

reset the scan state for each new mode

ok jsg@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Sep 7 05:40:11 2005 UTC (18 years, 9 months ago) by jsg
Branch: MAIN
Changes since 1.4: +1 -26 lines
Diff to previous 1.4 (colored)

Remove FreeBSD/NetBSD ifdef mess.  We are not likely to be
doing a wholesale merge with them in future.
very enthusiastic ok from reyk@

Revision 1.4 / (download) - annotate - [select for diffs], Wed May 25 07:40:49 2005 UTC (19 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.3: +1 -4 lines
Diff to previous 1.3 (colored)

add ifconfig -M option to replace wicontrol -L and -l for ap scanning
and node listing. wicontrol is not supported by net80211 drivers
anymore. further improvements will be done.

ok dlg@, jsg@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Feb 17 18:28:05 2005 UTC (19 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.2: +24 -3 lines
Diff to previous 1.2 (colored)

derived from NetBSD:

---
Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue.  Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver.  Every node in the table with ni_refcnt=0
is eligible to be garbage-collected.  The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match."  This keeps
net80211 from caching duplicate nodes in the table.
---

ok deraadt@ dlg@, looks good jsg@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 2 02:15:49 2004 UTC (19 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.1: +19 -1 lines
Diff to previous 1.1 (colored)

some changes merged in from netbsd. ieee80211_regdomain.# will be used
by sdr (software defined radios).

ok deraadt@ millert@ damien@

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 22 22:53:52 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6

Import current NetBSD/FreeBSD 802.11 framework.
Based in part on a diff from Matthew Gream.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.