Re: iwm: support 9260 devices

2019-11-20 Thread Patrick Wildt
On Wed, Nov 20, 2019 at 08:06:25AM -0800, Bryan Vyhmeister wrote:
> On Sat, Nov 16, 2019 at 10:01:44PM -0800, Philip Guenther wrote:
> > Looking good so far on my X1 extreme once I
> > added PCI_PRODUCT_INTEL_WL_9560_2 next to the _1 lines in if_iwm.c.
> > Awesome!
> 
> Could this change be committed as well? This allows the 9560 on my
> ThinkPad P1 to work as well. Thank you!
> 
> Bryan
> 

Oops.  Committed, thanks!

> 
> Index: sys/dev/pci/if_iwm.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
> retrieving revision 1.283
> diff -u -p -r1.283 if_iwm.c
> --- sys/dev/pci/if_iwm.c  18 Nov 2019 18:53:11 -  1.283
> +++ sys/dev/pci/if_iwm.c  20 Nov 2019 15:54:41 -
> @@ -8559,6 +8559,7 @@ iwm_attach(struct device *parent, struct
>   sc->sc_mqrx_supported = 1;
>   break;
>   case PCI_PRODUCT_INTEL_WL_9560_1:
> + case PCI_PRODUCT_INTEL_WL_9560_2:
>   sc->sc_fwname = "iwm-9000-34";
>   sc->host_interrupt_operation_mode = 0;
>   sc->sc_device_family = IWM_DEVICE_FAMILY_9000;
> 



Re: iwm: support 9260 devices

2019-11-20 Thread Bryan Vyhmeister
On Sat, Nov 16, 2019 at 10:01:44PM -0800, Philip Guenther wrote:
> Looking good so far on my X1 extreme once I
> added PCI_PRODUCT_INTEL_WL_9560_2 next to the _1 lines in if_iwm.c.
> Awesome!

Could this change be committed as well? This allows the 9560 on my
ThinkPad P1 to work as well. Thank you!

Bryan


Index: sys/dev/pci/if_iwm.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.283
diff -u -p -r1.283 if_iwm.c
--- sys/dev/pci/if_iwm.c18 Nov 2019 18:53:11 -  1.283
+++ sys/dev/pci/if_iwm.c20 Nov 2019 15:54:41 -
@@ -8559,6 +8559,7 @@ iwm_attach(struct device *parent, struct
sc->sc_mqrx_supported = 1;
break;
case PCI_PRODUCT_INTEL_WL_9560_1:
+   case PCI_PRODUCT_INTEL_WL_9560_2:
sc->sc_fwname = "iwm-9000-34";
sc->host_interrupt_operation_mode = 0;
sc->sc_device_family = IWM_DEVICE_FAMILY_9000;



Re: iwm: support 9260 devices

2019-11-18 Thread Stefan Sperling
On Mon, Nov 18, 2019 at 04:00:29AM +0100, Mark Kettenis wrote:
> > > iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d
> > 
> > I don't know yet what's up with that. Also happens on -17 firmware.
> > The number we show for -34 firmware on 8260 looks OK though.
> 
> It's printed using %d; probably should use %u instead.

Yes, exactly. jcs has fixed it in-tree.



Re: iwm: support 9260 devices

2019-11-17 Thread Mark Kettenis
> Date: Sat, 16 Nov 2019 19:08:05 +0100
> From: Stefan Sperling 
> 
> On Sat, Nov 16, 2019 at 11:44:03AM -0600, joshua stein wrote:
> > Awesome, thanks guys.  It's working great on the 9560 on my ThinkPad 
> > X1C7.  A speed test showed 44/18 Mbps and it continues to work fine 
> > after an S3 cycle.
> 
> Great :-)
> 
> > The firmware version string looks odd:
> > 
> > iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x11, 
> > msi
> > iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d
> 
> I don't know yet what's up with that. Also happens on -17 firmware.
> The number we show for -34 firmware on 8260 looks OK though.

It's printed using %d; probably should use %u instead.



Re: iwm: support 9260 devices

2019-11-17 Thread Kevin Lo
On Sat, Nov 16, 2019 at 10:01:44PM -0800, Philip Guenther wrote:
> 
> On Sat, Nov 16, 2019 at 8:19 AM Stefan Sperling  wrote:
> 
> > On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> > > This diff adds support for iwm(4) 9260 devices and hopefully 9560
> > > devices as well but I have not yet had time to test those.
> > >
> > > Joint work with patrick@. Some parts were lifted from FreeBSD.
> > >
> > > If you have the followng device in pcidump it should at least get
> > > an IP address from DHCP and be able to ping:
> > >  4:0:0: Intel Dual Band Wireless-AC 9260
> > >  0x: Vendor ID: 8086, Product ID: 2526
> > >
> > > The firmware is not in fw_update yet.
> > > In the meantime firmware can be fetched from here:
> > >
> > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> > >
> > > Copy these files to /etc/firmware as indicated:
> > > for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> > > for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> > >
> > > Checks for regressions on already supported devices are also welcome,
> > > in which case the firmware isn't needed.
> >
> > Better diff which fixes an Rx throughput issue which was present in
> > the previous diff.
> 
> 
> Looking good so far on my X1 extreme once I
> added PCI_PRODUCT_INTEL_WL_9560_2 next to the _1 lines in if_iwm.c.
> Awesome!

Also applied jcs and guenther diffs on my X1 Extreme:
iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x10, msi
iwm0: hw rev 0x310, fw ver 34.3125811985.0, address 48:f1:7f:xx:xx:xx

iwm(4) works perfectly.

Thanks,
Kevin



Re: iwm: support 9260 devices

2019-11-16 Thread Philip Guenther
On Sat, Nov 16, 2019 at 8:19 AM Stefan Sperling  wrote:

> On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> > This diff adds support for iwm(4) 9260 devices and hopefully 9560
> > devices as well but I have not yet had time to test those.
> >
> > Joint work with patrick@. Some parts were lifted from FreeBSD.
> >
> > If you have the followng device in pcidump it should at least get
> > an IP address from DHCP and be able to ping:
> >  4:0:0: Intel Dual Band Wireless-AC 9260
> >  0x: Vendor ID: 8086, Product ID: 2526
> >
> > The firmware is not in fw_update yet.
> > In the meantime firmware can be fetched from here:
> >
> https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> >
> > Copy these files to /etc/firmware as indicated:
> > for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> > for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> >
> > Checks for regressions on already supported devices are also welcome,
> > in which case the firmware isn't needed.
>
> Better diff which fixes an Rx throughput issue which was present in
> the previous diff.


Looking good so far on my X1 extreme once I
added PCI_PRODUCT_INTEL_WL_9560_2 next to the _1 lines in if_iwm.c.
Awesome!

Philip Guenther


Re: iwm: support 9260 devices

2019-11-16 Thread Mike Larkin
On Sat, Nov 16, 2019 at 05:09:40PM +0100, Stefan Sperling wrote:
> On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> > This diff adds support for iwm(4) 9260 devices and hopefully 9560
> > devices as well but I have not yet had time to test those.
> > 
> > Joint work with patrick@. Some parts were lifted from FreeBSD.
> > 
> > If you have the followng device in pcidump it should at least get
> > an IP address from DHCP and be able to ping:
> >  4:0:0: Intel Dual Band Wireless-AC 9260
> >  0x: Vendor ID: 8086, Product ID: 2526
> > 
> > The firmware is not in fw_update yet.
> > In the meantime firmware can be fetched from here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> > 
> > Copy these files to /etc/firmware as indicated:
> > for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> > for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> > 
> > Checks for regressions on already supported devices are also welcome,
> > in which case the firmware isn't needed.
> 
> Better diff which fixes an Rx throughput issue which was present in
> the previous diff.
> 

Cool. Seems like it works here, I'm using it now, but it seems to have had at
least one firmware error in the past few minutes:

iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x30, msi
iwm0: hw rev 0x310, fw ver 34.3125811985.0, address xxx
iwm0: fatal firmware error
iwm0: could not remove MAC context (error 35)

I didn't notice any problem though. Other than that it seems ok!

-ml



Re: iwm: support 9260 devices

2019-11-16 Thread Travis Cole
On Sat, Nov 16, 2019, at 08:09, Stefan Sperling wrote:
> On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> > This diff adds support for iwm(4) 9260 devices and hopefully 9560
> > devices as well but I have not yet had time to test those.
> > 
> > Joint work with patrick@. Some parts were lifted from FreeBSD.
> > 
> > If you have the followng device in pcidump it should at least get
> > an IP address from DHCP and be able to ping:
> > 4:0:0: Intel Dual Band Wireless-AC 9260
> > 0x: Vendor ID: 8086, Product ID: 2526
> > 
> > The firmware is not in fw_update yet.
> > In the meantime firmware can be fetched from here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> > 
> > Copy these files to /etc/firmware as indicated:
> > for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> > for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> > 
> > Checks for regressions on already supported devices are also welcome,
> > in which case the firmware isn't needed.
> 
> Better diff which fixes an Rx throughput issue which was present in
> the previous diff.

So far this works great on my Thinkpad X395.

 Speed tests at about 40Mbps and it seems ok under some load, such as
 cvs updates.

 I applied the diff from jcs too:

 iwm0 at pci1 dev 0 function 0 "Intel Dual Band Wireless-AC 9260" rev 0x29, msi
 iwm0: hw rev 0x320, fw ver 34.0.0, address d4:d2:52:93:9e:87

 Thanks for this work!



Re: iwm: support 9260 devices

2019-11-16 Thread Stefan Sperling
On Sat, Nov 16, 2019 at 12:30:56PM -0600, joshua stein wrote:
> On Sat, 16 Nov 2019 at 19:08:05 +0100, Stefan Sperling wrote:
> > On Sat, Nov 16, 2019 at 11:44:03AM -0600, joshua stein wrote:
> > > Awesome, thanks guys.  It's working great on the 9560 on my ThinkPad 
> > > X1C7.  A speed test showed 44/18 Mbps and it continues to work fine 
> > > after an S3 cycle.
> > 
> > Great :-)
> > 
> > > The firmware version string looks odd:
> > > 
> > > iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 
> > > 0x11, msi
> > > iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d
> > 
> > I don't know yet what's up with that. Also happens on -17 firmware.
> > The number we show for -34 firmware on 8260 looks OK though.
> 
> This fixes it and matches what Linux prints:
> 
> iwm0: hw rev 0x310, fw ver 34.3125811985.0, address 90:78:41:39:57:8d
> 
> iwlwifi :00:14.3: loaded firmware version 34.3125811985.0 op_mode iwlmvm

