git: 1110ed3b46ea - main - iwx: Use subdevice for comparison

From: Tom Jones <thj_at_FreeBSD.org>
Date: Mon, 14 Apr 2025 08:17:16 UTC
The branch main has been updated by thj:

URL: https://cgit.FreeBSD.org/src/commit/?id=1110ed3b46ea2765fd45ebfb4e0f0fd997ecb92e

commit 1110ed3b46ea2765fd45ebfb4e0f0fd997ecb92e
Author:     Tom Jones <thj@FreeBSD.org>
AuthorDate: 2025-04-14 08:10:48 +0000
Commit:     Tom Jones <thj@FreeBSD.org>
CommitDate: 2025-04-14 08:16:40 +0000

    iwx: Use subdevice for comparison
    
    iwx goes through a couple of steps to match devices to firmware. There
    is a default match of pcie device and subdevices and then a secondary
    pass to find a template configuration struct.
    
    Previously we were looking up the device not the subdevice and that
    led to ax210 cards in some devices (Framework 13) from being matched to
    the correct firmware.
    
    PR:     285905
    Reviewed by:    bz, adrian
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D49759
---
 sys/dev/iwx/if_iwx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c
index 9e5d5a9569d5..6d3aa1b49c15 100644
--- a/sys/dev/iwx/if_iwx.c
+++ b/sys/dev/iwx/if_iwx.c
@@ -10022,12 +10022,11 @@ out:
 const struct iwx_device_cfg *
 iwx_find_device_cfg(struct iwx_softc *sc)
 {
-	uint16_t mac_type, rf_type;
+	uint16_t sdev_id, mac_type, rf_type;
 	uint8_t mac_step, cdb, jacket, rf_id, no_160, cores;
 	int i;
-	uint16_t sdev_id;
 
-	sdev_id = pci_get_device(sc->sc_dev);
+	sdev_id = pci_get_subdevice(sc->sc_dev);
 	mac_type = IWX_CSR_HW_REV_TYPE(sc->sc_hw_rev);
 	mac_step = IWX_CSR_HW_REV_STEP(sc->sc_hw_rev << 2);
 	rf_type = IWX_CSR_HW_RFID_TYPE(sc->sc_hw_rf_id);