History log of /freebsd/sys/net80211/ieee80211_node.c (Results 1 – 25 of 410)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2c8b0d62 29-Dec-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211 / LinuxKPI 802.11: correct enum ieee80211_sta_rx_bw

When moving the enum from LinuxKPI to net80211 it got adjusted to be
used in net80211 style in order to use it with a print_mask (%b).
Tu

net80211 / LinuxKPI 802.11: correct enum ieee80211_sta_rx_bw

When moving the enum from LinuxKPI to net80211 it got adjusted to be
used in net80211 style in order to use it with a print_mask (%b).
Turns out that change broke assumptions given the minimum value of
BW_20 no longer was 0. Adjust it back to a plain enum starting at 0
and use an inline function to convert to value names.

Pointy hat to: bz
Fixes: ca389486a9599768e0ba69dca13c208020623083
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48375

show more ...


# ca389486 03-Dec-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211 / LinuxKPI 802.11: use enum ieee80211_sta_rx_bw for ni_chw

net80211 node ni_chw currently encodes the channel width as Mhz number.
LinuxKPI 802.11 uses enum ieee80211_sta_rx_bw for the same

net80211 / LinuxKPI 802.11: use enum ieee80211_sta_rx_bw for ni_chw

net80211 node ni_chw currently encodes the channel width as Mhz number.
LinuxKPI 802.11 uses enum ieee80211_sta_rx_bw for the same.

Rather than keeping the "20" and "40" throughout the code (eventually
expanded to 80/160/320) switch them over to use the enum throughout
and add a print mask for debug output. While designed as bitmask it
is not supposed to be used as such; the bitmask is only used to be
able to use %b with a print mask.

Once we get to 320Mhz channel widths we would otherwise also need to
extend the uint8_t in struct ieee80211_node; making
enum ieee80211_sta_rx_bw __packed allows us for three more channel
widths without breaking the KBI (if we were not to use %b with a
print_mask but use a lookup function for the string we could extend
it for a long time).

Sponsored by: The FreeBSD Foundation
MFC after: 14 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D47891

show more ...


Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# 49619f73 19-Jan-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: make sure calls to (*iv_update_bss)() are locked

It turned out thare various calls into (*iv_update_bss)(), that is
direct changes to vap->iv_bss in the old days, happened without
synchron

net80211: make sure calls to (*iv_update_bss)() are locked

It turned out thare various calls into (*iv_update_bss)(), that is
direct changes to vap->iv_bss in the old days, happened without
synchronisation.

Use locking assertions to document the requirement or status quo
at some callers given ic locking will eventually have to be dealt
with.

MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43512

show more ...


# 8a5a3e3d 16-Jan-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: fix a NULL deref in ieee80211_sta_join1()

When ieee80211_sta_join1() gets an obss without ni_nt trying to lock
that will cause a NULL pointer deref. Check for the table to be
valid and de

net80211: fix a NULL deref in ieee80211_sta_join1()

When ieee80211_sta_join1() gets an obss without ni_nt trying to lock
that will cause a NULL pointer deref. Check for the table to be
valid and deal with the obss node accordingly.

This can happen if sta_newstate() calls ieee80211_reset_bss() for
nstate == INIT and ostate != INIT. ieee80211_reset_bss() itself
calls ieee80211_node_table_reset() which calls node_reclaim()
which ends up in ieee80211_del_node_nt() which does remove the
node from the table and sets ni_table to NULL.
That node (former iv_bss) can then be returned as obss in the
(*iv_update_bss)() call in join1().

MFC after: 3 days
Reviewed by: adrian, cc
Differential Revision: https://reviews.freebsd.org/D43469

show more ...


# c93be307 30-Nov-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: ieee80211_dump_node() check for channel to be set

Avoid panics in case ieee80211_dump_node() gets called before a
channel context is set.

Sponsored by: The FreeBSD Foundation
MFC after: 3

net80211: ieee80211_dump_node() check for channel to be set

Avoid panics in case ieee80211_dump_node() gets called before a
channel context is set.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


Revision tags: release/14.0.0
# 562adbe1 27-Oct-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht

Like for the VAP rename ic_flags_vht to ic_vht_flags for consistency to
keep "VHT" fields together and merge ic_vhtcaps and ic_vht_mcsinfo

