History log of /freebsd-current/sys/dev/iwm/if_iwmvar.h
Revision Date Author Comments
# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

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

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 355c1513 24-Oct-2021 Adrian Chadd <adrian@FreeBSD.org>

iwm: update if_iwmreg.h to the latest (as of today) openbsd changes

Summary:
This updates the if_iwmreg.h definitions to;

OpenBSD: if_iwmreg.h,v 1.65 2021/10/11 09:03:22 stsp Exp

A few things haven't been fully converted, namely:

* I left a couple things as enums for now just to reduce the
other diffs needed; but they're the same values

* The IWM_SCD_QUEUE_* macros have different offsets which I
didn't update in case they broke things / changed based on later
firmware. But they also may be real bugfixes which are needed
for later chips. It'll need more testing before flipping this on.

The c file updates are:

* Use the newer names for things if the name changed but the semantics
didn't
* Explicitly use the earlier firmware structs which maintain compat
with the current firmware and code. The newer ones are in here and
they'll get converted when more openbsd code is merged into this tree.
* Use the older iwm rate table for now, which has entries for legacy
rates, HT and VHT. Our code works with that right now, updating it
to openbsd's err, "different" version can be done at a later date
when HT/VHT support is added.

Notably, a bunch of definitions were deleted that weren't used.
They're not used either in the openbsd/dfbsd drivers so I think it's
safe to delete them in the long run.

Test Plan: 7260 hw 0x140

Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D32627
Reviewed by: md5
Obtained From: OpenBSD


# 22d1b05c 20-May-2020 Andriy Gapon <avg@FreeBSD.org>

iwm: improve rfkill handling

Previously the driver handled the bit within itself, but did not expose
the state change to net80211 and interface layers.
This change uses net80211 KPI for rfkill signaling.
The code is modeled after similar code in iwn and wpi.

Reviewed by: adrian
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24923


# e7065dd1 27-Nov-2019 Mark Johnston <markj@FreeBSD.org>

iwm(4): Remove _mvm from the namespace.

This was inherited from iwlwifi, which drives devices supported by both
iwn(4) and iwm(4) in FreeBSD. In iwm(4) _mvm is meaningless, so remove
it. OpenBSD made the same change a long time ago. No functional change
intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 96c5aa2f 07-Nov-2019 Mark Johnston <markj@FreeBSD.org>

iwm: Implement the new receive path.

This is the multiqueue receive code required for 9000-series chips.
Note that we still only configure a single RX queue for now. Multiqueue
support will require MSI-X configuration and a scheme for managing a
global pool of RX buffers.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# eff8a979 07-Nov-2019 Mark Johnston <markj@FreeBSD.org>

iwm: Simplify fw_has_{api,capa}().

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 22a4c7bc 07-Nov-2019 Mark Johnston <markj@FreeBSD.org>

iwm: Remove a couple of unused fields from the softc.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 786ac703 10-Mar-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

Fix ieee80211_radiotap(9) usage in wireless drivers:

- Alignment issues:
* Add missing __packed attributes + padding across all drivers; in
most places there was an assumption that padding will be always
minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) -
padding was just missing.
* Add __aligned(8) attribute for all Rx radiotap headers since they can
contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so
just drop the attribute here. Refresh ieee80211_radiotap(9) man page
accordingly.

- Since net80211 automatically updates channel frequency / flags in
ieee80211_radiotap_chan_change() drop duplicate setup for these fields
in drivers.

Tested with Netgear WG111 v3 (urtw(4)), STA mode.

MFC after: 2 weeks


# e4bc6d1d 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

iwm - Update alive response handling, add v4 and remove old versions.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (3820e2bf3331ced3541d1811a38c5a5136dfab93)


# df34d80a 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

iwm - Clear Time Event active state, when receiving End Notification.

* This hopefully avoids some firmware panics, I was occasionally seeing,
when iwm disconnects upon losing signal to an access point at some point.

* This is synchronizing the if_iwm_time_event.c file a bit more from the
corresponding Linux iwlwifi/mvm/time-event.c.

Taken-From: Linux iwlwifi

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (e8cb71584a6a72232c13151d60e57f7f229220eb)


# 9a949c99 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

iwm - Improve firmware Time Event handling.

* This is a mix of the OpenBSD Git 7fd9664469d1b717a307eebd74aeececbd3c41cc
change, and syncing with the Linux iwlwifi code.

Taken-From: Linux iwlwifi, and OpenBSD

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (706a3044afd27c3fecfdf57bec1695310e53e228)


