Lines Matching defs:hdev
37 struct hci_dev *hdev;
49 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
51 BT_DBG("%s urb %p status %d count %d", hdev->name,
54 if (!test_bit(HCI_RUNNING, &hdev->flags))
58 hdev->stat.byte_tx += urb->transfer_buffer_length;
60 hdev->stat.err_tx++;
86 struct hci_dev *hdev = urb->context;
87 struct bpa10x_data *data = hci_get_drvdata(hdev);
90 BT_DBG("%s urb %p status %d count %d", hdev->name,
93 if (!test_bit(HCI_RUNNING, &hdev->flags))
99 data->rx_skb[idx] = h4_recv_buf(hdev, data->rx_skb[idx],
105 bt_dev_err(hdev, "corrupted event packet");
106 hdev->stat.err_rx++;
115 bt_dev_err(hdev, "urb %p failed to resubmit (%d)", urb, -err);
120 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
122 struct bpa10x_data *data = hci_get_drvdata(hdev);
128 BT_DBG("%s", hdev->name);
143 bpa10x_rx_complete, hdev, 1);
151 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err);
160 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
162 struct bpa10x_data *data = hci_get_drvdata(hdev);
168 BT_DBG("%s", hdev->name);
183 buf, size, bpa10x_rx_complete, hdev);
191 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err);
200 static int bpa10x_open(struct hci_dev *hdev)
202 struct bpa10x_data *data = hci_get_drvdata(hdev);
205 BT_DBG("%s", hdev->name);
207 err = bpa10x_submit_intr_urb(hdev);
211 err = bpa10x_submit_bulk_urb(hdev);
223 static int bpa10x_close(struct hci_dev *hdev)
225 struct bpa10x_data *data = hci_get_drvdata(hdev);
227 BT_DBG("%s", hdev->name);
234 static int bpa10x_flush(struct hci_dev *hdev)
236 struct bpa10x_data *data = hci_get_drvdata(hdev);
238 BT_DBG("%s", hdev->name);
245 static int bpa10x_setup(struct hci_dev *hdev)
250 BT_DBG("%s", hdev->name);
253 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT);
257 bt_dev_info(hdev, "%s", (char *)(skb->data + 1));
259 hci_set_fw_info(hdev, "%s", skb->data + 1);
265 static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
267 struct bpa10x_data *data = hci_get_drvdata(hdev);
273 BT_DBG("%s", hdev->name);
275 skb->dev = (void *) hdev;
303 hdev->stat.cmd_tx++;
312 hdev->stat.acl_tx++;
321 hdev->stat.sco_tx++;
333 bt_dev_err(hdev, "urb %p submission failed", urb);
343 static int bpa10x_set_diag(struct hci_dev *hdev, bool enable)
348 BT_DBG("%s", hdev->name);
350 if (!test_bit(HCI_RUNNING, &hdev->flags))
354 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT);
366 struct hci_dev *hdev;
383 hdev = hci_alloc_dev();
384 if (!hdev)
387 hdev->bus = HCI_USB;
388 hci_set_drvdata(hdev, data);
390 data->hdev = hdev;
392 SET_HCIDEV_DEV(hdev, &intf->dev);
394 hdev->open = bpa10x_open;
395 hdev->close = bpa10x_close;
396 hdev->flush = bpa10x_flush;
397 hdev->setup = bpa10x_setup;
398 hdev->send = bpa10x_send_frame;
399 hdev->set_diag = bpa10x_set_diag;
401 set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
403 err = hci_register_dev(hdev);
405 hci_free_dev(hdev);
425 hci_unregister_dev(data->hdev);
427 hci_free_dev(data->hdev);