Commit Graph

239 Commits

Author SHA1 Message Date
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
71625ec9ad sys: Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:24 -06:00
Warner Losh
2ff63af9b8 sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:18 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Gordon Bergling
2fae7b811f iwm(4): Correct some typos in source code comments
- s/occured/occurred/

MFC after:	3 days
2022-09-04 13:33:59 +02:00
John Baldwin
a571fed7f4 iwi/iwm/iwn: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:39:31 -07:00
Mateusz Guzik
f7daf71038 iwm: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-04-22 22:16:25 +00:00
Gordon Bergling
586023f10d iwm(4): Remove a double word in a source code comment
- s/for for/for/

MFC after:	3 days
2022-04-09 11:04:23 +02:00
Gordon Bergling
2543276943 iwm(4): Remove a whitespace
In 9f4dc7fd97 I accidentally added a whitespace at the
end of the line. Remove it.

Reported by:	Jose Luis Duran (via github)
MFC with:	9f4dc7fd97
2022-04-02 13:09:26 +02:00
Gordon Bergling
9f4dc7fd97 iwm(4): Fix a typo in a source code comment
- s/coresponding/corresponding/

Obtained from:	NetBSD
MFC after:	3 days
2022-04-02 11:50:38 +02:00
Mark Johnston
1dc8ed06f3 iwm: Fix -Wunused-but-set-variable warnings
MFC after:	1 week
2022-02-28 10:54:15 -05:00
Mateusz Guzik
35273e2099 iwm: plug some of set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 17:06:56 +00:00
Gordon Bergling
8acb662126 iwm(4): Fix a typo in a source code comment
- s/availabe/available/

MFC after:	3 days
2021-11-19 19:51:55 +01:00
Adrian Chadd
d524e370c4 iwm: Update SCD register accesses
This brings it inline with what's in openbsd.  I tested it locally
with 2G and 5G association; it seems to work.

Tested: Intel 7260 AC, hw 0x140, STA mode, 2G/5G

Differential Revision: https://reviews.freebsd.org/D32627
Subscribers: imp
Obtainde from: OpenBSD
2021-10-26 20:28:55 -07:00
Adrian Chadd
355c15130a 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
2021-10-26 20:28:54 -07:00
Bjoern A. Zeeb
9a6695532b net80211/drivers: improve ieee80211_rx_stats for band
While IEEE80211_R_BAND was defined, there was no place to store the
band.  Add a field for that, adjust ieee80211_lookup_channel_rxstatus()
to require it, and update drivers passing "R_{FREQ|IEEE}" in already to
provide the band as well.  For the moment keep the fall-back code
requiring all three fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D30662
2021-10-22 09:55:54 +00:00
Mark Johnston
90cc8706cc iwm(4): Add support for Intel Killer(R) Wireless-AC 1550i
PR:		252578
Submitted by:	shu <ankohuu@outlook.com>
MFC after:	1 week
2021-01-14 11:41:28 -05:00
Bjoern A. Zeeb
aaa1fdb87b iwm: fix regression from r365419 (ieee80211_media_change())
In r365419 ieee80211_media_change() callers were updated to not longer
act on the obselete ENETRESET return code.
While in the old days iwm has done a stop/init cycle in these cases,
this was not executed since r193340.
As a consequence simplify iwm code as well by passing ieee80211_media_change()
right to ieee80211_vap_attach() as there is no more need for a local
implementation.

Reported by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
MFC after:	3 days
X-MFC:		fix is already in stable/12
PR:		248955
2020-09-11 14:18:47 +00:00
Bjoern A. Zeeb
c6167b4bf5 WiFi: fix ieee80211_media_change() callers
In r178354 with the introduction of multi-bss ("vap") support factoring
out started and with r193340 ieee80211_media_change() no longer returned
ENETRESET but only 0 or error.
As ieee80211(9) tells the ieee80211_media_change() function should not
be called directly but is registered with ieee80211_vap_attach() instead.

Some drivers have not been fully converted.  After fixing the return
checking some of these functions were simply wrappers between
ieee80211_vap_attach() and ieee80211_media_change(), so remove the extra
function, where possible as well.

PR:		248955
Submitted by:	Tong Zhang (ztong0001 gmail.com) (original)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2020-09-07 15:35:40 +00:00
Andriy Gapon
22d1b05c8c 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
2020-05-20 08:15:09 +00:00
Mark Johnston
6844522a9a iwm: Print the command code for any unhandled commands.
Reported by:	Marc Veldman <marc@bumblingdork.com>
MFC after:	1 week
2020-04-27 13:26:43 +00:00
Hans Petter Selasky
b65f813c1a Widen EPOCH(9) usage in PCI WLAN drivers.
Make sure all occurrences of ieee80211_input_xxx() in sys/dev are
covered by a network epoch section. Do not depend on the interrupt
handler nor any taskqueues being in a network epoch section.

This patch should unbreak the PCI WLAN drivers after r357004.

