Commit ba165a90 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann

Bluetooth: Add proper defines for HCI connection role

All HCI commands and events, including LE ones, use 0x00 for master role
and 0x01 for slave role. It makes therefore sense to add generic defines
for these instead of the current LE_CONN_ROLE_MASTER. Having clean
defines will also make it possible to provide simpler internal APIs.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2d3c2260
...@@ -401,6 +401,9 @@ enum { ...@@ -401,6 +401,9 @@ enum {
/* The core spec defines 127 as the "not available" value */ /* The core spec defines 127 as the "not available" value */
#define HCI_TX_POWER_INVALID 127 #define HCI_TX_POWER_INVALID 127
#define HCI_ROLE_MASTER 0x00
#define HCI_ROLE_SLAVE 0x01
/* Extended Inquiry Response field types */ /* Extended Inquiry Response field types */
#define EIR_FLAGS 0x01 /* flags */ #define EIR_FLAGS 0x01 /* flags */
#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
...@@ -1713,9 +1716,6 @@ struct hci_ev_sync_train_complete { ...@@ -1713,9 +1716,6 @@ struct hci_ev_sync_train_complete {
#define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 #define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54
/* Low energy meta events */
#define LE_CONN_ROLE_MASTER 0x00
#define HCI_EV_LE_CONN_COMPLETE 0x01 #define HCI_EV_LE_CONN_COMPLETE 0x01
struct hci_ev_le_conn_complete { struct hci_ev_le_conn_complete {
__u8 status; __u8 status;
......
...@@ -4116,7 +4116,7 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -4116,7 +4116,7 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
conn->dst_type = ev->bdaddr_type; conn->dst_type = ev->bdaddr_type;
if (ev->role == LE_CONN_ROLE_MASTER) { if (ev->role == HCI_ROLE_MASTER) {
conn->out = true; conn->out = true;
set_bit(HCI_CONN_MASTER, &conn->flags); set_bit(HCI_CONN_MASTER, &conn->flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment