Path: blob/main/sys/contrib/dev/iwlwifi/iwl-utils.h
107228 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2024-2025 Intel Corporation3*/4#ifndef __iwl_utils_h__5#define __iwl_utils_h__67#include <net/cfg80211.h>89#ifdef CONFIG_INET10/**11* iwl_tx_tso_segment - Segments a TSO packet into subframes for A-MSDU.12* @skb: buffer to segment.13* @num_subframes: number of subframes to create.14* @netdev_flags: netdev feature flags.15* @mpdus_skbs: list to hold the segmented subframes.16*17* This function segments a large TCP packet into subframes.18* subframes are added to the mpdus_skbs list19*20* Returns: 0 on success and negative value on failure.21*/22int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,23netdev_features_t netdev_flags,24struct sk_buff_head *mpdus_skbs);25#else26static inline27int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,28netdev_features_t netdev_flags,29struct sk_buff_head *mpdus_skbs)30{31WARN_ON(1);3233return -1;34}35#endif /* CONFIG_INET */3637static inline38u32 iwl_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)39{40struct ieee80211_mgmt *mgmt = (void *)beacon;41const u8 *ie;4243if (WARN_ON_ONCE(frame_size <= (mgmt->u.beacon.variable - beacon)))44return 0;4546frame_size -= mgmt->u.beacon.variable - beacon;4748ie = cfg80211_find_ie(eid, mgmt->u.beacon.variable, frame_size);49if (!ie)50return 0;5152return ie - beacon;53}5455s8 iwl_average_neg_dbm(const u8 *neg_dbm_values, u8 len);5657#endif /* __iwl_utils_h__ */585960