# 8d969c53 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

iwm - Track firmware state better, and improve handling in iwm_newstate().

* This avoids firmware resets in all the cases in iwm_newstate(). Instead
iwm_bring_down_firmware() is called, which tears down all the STA
connection state, according to the sc->sc_firmware_state value.

* Improve the behaviour of the LED blinking a bit, so it only blinks when
there really is a wireless scan going on.

* Print the newstate arg in debug output of iwm_newstate(), to help in
debugging.

This is inspired by the firmware state maintaining change in OpenBSD's iwm,
by stsp@openbsd.org (OpenBSD Git 0ddb056fb7370664b1d4b84392697cb17d1a414a).

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (8a41b10ac639d0609878696808387a6799d39b57)


# 9612bbf4 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

if_iwm - Configure the PCIe LTR, fix PCI express capability accesses.

Taken-From: Linux iwlwifi

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (08a7ad5a5ff65aaaf2df6a609be7a4e1df43efc3)


# f33c8309 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.

* Rename some structs and struct members for firmware handling.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (4b1006a6e4d0f61d48c67b46e1f791e30837db67)


# 544b40d8 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

if_iwm - Move iwm_read_firmware() call into iwm_attach().

* We should load the firmware exactly once before the driver really
initializes the hardware the first time, and unload it at detach time.
There is no need to retrieve the firmware during execution of
iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the
firmware data at hand before that.

* The existing sc_preinit_hook code fails to deal with the case where
if_iwm is loaded by the loader (or is statically linked) and the
firmware needs to be loaded from disk. So we can just call
iwm_read_firmware() from iwm_attach() directly.

* A separate solution will have to be added to properly defer the firmware
loading during bootup, until the necessary filesystem is mounted.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (0104ee1f4cb6a2313c00c2526c6ae98d42e5041d)


# 95d69da4 23-Jan-2019 Kyle Evans <kevans@FreeBSD.org>

if_iwm - Update firmware rs table, instead of indexing the table in tx cmds.

* Rather than providing a non-zero index into the firmware RS table,
we should always use index 0 and update the firmware RS table whenever
our chosen tx rate for data-frames changes.

* Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211
rate control (which is after we tell the tx status to the net80211
rate-control in iwm_mvm_rx_tx_cmd_single()).

* Disregard frames transferred with a different tx rate than the currently
selected rate for the rate-control calculations. This way we avoid
counting management frames (which are sent at a slow, and fixed rate),
as well as frames we added to the tx queue just before a new IWM_LQ_CMD
update took effect.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (5d6b465e288ac5b52d7115688d4e6516acbbea1c)


# 1ecccab8 25-Jul-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Sync statistics API definitions with Linux iwlwifi.

Obtained from: dragonflybsd.git 75895a53a9c1ba60d75be9b4bf6e49a37f91a7cf


# 19d956ec 04-Jun-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Check for lar_disable tunable, and lar_enabled flag from NVM.

* LAR can be disabled with the hw.iwm.lar.disable tunable now.

* On Family 8000 devices we need to check the lar_enabled flag from
nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware.

* Add a separate IWM_DEBUG_LAR debugging flag.

Obtained from: dragonflybsd.git 0593e39cb295aa996ecf789ed4990c3b255f1770


# cd684dec 04-Jun-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Move Smart Fifo handling into if_iwm_sf.c, sync with Linux iwlwifi.

* This change also fixes a possible issue in the existing smart-fifo code,
which set the IWM_SF_CFG_DUMMY_NOTIF_OFF bit on AC8260 chipsets, although
that's only used in iwlwifi for Family 8000 chipsets connected via SDIO
interface.

Obtained from: Dragonflybsd.git cb650b01526b0aeef3c4307d926e7f1428997d50


# be793bcd 12-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Make powersaving more similar to Linux iwlwifi behaviour.

* Add a per-vap ps_disabled flag, and use it for a workaround which fixes
an association issue when powersaving is enabled.

* Compute flag that should correpsond to the mvmif->bss_conf.ps flag in
Linux's iwlwifi (e.g. this disallows powersaving when not associated
yet).

Inspired-By: Linux iwlwifi

Obtained from: dragonflybsd.git dc2e69bdfe8c9d7049c8a28da0adffbfbc6de5c0


# b80e7ca5 11-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Properly implement iwm_wme_update callback function.

* Inspired by iwn(4) and Linux iwlwifi.

