diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 18:38:07 -0300 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:28:21 -0700 |
commit | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (patch) | |
tree | afbb29b9cf58cf8ee5c581315d5b423d7775196f /include | |
parent | 03d4f879b9ddf7d5c1f788792247e62450342eed (diff) | |
download | op-kernel-dev-2a123b86e2b242a4a6db990d2851d45e192f88e5.zip op-kernel-dev-2a123b86e2b242a4a6db990d2851d45e192f88e5.tar.gz |
[BLUETOOTH]: Introduce skb->data accessor methods for hci_{acl,event,sco}_hdr
For consistency with other skb data accessors, reducing the number of direct
accesses to skb->data.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/hci.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 41456c1..93ce272 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -709,6 +709,24 @@ struct hci_sco_hdr { __u8 dlen; } __attribute__ ((packed)); +#ifdef __KERNEL__ +#include <linux/skbuff.h> +static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) +{ + return (struct hci_event_hdr *)skb->data; +} + +static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) +{ + return (struct hci_acl_hdr *)skb->data; +} + +static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) +{ + return (struct hci_sco_hdr *)skb->data; +} +#endif + /* Command opcode pack/unpack */ #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) #define hci_opcode_ogf(op) (op >> 10) |