]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: nan: add availability attribute to schedule config
authorAvraham Stern <avraham.stern@intel.com>
Fri, 15 May 2026 12:09:34 +0000 (15:09 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 May 2026 12:17:12 +0000 (15:17 +0300)
Add the availability attribute to the schedule config command. The
firmware needs to add this attribute to schedule update frames
(e.g. when ULW changed or the local schedule changed).

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20260515150751.97809376508e.Ie7f00f97992016c6bb2f4a5c9fc201ac58eed8ce@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/nan.c

index 530ba263c5f04f30f7a293f456de72289ddb4682..d13b2374b6422a374a4b6d929ddb91bbb477065b 100644 (file)
@@ -693,6 +693,14 @@ void iwl_mld_nan_vif_cfg_changed(struct iwl_mld *mld,
                break;
        case 2:
                cmd_size = sizeof(struct iwl_nan_schedule_cmd);
+
+               if (sched_cfg->avail_blob_len &&
+                   !WARN_ON(sched_cfg->avail_blob_len >
+                            sizeof(cmd.avail_attr.attr))) {
+                       cmd.avail_attr.attr_len = sched_cfg->avail_blob_len;
+                       memcpy(cmd.avail_attr.attr, sched_cfg->avail_blob,
+                              sched_cfg->avail_blob_len);
+               }
                break;
        default:
                IWL_ERR(mld, "NAN: unsupported NAN schedule cmd version %d\n",
@@ -727,6 +735,15 @@ void iwl_mld_nan_vif_cfg_changed(struct iwl_mld *mld,
        BUILD_BUG_ON(ARRAY_SIZE(sched_cfg->channels) !=
                     ARRAY_SIZE(cmd.channels));
 
+       /*
+        * mac80211 removes unused channels before adding new ones, so it may
+        * update an empty schedule with an availability attribute because it
+        * is going to add channels later. Since the firmware does not expect
+        * an availability attribute without channels, ignore it in that case.
+        */
+       if (empty_schedule)
+               cmd.avail_attr.attr_len = 0;
+
        /* find links we can keep (same chanctx/PHY) */
        for (i = 0; i < ARRAY_SIZE(sched_cfg->channels); i++) {
                struct ieee80211_chanctx_conf *chanctx;