Lines Matching +full:compute +full:- +full:cb
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
10 #include "iwl-drv.h"
11 #include "iwl-utils.h"
19 struct ieee80211_hdr *hdr = (void *)skb->data; in iwl_tx_tso_segment()
20 char cb[sizeof(skb->cb)]; in iwl_tx_tso_segment() local
23 unsigned int mss = skb_shinfo(skb)->gso_size; in iwl_tx_tso_segment()
24 bool ipv4 = (skb->protocol == htons(ETH_P_IP)); in iwl_tx_tso_segment()
25 bool qos = ieee80211_is_data_qos(hdr->frame_control); in iwl_tx_tso_segment()
26 u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; in iwl_tx_tso_segment()
28 skb_shinfo(skb)->gso_size = num_subframes * mss; in iwl_tx_tso_segment()
29 memcpy(cb, skb->cb, sizeof(cb)); in iwl_tx_tso_segment()
32 skb_shinfo(skb)->gso_size = mss; in iwl_tx_tso_segment()
33 skb_shinfo(skb)->gso_type = ipv4 ? SKB_GSO_TCPV4 : SKB_GSO_TCPV6; in iwl_tx_tso_segment()
35 if (IS_ERR(next) && PTR_ERR(next) == -ENOMEM) in iwl_tx_tso_segment()
36 return -ENOMEM; in iwl_tx_tso_segment()
46 memcpy(tmp->cb, cb, sizeof(tmp->cb)); in iwl_tx_tso_segment()
48 * Compute the length of all the data added for the A-MSDU. in iwl_tx_tso_segment()
49 * This will be used to compute the length to write in the TX in iwl_tx_tso_segment()
50 * command. We have: SNAP + IP + TCP for n -1 subframes and in iwl_tx_tso_segment()
53 tcp_payload_len = skb_tail_pointer(tmp) - in iwl_tx_tso_segment()
54 skb_transport_header(tmp) - in iwl_tx_tso_segment()
55 tcp_hdrlen(tmp) + tmp->data_len; in iwl_tx_tso_segment()
58 ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes); in iwl_tx_tso_segment()
61 skb_shinfo(tmp)->gso_size = mss; in iwl_tx_tso_segment()
62 skb_shinfo(tmp)->gso_type = ipv4 ? SKB_GSO_TCPV4 : in iwl_tx_tso_segment()
71 qc = ieee80211_get_qos_ctl((void *)tmp->data); in iwl_tx_tso_segment()
74 skb_shinfo(tmp)->gso_size = 0; in iwl_tx_tso_segment()