1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 /* 3 * Copyright (C) 2024-2025 Intel Corporation 4 */ 5 #ifndef __iwl_mld_phy_h__ 6 #define __iwl_mld_phy_h__ 7 8 #include "mld.h" 9 10 /** 11 * struct iwl_mld_phy - PHY configuration parameters 12 * 13 * @fw_id: fw id of the phy. 14 * @chandef: the last chandef that mac80211 configured the driver 15 * with. Used to detect a no-op when the chanctx changes. 16 * @channel_load_by_us: channel load on this channel caused by 17 * the NIC itself, as indicated by firmware 18 * @avg_channel_load_not_by_us: averaged channel load on this channel caused by 19 * others. This value is invalid when in EMLSR (due to FW limitations) 20 * @mld: pointer to the MLD context 21 */ 22 struct iwl_mld_phy { 23 /* Add here fields that need clean up on hw restart */ 24 struct_group(zeroed_on_hw_restart, 25 u8 fw_id; 26 struct cfg80211_chan_def chandef; 27 ); 28 /* And here fields that survive a hw restart */ 29 u32 channel_load_by_us; 30 u32 avg_channel_load_not_by_us; 31 struct iwl_mld *mld; 32 }; 33 34 static inline struct iwl_mld_phy * iwl_mld_phy_from_mac80211(struct ieee80211_chanctx_conf * channel)35iwl_mld_phy_from_mac80211(struct ieee80211_chanctx_conf *channel) 36 { 37 return (void *)channel->drv_priv; 38 } 39 40 /* Cleanup function for struct iwl_mld_phy, will be called in restart */ 41 static inline void iwl_mld_cleanup_phy(struct iwl_mld * mld,struct iwl_mld_phy * phy)42iwl_mld_cleanup_phy(struct iwl_mld *mld, struct iwl_mld_phy *phy) 43 { 44 CLEANUP_STRUCT(phy); 45 } 46 47 int iwl_mld_allocate_fw_phy_id(struct iwl_mld *mld); 48 int iwl_mld_phy_fw_action(struct iwl_mld *mld, 49 struct ieee80211_chanctx_conf *ctx, u32 action); 50 struct cfg80211_chan_def * 51 iwl_mld_get_chandef_from_chanctx(struct iwl_mld *mld, 52 struct ieee80211_chanctx_conf *ctx); 53 u8 iwl_mld_get_fw_ctrl_pos(const struct cfg80211_chan_def *chandef); 54 55 #endif /* __iwl_mld_phy_h__ */ 56