diff options
author | Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> | 2014-03-14 21:24:01 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-15 03:15:26 +0100 |
commit | e6278d92005e9d6e374f269b4ce39c908a68ad5d (patch) | |
tree | 4991dd3441843d55104c0fdba78cf36ed5d75034 /include | |
parent | ieee802154: add header structs with endiannes and operations (diff) | |
download | linux-e6278d92005e9d6e374f269b4ce39c908a68ad5d.tar.xz linux-e6278d92005e9d6e374f269b4ce39c908a68ad5d.zip |
mac802154: use header operations to create/parse headers
Use the operations on 802.15.4 header structs introduced in a previous
patch to create and parse all headers in the mac802154 stack. This patch
reduces code duplication between different parts of the mac802154 stack
that needed information from headers, and also fixes a few bugs that
seem to have gone unnoticed until now:
* 802.15.4 dgram sockets would return a slightly incorrect value for
the SIOCINQ ioctl
* mac802154 would not drop frames with the "security enabled" bit set,
even though it does not support security, in violation of the
standard
Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ieee802154_netdev.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index c3fc33a78920..8e7f6903db98 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h @@ -216,23 +216,17 @@ static inline struct ieee802154_mac_cb *mac_cb(struct sk_buff *skb) #define MAC_CB_FLAG_ACKREQ (1 << 3) #define MAC_CB_FLAG_SECEN (1 << 4) -#define MAC_CB_FLAG_INTRAPAN (1 << 5) -static inline int mac_cb_is_ackreq(struct sk_buff *skb) +static inline bool mac_cb_is_ackreq(struct sk_buff *skb) { return mac_cb(skb)->flags & MAC_CB_FLAG_ACKREQ; } -static inline int mac_cb_is_secen(struct sk_buff *skb) +static inline bool mac_cb_is_secen(struct sk_buff *skb) { return mac_cb(skb)->flags & MAC_CB_FLAG_SECEN; } -static inline int mac_cb_is_intrapan(struct sk_buff *skb) -{ - return mac_cb(skb)->flags & MAC_CB_FLAG_INTRAPAN; -} - static inline int mac_cb_type(struct sk_buff *skb) { return mac_cb(skb)->flags & MAC_CB_FLAG_TYPEMASK; |