From: Andre Guedes Date: Tue, 31 May 2011 17:20:54 +0000 (-0300) Subject: Bluetooth: Add 'dst_type' field to struct hci_conn X-Git-Tag: 2.1b_release~2504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5de568669da24c1aaef8fb0d314f6e85beeb86d9;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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. Change-Id: I1e363bb6de263fdb1fe976a5a16ed5debc9b8c0c Signed-off-by: Andre Guedes Signed-off-by: Gustavo F. Padovan --- diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 90a921c..924e172 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -224,6 +224,7 @@ struct hci_conn { spinlock_t lock; bdaddr_t dst; + __u8 dst_type; __u16 handle; __u16 state; __u8 mode; diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index a60c17b..4ad9ac3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -1235,10 +1235,12 @@ static void hci_cs_le_create_conn(struct hci_dev *hdev, __u8 status) } else { if (!conn) { conn = hci_conn_add(hdev, LE_LINK, 0, &cp->peer_addr); - if (conn) + if (conn) { + conn->dst_type = cp->peer_addr_type; conn->out = 1; - else + } else { BT_ERR("No memory for new connection"); + } } } @@ -2697,6 +2699,8 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff hci_dev_unlock(hdev); return; } + + conn->dst_type = ev->bdaddr_type; } if (ev->status) {