Skip to content

Commit 761f09e

Browse files
jhedbergGustavo Padovan
authored andcommitted
Bluetooth: Add missing feature test macros
This patch adds missing feature test macros needed for various use cases and also sorts the macros according to the feature bit location in the feature mask (for easy lookup). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
1 parent 53b2caa commit 761f09e

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

‎include/net/bluetooth/hci_core.h‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,18 +750,28 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
750750
#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev))
751751

752752
/* ----- LMP capabilities ----- */
753-
#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
754753
#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
754+
#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
755+
#define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD)
755756
#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
756-
#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
757+
#define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK)
758+
#define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ)
757759
#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
760+
#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR))
761+
#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
762+
#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
763+
#define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC)
764+
#define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ)
765+
#define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR)
758766
#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
759767
#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
760-
#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
761-
#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR))
768+
#define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO)
769+
#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR)
770+
#define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES)
762771

763772
/* ----- Extended LMP capabilities ----- */
764773
#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE)
774+
#define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR)
765775

766776
/* ----- HCI protocols ----- */
767777
static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,

0 commit comments

Comments
 (0)