diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-27 17:38:07 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:28:21 -0400 |
commit | 2a123b86e2b242a4a6db990d2851d45e192f88e5 (patch) | |
tree | afbb29b9cf58cf8ee5c581315d5b423d7775196f /include | |
parent | 03d4f879b9ddf7d5c1f788792247e62450342eed (diff) |
[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 41456c148842..93ce272a5d27 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -709,6 +709,24 @@ struct hci_sco_hdr { | |||
709 | __u8 dlen; | 709 | __u8 dlen; |
710 | } __attribute__ ((packed)); | 710 | } __attribute__ ((packed)); |
711 | 711 | ||
712 | #ifdef __KERNEL__ | ||
713 | #include <linux/skbuff.h> | ||
714 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | ||
715 | { | ||
716 | return (struct hci_event_hdr *)skb->data; | ||
717 | } | ||
718 | |||
719 | static inline struct hci_acl_hdr *hci_acl_hdr(const struct sk_buff *skb) | ||
720 | { | ||
721 | return (struct hci_acl_hdr *)skb->data; | ||
722 | } | ||
723 | |||
724 | static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | ||
725 | { | ||
726 | return (struct hci_sco_hdr *)skb->data; | ||
727 | } | ||
728 | #endif | ||
729 | |||
712 | /* Command opcode pack/unpack */ | 730 | /* Command opcode pack/unpack */ |
713 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 731 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) |
714 | #define hci_opcode_ogf(op) (op >> 10) | 732 | #define hci_opcode_ogf(op) (op >> 10) |