* Read wme parameters into a buffer within struct iwm_vap in
iwm_wme_update().

* If we aren't associated yet, the new settings will soon be sent
by iwm_mvm_mac_ctxt_changed() during association.

* If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed()
from iwm_wme_update() to send the new settings to the firmware.

* Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211
WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers.

Obtained from: dragonflybsd.git b8bd6cd746d1f45e616ccfcbeed06dfe452a1108


# 702287e4 11-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Process multiple frames per RX buffer.

* Factor out iwm_handle_rxb() function from iwm_notif_intr().

* Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows
the device to put multiple frames (both command responses and 80211
frames) into a single RX buffer.

* Uses m_copym() to split up the receive buffers when multiple 80211
frames are received in one RX buffer. The effect is basically the same
as when using m_split(), but we want to keep the original mbuf around
when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier
for now.

* Contains a small optimization to avoid the m_copym() when only a single
80211 frame is received in one RX buffer (i.e. matching the existing
behaviour).

Obtained from: dragonflybsd.git b5eb43f0280bbcfd26af51cf5a4b8e8ff3590b67


# bdba6830 11-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[if_iwm] Partly sync if_iwm_binding.c to Linux iwlwifi code.

* Store macid and color values in struct iwm_vap, to avoid hardcoded
constants a bit.

* Add iwm_mvm_binding_remove_vif() function (will be used in disconnecting
from an access point without resetting the whole device).

* Not adding code from Linux iwlwifi yet, to handle one PHY context to
be bound to several VAPs/virtual-interfaces, it's definitely not needed
in the near future.

Obtained from: dragonflybsd.git f16ef74977e51e1bfc7a625dd18b98b02158e0e5


# f32adafd 08-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap.

* This better matches how things are organized in Linux's iwlwifi.

Obtained from: dragonflybsd.git 0cf16dd2e0e09a3e5140e50222ac2e69bcdb19a2


# 08e1076c 08-May-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Add basic powermanagement support via ifconfig wlan0 powersave.

* The DEVICE_POWER_FLAGS_CAM_MSK flag was removed in the upstream iwlwifi
in Linux commit ceef91c89480dd18bb3ac51e91280a233d0ca41f.

* Add sc_ps_disabled flag to struct iwm_softc, which corresponds to
mvm->ps_disabled in struct iwl_mvm in Linux iwlwifi.

* Adds a hw.iwm.power_scheme tunable which corresponds to the power_scheme
module parameter in Linux iwlwifi. Set this to 1 for completely
disabling power management, 2 (default) for balanced powermanagement,
and 3 for lowerpower mode (which does dtim period skipping).

* Imports the constants.h file from iwlwifi as if_iwm_constants.h.

* This doesn't allow changing the powermanagement setting while connected,
also one can only choose between enabled and disabled powersaving with
ifconfig (so switching between balanced and low-power mode requires
rebooting to change the tunable).

* After any changes to powermanagement (i.e. "ifconfig wlan0 powersave" to
enable powermanagement, or "ifconfig wlan0 -powersave" for disabling
powermanagement), one has to disconnect and reconnect to the accespoint
for the change to take effect.

Obtained from: dragonflybsd.git d7002a7990d077c92585978ea998474af50f91e0


# cd20383e 24-Mar-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Enable Energy Based Scan (EBS).

This can significantly reduce scan duration thus saving time and power.
EBS failure reported by FW disables EBS for current connection. It is
re-enabled upon new connection attempt on any WLAN interface.

Obtained from: dragonflybsd.git 89f579e9823a5c446ca172cf82bbc210d6a054a4


# a00bfbb1 22-Mar-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Make ucode capabilities and api flags handling more like iwlwifi.

Obtained from: dragonflybsd.git 757eecf0e6c92745aa2eee95811e573c8300850e


# ad35d471 24-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Add support for Firmware paging, needed for newer 8000C firmware.

* Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
what memory ranges to use for paging.

Obtained from: dragonflybsd.git 8a5b199964f8e7bdb00039f0b48817a01b402f18


# 6c2c3bd8 21-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c

* This is more similar to how code/definitions are distributed in
Linux's iwlwifi.

* This should make recognizing new chipset variants, and adding additional
flags from the Linux iwlwifi code easier, without blowing up if_iwm.c

Obtained from: dragonflybsd.git 27d11320e707d2c41424efc1983762f6799941d6


# dfdbaed4 21-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants

* We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory.

