Commit Graph

19 Commits

Author SHA1 Message Date
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
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
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
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
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
Kyle Evans
9612bbf423 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)
2019-01-24 03:44:48 +00:00
Adrian Chadd
522f6fe474 [iwm] Add iwm_nic_unlock() calls missing from previous commit.
Obtained from:	dragonflybsd.git f88ab372284e63c4c13da93e9026a203b9b4cdc5
2017-05-09 02:42:53 +00:00
Adrian Chadd
ab492a5732 [iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves.
* Fix a couple of cases where the nic lock ended up not being grabbed
  during an iwm_read_prph() or iwm_write_prph().

Obtained from:	dragonflybsd.git 6c5470f2db219c61e362c981fea969d97e1b8293
2017-05-09 02:41:33 +00:00
Adrian Chadd
616201d1f7 [iwm] include opt_iwm.h and opt_wlan.h consistently in all files. 2017-05-09 02:38:23 +00:00
Adrian Chadd
6c2c3bd86d [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
2017-02-22 04:35:53 +00:00
Adrian Chadd
99baf303e7 [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
2017-02-08 06:53:23 +00:00
Adrian Chadd
760f56b7b8 [iwm] Get rid of iwm_disable_rx_dma, just use iwm_pcie_rx_stop directly.
* This also fixes one of many small nic lock handling bugs, and matches
  iwlwifi's code.

Obtained from:	DragonflyBSD git 50787d03cd0a0366c9cc4a055bb6977e5f65c85d
2017-02-08 06:43:02 +00:00
Adrian Chadd
8c03b09087 [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
2017-02-06 03:29:50 +00:00
Sean Bruno
6a5bc1d1ee 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
2016-07-26 00:02:17 +00:00
Adrian Chadd
88b6e4f33a [iwm] Fix several nitpicks in iwm(4).
Move some declarations to if_iwmreg.h.
    Remove iwm_fw_alive(); just call iwm_post_alive() directly.
    Simplify iwm_mvm_add_sta().
    Return timeout error from iwm_apm_init().
    Print a message when init (i.e. boot) firmware fails to load.
    Remove some commented-out code which wouldn't compile anyway.
    Move iwm_mvm_tx_fifo to if_iwmreg.h to match better where Linux puts it.

    Taken-From: OpenBSD (if_iwm.c r1.80 and if_iwmreg.h r1.11)

Submitted by:	 Imre Vadasz <imre@vdsz.com>
Obtained from:	DragonflyBSD 29fcb331e5620ae145a6ab9cdda830e22fff626a
2016-06-02 05:43:16 +00:00
Andriy Voskoboinyk
b789292fd8 iwm: add 'opt_wlan.h' include into source files.
Include net80211 options file, so IEEE80211_DEBUG_REFCNT option will be
handled correctly.
2016-05-19 23:31:00 +00:00
Rui Paulo
49fdbf0a92 iwm: use the proper include path for iwm headers. 2015-08-08 21:08:35 +00:00
Rui Paulo
d4886179cb 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
2015-08-08 06:06:48 +00:00