Thank you! OK stsp@

> diff --git sys/dev/pci/if_iwm.c sys/dev/pci/if_iwm.c
> index 74475da5e58..f6e7c36374c 100644
> --- sys/dev/pci/if_iwm.c
> +++ sys/dev/pci/if_iwm.c
> @@ -856,7 +856,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum 
> iwm_ucode_type ucode_type)
>   goto parse_out;
>   }
>   snprintf(sc->sc_fwver, sizeof(sc->sc_fwver),
> - "%d.%d.%d",
> + "%u.%u.%u",
>   le32toh(((uint32_t *)tlv_data)[0]),
>   le32toh(((uint32_t *)tlv_data)[1]),
>   le32toh(((uint32_t *)tlv_data)[2]));
> 
> 



Re: iwm: support 9260 devices

2019-11-16 Thread joshua stein
On Sat, 16 Nov 2019 at 19:08:05 +0100, Stefan Sperling wrote:
> On Sat, Nov 16, 2019 at 11:44:03AM -0600, joshua stein wrote:
> > Awesome, thanks guys.  It's working great on the 9560 on my ThinkPad 
> > X1C7.  A speed test showed 44/18 Mbps and it continues to work fine 
> > after an S3 cycle.
> 
> Great :-)
> 
> > The firmware version string looks odd:
> > 
> > iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x11, 
> > msi
> > iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d
> 
> I don't know yet what's up with that. Also happens on -17 firmware.
> The number we show for -34 firmware on 8260 looks OK though.

