]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: be more chatty when we fail to find a wifi7 device
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 19 Oct 2025 08:45:05 +0000 (11:45 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 28 Oct 2025 14:17:26 +0000 (16:17 +0200)
All wifi7 devices need CONFIG_IWLMLD to be enabled.
If we can't support the wifi7 device and the module is not enabled,
complain to the user.
The check in iwl_req_fw_callback is then no longer required.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20251019114304.071dae9a5de2.I1603085bac5a796442faa75982f8675647becfec@changeid
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/iwl-drv.h
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c

index 7d58e294618d601f8568ee135e9f077d21d17592..94ef422dc56a98bf15b7413a0a56f21fdbb73590 100644 (file)
@@ -177,7 +177,7 @@ static inline char iwl_drv_get_step(int step)
        return 'a' + step;
 }
 
-static bool iwl_drv_is_wifi7_supported(struct iwl_trans *trans)
+bool iwl_drv_is_wifi7_supported(struct iwl_trans *trans)
 {
        return trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ &&
               CSR_HW_RFID_TYPE(trans->info.hw_rf_id) >= IWL_CFG_RF_TYPE_FM;
@@ -1859,13 +1859,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 #if IS_ENABLED(CONFIG_IWLMLD)
        if (iwl_drv_is_wifi7_supported(drv->trans))
                op = &iwlwifi_opmode_table[MLD_OP_MODE];
-#else
-       if (iwl_drv_is_wifi7_supported(drv->trans)) {
-               IWL_ERR(drv,
-                       "IWLMLD needs to be compiled to support this firmware\n");
-               mutex_unlock(&iwlwifi_opmode_table_mtx);
-               goto out_unbind;
-       }
 #endif
 
        IWL_INFO(drv, "loaded firmware version %s op_mode %s\n",
index a0b67e8aba8da9aa032ab19e206e6f9e48d40105..6e60953de2ec4dae0e3ace7787f416346b8d2516 100644 (file)
@@ -78,6 +78,12 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans);
  */
 void iwl_drv_stop(struct iwl_drv *drv);
 
+/*
+ * iwl_drv_is_wifi7_supported - returns if wifi7 is supported
+ * If yes, iwlmld needs to be used to drive the device.
+ */
+bool iwl_drv_is_wifi7_supported(struct iwl_trans *trans);
+
 /*
  * exported symbol management
  *
index 59307b5df4417d2cf13099f8e5f6513e090cba73..164d060ec617c3e52627b0e4afd1a24db3485684 100644 (file)
@@ -4218,6 +4218,15 @@ int iwl_pci_gen1_2_probe(struct pci_dev *pdev,
                 pdev->device, pdev->subsystem_device,
                 info.hw_rev, info.hw_rf_id);
 
+#if !IS_ENABLED(CONFIG_IWLMLD)
+       if (iwl_drv_is_wifi7_supported(iwl_trans)) {
+               IWL_ERR(iwl_trans,
+                       "IWLMLD needs to be compiled to support this device\n");
+               ret = -EOPNOTSUPP;
+               goto out_free_trans;
+       }
+#endif
+
        dev_info = iwl_pci_find_dev_info(pdev->device, pdev->subsystem_device,
                                         CSR_HW_RFID_TYPE(info.hw_rf_id),
                                         CSR_HW_RFID_IS_CDB(info.hw_rf_id),