History

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.

Zijun Hu committed 3 months ago

Commit 22fd0fb1 parent 33971331 file · +10 −0Browse files

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/net/bluetooth/hci.h+10−0
@@ -3407,6 +3407,16 @@ static inline struct hci_iso_hdr *hci_iso_hdr(const struct sk_buff *skb) · 3406 unmodified lines
3407#define hci_handle(h) (h & 0x0fff)3407#define hci_handle(h) (h & 0x0fff)
3408#define hci_flags(h) (h >> 12)3408#define hci_flags(h) (h >> 12)
3409 3409
3410static inline __u16 hci_acl_handle(const struct sk_buff *skb)
3411{
3412 return hci_handle(__le16_to_cpu(hci_acl_hdr(skb)->handle));
3413}
3414
3415static inline __u16 hci_acl_dlen(const struct sk_buff *skb)
3416{
3417 return __le16_to_cpu(hci_acl_hdr(skb)->dlen);
3418}
3419
3410/* ISO handle and flags pack/unpack */3420/* ISO handle and flags pack/unpack */
3411#define hci_iso_flags_pb(f) (f & 0x0003)3421#define hci_iso_flags_pb(f) (f & 0x0003)
3412#define hci_iso_flags_ts(f) ((f >> 2) & 0x0001)3422#define hci_iso_flags_ts(f) ((f >> 2) & 0x0001)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t