This fixes it and matches what Linux prints:

iwm0: hw rev 0x310, fw ver 34.3125811985.0, address 90:78:41:39:57:8d

iwlwifi :00:14.3: loaded firmware version 34.3125811985.0 op_mode iwlmvm


diff --git sys/dev/pci/if_iwm.c sys/dev/pci/if_iwm.c
index 74475da5e58..f6e7c36374c 100644
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -856,7 +856,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type 
ucode_type)
goto parse_out;
}
snprintf(sc->sc_fwver, sizeof(sc->sc_fwver),
-   "%d.%d.%d",
+   "%u.%u.%u",
le32toh(((uint32_t *)tlv_data)[0]),
le32toh(((uint32_t *)tlv_data)[1]),
le32toh(((uint32_t *)tlv_data)[2]));



Re: iwm: support 9260 devices

2019-11-16 Thread Stefan Sperling
On Sat, Nov 16, 2019 at 11:44:03AM -0600, joshua stein wrote:
> Awesome, thanks guys.  It's working great on the 9560 on my ThinkPad 
> X1C7.  A speed test showed 44/18 Mbps and it continues to work fine 
> after an S3 cycle.

Great :-)

> The firmware version string looks odd:
> 
> iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x11, 
> msi
> iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d

I don't know yet what's up with that. Also happens on -17 firmware.
The number we show for -34 firmware on 8260 looks OK though.