net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht

Like for the VAP rename ic_flags_vht to ic_vht_flags for consistency to
keep "VHT" fields together and merge ic_vhtcaps and ic_vht_mcsinfo
into struct ieee80211_vht_cap ic_vht_cap.

While the structure layout changes no other functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian, cc
Differential Revision: https://reviews.freebsd.org/D42421

show more ...


# ef48d4fa 27-Oct-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: rename iv_flags_vht to iv_vht_flags

While the flag field is internal start naming it as well as "iv_vht*"
so we keep all "VHT" fields together. This breaks with what was done
done for HT

net80211: rename iv_flags_vht to iv_vht_flags

While the flag field is internal start naming it as well as "iv_vht*"
so we keep all "VHT" fields together. This breaks with what was done
done for HT but with HE, EHT, .. coming one day seems the more logic
choice.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: adrian, cc
Differential Revision: https://reviews.freebsd.org/D42419

show more ...


# 3a11944b 06-Oct-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: pass __func__, __LINE__ also to ieee80211_alloc_node()

Pass caller information to ieee80211_alloc_node() so that in case
IEEE80211_DEBUG_REFCNT is compiled in we can (better) track referen

net80211: pass __func__, __LINE__ also to ieee80211_alloc_node()

Pass caller information to ieee80211_alloc_node() so that in case
IEEE80211_DEBUG_REFCNT is compiled in we can (better) track references,
in this case the initial ieee80211_node_initref().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 21888521 02-Oct-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: de-inline ieee80211_ref_node()

Make ieee80211_ref_node() a macro so we can pass __func__, __LINE__
in for IEEE80211_DEBUG_REFCNT as we do for other refcount related
functions. Add the app

net80211: de-inline ieee80211_ref_node()

Make ieee80211_ref_node() a macro so we can pass __func__, __LINE__
in for IEEE80211_DEBUG_REFCNT as we do for other refcount related
functions. Add the appropriate IEEE80211_DPRINTF() call to the
_ieee80211_ref_node() implementation to support wlandebug(8) +node
printf style tracing.
As a plus we can now also use Dtrace fbt on the
_ieee80211_{ref,free}_node() implementations with futher logic,
gathering backtraces, etc. more flexibly.

Sponsored by: The FreeBSD Foundation
X-MFC: never

show more ...


# db195a52 02-Oct-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: make ieee80211_alloc_node() private

Looking through the allocation/free and reference cycle of nodes we have
a few (publicly) (almost) unused macros and functions.
Start making them privat

net80211: make ieee80211_alloc_node() private

Looking through the allocation/free and reference cycle of nodes we have
a few (publicly) (almost) unused macros and functions.
Start making them private and reducing the amount of entry paths to the
same/similar functionality.
First is to make ieee80211_alloc_node() static as it is nowhere used
in the tree outside this file.

Sponsored by: The FreeBSD Foundation
X-MFC: no

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 93e49148 18-Apr-2023 Gordon Bergling <gbe@FreeBSD.org>

net80211: Remove double words in source code comments

- s/we we/we/

MFC after: 5 days


Revision tags: release/13.2.0, release/12.4.0
# 4a8e4d15 29-Nov-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: fix IEEE80211_DEBUG_REFCNT builds

Remove the KPI/KBI changes from ieee80211_node.h and always use the
macros to pass in __func__ and __LINE__ to the functions.
The actual implementations a

net80211: fix IEEE80211_DEBUG_REFCNT builds

Remove the KPI/KBI changes from ieee80211_node.h and always use the
macros to pass in __func__ and __LINE__ to the functions.
The actual implementations are prefixed by "_" rather than suffixed
by "_debug" as they no longer are "debug"-specific.

Some of the select functions were not actually using the passed in
func, line options; however they are calling other functions which
use them. Directly call the internal implementation in those cases
passing the arguments on.

Use a file-local __debrefcnt_used define to mark the arguments __unused
in cases when we compile without IEEE80211_DEBUG_REFCNT and hope the
toolchain is intelligent enough to not pass them at all in those cases.

Also _ieee80211_free_node() now has a conflict so make the previous
_ieee80211_free_node() the new __ieee80211_free_node().

