wifi: iwlwifi: cfg: remove fw_name_mac
authorJohannes Berg <johannes.berg@intel.com>
Fri, 2 May 2025 12:20:23 +0000 (15:20 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 6 May 2025 19:22:12 +0000 (22:22 +0300)
Instead of having fw_name_mac in the config, derive it
from the MAC type instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250502151751.8dba9a2d3546.I41fa594d6a0be163444b90c1ed4b441a949d3899@changeid
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
drivers/net/wireless/intel/iwlwifi/cfg/ax210.c
drivers/net/wireless/intel/iwlwifi/cfg/bz.c
drivers/net/wireless/intel/iwlwifi/cfg/dr.c
drivers/net/wireless/intel/iwlwifi/cfg/sc.c
drivers/net/wireless/intel/iwlwifi/iwl-config.h
drivers/net/wireless/intel/iwlwifi/iwl-drv.c

index 1237d1b62b651b24c927197110b678b6fcf7fa75..b2d24a49234c825004da61480d50d2fb8bb79b82 100644 (file)
@@ -171,7 +171,6 @@ const struct iwl_cfg_trans_params iwl_qu_long_latency_trans_cfg = {
  * 9560 nevertheless.
  */
 const struct iwl_cfg iwl9560_qu_jf_cfg = {
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        .num_rbds = IWL_NUM_RBDS_NON_HE,
 };
@@ -212,7 +211,6 @@ const char iwl_ax201_killer_1650i_name[] =
        "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)";
 
 const struct iwl_cfg iwl_qu_hr1 = {
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -225,7 +223,6 @@ const struct iwl_cfg iwl_qu_hr1 = {
 };
 
 const struct iwl_cfg iwl_qu_hr = {
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -238,7 +235,6 @@ const struct iwl_cfg iwl_qu_hr = {
 
 const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
        .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -250,7 +246,6 @@ const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
 };
 
 const struct iwl_cfg iwl_quz_hr1 = {
-       .fw_name_mac = "QuZ",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -264,7 +259,6 @@ const struct iwl_cfg iwl_quz_hr1 = {
 
 const struct iwl_cfg iwl_ax201_cfg_quz_hr = {
        .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
-       .fw_name_mac = "QuZ",
        IWL_DEVICE_22500,
        /*
          * This device doesn't support receiving BlockAck with a large bitmap
@@ -277,7 +271,6 @@ const struct iwl_cfg iwl_ax201_cfg_quz_hr = {
 
 const struct iwl_cfg iwl_ax1650s_cfg_quz_hr = {
        .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)",
-       .fw_name_mac = "QuZ",
        IWL_DEVICE_22500,
        /*
          * This device doesn't support receiving BlockAck with a large bitmap
@@ -290,7 +283,6 @@ const struct iwl_cfg iwl_ax1650s_cfg_quz_hr = {
 
 const struct iwl_cfg iwl_ax1650i_cfg_quz_hr = {
        .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)",
-       .fw_name_mac = "QuZ",
        IWL_DEVICE_22500,
        /*
          * This device doesn't support receiving BlockAck with a large bitmap
@@ -315,7 +307,6 @@ const struct iwl_cfg iwl_ax200_cfg_cc = {
 
 const struct iwl_cfg killer1650s_2ax_cfg_qu_hr = {
        .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201NGW)",
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -328,7 +319,6 @@ const struct iwl_cfg killer1650s_2ax_cfg_qu_hr = {
 
 const struct iwl_cfg killer1650i_2ax_cfg_qu_hr = {
        .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201D2W)",
-       .fw_name_mac = "Qu",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
@@ -340,7 +330,6 @@ const struct iwl_cfg killer1650i_2ax_cfg_qu_hr = {
 };
 
 const struct iwl_cfg iwl_cfg_quz_hr = {
-       .fw_name_mac = "QuZ",
        IWL_DEVICE_22500,
        /*
         * This device doesn't support receiving BlockAck with a large bitmap
index e87b57b9e2c045a97b47976151db83fff945f7a1..309d59d28c73b4bedb8e4431899d61cbaf721c36 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2024 Intel Corporation
+ * Copyright (C) 2018-2025 Intel Corporation
  */
 #include <linux/module.h>
 #include <linux/stringify.h>
@@ -248,7 +248,6 @@ const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0_long = {
 };
 
 const struct iwl_cfg iwl_cfg_ma = {
-       .fw_name_mac = "ma",
        .uhb_supported = true,
        IWL_DEVICE_AX210,
        .num_rbds = IWL_NUM_RBDS_AX210_HE,
index f055255a7c9370a64687702be8be07bde8c964e9..1d491c72bae80e6470a7616eed6108b1cdfc65bc 100644 (file)
@@ -163,7 +163,6 @@ const char iwl_gl_name[] = "Intel(R) Wi-Fi 7 BE200 320MHz";
 const char iwl_mtp_name[] = "Intel(R) Wi-Fi 7 BE202 160MHz";
 
 const struct iwl_cfg iwl_cfg_bz = {
-       .fw_name_mac = "bz",
        .uhb_supported = true,
        IWL_DEVICE_BZ,
        .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,
@@ -171,7 +170,6 @@ const struct iwl_cfg iwl_cfg_bz = {
 };
 
 const struct iwl_cfg iwl_cfg_gl = {
-       .fw_name_mac = "gl",
        .uhb_supported = true,
        IWL_DEVICE_BZ,
        .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,
index 282b9b846c3ac0f2ffc7f1657fcdd238c326d052..4bca1b13858fe07cb1f9ce5be6a8765793c8bd4e 100644 (file)
@@ -138,7 +138,6 @@ const struct iwl_cfg_trans_params iwl_dr_trans_cfg = {
 const char iwl_dr_name[] = "Intel(R) TBD Dr device";
 
 const struct iwl_cfg iwl_cfg_dr = {
-       .fw_name_mac = "dr",
        IWL_DEVICE_DR,
 };
 
@@ -156,7 +155,6 @@ const struct iwl_cfg_trans_params iwl_br_trans_cfg = {
 const char iwl_br_name[] = "Intel(R) TBD Br device";
 
 const struct iwl_cfg iwl_cfg_br = {
-       .fw_name_mac = "br",
        IWL_DEVICE_DR,
 };
 
index 5c740f302c937a6da677e229882c19d27013717a..4b39f11c9582adbf0bfe910bb4c26f0a50d7fc95 100644 (file)
@@ -146,17 +146,14 @@ const char iwl_sp_name[] = "Intel(R) Wi-Fi 7 BE213 160MHz";
 const char iwl_pe_name[] = "Intel(R) Wi-Fi 8 BN201";
 
 const struct iwl_cfg iwl_cfg_sc = {
-       .fw_name_mac = "sc",
        IWL_DEVICE_SC,
 };
 
 const struct iwl_cfg iwl_cfg_sc2 = {
-       .fw_name_mac = "sc2",
        IWL_DEVICE_SC,
 };
 
 const struct iwl_cfg iwl_cfg_sc2f = {
-       .fw_name_mac = "sc2f",
        IWL_DEVICE_SC,
 };
 
index db8dbdde55bdb580485fbd657c25b564fe87d8fb..82ca7faf3fe0058b75bf80981b4d71e05659ccc2 100644 (file)
@@ -312,7 +312,6 @@ struct iwl_fw_mon_regs {
  * @fw_name_pre: Firmware filename prefix. The api version and extension
  *     (.ucode) will be added to filename before loading from disk. The
  *     filename is constructed as <fw_name_pre>-<api>.ucode.
- * @fw_name_mac: MAC name for this config, the remaining pieces of the
  *     name will be generated dynamically
  * @ucode_api_max: Highest version of uCode API supported by driver.
  * @ucode_api_min: Lowest version of uCode API supported by driver.
@@ -363,7 +362,6 @@ struct iwl_cfg {
        /* params specific to an individual device within a device family */
        const char *name;
        const char *fw_name_pre;
-       const char *fw_name_mac;
        /* params likely to change within a device family */
        const struct iwl_ht_params *ht_params;
        const struct iwl_eeprom_params *eeprom_params;
index d36837501e08a733d4aea71f76a0e241b7f6744a..0b208d973585b46e63fd4bf674b662e1a8ec382d 100644 (file)
@@ -182,16 +182,59 @@ static bool iwl_drv_is_wifi7_supported(struct iwl_trans *trans)
 const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf)
 {
        char mac_step, rf_step;
-       const char *rf, *cdb;
+       const char *mac, *rf, *cdb;
 
        if (trans->cfg->fw_name_pre)
                return trans->cfg->fw_name_pre;
 
-       if (WARN_ON(!trans->cfg->fw_name_mac))
-               return "unconfigured";
-
        mac_step = iwl_drv_get_step(trans->hw_rev_step);
 
+       switch (CSR_HW_REV_TYPE(trans->hw_rev)) {
+       case IWL_CFG_MAC_TYPE_PU:
+               mac = "pu";
+               break;
+       case IWL_CFG_MAC_TYPE_TH:
+               mac = "th";
+               break;
+       case IWL_CFG_MAC_TYPE_QU:
+               mac = "Qu";
+               break;
+       case IWL_CFG_MAC_TYPE_QUZ:
+               mac = "QuZ";
+               break;
+       case IWL_CFG_MAC_TYPE_SO:
+       case IWL_CFG_MAC_TYPE_SOF:
+               mac = "so";
+               break;
+       case IWL_CFG_MAC_TYPE_MA:
+               mac = "ma";
+               break;
+       case IWL_CFG_MAC_TYPE_BZ:
+       case IWL_CFG_MAC_TYPE_BZ_W:
+               mac = "bz";
+               break;
+       case IWL_CFG_MAC_TYPE_GL:
+               mac = "gl";
+               break;
+       case IWL_CFG_MAC_TYPE_SC:
+               mac = "sc";
+               break;
+       case IWL_CFG_MAC_TYPE_SC2:
+               mac = "sc2";
+               break;
+       case IWL_CFG_MAC_TYPE_SC2F:
+               mac = "sc2f";
+               break;
+       case IWL_CFG_MAC_TYPE_BR:
+               mac = "br";
+               break;
+       case IWL_CFG_MAC_TYPE_DR:
+               mac = "dr";
+               break;
+       default:
+               return "unknown-mac";
+       }
+
        rf_step = iwl_drv_get_step(CSR_HW_RFID_STEP(trans->hw_rf_id));
 
        switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
@@ -223,8 +266,7 @@ const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf)
 
        scnprintf(buf, FW_NAME_PRE_BUFSIZE,
                  "iwlwifi-%s-%c0-%s%s-%c0",
-                 trans->cfg->fw_name_mac, mac_step,
-                 rf, cdb, rf_step);
+                 mac, mac_step, rf, cdb, rf_step);
 
        return buf;
 }