On 2025-07-18 13:57, Stefan Sperling wrote:

> On Fri, Jul 18, 2025 at 03:33:40AM +0530, Prateek Kumar wrote: 
> 
> Thanks for tracking this down. Your fix works but I would not want
> to override cases for unrelated devices which need IWX_QU_C_HR_B_FW,
> or IWX_QUZ_A_HR_B_FW, or IWX_QU_B_HR_B_FW. The risk of breaking
> someone else's device has to be taken into account.

I agree with your reasoning on this.

> Below is a diff which attempts to target your specific device only, but
> leaves the logic for other devices untouched.  Does this also make the
> driver load the correct firmware image?
> 
> diff /usr/src
> path + /usr/src
> commit - f38c6673edb7aa3abc9726f600e2d2b7fb61a5a5
> blob - 6e44ed25dd855dc8ff0e684b40b17bdc31f3ef66
> file + sys/dev/pci/if_iwx.c
> --- sys/dev/pci/if_iwx.c
> +++ sys/dev/pci/if_iwx.c
> @@ -11489,9 +11489,14 @@ iwx_attach(struct device *parent, struct device 
> *self,
> case PCI_PRODUCT_INTEL_WL_22500_3:
> if (sc->sc_hw_rev == IWX_CSR_HW_REV_TYPE_QU_C0)
> sc->sc_fwname = IWX_QU_C_HR_B_FW;
> -        else if (sc->sc_hw_rev == IWX_CSR_HW_REV_TYPE_QUZ)
> -            sc->sc_fwname = IWX_QUZ_A_HR_B_FW;
> -        else
> +        else if (sc->sc_hw_rev == IWX_CSR_HW_REV_TYPE_QUZ) {
> +            uint32_t rf_id = IWX_CSR_HW_RFID_TYPE(sc->sc_hw_rf_id);
> +            if (rf_id == IWX_CFG_RF_TYPE_JF1 ||
> +                rf_id == IWX_CFG_RF_TYPE_JF2)
> +                sc->sc_fwname = IWX_QUZ_A_JF_B_FW;
> +            else
> +                sc->sc_fwname = IWX_QUZ_A_HR_B_FW;
> +        } else
> sc->sc_fwname = IWX_QU_B_HR_B_FW;
> sc->sc_device_family = IWX_DEVICE_FAMILY_22000;
> sc->sc_integrated = 1;

I have tested this change, it loads the correct firmware image.

Reply via email to