History log of /netbsd-current/sys/dev/ic/bwfm.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.36 31-Dec-2023 gutteridge

bwfm.c: KNF a comment (spaces->tabs)


Revision tags: thorpej-ifq-base thorpej-altq-separation-base
# 1.35 01-Aug-2023 mrg

fix simple mis-matched function prototype and definitions.

most of these are like, eg

void foo(int[2]);

with either of these

void foo(int*) { ... }
void foo(int[]) { ... }

in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.

found by GCC 12.


Revision tags: netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.34 04-Dec-2022 mlelstv

Make power save mode configurable by ifconfig, now defaults to non-powersave
like other interfaces.
Remove cargo-culted check for manual roaming.


# 1.33 03-Dec-2022 mlelstv

Fix bug in protocol parser that often caused fatal 'checksum error'.
Defer power save setting to interface start.
More verbose on errors.
Allow build without FDT.


Revision tags: bouyer-sunxi-drm-base
# 1.32 14-Mar-2022 mlelstv

Add OpenBSD to code to optionally load CLM (Country Locale Matrix) files.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.31 16-Jun-2021 riastradh

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base
# 1.30 13-Apr-2021 mrg

branches: 1.30.2;
remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

branches: 1.29.4;
bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.35 01-Aug-2023 mrg

fix simple mis-matched function prototype and definitions.

most of these are like, eg

void foo(int[2]);

with either of these

void foo(int*) { ... }
void foo(int[]) { ... }

in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.

found by GCC 12.


Revision tags: netbsd-10-base
# 1.34 04-Dec-2022 mlelstv

Make power save mode configurable by ifconfig, now defaults to non-powersave
like other interfaces.
Remove cargo-culted check for manual roaming.


# 1.33 03-Dec-2022 mlelstv

Fix bug in protocol parser that often caused fatal 'checksum error'.
Defer power save setting to interface start.
More verbose on errors.
Allow build without FDT.


Revision tags: bouyer-sunxi-drm-base
# 1.32 14-Mar-2022 mlelstv

Add OpenBSD to code to optionally load CLM (Country Locale Matrix) files.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.31 16-Jun-2021 riastradh

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base
# 1.30 13-Apr-2021 mrg

branches: 1.30.2;
remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

branches: 1.29.4;
bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.34 04-Dec-2022 mlelstv

Make power save mode configurable by ifconfig, now defaults to non-powersave
like other interfaces.
Remove cargo-culted check for manual roaming.


# 1.33 03-Dec-2022 mlelstv

Fix bug in protocol parser that often caused fatal 'checksum error'.
Defer power save setting to interface start.
More verbose on errors.
Allow build without FDT.


Revision tags: bouyer-sunxi-drm-base
# 1.32 14-Mar-2022 mlelstv

Add OpenBSD to code to optionally load CLM (Country Locale Matrix) files.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.31 16-Jun-2021 riastradh

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base
# 1.30 13-Apr-2021 mrg

branches: 1.30.2;
remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

branches: 1.29.4;
bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.32 14-Mar-2022 mlelstv

Add OpenBSD to code to optionally load CLM (Country Locale Matrix) files.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.31 16-Jun-2021 riastradh

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base
# 1.30 13-Apr-2021 mrg

branches: 1.30.2;
remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

branches: 1.29.4;
bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.31 16-Jun-2021 riastradh

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base
# 1.30 13-Apr-2021 mrg

remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

branches: 1.29.4;
bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.30 13-Apr-2021 mrg

remove extra line that clearly isn't meant to be there and may trigger
uninitialised reads of variables.


Revision tags: thorpej-cfargs-base thorpej-futex-base
# 1.29 22-Jul-2020 riastradh

bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.29 22-Jul-2020 riastradh

bwfm: Switch from pcq to pool_cache.

pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


# 1.28 22-Jul-2020 riastradh

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.


# 1.27 22-Jul-2020 riastradh

Sort #includes. Nix trailing whitespace.

No functional change intended.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.26 13-Jul-2020 mrg