Add IEEE80211_DEBUG_REFCNT to the NOTES file on amd64 to keep exercising
the option.

Sponsored by: The FreeBSD Foundation
X-MFC: never
Discussed on: freebsd-wireless
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D37529

show more ...


# 9d2ba518 17-Aug-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: ieee80211_ies_expand() add extra length check

Make sure the given IE length fits into the total length left when
parsing through the information elements. In theory I would say
discard ev

net80211: ieee80211_ies_expand() add extra length check

Make sure the given IE length fits into the total length left when
parsing through the information elements. In theory I would say
discard everything if there is an error but that proves hard with
the current code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36245

show more ...


Revision tags: release/13.1.0
# 91b4225a 22-Mar-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: introduce (*iv_update_bss)()

Introduce (*iv_update_bss)() with a default implementation to allow
drivers to overload/intercept the time when we swap iv_bss.

This helps firmware based driv

net80211: introduce (*iv_update_bss)()

Introduce (*iv_update_bss)() with a default implementation to allow
drivers to overload/intercept the time when we swap iv_bss.

This helps firmware based drivers to synchronize state with firmware.
Otherwise, for some state changes, we begin with one ni (and in
LinuxKPI lsta) and try to finish with another ni (and a new lsta
in different state) and may no longer have access to the previous state.
This also saves us from constantly checking for ni changes complicating
code.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-MFC: move (*iv_update_bss) to spare area

show more ...


# 453d1a90 22-Mar-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: improve one debug logging

When forcing DEUATH in ieee80211_sta_join1() log the current state
we are coming from as well. Note this isn't always the state we
are expecting as iv_state was

net80211: improve one debug logging

When forcing DEUATH in ieee80211_sta_join1() log the current state
we are coming from as well. Note this isn't always the state we
are expecting as iv_state was updated already, so contrary to the
comment we usually do not see RUN there.
Leave a comment earlier with regards to this as well.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# c3db9d4a 17-Jan-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: ieee80211_dump_node() cosmetics

Printing %p does not need the 0x prefix and while here mark the
ieee80211_node_table argument unused given we do not need it in the
current incarnation of t

net80211: ieee80211_dump_node() cosmetics

Printing %p does not need the 0x prefix and while here mark the
ieee80211_node_table argument unused given we do not need it in the
current incarnation of the function.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 04efa18f 26-Dec-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: add debugging information

Add more STATE / DEBUG probes and enhance the output of one in order
to track state changes triggered by "ack" (or not).
This helped to narrow down causes from dr

net80211: add debugging information

Add more STATE / DEBUG probes and enhance the output of one in order
to track state changes triggered by "ack" (or not).
This helped to narrow down causes from drivers or the LinuxKPI 802.11
compat framework which kept us in a scan -> auth -> scan loop.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


Revision tags: release/12.3.0
# 09dd08f1 06-Oct-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: correct length check in ieee80211_ies_expand()

In ieee80211_ies_expand() we are looping over Elements
(also known as Information Elements or IEs).
The comment suggests that we assume well-

net80211: correct length check in ieee80211_ies_expand()

In ieee80211_ies_expand() we are looping over Elements
(also known as Information Elements or IEs).
The comment suggests that we assume well-formedness of
the IEs themselves.
Checking the buffer length being least 2 (1 byte Element ID and
1 byte Length fields) rather than just 1 before accessing ie[1]
is still good practise and can prevent and out-of-bounds read in
case the input is not behaving according to the comment.

Reported by: (coypu sdf.org)
admbugs: 857
MFC after: 3 days
Reviewed by: adrian, markj
Differential Revision: https://reviews.freebsd.org/D32340

show more ...


# 2ec4c3c7 25-Sep-2021 Gordon Bergling <gbe@FreeBSD.org>

net80211(4): Fix a few common typos in source code comments

- s/annoucement/announcement/
- s/setings/settings/

MFC after: 1 week


Revision tags: release/13.0.0
# af7d9f8e 18-Mar-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

net80211: prefix get_random_bytes() with net80211_

Both linux/random.h and net80211 have a function named
get_random_bytes(). With overlapping files included these collide.
Arguably the function co

net80211: prefix get_random_bytes() with net80211_