Obtained from: dragonflybsd.git f414b8da30816705e32573cc58097cacac34f161


# 9df52443 21-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi.

* Use the notification wait API, like it's done in the Linux iwlwifi code,
to wait for the IWM_MVM_ALIVE notification.

* This also should fix some firmware load interrupt issues, and errors
in the nic lock using.

Tested:

* (adrian) Intel 7260, STA mode

Obtained from: dragonflybsd.git a7697ea01c11fd493aec52260a02f31df680eb91


# e97a1048 21-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Synchronize firmware loading code with Linux iwlwifi.

* While there, rename some functions to match the names and functionality
of the similarly named functions in Linux iwlwifi.

Obtained from: dragonflybsd.git e98ee77a816bfd8b4912047b93dfb2c560788f24


# 99baf303 07-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Implement apmg_wake_up_wa workaround properly for 7000 family.

* Add iwm_pcie_set_cmd_in_flight() and iwm_pcie_clear_cmd_in_flight()
helper methods.

* Use ring->queued tracking in the command queue to set/clear the
cmd_hold_nic_awake bit at the right points.

Taken-From: Linux iwlwifi

Obtained from: DragonflyBSD commit ce43f57f5308b579ea21e8a5a29969114ba2247d


# 82ba706c 07-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Use iwm_mvm_scan_stop_wait to properly abort scans.

* Add IWM_FLAG_SCAN_RUNNING to sc->sc_flags to track whether the firmware
is currently running a scan, in order to decide wheter iwm_scan_end
needs to abort a running scan.

* In iwm_scan_end, if the scan is still running, we now abort it, in order
to keep the firmware scanning state in sync.

* Try to make things a bit simpler, by reacting on the
IWM_SCAN_OFFLOAD_COMPLETE and IWM_SCAN_COMPLETE_UMAC notifications,
instead of IWM_SCAN_ITERATION_COMPLETE and
IWM_SCAN_ITERATION_COMPLETE_UMAC. This should be fine since we always
only tell the firmware to do a single scan iteration anyway.

Obtained from: DragonflyBSD commit 1f249c981c4e89e7cde1836a75b61cac36dc7ac5


# 31f7edff 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Use notification wait API to wait for calibration to complete.

Tested:

* 7260, STA mode (2g, 5g)

Obtained from: DragonflyBSD commit 1e0cf8ec6fcd77978f5336297ece61a415790f84


# 6e39c650 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Add implementation of the notification wait api from iwlwifi.

Obtained from: Linux iwlwifi
Obtained from: DragonflyBSD commit 94dc1dadceb57b688036211262d678bc6bbdde37


# 48f3dc7b 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Store paging_mem_size field in firmware image information struct.

Obtained from: DragonflyBSD commit a8524cc6c440e5ce9490ba2b0507c99ff6777c6d


# e89710f8 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Get rid of some gratuitous constant renaming wrt. Linux iwlwifi.

* IWM_UCODE_SECT_MAX -> IWM_UCODE_SECTION_MAX

* IWM_UCODE_TYPE_* -> IWM_UCODE_* (except for IWM_UCODE_TYPE_MAX which
stays).

Obtained from: DragonflyBSD commit ff4d1fc3ed002c9fb362423da6c45d711b65658a


# 2a2476b3 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Sync valid_tx_ant and valid_rx_ant mask handling with iwlwifi.

* This fixes the phy_cfg field sent in the iwm_send_phy_cfg_cmd()
command, which wasn't taking into account the valid_rx_ant and
valid_tx_ant masks from nvm_data before.

Tested:

* 7260, STA mode, 2G and 5G

Obtained from: DragonflyBSD commit cbb82693c18fd71b4eb86855b82d03995f352d65


# 8c03b090 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Use chipset configuration structs like iwlwifi does.

* This makes it a bit easier to factor out common parts for e.g. the
7000 chipset family.

* Add iwm7265d config, and recognize the 7265D chipset variant via the
hardware revision.

Tested:

* 7260, STA mode (2ghz)

Obtained from: Dragonflybsd commit cc8d6ccf5583fd45964f3bde9b057ee4f834c0e0


# 6349bdb3 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Sync nvm parsing code with Linux iwlwifi.

* sc->sc_nvm becomes sc->nvm_data and is now a pointer instead of an
inlined struct.

* Add sc->eeprom_size and sc->nvm_hw_section_num configuration values to
struct iwm_softc.

* For now continue to avoid negative error return-values, and use pointer
variables for some return values, as before.