move some of the patching of callbacks and other data after
ieee80211_ifattach() but before if_deferred_start_init().

may fix panic i saw in after restarting wpa_supplicant.

from mlelstv.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.25 30-May-2020 jdolecek

discussed with thorpej@, and it seems it's better to allocate the bss
alignment buffer statically (as part of softc) just to be sure to not
affect performance


# 1.24 30-May-2020 jdolecek

reduce stack usage in bwfm_rx_event_cb(), can use KM_SLEEP because
this is called from workqueue handler (i.e. thread context)


# 1.23 30-May-2020 jdolecek

constify, and make static where possible


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: is-mlppp-base ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.22 25-Mar-2020 thorpej

Add a file type entry for CLM files.


# 1.21 25-Mar-2020 thorpej

- Refactor the firmware loading code into a set of common routines in the
core driver that understand how to find model-specific files before the
generic files. This greatly simplifies the firmware loading procedure
in each of the bus front ends. Adding additional firmware file types
(such as CLM files) much simpler.
- Make firmware image selection table-driven rather than a set of switch()
and if() statements.
- Add several additional firmware image entries.


Revision tags: ad-namecache-base3
# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

branches: 1.19.2;
s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2; 1.14.6;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.20 29-Jan-2020 thorpej

Adopt <net/if_stats.h>.


Revision tags: ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.19 27-Dec-2019 msaitoh

s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.19 27-Dec-2019 msaitoh

s/suport/support/


Revision tags: phil-wifi-20191119
# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.18 28-Oct-2019 mlelstv

More code from OpenBSD
no need to splnet() when enqueing packets
explicit structure padding
make internal functions static

also prepare for GPIO interrupts.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.17 03-Oct-2019 jmcneill

If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.16 02-Sep-2019 mlelstv

tagging work queue as MPSAFE was premature. Revert.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.15 01-Sep-2019 mlelstv

From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
Tag work queue as MPsafe and increase length.
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

branches: 1.12.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.14 02-Sep-2018 maya

branches: 1.14.2;
Initialize if_stop so suspend won't jump to NULL.


# 1.13 01-Sep-2018 riastradh

bwfm has only one tx descriptor; limit mbuf chains to one segment.

PR kern/53287

Can't use m_defrag because it always yields two segments.

Discussion on tech-net:
https://mail-index.netbsd.org/tech-net/2018/09/01/msg007031.html

Diagnosed and tested by maya.


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 phil-wifi-base
# 1.12 26-Jun-2018 msaitoh

Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.


Revision tags: pgoyette-compat-0625 pgoyette-compat-0521
# 1.11 11-May-2018 maya

sync with openbsd bwfm to some extent.

add a txcheck
set chip active/passive for more kinds of chips
add wrapper around setting active/passive
detect chip RAM
make bwfm_rx take an mbuf


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.10 16-Jan-2018 maxv

branches: 1.10.2;
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.


# 1.10 16-Jan-2018 maxv

Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.


# 1.9 16-Jan-2018 maxv

Mmh refix previous, we also need to make sure frm[1] is there.


# 1.8 16-Jan-2018 maxv

Fix overflow, noted by Maya.


# 1.7 18-Dec-2017 jmcneill

Support promiscuous mode


# 1.6 18-Dec-2017 jmcneill

Use ieee80211_media_status


# 1.5 18-Dec-2017 jmcneill

Stop the device at attach in case it was previously initialized


Revision tags: tls-maxphys-base-20171202
# 1.4 23-Oct-2017 jmcneill

branches: 1.4.2;
Initialize txrate to 0 for new associations; firmware handles rate adaptation for us


# 1.3 23-Oct-2017 msaitoh

If if_initialize() failed in the attach function, free resources and return.


# 1.2 20-Oct-2017 jmcneill

Fix an alignment problem with scan results within an escan event


# 1.1 19-Oct-2017 jmcneill

Add driver for Broadcom 802.11a/b/g/n/ac USB wireless devices, based on
the OpenBSD bwfm(4) driver.