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.
Unified · Split
| @@ -3407,6 +3407,16 @@ static inline struct hci_iso_hdr *hci_iso_hdr(const struct sk_buff *skb) · 3406 unmodified lines | ||
| 3407 | 3407 | #define hci_handle(h) (h & 0x0fff) |
| 3408 | 3408 | #define hci_flags(h) (h >> 12) |
| 3409 | 3409 | |
| 3410 | +static 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 | + | |
| 3415 | +static inline __u16 hci_acl_dlen(const struct sk_buff *skb) | |
| 3416 | +{ | |
| 3417 | + return __le16_to_cpu(hci_acl_hdr(skb)->dlen); | |
| 3418 | +} | |
| 3419 | + | |
| 3410 | 3420 | /* ISO handle and flags pack/unpack */ |
| 3411 | 3421 | #define hci_iso_flags_pb(f) (f & 0x0003) |
| 3412 | 3422 | #define hci_iso_flags_ts(f) ((f >> 2) & 0x0001) |