Re: iwm: support 9260 devices

2019-11-16 Thread joshua stein
On Sat, 16 Nov 2019 at 17:09:40 +0100, Stefan Sperling wrote:
> On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> > This diff adds support for iwm(4) 9260 devices and hopefully 9560
> > devices as well but I have not yet had time to test those.
> > 
> > Joint work with patrick@. Some parts were lifted from FreeBSD.
> > 
> > If you have the followng device in pcidump it should at least get
> > an IP address from DHCP and be able to ping:
> >  4:0:0: Intel Dual Band Wireless-AC 9260
> >  0x: Vendor ID: 8086, Product ID: 2526
> > 
> > The firmware is not in fw_update yet.
> > In the meantime firmware can be fetched from here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> > 
> > Copy these files to /etc/firmware as indicated:
> > for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> > for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> > 
> > Checks for regressions on already supported devices are also welcome,
> > in which case the firmware isn't needed.
> 
> Better diff which fixes an Rx throughput issue which was present in
> the previous diff.

Awesome, thanks guys.  It's working great on the 9560 on my ThinkPad 
X1C7.  A speed test showed 44/18 Mbps and it continues to work fine 
after an S3 cycle.

The firmware version string looks odd:

iwm0 at pci0 dev 20 function 3 "Intel Dual Band Wireless AC 9560" rev 0x11, msi
iwm0: hw rev 0x310, fw ver 34.-1169155311.0, address 90:78:41:39:57:8d



Re: iwm: support 9260 devices

2019-11-16 Thread Stefan Sperling
On Sat, Nov 16, 2019 at 04:51:44PM +0100, Stefan Sperling wrote:
> This diff adds support for iwm(4) 9260 devices and hopefully 9560
> devices as well but I have not yet had time to test those.
> 
> Joint work with patrick@. Some parts were lifted from FreeBSD.
> 
> If you have the followng device in pcidump it should at least get
> an IP address from DHCP and be able to ping:
>  4:0:0: Intel Dual Band Wireless-AC 9260
>  0x: Vendor ID: 8086, Product ID: 2526
> 
> The firmware is not in fw_update yet.
> In the meantime firmware can be fetched from here:
> https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/
> 
> Copy these files to /etc/firmware as indicated:
> for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
> for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34
> 
> Checks for regressions on already supported devices are also welcome,
> in which case the firmware isn't needed.

Better diff which fixes an Rx throughput issue which was present in
the previous diff.


diff refs/heads/master refs/heads/iwm9k
blob - d00bf976e9384dab139d990efb834c2d41fe0e62 (mode 644)
blob + 03298eb329f8c8fbe2da16e8ac33dfa2cea96715 (mode 600)
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -292,6 +292,8 @@ int iwm_start_hw(struct iwm_softc *);
 void   iwm_stop_device(struct iwm_softc *);
 void   iwm_nic_config(struct iwm_softc *);
 intiwm_nic_rx_init(struct iwm_softc *);
+intiwm_nic_rx_legacy_init(struct iwm_softc *);
+intiwm_nic_rx_mq_init(struct iwm_softc *);
 intiwm_nic_tx_init(struct iwm_softc *);
 intiwm_nic_init(struct iwm_softc *);
 intiwm_enable_ac_txq(struct iwm_softc *, int, int);
@@ -363,11 +365,14 @@ int   iwm_run_init_mvm_ucode(struct iwm_softc *, int);
 intiwm_config_ltr(struct iwm_softc *);
 intiwm_rx_addbuf(struct iwm_softc *, int, int);
 intiwm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *);
