Skip to content

Commit 3735526

Browse files
egrumbachMiriam-Rachel
authored andcommitted
wifi: iwlwifi: mld: support iwl_omi_send_status_notif version 2
The firmware provides the station id, use it since it makes our lives easier. No need to assume we have a single BSS vif, and look up the station id to whom the OMI was sent. Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250711183056.7d2cd878855f.I8625ebb2c4e1fb484aafd16a07549f2eeb506e08@changeid
1 parent 8bec2ec commit 3735526

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,24 @@ struct iwl_sec_key_cmd {
699699
} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
700700
} __packed; /* SEC_KEY_CMD_API_S_VER_1 */
701701

702+
/**
703+
* struct iwl_omi_send_status_notif_v1 - OMI status notification
704+
* @success: indicates that the OMI was sent successfully
705+
* (currently always set)
706+
*/
707+
struct iwl_omi_send_status_notif_v1 {
708+
__le32 success;
709+
} __packed; /* OMI_SEND_STATUS_NTFY_API_S_VER_1 */
710+
702711
/**
703712
* struct iwl_omi_send_status_notif - OMI status notification
704713
* @success: indicates that the OMI was sent successfully
705714
* (currently always set)
715+
* @sta_id: sta_id to which the OMI was sent
706716
*/
707717
struct iwl_omi_send_status_notif {
708718
__le32 success;
709-
} __packed; /* OMI_SEND_STATUS_NTFY_API_S_VER_1 */
719+
__le32 sta_id;
720+
} __packed; /* OMI_SEND_STATUS_NTFY_API_S_VER_2 */
710721

711722
#endif /* __iwl_fw_api_datapath_h__ */

drivers/net/wireless/intel/iwlwifi/mld/link.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,11 +649,39 @@ void iwl_mld_omi_ap_changed_bw(struct iwl_mld *mld,
649649
void iwl_mld_handle_omi_status_notif(struct iwl_mld *mld,
650650
struct iwl_rx_packet *pkt)
651651
{
652+
int ver = iwl_fw_lookup_notif_ver(mld->fw, DATA_PATH_GROUP,
653+
OMI_SEND_STATUS_NOTIF, 1);
652654
struct ieee80211_link_sta *link_sta;
653655
struct iwl_mld_link *mld_link;
654656
struct ieee80211_vif *vif;
655657

656-
vif = iwl_mld_get_omi_bw_reduction_pointers(mld, &link_sta, &mld_link);
658+
if (ver == 2) {
659+
const struct iwl_omi_send_status_notif *notif =
660+
(const void *)pkt->data;
661+
u32 sta_id = le32_to_cpu(notif->sta_id);
662+
struct iwl_mld_vif *mld_vif;
663+
664+
if (IWL_FW_CHECK(mld, sta_id >= mld->fw->ucode_capa.num_stations,
665+
"Invalid station %d\n", sta_id))
666+
return;
667+
668+
link_sta = wiphy_dereference(mld->wiphy,
669+
mld->fw_id_to_link_sta[sta_id]);
670+
if (IWL_FW_CHECK(mld, !link_sta, "Station does not exist\n"))
671+
return;
672+
673+
vif = iwl_mld_sta_from_mac80211(link_sta->sta)->vif;
674+
mld_vif = iwl_mld_vif_from_mac80211(vif);
675+
676+
mld_link = iwl_mld_link_dereference_check(mld_vif,
677+
link_sta->link_id);
678+
if (WARN(!mld_link, "Link %d does not exist\n",
679+
link_sta->link_id))
680+
return;
681+
} else {
682+
vif = iwl_mld_get_omi_bw_reduction_pointers(mld, &link_sta,
683+
&mld_link);
684+
}
657685
if (IWL_FW_CHECK(mld, !vif, "unexpected OMI notification\n"))
658686
return;
659687

drivers/net/wireless/intel/iwlwifi/mld/notif.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ CMD_VERSIONS(time_msmt_notif,
349349
CMD_VERSIONS(time_sync_confirm_notif,
350350
CMD_VER_ENTRY(1, iwl_time_msmt_cfm_notify))
351351
CMD_VERSIONS(omi_status_notif,
352-
CMD_VER_ENTRY(1, iwl_omi_send_status_notif))
352+
CMD_VER_ENTRY(1, iwl_omi_send_status_notif_v1)
353+
CMD_VER_ENTRY(2, iwl_omi_send_status_notif))
353354
CMD_VERSIONS(ftm_resp_notif, CMD_VER_ENTRY(10, iwl_tof_range_rsp_ntfy))
354355
CMD_VERSIONS(beacon_filter_notif, CMD_VER_ENTRY(2, iwl_beacon_filter_notif))
355356

0 commit comments

Comments
 (0)