The oldest firmware core supported by devices that use the iwlmld op mode is now core107, which uses version 3 of MAC_PM_POWER_TABLE. No supported firmware uses version 2 anymore, so remove it, along with the constants that only it used. Assisted-by: LLM Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/mld/constants.h | 7 - .../net/wireless/intel/iwlwifi/mld/power.c | 173 +----------------- 2 files changed, 4 insertions(+), 176 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mld/constants.h b/drivers/net/wireless/intel/iwlwifi/mld/constants.h index bfd5398510ee..0b57e4afed2b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mld/constants.h @@ -20,13 +20,6 @@ #define IWL_MLD_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024) /* defined in TU */ #define IWL_MLD_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024) /* defined in TU */ -#define IWL_MLD_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC) -#define IWL_MLD_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC) - -#define IWL_MLD_PS_SNOOZE_INTERVAL 25 -#define IWL_MLD_PS_SNOOZE_INTERVAL 25 -#define IWL_MLD_PS_SNOOZE_WINDOW 50 - #define IWL_MLD_PS_SNOOZE_HEAVY_TX_THLD_PACKETS 30 #define IWL_MLD_PS_SNOOZE_HEAVY_RX_THLD_PACKETS 20 diff --git a/drivers/net/wireless/intel/iwlwifi/mld/power.c b/drivers/net/wireless/intel/iwlwifi/mld/power.c index f81949686af9..56dbfad8e8a5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/power.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/power.c @@ -88,68 +88,6 @@ static bool iwl_mld_power_is_radar(struct iwl_mld *mld, return chanctx_conf->def.chan->flags & IEEE80211_CHAN_RADAR; } -static void iwl_mld_power_configure_uapsd_v2(struct iwl_mld *mld, - struct iwl_mld_link *link, - struct iwl_mac_power_cmd_v2 *cmd, - bool ps_poll) -{ - bool tid_found = false; - - cmd->rx_data_timeout_uapsd = - cpu_to_le32(IWL_MLD_UAPSD_RX_DATA_TIMEOUT); - cmd->tx_data_timeout_uapsd = - cpu_to_le32(IWL_MLD_UAPSD_TX_DATA_TIMEOUT); - - /* set advanced pm flag with no uapsd ACs to enable ps-poll */ - if (ps_poll) { - cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); - return; - } - - for (enum ieee80211_ac_numbers ac = IEEE80211_AC_VO; - ac <= IEEE80211_AC_BK; - ac++) { - if (!link->queue_params[ac].uapsd) - continue; - - cmd->flags |= - cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK | - POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK); - - cmd->uapsd_ac_flags |= BIT(ac); - - /* QNDP TID - the highest TID with no admission control */ - if (!tid_found && !link->queue_params[ac].acm) { - tid_found = true; - switch (ac) { - case IEEE80211_AC_VO: - cmd->qndp_tid = 6; - break; - case IEEE80211_AC_VI: - cmd->qndp_tid = 5; - break; - case IEEE80211_AC_BE: - cmd->qndp_tid = 0; - break; - case IEEE80211_AC_BK: - cmd->qndp_tid = 1; - break; - } - } - } - - if (cmd->uapsd_ac_flags == (BIT(IEEE80211_AC_VO) | - BIT(IEEE80211_AC_VI) | - BIT(IEEE80211_AC_BE) | - BIT(IEEE80211_AC_BK))) { - cmd->flags |= cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK); - cmd->snooze_interval = cpu_to_le16(IWL_MLD_PS_SNOOZE_INTERVAL); - cmd->snooze_window = cpu_to_le16(IWL_MLD_PS_SNOOZE_WINDOW); - } - - cmd->uapsd_max_sp = mld->hw->uapsd_max_sp_len; -} - static void iwl_mld_power_configure_uapsd(struct iwl_mld *mld, struct iwl_mld_link *link, struct iwl_mac_power_cmd *cmd, @@ -220,97 +158,6 @@ iwl_mld_power_config_skip_dtim(struct iwl_mld *mld, } #define POWER_KEEP_ALIVE_PERIOD_SEC 25 -static void iwl_mld_power_build_cmd_v2(struct iwl_mld *mld, - struct ieee80211_vif *vif, - struct iwl_mac_power_cmd_v2 *cmd, - bool d3) -{ - int dtimper, bi; - int keep_alive; - struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif); - struct ieee80211_bss_conf *link_conf = &vif->bss_conf; - struct iwl_mld_link *link = &mld_vif->deflink; - bool ps_poll = false; - - cmd->id_and_color = cpu_to_le32(mld_vif->fw_id); - - if (ieee80211_vif_is_mld(vif)) { - int link_id; - - if (WARN_ON(!vif->active_links)) - return; - - /* The firmware consumes one single configuration for the vif - * and can't differentiate between links, just pick the lowest - * link_id's configuration and use that. - */ - link_id = __ffs(vif->active_links); - link_conf = link_conf_dereference_check(vif, link_id); - link = iwl_mld_link_dereference_check(mld_vif, link_id); - - if (WARN_ON(!link_conf || !link)) - return; - } - dtimper = link_conf->dtim_period; - bi = link_conf->beacon_int; - - /* Regardless of power management state the driver must set - * keep alive period. FW will use it for sending keep alive NDPs - * immediately after association. Check that keep alive period - * is at least 3 * DTIM - */ - keep_alive = DIV_ROUND_UP(ieee80211_tu_to_usec(3 * dtimper * bi), - USEC_PER_SEC); - keep_alive = max(keep_alive, POWER_KEEP_ALIVE_PERIOD_SEC); - cmd->keep_alive_seconds = cpu_to_le16(keep_alive); - - if (iwlmld_mod_params.power_scheme != IWL_POWER_SCHEME_CAM) - cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); - - if (!vif->cfg.ps || iwl_mld_tdls_sta_count(mld) > 0) - return; - - cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); - cmd->flags |= cpu_to_le16(POWER_FLAGS_ENABLE_SMPS_MSK); - - /* firmware supports LPRX for beacons at rate 1 Mbps or 6 Mbps only */ - if (link_conf->beacon_rate && - (link_conf->beacon_rate->bitrate == 10 || - link_conf->beacon_rate->bitrate == 60)) { - cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); - cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; - } - - if (d3) { - iwl_mld_power_config_skip_dtim(mld, link_conf, - &cmd->skip_dtim_periods, - &cmd->flags); - cmd->rx_data_timeout = - cpu_to_le32(IWL_MLD_WOWLAN_PS_RX_DATA_TIMEOUT); - cmd->tx_data_timeout = - cpu_to_le32(IWL_MLD_WOWLAN_PS_TX_DATA_TIMEOUT); - } else if (iwl_mld_vif_low_latency(mld_vif) && vif->p2p) { - cmd->tx_data_timeout = - cpu_to_le32(IWL_MLD_SHORT_PS_TX_DATA_TIMEOUT); - cmd->rx_data_timeout = - cpu_to_le32(IWL_MLD_SHORT_PS_RX_DATA_TIMEOUT); - } else { - cmd->rx_data_timeout = - cpu_to_le32(IWL_MLD_DEFAULT_PS_RX_DATA_TIMEOUT); - cmd->tx_data_timeout = - cpu_to_le32(IWL_MLD_DEFAULT_PS_TX_DATA_TIMEOUT); - } - - /* uAPSD is only enabled for specific certifications. For those cases, - * mac80211 will allow uAPSD. Always call iwl_mld_power_configure_uapsd - * which will look at what mac80211 is saying. - */ -#ifdef CONFIG_IWLWIFI_DEBUGFS - ps_poll = mld_vif->use_ps_poll; -#endif - iwl_mld_power_configure_uapsd_v2(mld, link, cmd, ps_poll); -} - static void iwl_mld_power_build_cmd(struct iwl_mld *mld, struct ieee80211_vif *vif, struct iwl_mac_power_cmd *cmd, @@ -403,23 +250,11 @@ static void iwl_mld_power_build_cmd(struct iwl_mld *mld, int iwl_mld_update_mac_power(struct iwl_mld *mld, struct ieee80211_vif *vif, bool d3) { - int cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, MAC_PM_POWER_TABLE, 0); - - if (cmd_ver >= 3) { - struct iwl_mac_power_cmd cmd = {}; + struct iwl_mac_power_cmd cmd = {}; - iwl_mld_power_build_cmd(mld, vif, &cmd, d3); - return iwl_mld_send_cmd_with_flags_pdu(mld, - MAC_PM_POWER_TABLE, 0, - &cmd, sizeof(cmd)); - } else { - struct iwl_mac_power_cmd_v2 cmd = {}; - - iwl_mld_power_build_cmd_v2(mld, vif, &cmd, d3); - return iwl_mld_send_cmd_with_flags_pdu(mld, - MAC_PM_POWER_TABLE, 0, - &cmd, sizeof(cmd)); - } + iwl_mld_power_build_cmd(mld, vif, &cmd, d3); + return iwl_mld_send_cmd_with_flags_pdu(mld, MAC_PM_POWER_TABLE, 0, + &cmd, sizeof(cmd)); } static void -- 2.34.1