+intiwm_rxmq_get_signal_strength(struct iwm_softc *, struct 
iwm_rx_mpdu_desc *);
 void   iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *);
 intiwm_get_noise(const struct iwm_statistics_rx_non_phy *);
 void   iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *, struct mbuf_list *);
+void   iwm_rx_mpdu_mq(struct iwm_softc *, struct iwm_rx_packet *,
+   struct iwm_rx_data *, struct mbuf_list *);
 void   iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node *);
 void   iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_node *);
@@ -913,6 +918,13 @@ iwm_write_prph(struct iwm_softc *sc, uint32_t addr, ui
IWM_WRITE(sc, IWM_HBUS_TARG_PRPH_WDAT, val);
 }
 
+void
+iwm_write_prph64(struct iwm_softc *sc, uint64_t addr, uint64_t val)
+{
+   iwm_write_prph(sc, (uint32_t)addr, val & 0x);
+   iwm_write_prph(sc, (uint32_t)addr + 4, val >> 32);
+}
+
 int
 iwm_read_mem(struct iwm_softc *sc, uint32_t addr, void *buf, int dwords)
 {
@@ -984,7 +996,7 @@ iwm_nic_lock(struct iwm_softc *sc)
IWM_SETBITS(sc, IWM_CSR_GP_CNTRL,
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
 
-   if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000)
+   if (sc->sc_device_family >= IWM_DEVICE_FAMILY_8000)
DELAY(2);
 
if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL,
@@ -,19 +1123,28 @@ int
 iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring)
 {
bus_size_t size;
-   int i, err;
+   size_t descsz;
+   int count, i, err;
 
ring->cur = 0;
 
+   if (sc->sc_mqrx_supported) {
+   count = IWM_RX_MQ_RING_COUNT;
+   descsz = sizeof(uint64_t);
+   } else {
+   count = IWM_RX_RING_COUNT;
+   descsz = sizeof(uint32_t);
+   }
+
/* Allocate RX descriptors (256-byte aligned). */
-   size = IWM_RX_RING_COUNT * sizeof(uint32_t);
-   err = iwm_dma_contig_alloc(sc->sc_dmat, >desc_dma, size, 256);
+   size = count * descsz;
+   err = iwm_dma_contig_alloc(sc->sc_dmat, >free_desc_dma, size, 
256);
if (err) {
printf("%s: could not allocate RX ring DMA memory\n",
DEVNAME(sc));
goto fail;
}
-   ring->desc = ring->desc_dma.vaddr;
+   ring->desc = ring->free_desc_dma.vaddr;
 
/* Allocate RX status area (16-byte aligned). */
err = iwm_dma_contig_alloc(sc->sc_dmat, >stat_dma,
@@ -1135,7 +1156,18 @@ iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_
}
ring->stat = ring->stat_dma.vaddr;
 
-   for (i = 0; i < IWM_RX_RING_COUNT; i++) {
+   if (sc->sc_mqrx_supported) {
+   size = count * sizeof(uint32_t);
+   err = iwm_dma_contig_alloc(sc->sc_dmat, >used_desc_dma,
+   size, 256);
+   if (err) {
+   printf("%s: could not allocate RX 

iwm: support 9260 devices

2019-11-16 Thread Stefan Sperling
This diff adds support for iwm(4) 9260 devices and hopefully 9560
devices as well but I have not yet had time to test those.

Joint work with patrick@. Some parts were lifted from FreeBSD.

If you have the followng device in pcidump it should at least get
an IP address from DHCP and be able to ping:
 4:0:0: Intel Dual Band Wireless-AC 9260
 0x: Vendor ID: 8086, Product ID: 2526

The firmware is not in fw_update yet.
In the meantime firmware can be fetched from here:
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/

Copy these files to /etc/firmware as indicated:
for 9260: iwlwifi-9260-th-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9260-34
for 9560: iwlwifi-9000-pu-b0-jf-b0-34.ucode -> /etc/firmware/iwm-9000-34

Checks for regressions on already supported devices are also welcome,
in which case the firmware isn't needed.

diff refs/heads/master refs/heads/iwm9k
blob - d00bf976e9384dab139d990efb834c2d41fe0e62 (mode 644)
blob + b6519e1e982ea6dfbcfb4c460537b622c19be90e (mode 600)
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -292,6 +292,8 @@ int iwm_start_hw(struct iwm_softc *);
 void   iwm_stop_device(struct iwm_softc *);
 void   iwm_nic_config(struct iwm_softc *);
 intiwm_nic_rx_init(struct iwm_softc *);
+intiwm_nic_rx_legacy_init(struct iwm_softc *);
+intiwm_nic_rx_mq_init(struct iwm_softc *);
 intiwm_nic_tx_init(struct iwm_softc *);
 intiwm_nic_init(struct iwm_softc *);
 intiwm_enable_ac_txq(struct iwm_softc *, int, int);
@@ -363,11 +365,14 @@ int   iwm_run_init_mvm_ucode(struct iwm_softc *, int);
 intiwm_config_ltr(struct iwm_softc *);
 intiwm_rx_addbuf(struct iwm_softc *, int, int);
 intiwm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *);
+intiwm_rxmq_get_signal_strength(struct iwm_softc *, struct 
iwm_rx_mpdu_desc *);
 void   iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *);
 intiwm_get_noise(const struct iwm_statistics_rx_non_phy *);
 void   iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *, struct mbuf_list *);
+void   iwm_rx_mpdu_mq(struct iwm_softc *, struct iwm_rx_packet *,
+   struct iwm_rx_data *, struct mbuf_list *);
 void   iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node *);
 void   iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_node *);