Both linux/random.h and net80211 have a function named
get_random_bytes(). With overlapping files included these collide.
Arguably the function could be renamed in linuxkpi but the generic
name should also not be used in net80211 so rename it there.

Sponsored-by: The FreeBSD Foundation
MFC-after: 2 weeks
Reviewed-by: philip, adrian
Differential Revision: https://reviews.freebsd.org/D29335

show more ...


Revision tags: release/12.2.0
# 662c1305 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

net: clean up empty lines in .c and .h files


# f1481c8d 01-Jul-2020 Adrian Chadd <adrian@FreeBSD.org>

[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP flags

The later firmware devices (including iwn!) support multiple configuration
contexts for a lot of things, leavin

[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP flags

The later firmware devices (including iwn!) support multiple configuration
contexts for a lot of things, leaving it up to the firmware to decide
which channel and vap is active. This allows for things like off-channel
p2p sta/ap operation and other weird things.

However, net80211 is still focused on a "net80211 drives all" when it comes to driving
the NIC, and as part of this history a lot of these options are global and not per-VAP.
This is fine when net80211 drives things and all VAPs share a single channel - these
parameters importantly really reflect the state of the channel! - but it will increasingly
be not fine when we start supporting more weird configurations and more recent NICs.
Yeah, recent like iwn/iwm.

Anyway - so, migrate all of the HT protection, legacy protection and preamble
stuff to be per-VAP. The global flags are still there; they're now calculated
in a deferred taskqueue that mirrors the old behaviour. Firmware based drivers
which have per-VAP configuration of these parameters can now just listen to the
per-VAP options.

What do I mean by per-channel? Well, the above configuration parameters really
are about interoperation with other devices on the same channel. Eg, HT protection
mode will flip to legacy/mixed if it hears ANY BSS that supports non-HT stations or
indicates it has non-HT stations associated. So, these flags really should be
per-channel rather than per-VAP, and then for things like "do i need short preamble
or long preamble?" turn into a "do I need it for this current operating channel".
Then any VAP using it can query the channel that it's on, reflecting the real
required state.

This patch does none of the above paragraph just yet.

I'm also cheating a bit - I'm currently not using separate taskqueues for
the beacon updates and the per-VAP configuration updates. I can always further
split it later if I need to but I didn't think it was SUPER important here.

So:

* Create vap taskqueue entries for ERP/protection, HT protection and short/long
preamble;
* Migrate the HT station count, short/long slot station count, etc - into per-VAP
variables rather than global;
* Fix a bug with my WME work from a while ago which made it per-VAP - do the WME
beacon update /after/ the WME update taskqueue runs, not before;
* Any time the HT protmode configuration changes or the ERP protection mode
config changes - schedule the task, which will call the driver without the
net80211 lock held and all correctly serialised;
* Use the global flags for beacon IEs and VAP flags for probe responses and
other IE situations.

The primary consumer of this is ath10k. iwn could use it when sending RXON,
but we don't support IBSS or AP modes on it yet, and I'm not yet sure whether
it's required in STA mode (ie whether the firmware parses beacons to change
protection mode or whether we need to.)

Tested:

* AR9280, STA/AP
* AR9380, DWDS STA+STA/AP
* ath10k work, STA/AP
* Intel 6235, STA
* Various rtwn / run NICs, DWDS STA and STA configurations

show more ...


# ea3d5fd9 14-Jun-2020 Adrian Chadd <adrian@FreeBSD.org>

[net80211] separate out node allocation and node initialisation.

This is a new, optional (for now!) method that drivers can use to separate
node allocation and node initialisation. Right now they'r

[net80211] separate out node allocation and node initialisation.

This is a new, optional (for now!) method that drivers can use to separate
node allocation and node initialisation. Right now they're the same, and
drivers that need to do node allocation via firmware commands need to sleep
and thus they need to defer node allocation into an internal taskqueue.

Right now they're just separate but not deferred. Later on if I get the time
we'll start deferring the node and key related operations but that requires
making a bunch of other stuff (notably things that generate frames!) also
async/deferred.

Tested:

* RT3593, STA/DWDS mode
* AR9380, STA/AP modes
* QCA9880 (athp) - STA/AP modes

show more ...


12345678910>>...17