From: Johannes Berg Date: Thu, 15 Feb 2024 08:54:45 +0000 (+0100) Subject: Merge wireless into wireless-next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=cd882e2fb2e63c80367fc984a2155239710e2801;p=linux.git Merge wireless into wireless-next There's a conflict already and some upcoming changes also depend on changes in wireless for being conflict- free, so pull wireless in to make all that easier. Signed-off-by: Johannes Berg --- cd882e2fb2e63c80367fc984a2155239710e2801 diff --cc drivers/net/wireless/intel/iwlwifi/mvm/tx.c index 4981bb1f02512,461f26d9214e4..e502f4ee9e1f7 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@@ -520,31 -520,16 +520,41 @@@ static void iwl_mvm_set_tx_cmd_crypto(s } } +static bool iwl_mvm_use_host_rate(struct iwl_mvm *mvm, + struct iwl_mvm_sta *mvmsta, + struct ieee80211_hdr *hdr, + struct ieee80211_tx_info *info) +{ + if (unlikely(!mvmsta)) + return true; + + if (unlikely(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT)) + return true; + + if (likely(ieee80211_is_data(hdr->frame_control) && + mvmsta->sta_state >= IEEE80211_STA_AUTHORIZED)) + return false; + + /* + * Not a data frame, use host rate if on an old device that + * can't possibly be doing MLO (firmware may be selecting a + * bad rate), if we might be doing MLO we need to let FW pick + * (since we don't necesarily know the link), but FW rate + * selection was fixed. + */ + return mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ; +} + + static void iwl_mvm_copy_hdr(void *cmd, const void *hdr, int hdrlen, + const u8 *addr3_override) + { + struct ieee80211_hdr *out_hdr = cmd; + + memcpy(cmd, hdr, hdrlen); + if (addr3_override) + memcpy(out_hdr->addr3, addr3_override, ETH_ALEN); + } + /* * Allocates and sets the Tx cmd the driver data pointers in the skb */