diff options
Diffstat (limited to 'drivers/bluetooth/bfusb.c')
-rw-r--r-- | drivers/bluetooth/bfusb.c | 317 |
1 files changed, 159 insertions, 158 deletions
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 8947c8837da..efcc28ec9d9 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * AVM BlueFRITZ! USB driver | 3 | * AVM BlueFRITZ! USB driver |
4 | * | 4 | * |
5 | * Copyright (C) 2003 Marcel Holtmann <marcel@holtmann.org> | 5 | * Copyright (C) 2003-2006 Marcel Holtmann <marcel@holtmann.org> |
6 | * | 6 | * |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
@@ -21,7 +21,6 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/config.h> | ||
25 | #include <linux/module.h> | 24 | #include <linux/module.h> |
26 | 25 | ||
27 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
@@ -60,7 +59,6 @@ static struct usb_device_id bfusb_table[] = { | |||
60 | 59 | ||
61 | MODULE_DEVICE_TABLE(usb, bfusb_table); | 60 | MODULE_DEVICE_TABLE(usb, bfusb_table); |
62 | 61 | ||
63 | |||
64 | #define BFUSB_MAX_BLOCK_SIZE 256 | 62 | #define BFUSB_MAX_BLOCK_SIZE 256 |
65 | 63 | ||
66 | #define BFUSB_BLOCK_TIMEOUT 3000 | 64 | #define BFUSB_BLOCK_TIMEOUT 3000 |
@@ -71,7 +69,7 @@ MODULE_DEVICE_TABLE(usb, bfusb_table); | |||
71 | #define BFUSB_MAX_BULK_TX 2 | 69 | #define BFUSB_MAX_BULK_TX 2 |
72 | #define BFUSB_MAX_BULK_RX 2 | 70 | #define BFUSB_MAX_BULK_RX 2 |
73 | 71 | ||
74 | struct bfusb { | 72 | struct bfusb_data { |
75 | struct hci_dev *hdev; | 73 | struct hci_dev *hdev; |
76 | 74 | ||
77 | unsigned long state; | 75 | unsigned long state; |
@@ -93,137 +91,136 @@ struct bfusb { | |||
93 | struct sk_buff_head completed_q; | 91 | struct sk_buff_head completed_q; |
94 | }; | 92 | }; |
95 | 93 | ||
96 | struct bfusb_scb { | 94 | struct bfusb_data_scb { |
97 | struct urb *urb; | 95 | struct urb *urb; |
98 | }; | 96 | }; |
99 | 97 | ||
100 | static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs); | 98 | static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs); |
101 | static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs); | 99 | static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs); |
102 | 100 | ||
103 | static struct urb *bfusb_get_completed(struct bfusb *bfusb) | 101 | static struct urb *bfusb_get_completed(struct bfusb_data *data) |
104 | { | 102 | { |
105 | struct sk_buff *skb; | 103 | struct sk_buff *skb; |
106 | struct urb *urb = NULL; | 104 | struct urb *urb = NULL; |
107 | 105 | ||
108 | BT_DBG("bfusb %p", bfusb); | 106 | BT_DBG("bfusb %p", data); |
109 | 107 | ||
110 | skb = skb_dequeue(&bfusb->completed_q); | 108 | skb = skb_dequeue(&data->completed_q); |
111 | if (skb) { | 109 | if (skb) { |
112 | urb = ((struct bfusb_scb *) skb->cb)->urb; | 110 | urb = ((struct bfusb_data_scb *) skb->cb)->urb; |
113 | kfree_skb(skb); | 111 | kfree_skb(skb); |
114 | } | 112 | } |
115 | 113 | ||
116 | return urb; | 114 | return urb; |
117 | } | 115 | } |
118 | 116 | ||
119 | static void bfusb_unlink_urbs(struct bfusb *bfusb) | 117 | static void bfusb_unlink_urbs(struct bfusb_data *data) |
120 | { | 118 | { |
121 | struct sk_buff *skb; | 119 | struct sk_buff *skb; |
122 | struct urb *urb; | 120 | struct urb *urb; |
123 | 121 | ||
124 | BT_DBG("bfusb %p", bfusb); | 122 | BT_DBG("bfusb %p", data); |
125 | 123 | ||
126 | while ((skb = skb_dequeue(&bfusb->pending_q))) { | 124 | while ((skb = skb_dequeue(&data->pending_q))) { |
127 | urb = ((struct bfusb_scb *) skb->cb)->urb; | 125 | urb = ((struct bfusb_data_scb *) skb->cb)->urb; |
128 | usb_kill_urb(urb); | 126 | usb_kill_urb(urb); |
129 | skb_queue_tail(&bfusb->completed_q, skb); | 127 | skb_queue_tail(&data->completed_q, skb); |
130 | } | 128 | } |
131 | 129 | ||
132 | while ((urb = bfusb_get_completed(bfusb))) | 130 | while ((urb = bfusb_get_completed(data))) |
133 | usb_free_urb(urb); | 131 | usb_free_urb(urb); |
134 | } | 132 | } |
135 | 133 | ||
136 | 134 | static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb) | |
137 | static int bfusb_send_bulk(struct bfusb *bfusb, struct sk_buff *skb) | ||
138 | { | 135 | { |
139 | struct bfusb_scb *scb = (void *) skb->cb; | 136 | struct bfusb_data_scb *scb = (void *) skb->cb; |
140 | struct urb *urb = bfusb_get_completed(bfusb); | 137 | struct urb *urb = bfusb_get_completed(data); |
141 | int err, pipe; | 138 | int err, pipe; |
142 | 139 | ||
143 | BT_DBG("bfusb %p skb %p len %d", bfusb, skb, skb->len); | 140 | BT_DBG("bfusb %p skb %p len %d", data, skb, skb->len); |
144 | 141 | ||
145 | if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC))) | 142 | if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC))) |
146 | return -ENOMEM; | 143 | return -ENOMEM; |
147 | 144 | ||
148 | pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep); | 145 | pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep); |
149 | 146 | ||
150 | usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, skb->len, | 147 | usb_fill_bulk_urb(urb, data->udev, pipe, skb->data, skb->len, |
151 | bfusb_tx_complete, skb); | 148 | bfusb_tx_complete, skb); |
152 | 149 | ||
153 | scb->urb = urb; | 150 | scb->urb = urb; |
154 | 151 | ||
155 | skb_queue_tail(&bfusb->pending_q, skb); | 152 | skb_queue_tail(&data->pending_q, skb); |
156 | 153 | ||
157 | err = usb_submit_urb(urb, GFP_ATOMIC); | 154 | err = usb_submit_urb(urb, GFP_ATOMIC); |
158 | if (err) { | 155 | if (err) { |
159 | BT_ERR("%s bulk tx submit failed urb %p err %d", | 156 | BT_ERR("%s bulk tx submit failed urb %p err %d", |
160 | bfusb->hdev->name, urb, err); | 157 | data->hdev->name, urb, err); |
161 | skb_unlink(skb, &bfusb->pending_q); | 158 | skb_unlink(skb, &data->pending_q); |
162 | usb_free_urb(urb); | 159 | usb_free_urb(urb); |
163 | } else | 160 | } else |
164 | atomic_inc(&bfusb->pending_tx); | 161 | atomic_inc(&data->pending_tx); |
165 | 162 | ||
166 | return err; | 163 | return err; |
167 | } | 164 | } |
168 | 165 | ||
169 | static void bfusb_tx_wakeup(struct bfusb *bfusb) | 166 | static void bfusb_tx_wakeup(struct bfusb_data *data) |
170 | { | 167 | { |
171 | struct sk_buff *skb; | 168 | struct sk_buff *skb; |
172 | 169 | ||
173 | BT_DBG("bfusb %p", bfusb); | 170 | BT_DBG("bfusb %p", data); |
174 | 171 | ||
175 | if (test_and_set_bit(BFUSB_TX_PROCESS, &bfusb->state)) { | 172 | if (test_and_set_bit(BFUSB_TX_PROCESS, &data->state)) { |
176 | set_bit(BFUSB_TX_WAKEUP, &bfusb->state); | 173 | set_bit(BFUSB_TX_WAKEUP, &data->state); |
177 | return; | 174 | return; |
178 | } | 175 | } |
179 | 176 | ||
180 | do { | 177 | do { |
181 | clear_bit(BFUSB_TX_WAKEUP, &bfusb->state); | 178 | clear_bit(BFUSB_TX_WAKEUP, &data->state); |
182 | 179 | ||
183 | while ((atomic_read(&bfusb->pending_tx) < BFUSB_MAX_BULK_TX) && | 180 | while ((atomic_read(&data->pending_tx) < BFUSB_MAX_BULK_TX) && |
184 | (skb = skb_dequeue(&bfusb->transmit_q))) { | 181 | (skb = skb_dequeue(&data->transmit_q))) { |
185 | if (bfusb_send_bulk(bfusb, skb) < 0) { | 182 | if (bfusb_send_bulk(data, skb) < 0) { |
186 | skb_queue_head(&bfusb->transmit_q, skb); | 183 | skb_queue_head(&data->transmit_q, skb); |
187 | break; | 184 | break; |
188 | } | 185 | } |
189 | } | 186 | } |
190 | 187 | ||
191 | } while (test_bit(BFUSB_TX_WAKEUP, &bfusb->state)); | 188 | } while (test_bit(BFUSB_TX_WAKEUP, &data->state)); |
192 | 189 | ||
193 | clear_bit(BFUSB_TX_PROCESS, &bfusb->state); | 190 | clear_bit(BFUSB_TX_PROCESS, &data->state); |
194 | } | 191 | } |
195 | 192 | ||
196 | static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs) | 193 | static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs) |
197 | { | 194 | { |
198 | struct sk_buff *skb = (struct sk_buff *) urb->context; | 195 | struct sk_buff *skb = (struct sk_buff *) urb->context; |
199 | struct bfusb *bfusb = (struct bfusb *) skb->dev; | 196 | struct bfusb_data *data = (struct bfusb_data *) skb->dev; |
200 | 197 | ||
201 | BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len); | 198 | BT_DBG("bfusb %p urb %p skb %p len %d", data, urb, skb, skb->len); |
202 | 199 | ||
203 | atomic_dec(&bfusb->pending_tx); | 200 | atomic_dec(&data->pending_tx); |
204 | 201 | ||
205 | if (!test_bit(HCI_RUNNING, &bfusb->hdev->flags)) | 202 | if (!test_bit(HCI_RUNNING, &data->hdev->flags)) |
206 | return; | 203 | return; |
207 | 204 | ||
208 | if (!urb->status) | 205 | if (!urb->status) |
209 | bfusb->hdev->stat.byte_tx += skb->len; | 206 | data->hdev->stat.byte_tx += skb->len; |
210 | else | 207 | else |
211 | bfusb->hdev->stat.err_tx++; | 208 | data->hdev->stat.err_tx++; |
212 | 209 | ||
213 | read_lock(&bfusb->lock); | 210 | read_lock(&data->lock); |
214 | 211 | ||
215 | skb_unlink(skb, &bfusb->pending_q); | 212 | skb_unlink(skb, &data->pending_q); |
216 | skb_queue_tail(&bfusb->completed_q, skb); | 213 | skb_queue_tail(&data->completed_q, skb); |
217 | 214 | ||
218 | bfusb_tx_wakeup(bfusb); | 215 | bfusb_tx_wakeup(data); |
219 | 216 | ||
220 | read_unlock(&bfusb->lock); | 217 | read_unlock(&data->lock); |
221 | } | 218 | } |
222 | 219 | ||
223 | 220 | ||
224 | static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb) | 221 | static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb) |
225 | { | 222 | { |
226 | struct bfusb_scb *scb; | 223 | struct bfusb_data_scb *scb; |
227 | struct sk_buff *skb; | 224 | struct sk_buff *skb; |
228 | int err, pipe, size = HCI_MAX_FRAME_SIZE + 32; | 225 | int err, pipe, size = HCI_MAX_FRAME_SIZE + 32; |
229 | 226 | ||
@@ -232,28 +229,29 @@ static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb) | |||
232 | if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC))) | 229 | if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC))) |
233 | return -ENOMEM; | 230 | return -ENOMEM; |
234 | 231 | ||
235 | if (!(skb = bt_skb_alloc(size, GFP_ATOMIC))) { | 232 | skb = bt_skb_alloc(size, GFP_ATOMIC); |
233 | if (!skb) { | ||
236 | usb_free_urb(urb); | 234 | usb_free_urb(urb); |
237 | return -ENOMEM; | 235 | return -ENOMEM; |
238 | } | 236 | } |
239 | 237 | ||
240 | skb->dev = (void *) bfusb; | 238 | skb->dev = (void *) data; |
241 | 239 | ||
242 | scb = (struct bfusb_scb *) skb->cb; | 240 | scb = (struct bfusb_data_scb *) skb->cb; |
243 | scb->urb = urb; | 241 | scb->urb = urb; |
244 | 242 | ||
245 | pipe = usb_rcvbulkpipe(bfusb->udev, bfusb->bulk_in_ep); | 243 | pipe = usb_rcvbulkpipe(data->udev, data->bulk_in_ep); |
246 | 244 | ||
247 | usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, size, | 245 | usb_fill_bulk_urb(urb, data->udev, pipe, skb->data, size, |
248 | bfusb_rx_complete, skb); | 246 | bfusb_rx_complete, skb); |
249 | 247 | ||
250 | skb_queue_tail(&bfusb->pending_q, skb); | 248 | skb_queue_tail(&data->pending_q, skb); |
251 | 249 | ||
252 | err = usb_submit_urb(urb, GFP_ATOMIC); | 250 | err = usb_submit_urb(urb, GFP_ATOMIC); |
253 | if (err) { | 251 | if (err) { |
254 | BT_ERR("%s bulk rx submit failed urb %p err %d", | 252 | BT_ERR("%s bulk rx submit failed urb %p err %d", |
255 | bfusb->hdev->name, urb, err); | 253 | data->hdev->name, urb, err); |
256 | skb_unlink(skb, &bfusb->pending_q); | 254 | skb_unlink(skb, &data->pending_q); |
257 | kfree_skb(skb); | 255 | kfree_skb(skb); |
258 | usb_free_urb(urb); | 256 | usb_free_urb(urb); |
259 | } | 257 | } |
@@ -261,15 +259,15 @@ static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb) | |||
261 | return err; | 259 | return err; |
262 | } | 260 | } |
263 | 261 | ||
264 | static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *data, int len) | 262 | static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned char *buf, int len) |
265 | { | 263 | { |
266 | BT_DBG("bfusb %p hdr 0x%02x data %p len %d", bfusb, hdr, data, len); | 264 | BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len); |
267 | 265 | ||
268 | if (hdr & 0x10) { | 266 | if (hdr & 0x10) { |
269 | BT_ERR("%s error in block", bfusb->hdev->name); | 267 | BT_ERR("%s error in block", data->hdev->name); |
270 | if (bfusb->reassembly) | 268 | if (data->reassembly) |
271 | kfree_skb(bfusb->reassembly); | 269 | kfree_skb(data->reassembly); |
272 | bfusb->reassembly = NULL; | 270 | data->reassembly = NULL; |
273 | return -EIO; | 271 | return -EIO; |
274 | } | 272 | } |
275 | 273 | ||
@@ -278,46 +276,46 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char * | |||
278 | unsigned char pkt_type; | 276 | unsigned char pkt_type; |
279 | int pkt_len = 0; | 277 | int pkt_len = 0; |
280 | 278 | ||
281 | if (bfusb->reassembly) { | 279 | if (data->reassembly) { |
282 | BT_ERR("%s unexpected start block", bfusb->hdev->name); | 280 | BT_ERR("%s unexpected start block", data->hdev->name); |
283 | kfree_skb(bfusb->reassembly); | 281 | kfree_skb(data->reassembly); |
284 | bfusb->reassembly = NULL; | 282 | data->reassembly = NULL; |
285 | } | 283 | } |
286 | 284 | ||
287 | if (len < 1) { | 285 | if (len < 1) { |
288 | BT_ERR("%s no packet type found", bfusb->hdev->name); | 286 | BT_ERR("%s no packet type found", data->hdev->name); |
289 | return -EPROTO; | 287 | return -EPROTO; |
290 | } | 288 | } |
291 | 289 | ||
292 | pkt_type = *data++; len--; | 290 | pkt_type = *buf++; len--; |
293 | 291 | ||
294 | switch (pkt_type) { | 292 | switch (pkt_type) { |
295 | case HCI_EVENT_PKT: | 293 | case HCI_EVENT_PKT: |
296 | if (len >= HCI_EVENT_HDR_SIZE) { | 294 | if (len >= HCI_EVENT_HDR_SIZE) { |
297 | struct hci_event_hdr *hdr = (struct hci_event_hdr *) data; | 295 | struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf; |
298 | pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen; | 296 | pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen; |
299 | } else { | 297 | } else { |
300 | BT_ERR("%s event block is too short", bfusb->hdev->name); | 298 | BT_ERR("%s event block is too short", data->hdev->name); |
301 | return -EILSEQ; | 299 | return -EILSEQ; |
302 | } | 300 | } |
303 | break; | 301 | break; |
304 | 302 | ||
305 | case HCI_ACLDATA_PKT: | 303 | case HCI_ACLDATA_PKT: |
306 | if (len >= HCI_ACL_HDR_SIZE) { | 304 | if (len >= HCI_ACL_HDR_SIZE) { |
307 | struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) data; | 305 | struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf; |
308 | pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen); | 306 | pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen); |
309 | } else { | 307 | } else { |
310 | BT_ERR("%s data block is too short", bfusb->hdev->name); | 308 | BT_ERR("%s data block is too short", data->hdev->name); |
311 | return -EILSEQ; | 309 | return -EILSEQ; |
312 | } | 310 | } |
313 | break; | 311 | break; |
314 | 312 | ||
315 | case HCI_SCODATA_PKT: | 313 | case HCI_SCODATA_PKT: |
316 | if (len >= HCI_SCO_HDR_SIZE) { | 314 | if (len >= HCI_SCO_HDR_SIZE) { |
317 | struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) data; | 315 | struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf; |
318 | pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen; | 316 | pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen; |
319 | } else { | 317 | } else { |
320 | BT_ERR("%s audio block is too short", bfusb->hdev->name); | 318 | BT_ERR("%s audio block is too short", data->hdev->name); |
321 | return -EILSEQ; | 319 | return -EILSEQ; |
322 | } | 320 | } |
323 | break; | 321 | break; |
@@ -325,27 +323,27 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char * | |||
325 | 323 | ||
326 | skb = bt_skb_alloc(pkt_len, GFP_ATOMIC); | 324 | skb = bt_skb_alloc(pkt_len, GFP_ATOMIC); |
327 | if (!skb) { | 325 | if (!skb) { |
328 | BT_ERR("%s no memory for the packet", bfusb->hdev->name); | 326 | BT_ERR("%s no memory for the packet", data->hdev->name); |
329 | return -ENOMEM; | 327 | return -ENOMEM; |
330 | } | 328 | } |
331 | 329 | ||
332 | skb->dev = (void *) bfusb->hdev; | 330 | skb->dev = (void *) data->hdev; |
333 | bt_cb(skb)->pkt_type = pkt_type; | 331 | bt_cb(skb)->pkt_type = pkt_type; |
334 | 332 | ||
335 | bfusb->reassembly = skb; | 333 | data->reassembly = skb; |
336 | } else { | 334 | } else { |
337 | if (!bfusb->reassembly) { | 335 | if (!data->reassembly) { |
338 | BT_ERR("%s unexpected continuation block", bfusb->hdev->name); | 336 | BT_ERR("%s unexpected continuation block", data->hdev->name); |
339 | return -EIO; | 337 | return -EIO; |
340 | } | 338 | } |
341 | } | 339 | } |
342 | 340 | ||
343 | if (len > 0) | 341 | if (len > 0) |
344 | memcpy(skb_put(bfusb->reassembly, len), data, len); | 342 | memcpy(skb_put(data->reassembly, len), buf, len); |
345 | 343 | ||
346 | if (hdr & 0x08) { | 344 | if (hdr & 0x08) { |
347 | hci_recv_frame(bfusb->reassembly); | 345 | hci_recv_frame(data->reassembly); |
348 | bfusb->reassembly = NULL; | 346 | data->reassembly = NULL; |
349 | } | 347 | } |
350 | 348 | ||
351 | return 0; | 349 | return 0; |
@@ -354,22 +352,22 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char * | |||
354 | static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs) | 352 | static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs) |
355 | { | 353 | { |
356 | struct sk_buff *skb = (struct sk_buff *) urb->context; | 354 | struct sk_buff *skb = (struct sk_buff *) urb->context; |
357 | struct bfusb *bfusb = (struct bfusb *) skb->dev; | 355 | struct bfusb_data *data = (struct bfusb_data *) skb->dev; |
358 | unsigned char *buf = urb->transfer_buffer; | 356 | unsigned char *buf = urb->transfer_buffer; |
359 | int count = urb->actual_length; | 357 | int count = urb->actual_length; |
360 | int err, hdr, len; | 358 | int err, hdr, len; |
361 | 359 | ||
362 | BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len); | 360 | BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len); |
363 | 361 | ||
364 | read_lock(&bfusb->lock); | 362 | read_lock(&data->lock); |
365 | 363 | ||
366 | if (!test_bit(HCI_RUNNING, &bfusb->hdev->flags)) | 364 | if (!test_bit(HCI_RUNNING, &data->hdev->flags)) |
367 | goto unlock; | 365 | goto unlock; |
368 | 366 | ||
369 | if (urb->status || !count) | 367 | if (urb->status || !count) |
370 | goto resubmit; | 368 | goto resubmit; |
371 | 369 | ||
372 | bfusb->hdev->stat.byte_rx += count; | 370 | data->hdev->stat.byte_rx += count; |
373 | 371 | ||
374 | skb_put(skb, count); | 372 | skb_put(skb, count); |
375 | 373 | ||
@@ -388,90 +386,89 @@ static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs) | |||
388 | 386 | ||
389 | if (count < len) { | 387 | if (count < len) { |
390 | BT_ERR("%s block extends over URB buffer ranges", | 388 | BT_ERR("%s block extends over URB buffer ranges", |
391 | bfusb->hdev->name); | 389 | data->hdev->name); |
392 | } | 390 | } |
393 | 391 | ||
394 | if ((hdr & 0xe1) == 0xc1) | 392 | if ((hdr & 0xe1) == 0xc1) |
395 | bfusb_recv_block(bfusb, hdr, buf, len); | 393 | bfusb_recv_block(data, hdr, buf, len); |
396 | 394 | ||
397 | count -= len; | 395 | count -= len; |
398 | buf += len; | 396 | buf += len; |
399 | } | 397 | } |
400 | 398 | ||
401 | skb_unlink(skb, &bfusb->pending_q); | 399 | skb_unlink(skb, &data->pending_q); |
402 | kfree_skb(skb); | 400 | kfree_skb(skb); |
403 | 401 | ||
404 | bfusb_rx_submit(bfusb, urb); | 402 | bfusb_rx_submit(data, urb); |
405 | 403 | ||
406 | read_unlock(&bfusb->lock); | 404 | read_unlock(&data->lock); |
407 | 405 | ||
408 | return; | 406 | return; |
409 | 407 | ||
410 | resubmit: | 408 | resubmit: |
411 | urb->dev = bfusb->udev; | 409 | urb->dev = data->udev; |
412 | 410 | ||
413 | err = usb_submit_urb(urb, GFP_ATOMIC); | 411 | err = usb_submit_urb(urb, GFP_ATOMIC); |
414 | if (err) { | 412 | if (err) { |
415 | BT_ERR("%s bulk resubmit failed urb %p err %d", | 413 | BT_ERR("%s bulk resubmit failed urb %p err %d", |
416 | bfusb->hdev->name, urb, err); | 414 | data->hdev->name, urb, err); |
417 | } | 415 | } |
418 | 416 | ||
419 | unlock: | 417 | unlock: |
420 | read_unlock(&bfusb->lock); | 418 | read_unlock(&data->lock); |
421 | } | 419 | } |
422 | 420 | ||
423 | |||
424 | static int bfusb_open(struct hci_dev *hdev) | 421 | static int bfusb_open(struct hci_dev *hdev) |
425 | { | 422 | { |
426 | struct bfusb *bfusb = (struct bfusb *) hdev->driver_data; | 423 | struct bfusb_data *data = hdev->driver_data; |
427 | unsigned long flags; | 424 | unsigned long flags; |
428 | int i, err; | 425 | int i, err; |
429 | 426 | ||
430 | BT_DBG("hdev %p bfusb %p", hdev, bfusb); | 427 | BT_DBG("hdev %p bfusb %p", hdev, data); |
431 | 428 | ||
432 | if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) | 429 | if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) |
433 | return 0; | 430 | return 0; |
434 | 431 | ||
435 | write_lock_irqsave(&bfusb->lock, flags); | 432 | write_lock_irqsave(&data->lock, flags); |
436 | 433 | ||
437 | err = bfusb_rx_submit(bfusb, NULL); | 434 | err = bfusb_rx_submit(data, NULL); |
438 | if (!err) { | 435 | if (!err) { |
439 | for (i = 1; i < BFUSB_MAX_BULK_RX; i++) | 436 | for (i = 1; i < BFUSB_MAX_BULK_RX; i++) |
440 | bfusb_rx_submit(bfusb, NULL); | 437 | bfusb_rx_submit(data, NULL); |
441 | } else { | 438 | } else { |
442 | clear_bit(HCI_RUNNING, &hdev->flags); | 439 | clear_bit(HCI_RUNNING, &hdev->flags); |
443 | } | 440 | } |
444 | 441 | ||
445 | write_unlock_irqrestore(&bfusb->lock, flags); | 442 | write_unlock_irqrestore(&data->lock, flags); |
446 | 443 | ||
447 | return err; | 444 | return err; |
448 | } | 445 | } |
449 | 446 | ||
450 | static int bfusb_flush(struct hci_dev *hdev) | 447 | static int bfusb_flush(struct hci_dev *hdev) |
451 | { | 448 | { |
452 | struct bfusb *bfusb = (struct bfusb *) hdev->driver_data; | 449 | struct bfusb_data *data = hdev->driver_data; |
453 | 450 | ||
454 | BT_DBG("hdev %p bfusb %p", hdev, bfusb); | 451 | BT_DBG("hdev %p bfusb %p", hdev, data); |
455 | 452 | ||
456 | skb_queue_purge(&bfusb->transmit_q); | 453 | skb_queue_purge(&data->transmit_q); |
457 | 454 | ||
458 | return 0; | 455 | return 0; |
459 | } | 456 | } |
460 | 457 | ||
461 | static int bfusb_close(struct hci_dev *hdev) | 458 | static int bfusb_close(struct hci_dev *hdev) |
462 | { | 459 | { |
463 | struct bfusb *bfusb = (struct bfusb *) hdev->driver_data; | 460 | struct bfusb_data *data = hdev->driver_data; |
464 | unsigned long flags; | 461 | unsigned long flags; |
465 | 462 | ||
466 | BT_DBG("hdev %p bfusb %p", hdev, bfusb); | 463 | BT_DBG("hdev %p bfusb %p", hdev, data); |
467 | 464 | ||
468 | if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) | 465 | if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) |
469 | return 0; | 466 | return 0; |
470 | 467 | ||
471 | write_lock_irqsave(&bfusb->lock, flags); | 468 | write_lock_irqsave(&data->lock, flags); |
472 | write_unlock_irqrestore(&bfusb->lock, flags); | 469 | write_unlock_irqrestore(&data->lock, flags); |
473 | 470 | ||
474 | bfusb_unlink_urbs(bfusb); | 471 | bfusb_unlink_urbs(data); |
475 | bfusb_flush(hdev); | 472 | bfusb_flush(hdev); |
476 | 473 | ||
477 | return 0; | 474 | return 0; |
@@ -480,7 +477,7 @@ static int bfusb_close(struct hci_dev *hdev) | |||
480 | static int bfusb_send_frame(struct sk_buff *skb) | 477 | static int bfusb_send_frame(struct sk_buff *skb) |
481 | { | 478 | { |
482 | struct hci_dev *hdev = (struct hci_dev *) skb->dev; | 479 | struct hci_dev *hdev = (struct hci_dev *) skb->dev; |
483 | struct bfusb *bfusb; | 480 | struct bfusb_data *data; |
484 | struct sk_buff *nskb; | 481 | struct sk_buff *nskb; |
485 | unsigned char buf[3]; | 482 | unsigned char buf[3]; |
486 | int sent = 0, size, count; | 483 | int sent = 0, size, count; |
@@ -495,7 +492,7 @@ static int bfusb_send_frame(struct sk_buff *skb) | |||
495 | if (!test_bit(HCI_RUNNING, &hdev->flags)) | 492 | if (!test_bit(HCI_RUNNING, &hdev->flags)) |
496 | return -EBUSY; | 493 | return -EBUSY; |
497 | 494 | ||
498 | bfusb = (struct bfusb *) hdev->driver_data; | 495 | data = hdev->driver_data; |
499 | 496 | ||
500 | switch (bt_cb(skb)->pkt_type) { | 497 | switch (bt_cb(skb)->pkt_type) { |
501 | case HCI_COMMAND_PKT: | 498 | case HCI_COMMAND_PKT: |
@@ -515,12 +512,13 @@ static int bfusb_send_frame(struct sk_buff *skb) | |||
515 | count = skb->len; | 512 | count = skb->len; |
516 | 513 | ||
517 | /* Max HCI frame size seems to be 1511 + 1 */ | 514 | /* Max HCI frame size seems to be 1511 + 1 */ |
518 | if (!(nskb = bt_skb_alloc(count + 32, GFP_ATOMIC))) { | 515 | nskb = bt_skb_alloc(count + 32, GFP_ATOMIC); |
516 | if (!nskb) { | ||
519 | BT_ERR("Can't allocate memory for new packet"); | 517 | BT_ERR("Can't allocate memory for new packet"); |
520 | return -ENOMEM; | 518 | return -ENOMEM; |
521 | } | 519 | } |
522 | 520 | ||
523 | nskb->dev = (void *) bfusb; | 521 | nskb->dev = (void *) data; |
524 | 522 | ||
525 | while (count) { | 523 | while (count) { |
526 | size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE); | 524 | size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE); |
@@ -537,18 +535,18 @@ static int bfusb_send_frame(struct sk_buff *skb) | |||
537 | } | 535 | } |
538 | 536 | ||
539 | /* Don't send frame with multiple size of bulk max packet */ | 537 | /* Don't send frame with multiple size of bulk max packet */ |
540 | if ((nskb->len % bfusb->bulk_pkt_size) == 0) { | 538 | if ((nskb->len % data->bulk_pkt_size) == 0) { |
541 | buf[0] = 0xdd; | 539 | buf[0] = 0xdd; |
542 | buf[1] = 0x00; | 540 | buf[1] = 0x00; |
543 | memcpy(skb_put(nskb, 2), buf, 2); | 541 | memcpy(skb_put(nskb, 2), buf, 2); |
544 | } | 542 | } |
545 | 543 | ||
546 | read_lock(&bfusb->lock); | 544 | read_lock(&data->lock); |
547 | 545 | ||
548 | skb_queue_tail(&bfusb->transmit_q, nskb); | 546 | skb_queue_tail(&data->transmit_q, nskb); |
549 | bfusb_tx_wakeup(bfusb); | 547 | bfusb_tx_wakeup(data); |
550 | 548 | ||
551 | read_unlock(&bfusb->lock); | 549 | read_unlock(&data->lock); |
552 | 550 | ||
553 | kfree_skb(skb); | 551 | kfree_skb(skb); |
554 | 552 | ||
@@ -557,11 +555,11 @@ static int bfusb_send_frame(struct sk_buff *skb) | |||
557 | 555 | ||
558 | static void bfusb_destruct(struct hci_dev *hdev) | 556 | static void bfusb_destruct(struct hci_dev *hdev) |
559 | { | 557 | { |
560 | struct bfusb *bfusb = (struct bfusb *) hdev->driver_data; | 558 | struct bfusb_data *data = hdev->driver_data; |
561 | 559 | ||
562 | BT_DBG("hdev %p bfusb %p", hdev, bfusb); | 560 | BT_DBG("hdev %p bfusb %p", hdev, data); |
563 | 561 | ||
564 | kfree(bfusb); | 562 | kfree(data); |
565 | } | 563 | } |
566 | 564 | ||
567 | static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg) | 565 | static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg) |
@@ -569,25 +567,24 @@ static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg | |||
569 | return -ENOIOCTLCMD; | 567 | return -ENOIOCTLCMD; |
570 | } | 568 | } |
571 | 569 | ||
572 | 570 | static int bfusb_load_firmware(struct bfusb_data *data, unsigned char *firmware, int count) | |
573 | static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int count) | ||
574 | { | 571 | { |
575 | unsigned char *buf; | 572 | unsigned char *buf; |
576 | int err, pipe, len, size, sent = 0; | 573 | int err, pipe, len, size, sent = 0; |
577 | 574 | ||
578 | BT_DBG("bfusb %p udev %p", bfusb, bfusb->udev); | 575 | BT_DBG("bfusb %p udev %p", data, data->udev); |
579 | 576 | ||
580 | BT_INFO("BlueFRITZ! USB loading firmware"); | 577 | BT_INFO("BlueFRITZ! USB loading firmware"); |
581 | 578 | ||
582 | pipe = usb_sndctrlpipe(bfusb->udev, 0); | 579 | pipe = usb_sndctrlpipe(data->udev, 0); |
583 | 580 | ||
584 | if (usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION, | 581 | if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION, |
585 | 0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) { | 582 | 0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) { |
586 | BT_ERR("Can't change to loading configuration"); | 583 | BT_ERR("Can't change to loading configuration"); |
587 | return -EBUSY; | 584 | return -EBUSY; |
588 | } | 585 | } |
589 | 586 | ||
590 | bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0; | 587 | data->udev->toggle[0] = data->udev->toggle[1] = 0; |
591 | 588 | ||
592 | buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC); | 589 | buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC); |
593 | if (!buf) { | 590 | if (!buf) { |
@@ -595,14 +592,14 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int | |||
595 | return -ENOMEM; | 592 | return -ENOMEM; |
596 | } | 593 | } |
597 | 594 | ||
598 | pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep); | 595 | pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep); |
599 | 596 | ||
600 | while (count) { | 597 | while (count) { |
601 | size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE + 3); | 598 | size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE + 3); |
602 | 599 | ||
603 | memcpy(buf, firmware + sent, size); | 600 | memcpy(buf, firmware + sent, size); |
604 | 601 | ||
605 | err = usb_bulk_msg(bfusb->udev, pipe, buf, size, | 602 | err = usb_bulk_msg(data->udev, pipe, buf, size, |
606 | &len, BFUSB_BLOCK_TIMEOUT); | 603 | &len, BFUSB_BLOCK_TIMEOUT); |
607 | 604 | ||
608 | if (err || (len != size)) { | 605 | if (err || (len != size)) { |
@@ -614,21 +611,23 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int | |||
614 | count -= size; | 611 | count -= size; |
615 | } | 612 | } |
616 | 613 | ||
617 | if ((err = usb_bulk_msg(bfusb->udev, pipe, NULL, 0, | 614 | err = usb_bulk_msg(data->udev, pipe, NULL, 0, |
618 | &len, BFUSB_BLOCK_TIMEOUT)) < 0) { | 615 | &len, BFUSB_BLOCK_TIMEOUT); |
616 | if (err < 0) { | ||
619 | BT_ERR("Error in null packet request"); | 617 | BT_ERR("Error in null packet request"); |
620 | goto error; | 618 | goto error; |
621 | } | 619 | } |
622 | 620 | ||
623 | pipe = usb_sndctrlpipe(bfusb->udev, 0); | 621 | pipe = usb_sndctrlpipe(data->udev, 0); |
624 | 622 | ||
625 | if ((err = usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION, | 623 | err = usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION, |
626 | 0, 2, 0, NULL, 0, USB_CTRL_SET_TIMEOUT)) < 0) { | 624 | 0, 2, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); |
625 | if (err < 0) { | ||
627 | BT_ERR("Can't change to running configuration"); | 626 | BT_ERR("Can't change to running configuration"); |
628 | goto error; | 627 | goto error; |
629 | } | 628 | } |
630 | 629 | ||
631 | bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0; | 630 | data->udev->toggle[0] = data->udev->toggle[1] = 0; |
632 | 631 | ||
633 | BT_INFO("BlueFRITZ! USB device ready"); | 632 | BT_INFO("BlueFRITZ! USB device ready"); |
634 | 633 | ||
@@ -638,9 +637,9 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int | |||
638 | error: | 637 | error: |
639 | kfree(buf); | 638 | kfree(buf); |
640 | 639 | ||
641 | pipe = usb_sndctrlpipe(bfusb->udev, 0); | 640 | pipe = usb_sndctrlpipe(data->udev, 0); |
642 | 641 | ||
643 | usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION, | 642 | usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION, |
644 | 0, 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); | 643 | 0, 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); |
645 | 644 | ||
646 | return err; | 645 | return err; |
@@ -653,7 +652,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
653 | struct usb_host_endpoint *bulk_out_ep; | 652 | struct usb_host_endpoint *bulk_out_ep; |
654 | struct usb_host_endpoint *bulk_in_ep; | 653 | struct usb_host_endpoint *bulk_in_ep; |
655 | struct hci_dev *hdev; | 654 | struct hci_dev *hdev; |
656 | struct bfusb *bfusb; | 655 | struct bfusb_data *data; |
657 | 656 | ||
658 | BT_DBG("intf %p id %p", intf, id); | 657 | BT_DBG("intf %p id %p", intf, id); |
659 | 658 | ||
@@ -673,23 +672,24 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
673 | } | 672 | } |
674 | 673 | ||
675 | /* Initialize control structure and load firmware */ | 674 | /* Initialize control structure and load firmware */ |
676 | if (!(bfusb = kzalloc(sizeof(struct bfusb), GFP_KERNEL))) { | 675 | data = kzalloc(sizeof(struct bfusb_data), GFP_KERNEL); |
676 | if (!data) { | ||
677 | BT_ERR("Can't allocate memory for control structure"); | 677 | BT_ERR("Can't allocate memory for control structure"); |
678 | goto done; | 678 | goto done; |
679 | } | 679 | } |
680 | 680 | ||
681 | bfusb->udev = udev; | 681 | data->udev = udev; |
682 | bfusb->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; | 682 | data->bulk_in_ep = bulk_in_ep->desc.bEndpointAddress; |
683 | bfusb->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress; | 683 | data->bulk_out_ep = bulk_out_ep->desc.bEndpointAddress; |
684 | bfusb->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize); | 684 | data->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize); |
685 | 685 | ||
686 | rwlock_init(&bfusb->lock); | 686 | rwlock_init(&data->lock); |
687 | 687 | ||
688 | bfusb->reassembly = NULL; | 688 | data->reassembly = NULL; |
689 | 689 | ||
690 | skb_queue_head_init(&bfusb->transmit_q); | 690 | skb_queue_head_init(&data->transmit_q); |
691 | skb_queue_head_init(&bfusb->pending_q); | 691 | skb_queue_head_init(&data->pending_q); |
692 | skb_queue_head_init(&bfusb->completed_q); | 692 | skb_queue_head_init(&data->completed_q); |
693 | 693 | ||
694 | if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) { | 694 | if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) { |
695 | BT_ERR("Firmware request failed"); | 695 | BT_ERR("Firmware request failed"); |
@@ -698,7 +698,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
698 | 698 | ||
699 | BT_DBG("firmware data %p size %d", firmware->data, firmware->size); | 699 | BT_DBG("firmware data %p size %d", firmware->data, firmware->size); |
700 | 700 | ||
701 | if (bfusb_load_firmware(bfusb, firmware->data, firmware->size) < 0) { | 701 | if (bfusb_load_firmware(data, firmware->data, firmware->size) < 0) { |
702 | BT_ERR("Firmware loading failed"); | 702 | BT_ERR("Firmware loading failed"); |
703 | goto release; | 703 | goto release; |
704 | } | 704 | } |
@@ -712,10 +712,10 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
712 | goto error; | 712 | goto error; |
713 | } | 713 | } |
714 | 714 | ||
715 | bfusb->hdev = hdev; | 715 | data->hdev = hdev; |
716 | 716 | ||
717 | hdev->type = HCI_USB; | 717 | hdev->type = HCI_USB; |
718 | hdev->driver_data = bfusb; | 718 | hdev->driver_data = data; |
719 | SET_HCIDEV_DEV(hdev, &intf->dev); | 719 | SET_HCIDEV_DEV(hdev, &intf->dev); |
720 | 720 | ||
721 | hdev->open = bfusb_open; | 721 | hdev->open = bfusb_open; |
@@ -733,7 +733,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
733 | goto error; | 733 | goto error; |
734 | } | 734 | } |
735 | 735 | ||
736 | usb_set_intfdata(intf, bfusb); | 736 | usb_set_intfdata(intf, data); |
737 | 737 | ||
738 | return 0; | 738 | return 0; |
739 | 739 | ||
@@ -741,7 +741,7 @@ release: | |||
741 | release_firmware(firmware); | 741 | release_firmware(firmware); |
742 | 742 | ||
743 | error: | 743 | error: |
744 | kfree(bfusb); | 744 | kfree(data); |
745 | 745 | ||
746 | done: | 746 | done: |
747 | return -EIO; | 747 | return -EIO; |
@@ -749,8 +749,8 @@ done: | |||
749 | 749 | ||
750 | static void bfusb_disconnect(struct usb_interface *intf) | 750 | static void bfusb_disconnect(struct usb_interface *intf) |
751 | { | 751 | { |
752 | struct bfusb *bfusb = usb_get_intfdata(intf); | 752 | struct bfusb_data *data = usb_get_intfdata(intf); |
753 | struct hci_dev *hdev = bfusb->hdev; | 753 | struct hci_dev *hdev = data->hdev; |
754 | 754 | ||
755 | BT_DBG("intf %p", intf); | 755 | BT_DBG("intf %p", intf); |
756 | 756 | ||
@@ -780,7 +780,8 @@ static int __init bfusb_init(void) | |||
780 | 780 | ||
781 | BT_INFO("BlueFRITZ! USB driver ver %s", VERSION); | 781 | BT_INFO("BlueFRITZ! USB driver ver %s", VERSION); |
782 | 782 | ||
783 | if ((err = usb_register(&bfusb_driver)) < 0) | 783 | err = usb_register(&bfusb_driver); |
784 | if (err < 0) | ||
784 | BT_ERR("Failed to register BlueFRITZ! USB driver"); | 785 | BT_ERR("Failed to register BlueFRITZ! USB driver"); |
785 | 786 | ||
786 | return err; | 787 | return err; |