aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btwilink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/btwilink.c')
-rw-r--r--drivers/bluetooth/btwilink.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
index 65d27aff553..c0470bc95e1 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -22,7 +22,6 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 23 *
24 */ 24 */
25#define DEBUG
26#include <linux/platform_device.h> 25#include <linux/platform_device.h>
27#include <net/bluetooth/bluetooth.h> 26#include <net/bluetooth/bluetooth.h>
28#include <net/bluetooth/hci_core.h> 27#include <net/bluetooth/hci_core.h>
@@ -125,6 +124,13 @@ static long st_receive(void *priv_data, struct sk_buff *skb)
125/* protocol structure registered with shared transport */ 124/* protocol structure registered with shared transport */
126static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = { 125static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
127 { 126 {
127 .chnl_id = HCI_EVENT_PKT, /* HCI Events */
128 .hdr_len = sizeof(struct hci_event_hdr),
129 .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
130 .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
131 .reserve = 8,
132 },
133 {
128 .chnl_id = HCI_ACLDATA_PKT, /* ACL */ 134 .chnl_id = HCI_ACLDATA_PKT, /* ACL */
129 .hdr_len = sizeof(struct hci_acl_hdr), 135 .hdr_len = sizeof(struct hci_acl_hdr),
130 .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen), 136 .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen),
@@ -138,13 +144,6 @@ static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
138 .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */ 144 .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */
139 .reserve = 8, 145 .reserve = 8,
140 }, 146 },
141 {
142 .chnl_id = HCI_EVENT_PKT, /* HCI Events */
143 .hdr_len = sizeof(struct hci_event_hdr),
144 .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
145 .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
146 .reserve = 8,
147 },
148}; 147};
149 148
150/* Called from HCI core to initialize the device */ 149/* Called from HCI core to initialize the device */
@@ -240,7 +239,7 @@ static int ti_st_close(struct hci_dev *hdev)
240 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) 239 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
241 return 0; 240 return 0;
242 241
243 for (i = 0; i < MAX_BT_CHNL_IDS; i++) { 242 for (i = MAX_BT_CHNL_IDS-1; i >= 0; i--) {
244 err = st_unregister(&ti_st_proto[i]); 243 err = st_unregister(&ti_st_proto[i]);
245 if (err) 244 if (err)
246 BT_ERR("st_unregister(%d) failed with error %d", 245 BT_ERR("st_unregister(%d) failed with error %d",