* Continue to omit LAR (location aware regulatory) related code as well.

Tested:

* Intel 7260, STA mode (2GHz)

Obtained from: dragonflybsd commit 39f8331b1a6f295291e08c377da12a8e7a5436c0


# 59e6427f 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] make sure we call iwm_detach_local() only once.

Obtained from: DragonflyBSD git ebd4ceab76a6f161362029cbfd08efaedaab0519


# 30a0fd92 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Sync if_iwm_phy_db code with Linux iwlwifi.

Obtained from: Dragonflybsd commit c1019b6bfff36c856f7b4fccbdf3bb13ac27750c


# a994fb3b 05-Feb-2017 Adrian Chadd <adrian@FreeBSD.org>

[iwm] The HW Revision stepping constants should be in if_iwmreg.h.

Obtained from: dragonflybsd 84292f0c38594c462c719c0e59da5908b93aba5f


# f6930bec 02-Oct-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

net80211: ieee80211_ratectl*: switch to reusable KPI

Replace various void * / int argument combinations with common structures:
- ieee80211_ratectl_tx_status for *_tx_complete();
- ieee80211_ratectl_tx_stats for *_tx_update();

While here, improve amrr_tx_update() for a bit:
1. In case, if receiver is not known (typical for Ralink USB drivers),
refresh Tx rate for all nodes on the interface.
2. There was a misuse:
- otus(4) sends non-decreasing counters (as originally intended);
- but ural(4), rum(4) and run(4) are using 'read & clear' registers
to obtain statistics for some period of time (and those 'last period'
values are used as arguments for tx_update()). If arguments are not big
enough, they are just discarded after the next call.

Fix: move counting into *_tx_update()
(now otus(4) will zero out all node counters after every tx_update() call)

Tested with:
- Intel 3945BG (wpi(4)), STA mode.
- WUSB54GC (rum(4)), STA / HOSTAP mode.
- RTL8188EU (urtwn(4)), STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D8037


# e4dc86e0 19-Sep-2016 Imre Vadász <ivadasz@FreeBSD.org>

[iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data.

* No functional change, none of these values were ever read.

* The values removed from struct iwm_nvm_data are only used for old dvm
devices in Linux iwlwifi, and irrelevant to iwm hence.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7945


# ef81578c 19-Sep-2016 Imre Vadász <ivadasz@FreeBSD.org>

[iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type.

The wantresp field in struct iwm_rx_data has never been used for anything,
so we can just delete it.

Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit
value to represent the enum), but it still seems like a very bad idea to use
an enum type in a __packed struct.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7930


# 6a5bc1d1 25-Jul-2016 Sean Bruno <sbruno@FreeBSD.org>

iwm(4) synchronize driver to DragonFlyBSD version and recent f/w update.

Submitted by: Kevin Bowling (kevin.bowling@kev009.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6967


# 33c7715f 25-Jul-2016 Sean Bruno <sbruno@FreeBSD.org>

iwm(4): switch to ieee80211_runtask()

Submitted by: Andiry Voskoboinyk (s3erios@gmail.com)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5054


# 5799c2bc 12-Jun-2016 Adrian Chadd <adrian@FreeBSD.org>

[iwm] Fix up busdma use in the RX path

When allocating a new mbuf or bus_dmamap_load()-ing it fails,
we can just keep the old mbuf since we are dropping that packet anyway.
Instead of doing bus_dmamap_create() and bus_dmamap_destroy() all the time,
create an extra bus_dmamap_t which we can use to safely try
bus_dmamap_load()-ing the new mbuf. On success we just swap the spare
bus_dmamap_t with the data->map of that ring entry.

Tested:

Tested with Intel AC7260, verified with vmstat -m that new kernel no
longer visibly leaks memory from the M_DEVBUF malloc type.
Before, leakage was 1KB every few seconds while ping(8)-ing over the wlan
connection.

Submitted by: Imre Vadasz <imre@vdsz.com>
Approved by: re@
Obtained from: DragonflyBSD.git cc440b26818b5dfdd9af504d71c1b0e6522b53ef
Differential Revision: https://reviews.freebsd.org/D6742


# ee55925e 01-Jun-2016 Adrian Chadd <adrian@FreeBSD.org>

[iwm] add LED blinking for iwm hardware that supports it.

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD, Linux iwlwifi/mvm


# 63b3f62a 27-May-2016 Adrian Chadd <adrian@FreeBSD.org>

[iwm] remove dead code.

if_iwm - GC some dead code, left by a partially applied OpenBSD change.

Taken-From: OpenBSD (if_iwm.c r1.69)

Submitted by: Imre Vadasz <imre@vdsz.com>
Obtained from: DragonflyBSD git 07dfed32ea39b980b0b80d27ff938e7c3ca4c0b5


# 453130d9 02-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.


# 5c1f6e21 01-May-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

iwm: switch to ieee80211_add_channel()

- Switch to ieee80211_add_channel().
- Parse/set more channel flags (DFS, NOADHOC).
- Add ic_getradiocaps() method.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6150


# 125b5701 25-Apr-2016 Adrian Chadd <adrian@FreeBSD.org>

[iwm] implement suspend/resume through ieee80211_{suspend,resume}_all

This allows wifi to associate correctly after a suspend/resume cycle.

Yes, I'm using this now day to day.

Tested:

* Intel 7260AC, STA mode


# 1b3ae3ba 04-Jan-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

iwm: store pointer for 'struct firmware' instead of
'size_t' and 'void *' pair.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD
Differential Revision: https://reviews.freebsd.org/D4765


# 612d1816 03-Jan-2016 Andriy Voskoboinyk <avos@FreeBSD.org>

iwm: reorganize if_iwmvar.h

- Change order of data in if_iwmvar.h
(like it is in other drivers: defines, data structures,
vap/node structures, softc struct and locks); use indentation.
- Fix IWM_LOCK(_sc) / IWM_UNLOCK(_sc) macro.
- Add IWM_LOCK_INIT / DESTROY(sc) + fix mtx_init() usage.
- Wrap iwm_node casts into IWM_NODE() macro.
- Drop some fields:
* wt_hwqueue from Tx radiotap header;
* macaddr[6] from iwm_vap;

Approved by: adrian
Differential Revision: https://reviews.freebsd.org/D4753


# 4f4a7a03 11-Oct-2015 Adrian Chadd <adrian@FreeBSD.org>

net80211 drivers: eliminate any references to sc_rxtap_len/sc_txtap_len (never used here)

Submitted by: <s3erios@gmail.com>
Differential Revision: https://reviews.freebsd.org/D3776


# 7a79cebf 27-Aug-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Replay r286410. Change KPI of how device drivers that provide wireless
connectivity interact with the net80211 stack.

Historical background: originally wireless devices created an interface,
just like Ethernet devices do. Name of an interface matched the name of
the driver that created. Later, wlan(4) layer was introduced, and the
wlanX interfaces become the actual interface, leaving original ones as
"a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer
and a driver became a mix of methods that pass a pointer to struct ifnet
as identifier and methods that pass pointer to struct ieee80211com. From
user point of view, the parent interface just hangs on in the ifconfig
list, and user can't do anything useful with it.

Now, the struct ifnet goes away. The struct ieee80211com is the only
KPI between a device driver and net80211. Details:

- The struct ieee80211com is embedded into drivers softc.
- Packets are sent via new ic_transmit method, which is very much like
the previous if_transmit.
- Bringing parent up/down is done via new ic_parent method, which notifies
driver about any changes: number of wlan(4) interfaces, number of them
in promisc or allmulti state.
- Device specific ioctls (if any) are received on new ic_ioctl method.
- Packets/errors accounting are done by the stack. In certain cases, when
driver experiences errors and can not attribute them to any specific
interface, driver updates ic_oerrors or ic_ierrors counters.

Details on interface configuration with new world order:
- A sequence of commands needed to bring up wireless DOESN"T change.
- /etc/rc.conf parameters DON'T change.
- List of devices that can be used to create wlan(4) interfaces is
now provided by net.wlan.devices sysctl.

Most drivers in this change were converted by me, except of wpi(4),
that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
testing.

Reviewed by: adrian
Sponsored by: Netflix
Sponsored by: Nginx, Inc.


# d4886179 08-Aug-2015 Rui Paulo <rpaulo@FreeBSD.org>

Import OpenBSD's iwm WiFi driver for Intel 3160/7260/7265.

There are still several bugs, but I've been using it for a while now.
Thanks to all the testers and to Adrian for his help with this
driver.

This driver isn't connected to the build yet, but it will be soon.

There's no MFC planned because the driver isn't very stable yet.

Reviewed by: adrian
Obtained from: https://github.com/rpaulo/iwm
Tested by: adrian, gjb, dumbbell (others that I forgot).
Relnotes: yes