summaryrefslogtreecommitdiff
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin.berg@intel.com>2023-06-16 09:54:05 +0300
committerJohannes Berg <johannes.berg@intel.com>2023-06-19 13:05:29 +0300
commitf837a653a09700daa136a3db49c0c97d7295ca30 (patch)
tree90346dcd83b8a7178a635eb5fed80ff0c5c4de0a /include/net/cfg80211.h
parent39432f8a3752a87a53fd8d5e51824a43aaae5cab (diff)
downloadlinux-f837a653a09700daa136a3db49c0c97d7295ca30.tar.xz
wifi: cfg80211: add element defragmentation helper
This is already needed within mac80211 and support is also needed by cfg80211 to parse ML elements. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230616094949.29c3ebeed10d.I009c049289dd0162c2e858ed8b68d2875a672ed6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e912b7cd3093..9972de114d73 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -6677,6 +6677,28 @@ cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
}
/**
+ * cfg80211_defragment_element - Defrag the given element data into a buffer
+ *
+ * @elem: the element to defragment
+ * @ies: elements where @elem is contained
+ * @ieslen: length of @ies
+ * @data: buffer to store element data
+ * @data_len: length of @data
+ * @frag_id: the element ID of fragments
+ *
+ * Return: length of @data, or -EINVAL on error
+ *
+ * Copy out all data from an element that may be fragmented into @data, while
+ * skipping all headers.
+ *
+ * The function uses memmove() internally. It is acceptable to defragment an
+ * element in-place.
+ */
+ssize_t cfg80211_defragment_element(const struct element *elem, const u8 *ies,
+ size_t ieslen, u8 *data, size_t data_len,
+ u8 frag_id);
+
+/**
* cfg80211_send_layer2_update - send layer 2 update frame
*
* @dev: network device