mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 23:28:55 +00:00
Bluetooth: Add 'dst_type' field to struct hci_conn
This patch adds a new field (dst_type) to the struct hci_conn which holds the type of the destination address (bdaddr_t dst). This approach is needed in order to use the struct hci_conn as an abstraction of LE connections in HCI Layer. For non-LE this field is ignored. This patch also set properly the 'dst_type' field after initializing LE hci_conn structures. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
d7556e20ad
commit
29b7988a23
2 changed files with 7 additions and 2 deletions
|
@ -224,6 +224,7 @@ struct hci_conn {
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
|
|
||||||
bdaddr_t dst;
|
bdaddr_t dst;
|
||||||
|
__u8 dst_type;
|
||||||
__u16 handle;
|
__u16 handle;
|
||||||
__u16 state;
|
__u16 state;
|
||||||
__u8 mode;
|
__u8 mode;
|
||||||
|
|
|
@ -1234,10 +1234,12 @@ static void hci_cs_le_create_conn(struct hci_dev *hdev, __u8 status)
|
||||||
} else {
|
} else {
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
conn = hci_conn_add(hdev, LE_LINK, &cp->peer_addr);
|
conn = hci_conn_add(hdev, LE_LINK, &cp->peer_addr);
|
||||||
if (conn)
|
if (conn) {
|
||||||
|
conn->dst_type = cp->peer_addr_type;
|
||||||
conn->out = 1;
|
conn->out = 1;
|
||||||
else
|
} else {
|
||||||
BT_ERR("No memory for new connection");
|
BT_ERR("No memory for new connection");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2694,6 +2696,8 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
|
||||||
hci_dev_unlock(hdev);
|
hci_dev_unlock(hdev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conn->dst_type = ev->bdaddr_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->status) {
|
if (ev->status) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue