1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2024 Intel Corporation
5 #ifndef __iwl_utils_h__
6 #define __iwl_utils_h__
8 #include <net/cfg80211.h>
12 * iwl_tx_tso_segment - Segments a TSO packet into subframes for A-MSDU.
13 * @skb: buffer to segment.
14 * @num_subframes: number of subframes to create.
15 * @netdev_flags: netdev feature flags.
16 * @mpdus_skbs: list to hold the segmented subframes.
18 * This function segments a large TCP packet into subframes.
19 * subframes are added to the mpdus_skbs list
21 * Returns: 0 on success and negative value on failure.
23 int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
24 netdev_features_t netdev_flags,
25 struct sk_buff_head *mpdus_skbs);
28 int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
29 netdev_features_t netdev_flags,
30 struct sk_buff_head *mpdus_skbs)
36 #endif /* CONFIG_INET */
39 u32 iwl_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
41 struct ieee80211_mgmt *mgmt = (void *)beacon;
44 if (WARN_ON_ONCE(frame_size <= (mgmt->u.beacon.variable - beacon)))
47 frame_size -= mgmt->u.beacon.variable - beacon;
49 ie = cfg80211_find_ie(eid, mgmt->u.beacon.variable, frame_size);
56 #endif /* __iwl_utils_h__ */