Pointy hat:	glebius@
Sponsored by:	Mellanox Technologies
2020-01-30 10:28:01 +00:00
Mark Johnston
e7065dd1e8 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
2019-11-27 20:32:53 +00:00
Mark Johnston
86ea3e8bb1 iwm(4): Fix version string formatting.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-27 20:32:31 +00:00
Mark Johnston
1903c60041 iwm: Sync device initialization and reset code with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:17 +00:00
Mark Johnston
666c8655f2 iwm: Implement support for scans with "adaptive" dwell time.
This is required by 9000-series firmware.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:39:04 +00:00
Mark Johnston
c513f15bf0 iwm: Use the default station for all transmits.
This is what iwlwifi seems to do, and the previous behaviour triggered
firmware panics during transmit on a 9560.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:49 +00:00
Mark Johnston
d2c7b21a56 iwm: Set flag for pad bytes in offload_assist.
Though we don't otherwise use firmware's offload capabilities, we need
to set this flag when the MAC header's size isn't a multiple of four.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:36 +00:00
Mark Johnston
49c76634fb iwm: Use antenna B for TX on 9000-series chips.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:38:17 +00:00
Mark Johnston
09a07cd5ea iwm: Update the station add command for the new RX API.
The firmware expects a new version of the add-station command in
9000-series chips.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:55 +00:00
Mark Johnston
c3bfecf3df iwm: Sync with iwm_run_init_mvm_ucode() with iwlwifi.
Do not configure bluetooth on newer chips, it causes firmware panics.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:30 +00:00
Mark Johnston
1f0976dc58 iwm: Fix scheduler configuration for aux and cmd queue configuration.
- Configure the scheduler only for the management queue.
- Fix a bug when enabling the schduler: the queues are specified using a
  bitmask.
- Fix style in the area.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:37:17 +00:00
Mark Johnston
96c5aa2f4b 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
2019-11-07 23:37:02 +00:00
Mark Johnston
2ca43dacca iwm: Enable all 31 tx queues.
For now iwm only ever uses queue 0 and the management queue, but my 9560
raises a software error interrupt during initialization if this flag is
not set.  iwlwifi sets it for all 7000- and 8000-series hardware, so we
might as well do it unconditionally.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:46 +00:00
Mark Johnston
b1a48ccc18 iwm: Explicitly enable MSI on newer chipsets.
9000-series chips implement support for MSI-X interrupts and disable MSI
by default.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:25 +00:00
Mark Johnston
1809534a1a iwm: Define the mqrx_supported capability.
The firmware for 9000-series and newer devices has a different receive
API which supports multiple queues.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:36:10 +00:00
Mark Johnston
5b3b7a2df1 iwm: Add device configuration definitions for 9000-series chips.
Match such chips using the device ID.  We should really be checking the
subdevice as well, since a smaller number of 9460 and 9560 devices
actually belong to a new series of devices and require different
firmware, but that will require some extra logic in iwm_attach().

Submitted by:	lwhsu, Guo Wen Jun <blockk2000@gmail.com>
MFC after:	2 weeks
2019-11-07 23:35:54 +00:00
Mark Johnston
d2ec5b521b iwm: Sync the firmware tx_cmd descriptor fields with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:35:29 +00:00
Mark Johnston
be05a0fd77 iwm: Use the same delays as iwlwifi when resetting the device.
This is required for initialization to succeed for newer device
families.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:35:15 +00:00
Mark Johnston
3bf2d5dd64 iwm: Add a device family definition for 9000 chips.
Convert existing device family checks to avoid assuming that the device
family is always one of IWM_DEVICE_FAMILY_7000 or _8000.

Submitted by:	lwhsu, Guo Wen Jun <blockk2000@gmail.com>
MFC after:	2 weeks
2019-11-07 23:35:01 +00:00
Mark Johnston
381471bc83 iwm: Add 9000-series RX register definitions.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:41 +00:00
Mark Johnston
4e5deb6734 iwm: Add a few _prph functions needed for 9000-series chips.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:28 +00:00
Mark Johnston
9dd2749044 iwm: Sync the TLV API enum with iwlwifi.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:34:12 +00:00
Mark Johnston
267c626f0d iwm: Define a name for TLV 48.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:33:58 +00:00
Mark Johnston
b41c219912 iwm: Avoid calling iwm_start() each time a descriptor is reclaimed.
Only perform the call when a qfull bit transitions.  While here, avoid
assignments in declarations in iwm_mvm_rx_tx_cmd().

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:57 +00:00
Mark Johnston
3cc50d22fd iwm: Call iwm_dev_check() earlier in iwm_attach().
This ensures that the driver softc reflects device capabilities as early
as possible, for use by device initialization code that is conditional
on certain capabilities.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:43 +00:00
Mark Johnston
eff8a9793e iwm: Simplify fw_has_{api,capa}().
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:25 +00:00
Mark Johnston
22a4c7bcb3 iwm: Remove a couple of unused fields from the softc.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:29:00 +00:00
Mark Johnston
113875bd68 iwm: Fix style in the TX path.
Also ensure that the htole* macros are applied correctly when specifying
the segment length and upper address bits.  No functional change
intended (unless you use iwm(4) on a big-endian machine).

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-11-07 23:27:54 +00:00
Mark Johnston
dda0c86204 iwm: Drain callouts after stopping the device during detach.
Otherwise there is a window where they may be rescheduled.  This
typically manifested as a page fault shortly after unloading if_iwm.ko.
Close the race by draining callouts after calling iwm_stop_device(),
which is also what Dragonfly does.

Change whitespace to reduce gratuitous diffs with Dragonfly.

Reported and tested by:	seanc
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2019-07-03 21:05:40 +00:00