@@ -913,6 +918,13 @@ iwm_write_prph(struct iwm_softc *sc, uint32_t addr, ui
IWM_WRITE(sc, IWM_HBUS_TARG_PRPH_WDAT, val);
 }
 
+void
+iwm_write_prph64(struct iwm_softc *sc, uint64_t addr, uint64_t val)
+{
+   iwm_write_prph(sc, (uint32_t)addr, val & 0x);
+   iwm_write_prph(sc, (uint32_t)addr + 4, val >> 32);
+}
+
 int
 iwm_read_mem(struct iwm_softc *sc, uint32_t addr, void *buf, int dwords)
 {
@@ -984,7 +996,7 @@ iwm_nic_lock(struct iwm_softc *sc)
IWM_SETBITS(sc, IWM_CSR_GP_CNTRL,
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
 
-   if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000)
+   if (sc->sc_device_family >= IWM_DEVICE_FAMILY_8000)
DELAY(2);
 
if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL,
@@ -,19 +1123,28 @@ int
 iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring)
 {
bus_size_t size;
-   int i, err;
+   size_t descsz;
+   int count, i, err;
 
ring->cur = 0;
 
+   if (sc->sc_mqrx_supported) {
+   count = IWM_RX_MQ_RING_COUNT;
+   descsz = sizeof(uint64_t);
+   } else {
+   count = IWM_RX_RING_COUNT;
+   descsz = sizeof(uint32_t);
+   }
+
/* Allocate RX descriptors (256-byte aligned). */
-   size = IWM_RX_RING_COUNT * sizeof(uint32_t);
-   err = iwm_dma_contig_alloc(sc->sc_dmat, >desc_dma, size, 256);
+   size = count * descsz;
+   err = iwm_dma_contig_alloc(sc->sc_dmat, >free_desc_dma, size, 
256);
if (err) {
printf("%s: could not allocate RX ring DMA memory\n",
DEVNAME(sc));
goto fail;
}
-   ring->desc = ring->desc_dma.vaddr;
+   ring->desc = ring->free_desc_dma.vaddr;
 
/* Allocate RX status area (16-byte aligned). */
err = iwm_dma_contig_alloc(sc->sc_dmat, >stat_dma,
@@ -1135,7 +1156,18 @@ iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_
}
ring->stat = ring->stat_dma.vaddr;
 
-   for (i = 0; i < IWM_RX_RING_COUNT; i++) {
+   if (sc->sc_mqrx_supported) {
+   size = count * sizeof(uint32_t);
+   err = iwm_dma_contig_alloc(sc->sc_dmat, >used_desc_dma,
+   size, 256);
+   if (err) {
+   printf("%s: could not allocate RX ring DMA memory\n",
+   DEVNAME(sc));
+   goto fail;
+   }
+   }
+
+   for (i = 0; i < count; i++) {
struct