aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-06-14 14:59:05 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-06-19 12:05:24 +0200
commitedcda51d99a7ae67d1cb4019b2d33d8d5defc6fe (patch)
tree0b8c1b90a09619ec50dc3f3627c7d60b7a2eb959 /drivers/net/wireless/intel/iwlwifi/mvm/tx.c
parentwifi: mac80211: Add debugfs entry to report dormant links (diff)
downloadwireguard-linux-edcda51d99a7ae67d1cb4019b2d33d8d5defc6fe.tar.xz
wireguard-linux-edcda51d99a7ae67d1cb4019b2d33d8d5defc6fe.zip
wifi: iwlwifi: mvm: remove new checksum code
The hardware isn't going to get fixed, so this mode cannot work in the foreseeable future. Remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230614145722.ddbc16c4affe.Ia6921e4b8a9624d4f57489ac775105ed0e400313@changeid [restore original subject] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tx.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/tx.c60
1 files changed, 6 insertions, 54 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index bacc3045ea16..c0001ee3d9fd 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -40,8 +40,9 @@ iwl_mvm_bar_check_trigger(struct iwl_mvm *mvm, const u8 *addr,
#define OPT_HDR(type, skb, off) \
(type *)(skb_network_header(skb) + (off))
-static u16 iwl_mvm_tx_csum_pre_bz(struct iwl_mvm *mvm, struct sk_buff *skb,
- struct ieee80211_tx_info *info, bool amsdu)
+static u32 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb,
+ struct ieee80211_tx_info *info,
+ bool amsdu)
{
struct ieee80211_hdr *hdr = (void *)skb->data;
u16 mh_len = ieee80211_hdrlen(hdr->frame_control);
@@ -141,54 +142,6 @@ out:
return offload_assist;
}
-u32 iwl_mvm_tx_csum_bz(struct iwl_mvm *mvm, struct sk_buff *skb, bool amsdu)
-{
- struct ieee80211_hdr *hdr = (void *)skb->data;
- u32 offload_assist = IWL_TX_CMD_OFFLD_BZ_PARTIAL_CSUM;
- unsigned int hdrlen = ieee80211_hdrlen(hdr->frame_control);
- unsigned int csum_start = skb_checksum_start_offset(skb);
-
- offload_assist |= u32_encode_bits(hdrlen / 2,
- IWL_TX_CMD_OFFLD_BZ_MH_LEN);
- if (amsdu)
- offload_assist |= IWL_TX_CMD_OFFLD_BZ_AMSDU;
- else if (hdrlen % 4)
- /* padding is inserted later in transport */
- offload_assist |= IWL_TX_CMD_OFFLD_BZ_MH_PAD;
-
- if (skb->ip_summed != CHECKSUM_PARTIAL)
- return offload_assist;
-
- offload_assist |= IWL_TX_CMD_OFFLD_BZ_ENABLE_CSUM |
- IWL_TX_CMD_OFFLD_BZ_ZERO2ONES;
-
- /*
- * mac80211 will always calculate checksum in software for
- * non-fast-xmit, and so we can only do offloaded checksum
- * for fast-xmit frames. In this case, we always have the
- * RFC 1042 header present. skb_checksum_start_offset()
- * returns the offset from the beginning, but the hardware
- * needs it from after the header & SNAP header.
- */
- csum_start -= hdrlen + 8;
-
- offload_assist |= u32_encode_bits(csum_start,
- IWL_TX_CMD_OFFLD_BZ_START_OFFS);
- offload_assist |= u32_encode_bits(csum_start + skb->csum_offset,
- IWL_TX_CMD_OFFLD_BZ_RESULT_OFFS);
-
- return offload_assist;
-}
-
-static u32 iwl_mvm_tx_csum(struct iwl_mvm *mvm, struct sk_buff *skb,
- struct ieee80211_tx_info *info,
- bool amsdu)
-{
- if (!iwl_mvm_has_new_tx_csum(mvm))
- return iwl_mvm_tx_csum_pre_bz(mvm, skb, info, amsdu);
- return iwl_mvm_tx_csum_bz(mvm, skb, amsdu);
-}
-
/*
* Sets most of the Tx cmd's fields
*/
@@ -288,7 +241,7 @@ void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb,
tx_cmd->sta_id = sta_id;
tx_cmd->offload_assist =
- cpu_to_le16(iwl_mvm_tx_csum_pre_bz(mvm, skb, info, amsdu));
+ cpu_to_le16(iwl_mvm_tx_csum(mvm, skb, info, amsdu));
}
static u32 iwl_mvm_get_tx_ant(struct iwl_mvm *mvm,
@@ -612,9 +565,8 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
cmd->rate_n_flags = cpu_to_le32(rate_n_flags);
} else {
struct iwl_tx_cmd_gen2 *cmd = (void *)dev_cmd->payload;
- u16 offload_assist = iwl_mvm_tx_csum_pre_bz(mvm, skb,
- info,
- amsdu);
+ u16 offload_assist = iwl_mvm_tx_csum(mvm, skb,
+ info, amsdu);
cmd->offload_assist = cpu_to_le16(offload_assist);