mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 08:44:29 -04:00
Bluetooth: hci: Introduce hci_acl_handle() and hci_acl_dlen() helpers
Introduce both helpers for ACL packet since: both core and transport drivers extract the handle and data length from its header in several places. Both will be used later. Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
committed by
Luiz Augusto von Dentz
parent
33971338ef
commit
22fd0fbcf7
@@ -3407,6 +3407,16 @@ static inline struct hci_iso_hdr *hci_iso_hdr(const struct sk_buff *skb)
|
||||
#define hci_handle(h) (h & 0x0fff)
|
||||
#define hci_flags(h) (h >> 12)
|
||||
|
||||
static inline __u16 hci_acl_handle(const struct sk_buff *skb)
|
||||
{
|
||||
return hci_handle(__le16_to_cpu(hci_acl_hdr(skb)->handle));
|
||||
}
|
||||
|
||||
static inline __u16 hci_acl_dlen(const struct sk_buff *skb)
|
||||
{
|
||||
return __le16_to_cpu(hci_acl_hdr(skb)->dlen);
|
||||
}
|
||||
|
||||
/* ISO handle and flags pack/unpack */
|
||||
#define hci_iso_flags_pb(f) (f & 0x0003)
|
||||
#define hci_iso_flags_ts(f) ((f >> 2) & 0x0001)
|
||||
|
||||
Reference in New Issue
Block a user