summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwmvar.h
AgeCommit message (Collapse)Author
2022-05-14Remove unused buf_dma member from struct iwm_rx_ring.Stefan Sperling
Spotted by waddlesplash from haiku-os.org
2022-03-19Fix attach of multiple iwm(4) or iwx(4) interfaces in the same machine.Stefan Sperling
ok kettenis@, jca@
2022-03-19Add initial 802.11ac support to the iwm(4) driver.Stefan Sperling
VHT MCS and 80MHz channels can now be used. Other 11ac features such as larger aggregates are left for later work. Tested: 3160: stsp 7260: florian, jmatthew 7265: rfreeman, mlarkin, landry, Peter J. Philip 8260: bket 8265: jturner, Marcus MERIGHI, stsp 9260: florian, matthieu, stsp 9650: kmos, sthen ok sthen@
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2021-12-20Make iwm(4) attach to PCI devices with product ID 0x31dc.Stefan Sperling
This device is part of the 9560 chip family. With a small device-specific quirk we can make iwm(4) attach and provide a working wifi interface. Problem reported and fix tested by Joao Victor.
2021-12-03Implement a bgscan_done() handler for iwm(4).Stefan Sperling
Required to prevent breakage of roaming with new Intel firmware on 9k devices. Tested: 8265: Aaron Poffenberger, stsp 9260: florian 9560: sthen
2021-11-27Let iwm(4) use per-Tx-queue interface timers to ensure that the interfaceStefan Sperling
watchdog will trigger a device timeout if a particular Tx queue gets stuck while other Tx queues keep working. The Linux driver is using a similar workaround for "stuck queues". I have only observed this problem on iwx(4) hardware but it won't hurt to add this workaround to iwm(4) as well.
2021-10-11Add support for 802.11n 40MHz channels to the iwm(4) driver.Stefan Sperling
According to 11n MCS index tables our maximum data rate is now 300 Mbit/s at MCS 15, excluding protocol overhead. I have measured up to 200Mbit/s of effective throughput on clean 5GHz channels. The driver enables use of 40MHz channels automatically as long as the access point announces support for such channels in its beacons. In case 40MHz transmissions fail we ask firmware to retry with a 20MHz transmission. There is no integration with ifconfig yet, so use of 40MHz is not yet displayed there. In the meantime, tcpdump(8) can be used to check if the current access point supports 40MHz: tcpdump -n -i iwm0 -v -y IEEE802_11_RADIO -s 4096 type mgt and subtype beacon Channel width is displayed in the HT operation information element, where a 40MHz channels looks like this: htop=<40MHz chan X:Y ...> Tested: 7260: florian, bcallah 7265: landry 8260: bket 8265: stsp, abieber, Matthias Schmidt, Josh Rickmar, empee on mastodon 9560: stsp
2021-10-07Make our old BSSID available to iwm_newstate() when roaming.Stefan Sperling
ic_bss->ni_bssid has already been overwritten once we enter iwm_newstate() to perform the state transitions necessary for roaming to our new access point (RUN->AUTH->ASSOC->RUN). We do however use the BSSID in commands sent to firmware. Cache our BSSID in struct iwm_node such that firmware commands keep using the old BSSID while we are still tearing things down. Switch to the new BSSID only once we start back up in iwm_auth(). This should be consistent from the firmware's point of view. ok mpi@
2021-07-08Support MCC update response used by newer iwm(4) firmware, and verifyStefan Sperling
the size of the response we receive for MCC_UPDATE commands (even though we aren't doing anything with this response yet). With the correct expected response length this time. The driver needs to expect the maximum response size, not sizeof() the response struct. The actual response size depends on the number of channels stored in the "world" regulatory profile of the device. ok sthen@
2021-07-08Back out support for newer MCC update commands in iwm(4) for now.Stefan Sperling
This seems to cause "could not init LAR" errors on some devices. Reported by dv@ (8265) and sthen@ (9560)
2021-07-07Support MCC update response used by newer iwm(4) firmware, and verifyStefan Sperling
the size of the response we receive for MCC_UPDATE commands (even though we aren't doing anything with this response yet).
2021-07-07Support the SoC configuration command used by newer iwm(4) 9560 firmware.Stefan Sperling
2021-07-07Parse CMD_VERSION TLV found in iwm(4) fw images and add iwm_lookup_cmd_ver().Stefan Sperling
It seems Intel saw a risk of eventually running out of firmware capability support and API support flags, so yet another such mechanism was added. If you want to know which variant of a command needs to be used there are now at least three places to check for related information.
2021-06-01Revert iwm(4) firmware updates for now; robert@ reports stalled Tx on 9260Stefan Sperling
2021-06-01Switch iwm(4) to new firmware images available in iwm-firmware-20210512.Stefan Sperling
This updates firmware for 3165, 3168, 7265, 8260, 8265, 9260, 9560 devices. Other devices did not receive firmware updates from Intel. New firmware images should contain revelant fixes for fragattacks: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00473.html Running fw_update(1) may be required before rebooting into a new kernel. sysupgrade(8) will take care of this. When reporting issues (I am sure there will be new "fatal firmware errors" for some people) please enable 'ifconfig iwm0 debug', reproduce the error once more, and include the full dmesg in your bug report. Important changes required for new firmware: - Support new variants of several existing firmware commands just because Intel loves adding new features and changing the commands. - Implement the 'clear persistence bit' workaround for 9k devices to avoid potential issues during suspend/resume. - Recognize Mobile Country Code update notifications for the regulatory domain, like iwx(4) does. - Handle PHY context updates more like the Linux iwlwifi driver does. Some devices need an add/remove dance if the band has changed. - For 9560, configure SoC latency parameters after booting firmware. - Handle critical temperature notifications by shutting the device down. - Use only antenna B for single-antenna Tx on 9k devices (matches what Linux and FreeBSD do; Likely only matters if Bluetooth is active, but who knows, Git logs and comments are the only documentation we have). Other small fixes: - Fix various scan command parameters. Some fixes were taken from iwx(4). - Don't send probe requests when scanning passive channels. Experimentation has shown that this will make 9k devices crash after associating to an AP. This same fix does not seem to work on iwx(4) devices, where active scan is disabled for the same reason, and it is not yet clear why. - Fix firmware reloading after parsing the firmware image has failed. - Flushing Tx rings will fail if the AP disappears. Don't make any noise about that in dmesg, instead gracefully reset the device and continue. Tested: 7260: florian 3168: kevlo 7265: stsp, mlarkin 8260: bket 8265: stsp, benno 9560: stsp, steven
2021-05-10Let iwm(4) flush Tx queues before removing the firmware station andStefan Sperling
before stopping a Tx block ack session. This aligns us more closely with how the Linux iwlwifi driver is doing things. Also, reset the device if an errors occurs in the block ack session task. Fixes auto-recovery after such errors. Prompted by firmware error reports from kettenis@ and Matthias Schmidt. Doesn't fix the reported issues completely. I will keep investigating. Tested: 7265: stsp 8265: Matthias Schmidt 9260: phessler, kettenis
2021-05-03Add 802.11n Tx aggregation support to iwm(4).Stefan Sperling
Makes packets go swoosh swoosh swoosh. Welcome to actual 802.11n! Tested: 7260: dv, florian 7265: trondd, dv, landry, stsp 8260: bket 8265: Matthias Schmidt, stsp 9260: kettenis 9560: phessler, stsp
2021-04-29Make iwn, iwm, and iwx keep track of beacon parameters at run-time.Stefan Sperling
- HT protection settings (this was already implemented) - ERP (11g) protection setting - short slottime setting - short preamble setting - EDCA (QoS) parameters All of these parameters are communicated in beacons and hardware is now kept up-to-date with them. Prompted by a problem report from Christian Ehrhardt regarding ERP. Tested: iwn 6205: stsp, Josh Grosse iwm 7265: trondd iwm 8265: stsp, Matthias Schmidt iwm 9260: phessler iwx ax200: stsp, jmc, gnezdo
2021-04-25Implement support for Rx aggregation offload in iwm(9) and iwx(4), andStefan Sperling
re-enable de-aggregation of A-MSDUs in net80211 for all drivers capable of 11n mode. This can provide improved Rx performance if the access point supports transmission of A-MSDUs nested in A-MDPUs. iwm(9) 9k and iwx(4) devices de-aggregate A-MSDUs in hardware. Neither our drivers nor the net80211 stack were prepared to handle this. Add two Rx-info flags which drivers can use to avoid having subframes which arrived in the same A-MSDU rejected as duplicates in the net80211 input layer: IEEE80211_RXI_HWDEC_SAME_PN allows the same CCMP packet number for a series of subsequent frames. IEEE80211_RXI_SAME_SEQ allows the same 802.11 frame header sequence number for a series of subsequent of frames. Handle A-MPDU reordering on iwm 9k and iwx devices, based on code from iwlwifi. Rx block ack window information is provided by firmware. So far this info was ignored by drivers and reordering of A-MPDU subframes happened twice: Once in firmware, and again in net80211. Tested: iwm 7260: bcallah, dv iwm 7265: mpi, trondd, Matthias Schmidt iwm 8260: bket, Marcus MERIGHI iwm 8265: stsp, tracey, Uwe Werler iwm 9260: phessler, matthieu iwm 9560: stsp, Uwe Werler iwx ax200: jmc, stsp iwx ax201: stsp
2021-03-12Use RA instead of MiRA in iwm(4).Stefan Sperling
Tested by: iwm 7260: florian iwm 7265: TronDD, Aaron Miller, stsp iwm 8260: bket iwm 8265: matthieu, tracey, naddy, Dave Voutila, jcs, Mathieu Kerjouan, Matthias Schmidt, stsp iwm 9260: matthieu, phessler, Darren VanBuren iwm 9560: Uwe Werler
2020-10-11Stop exporting `wt_hwqueue' now that drivers don't advertise it.Martin Pieuchot
Pointed by and ok jsg@
2020-10-09Kill unused IEEE80211_RADIOTAP_HWQUEUE.Martin Pieuchot
Its value is conflicting with an effort to standardize TX flags fields of the radiotap header from Mathy Vanhoef. This flag used to indicate the presence of a specific hardware queue used by WME but is unchecked. ok sthen@, kn@
2020-04-03Fix an automatic Tx rate control issue in iwm(4) and iwx(4).Stefan Sperling
During a transmit burst, e.g. while tcpbench is running, iwm and iwx will queue up to 224 frames on the Tx ring. Rate control will make decisions a lot more often than just every 224 frames. Which means that results were reported and evaluated even if they did not correspond to the most recently chosen rate, spoiling the data available to the rate control algorithm. Prevent this problem by only reporting frames which match the currently chosen Tx rate. ok mpi@
2020-04-02Remove iwm(4) 11n mode CCK Tx rate fallback.Stefan Sperling
This fallback was added in r1.235 because we disabled firmware-based Tx retries in that commit. Firmware-based Tx retries were re-enabled in r1.291 so manual fallback to CCK rates is no longer required since the firmware will do this for us if needed (at a cost of a single retry).
2020-04-02iwm's LQ_CMD can work asynchronously from interrupt context.Stefan Sperling
There is no need to schedule a task to send this command and wait for a response. Linux iwlwifi also sends this command async. tested by myself and benno
2020-04-02Remove 'done' flag from struct iwm_tx_data. Check data->m == NULL instead.Stefan Sperling
No functional change.
2020-02-28Some monitor mode fixes for iwm(4):Stefan Sperling
- use a distinct station ID for monitor STA - set station type to "general purpose" instead of "link" - use "any address" (zero) as station address instead of broadcast address - use the inject monitor Tx queue, and do not enable regular Tx queues - accept multicast frames With this I can reliably switch back and forth between BSS and monitor modes. Tested on 7265 and 8265. ok mpi@
2020-02-12Implement a workaround for missing Tx completion interrupts in iwm(4).Stefan Sperling
iwm(4) releases resources whenever hardware signals Tx completion for a frame at Tx queue index 'N'. It has been observed that we sometimes get an interrupt for frame 'N - 2' followed by an interrupt for frame 'N', with no interrupt being received for frame 'N - 1'. Whenever this occurred a later decision to roam to another AP would fail since AP node references for frames affected by missing interrupts were never released. Another side-effect was an mbuf leak. The problem was first observed at 36c3 and debugged there with bluhm@. ok tobhe@
2019-12-18Re-enable firmware-based Tx retries at lower rates for iwm(4).Stefan Sperling
Firmware-based Tx retries were disabled when it was found that MiRA makes better choices while probing with a constant Tx retry rate. Before that change, high Tx rates looked better than they actually were. The change resulted in less retries and thus higher throughput because a lower, but actually working, initial Tx rate eventually became the preferred choice. However, disallowing retries at lower rates also resulted in increased amounts of observable packet loss, especially while the connection to the AP was still fresh and bad Tx rates had not been discovered yet. To get the best of both worlds, use a constant Tx rate for retries while MiRA is probing and otherwise allow firmware fallback to lower rates. tested by Tracey Emery, pamela, jasper, and myself, on 7265/8265/9260
2019-11-26Add support for MSI-X. MSI-X allows establishing a number ofPatrick Wildt
interrupt vectors and mapping events (RX on queues, commands, mgmt frames) to those vectors. For now we keep the existing behaviour, establish a single vector and map all events to it. Makes my Intel NUC 8i5BEH 9560 work Tested by jcs@ on a 9560 (w/ MSI-X) Tested by deraadt@ on a 9260 (w/ MSI-X) Tested by phessler@ on a 8260 (w/o MSI-X) ok stsp@
2019-11-18Add support for 9260 and 9560 devices to iwm(4).Stefan Sperling
Joint work with patrick@ Parts lifted from FreeBSD's r354492, r354502, r354508, r354516, r354508. Firmware is available with fw_update(1) thanks to sthen@ 7265 device tested by myself (still works) 8260 device tested by phessler@ (still works) 9260 devices tested by Travis Cole and myself 9560 devices tested by jcs@, mlarkin@, kevlo@, guenther@ Some 9560 devices have known issues. Those are being worked on. ok patrick@
2019-11-12Fix support for 3168 iwm(4) devices, and load new firmware for them.Stefan Sperling
Based on FreeBSD r345002 and Linux 44fd09dad5d2b78efbabbbbf623774e561e36cca. Tested for regressions by phessler@ (8260), kevlo@ (3165), and myself (7265) ok kevlo@
2019-11-08Add support to iwm(4) for ADD_STA commands used by newer firmware.Stefan Sperling
Tested by phessler@, Tracey Emery, and myself on 8260 and 8265.
2019-11-04Support iwm(4) firmware images with ucode_api flags larger than 32 bits.Stefan Sperling
ok patrick@
2019-11-04Add support for iwm firmware paging, required for newer 8k device firmware.Stefan Sperling
Patch by Imre Vadasz Tested for regressions by phessler and Krystian Lewandowski No very obvious mistakes found by kettenis@ ok patrick@
2019-10-28Have iwm(4) configure the PCIe LTR.Stefan Sperling
Patch by Imre Vadasz. Cross-check and pcireg.h tweak by kettenis@ ok patrick@
2019-10-28Skip the 'update MCC' command if iwm 8k firmware supports LocationStefan Sperling
Aware Regulatory (LAR) mode and LAR is disabled according to NVM. Patch by Imre Vadasz. ok patrick@
2019-10-28iwm: enlarge maximum NVM section size; required for newer firmwareStefan Sperling
ok patrick@
2019-10-18Add support for dynamic queue allocation (DQA) to iwm(4).Stefan Sperling
Required for new firmware images because the command queue index has changed. The driver remains compatible with our current firmware images for now. Tested by benno, jan, kevlo, florian, jmatthew, Tracey Emery ok jmatthew
2019-02-24Rework iwm(4) Tx rate selection.Stefan Sperling
Ask firmware to retry at a constant Tx rate instead of successively lower rates. This provides better feedback to Tx rate scaling algorithms in our kernel and thus increases Tx throughput, especially on clean channels. Make the driver fall back to CCK rates on 2 GHz channels if 11n MCS don't work. Previously, we were relying on firmware to do this for us. Tested on 7260, 7265, 8260, 8265 by me, jcs@, tb@, solene@, Matthias Schmidt.
2017-12-08Add support for background scanning to net80211 and iwm(4).Stefan Sperling
The iwm(4) driver will now roam between access points which share an SSID. Use 'ifconfig iwm0 debug' and 'tail -f /var/log/messages' to watch it do so. Tested by several people in various iterations. As usual, let me know if you run into issues. ok phessler deraadt
2017-10-22In iwm(4), allocate command response buffers dynamically in a ringStefan Sperling
instead of stashing responses in one single buffer in the softc. Allows getting rid of a tsleep() which protected the single buffer. Tested by myself and Carlos Cardenas on 7260, 7265, and 8260. hurray ok deraadt@
2017-10-04Introduce reference counting for tasks in iwm(4).Stefan Sperling
When bringing the interface down, the driver now waits for any running tasks to complete before shutting down the hardware. Based on suggestions by dlg@ and mpi@ Tested by myself, Manuel Giraud, anton@, and jcs@
2017-08-27Make it possible for iwm_stop() to sleep by always running it inStefan Sperling
a process context. In interrupt context, schedule the init task instead of calling iwm_stop() directly. ok procter@
2017-08-13Add proper support for iwm(4) firmware's time event. Cancel the event ifStefan Sperling
it is still scheduled before tearing down firmware state in iwm_unauth(). This change does not address any particular known issue, but matches what Linux does. If it causes any problems, let me know. ok tb@
2017-08-12In iwm(4), instead of scheduling a task which calls ieee80211_end_scan(),Stefan Sperling
call ieee80211_end_scan() directly from interrupt context. This extra task was already part of the original driver code from 2015 (but with a workq instead of a task). Back then, the driver had to run two separate scan commands in succession, for 2 GHz and then 5 GHz. Which is why a task was used, since sending another command requires a sleepable context. Nowadays, with our current firmware, a single scan command is sufficient so there is no code path which needs to sleep when the scan ends. ok mpi@
2017-07-16Add comments to the definitions of iwm(4) driver-private flags.Stefan Sperling
2017-07-15Get rid of the device reset hack in iwm_newstate_task().Stefan Sperling
Instead, maintain firmware state in accordance to the current net80211 state by adding/updating/removing MAC config, PHY->MAC binding, and the station in the firmare station table (we only add the AP to this table). By eliminating the iwm_stop() call from iwm_newstate_task(), this change prepares future work on fixing races between ioctls and tasks scheduled by this driver. There's a known new occasional fatal firmware error which results in the message "iwm0: could not remove MAC context (error 35)" I expect to fix this soon. tested by tb@ on 7265, by jcs@ on 8265, and by myself on 7260/7265/8260 ok mpi@ tb@
2017-06-20Remove the IWM_FLAG_HW_INITED flag from iwm(4). This flag was redundant.Stefan Sperling
The IFF_RUNNING flag in struct ifnet serves the same purpose. ok mpi@ kettenis@ deraadt@