summaryrefslogtreecommitdiffstats
path: root/include/linux/ieee802154.h
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-09-18 11:30:43 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-09-22 11:51:20 +0200
commit87a93e4eceb495f93e3f37b100334d2641765b6c (patch)
treed917662b1912a9788cdf431fc735b243e32dfb6c /include/linux/ieee802154.h
parent838b83d63d2909f9136f3030dc4fffa8230c31da (diff)
downloadlinux-87a93e4eceb495f93e3f37b100334d2641765b6c.tar.gz
linux-87a93e4eceb495f93e3f37b100334d2641765b6c.tar.bz2
linux-87a93e4eceb495f93e3f37b100334d2641765b6c.zip
ieee802154: change needed headroom/tailroom
This patch cleanups needed_headroom, needed_tailroom and hard_header_len fields for wpan and lowpan interfaces. For wpan interfaces the worst case mac header len should be part of needed_headroom, currently this is set as hard_header_len, but hard_header_len should be set to the minimum header length which xmit call assumes and this is the minimum frame length of 802.15.4. The hard_header_len value will check inside send callbacl of AF_PACKET raw sockets. For lowpan interfaces, if fragmentation isn't needed the skb will call dev_hard_header for 802154 layer and queue it afterwards. This happens without new skb allocation, so we need the same headroom and tailroom lengths like 802154 inside 802154 6lowpan layer. At least we assume as minimum header length an ipv6 header size. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/linux/ieee802154.h')
-rw-r--r--include/linux/ieee802154.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/ieee802154.h b/include/linux/ieee802154.h
index db01492814d3..205ce4e1ac32 100644
--- a/include/linux/ieee802154.h
+++ b/include/linux/ieee802154.h
@@ -31,6 +31,17 @@
#define IEEE802154_ACK_PSDU_LEN 5
#define IEEE802154_MIN_PSDU_LEN 9
#define IEEE802154_FCS_LEN 2
+#define IEEE802154_MAX_AUTH_TAG_LEN 16
+
+/* General MAC frame format:
+ * 2 bytes: Frame Control
+ * 1 byte: Sequence Number
+ * 20 bytes: Addressing fields
+ * 14 bytes: Auxiliary Security Header
+ */
+#define IEEE802154_MAX_HEADER_LEN (2 + 1 + 20 + 14)
+#define IEEE802154_MIN_HEADER_LEN (IEEE802154_ACK_PSDU_LEN - \
+ IEEE802154_FCS_LEN)
#define IEEE802154_PAN_ID_BROADCAST 0xffff
#define IEEE802154_ADDR_SHORT_BROADCAST 0xffff