]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mld: support FW TLV for NAN max channel switch time
authorIsrael Kozitz <israel.kozitz@intel.com>
Wed, 27 May 2026 20:05:06 +0000 (23:05 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 3 Jun 2026 14:02:54 +0000 (17:02 +0300)
Add a new FW TLV (IWL_UCODE_TLV_FW_NAN_MAX_CHAN_SWITCH_TIME) that
allows the firmware to specify the NAN maximum channel switch time
in microseconds.

When the TLV is present, use its value for the NAN device capability.
Otherwise, fall back to the default of 4 milliseconds.

Signed-off-by: Israel Kozitz <israel.kozitz@intel.com>
Link: https://patch.msgid.link/20260527230313.e8ae1a3adacd.I15b933407ca3974a65047b63b4f9b00bed3520fb@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/fw/img.h
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c

index 197c88c25f72d14147bac1fcae9da579fe5b9505..a26ed82a8106f3c64081cd5251a09d7ab77c4244 100644 (file)
@@ -112,6 +112,7 @@ enum iwl_ucode_tlv_type {
        IWL_UCODE_TLV_FW_NUM_LINKS              = IWL_UCODE_TLV_CONST_BASE + 1,
        IWL_UCODE_TLV_FW_NUM_BEACONS            = IWL_UCODE_TLV_CONST_BASE + 2,
        IWL_UCODE_TLV_FW_NUM_MCAST_KEY_ENTRIES  = IWL_UCODE_TLV_CONST_BASE + 3,
+       IWL_UCODE_TLV_FW_NAN_MAX_CHAN_SWITCH_TIME = IWL_UCODE_TLV_CONST_BASE + 4,
 
        IWL_UCODE_TLV_TYPE_DEBUG_INFO           = IWL_UCODE_TLV_DEBUG_BASE + 0,
        IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION    = IWL_UCODE_TLV_DEBUG_BASE + 1,
index 75b1344f6cbe0931f292d45ea0a6e3b5699728a6..95b45a253641b6650ed43fa3106e4b6c3fd5eb74 100644 (file)
@@ -54,6 +54,7 @@ struct iwl_ucode_capabilities {
        u32 num_links;
        u32 num_beacons;
        u32 num_mcast_key_entries;
+       u16 nan_max_chan_switch_time;
        DECLARE_BITMAP(_api, NUM_IWL_UCODE_TLV_API);
        DECLARE_BITMAP(_capa, NUM_IWL_UCODE_TLV_CAPA);
 
index 4885245295380ea09e6418321bfe003c50b057bb..842586d4fc5ce4a2f1f12a524a9e518a27d2d5c4 100644 (file)
@@ -1337,6 +1337,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
                        capa->num_mcast_key_entries =
                                le32_to_cpup((const __le32 *)tlv_data);
                        break;
+               case IWL_UCODE_TLV_FW_NAN_MAX_CHAN_SWITCH_TIME:
+                       if (tlv_len != sizeof(u32))
+                               goto invalid_tlv_len;
+                       capa->nan_max_chan_switch_time =
+                               le32_to_cpup((const __le32 *)tlv_data);
+                       break;
                case IWL_UCODE_TLV_UMAC_DEBUG_ADDRS: {
                        const struct iwl_umac_debug_addrs *dbg_ptrs =
                                (const void *)tlv_data;
index 92858b8f7395c35c565e2e911c8f8d5b59178193..56e0c19e0f81efdd648db0e194146b6892574905 100644 (file)
@@ -291,8 +291,13 @@ static void iwl_mld_hw_set_nan(struct iwl_mld *mld)
                  NAN_DEV_CAPA_NUM_RX_ANT_POS) &
                 NAN_DEV_CAPA_NUM_RX_ANT_MASK);
 
-       /* Maximal channel switch time is 4 msec */
-       hw->wiphy->nan_capa.max_channel_switch_time = 4 * USEC_PER_MSEC;
+       /* Maximal channel switch time - use FW TLV value if available */
+       if (mld->fw->ucode_capa.nan_max_chan_switch_time)
+               hw->wiphy->nan_capa.max_channel_switch_time =
+                       mld->fw->ucode_capa.nan_max_chan_switch_time;
+       else
+               hw->wiphy->nan_capa.max_channel_switch_time =
+                       4 * USEC_PER_MSEC;
 
        hw->wiphy->nan_capa.phy.ht = mld->nvm_data->nan_phy_capa.ht;
        hw->wiphy->nan_capa.phy.vht = mld->nvm_data->nan_phy_capa.vht;