Bluetooth: Add state to hci_chan
authorMat Martineau <mathewm@codeaurora.org>
Tue, 23 Oct 2012 22:24:13 +0000 (15:24 -0700)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 24 Oct 2012 02:16:23 +0000 (00:16 -0200)
On an AMP controller, hci_chan maps to a logical link.  When a channel
is being moved, the logical link may or may not be connected already.
The hci_chan->state is used to determine the existance of a useable
logical link so the link can be either used or requested.

Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c

index 9fe8e2dec870c57073d24aaf1b0ff6ebfbfc1801..00abc5246cbfe8b041e7753742bcf04032c01626 100644 (file)
@@ -355,6 +355,7 @@ struct hci_chan {
        struct hci_conn *conn;
        struct sk_buff_head data_q;
        unsigned int    sent;
+       __u8            state;
 };
 
 extern struct list_head hci_dev_list;
index fe646211c61f5f0a056884e34bdff6c0336f9043..6dcf4523df3c6a9fb320703b89e41011bbc489da 100644 (file)
@@ -959,6 +959,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn)
 
        chan->conn = conn;
        skb_queue_head_init(&chan->data_q);
+       chan->state = BT_CONNECTED;
 
        list_add_rcu(&chan->list, &conn->chan_list);