Lines Matching refs:hdev
37 struct hci_dev *hdev; member
50 struct hci_dev *hdev = (struct hci_dev *) skb->dev; in bpa10x_tx_complete() local
52 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_tx_complete()
55 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_tx_complete()
59 hdev->stat.byte_tx += urb->transfer_buffer_length; in bpa10x_tx_complete()
61 hdev->stat.err_tx++; in bpa10x_tx_complete()
87 struct hci_dev *hdev = urb->context; in bpa10x_rx_complete() local
88 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_rx_complete()
91 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_rx_complete()
94 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_rx_complete()
106 bt_dev_err(hdev, "corrupted event packet"); in bpa10x_rx_complete()
107 hdev->stat.err_rx++; in bpa10x_rx_complete()
116 bt_dev_err(hdev, "urb %p failed to resubmit (%d)", urb, -err); in bpa10x_rx_complete()
121 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) in bpa10x_submit_intr_urb() argument
123 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_intr_urb()
129 BT_DBG("%s", hdev->name); in bpa10x_submit_intr_urb()
144 bpa10x_rx_complete, hdev, 1); in bpa10x_submit_intr_urb()
152 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); in bpa10x_submit_intr_urb()
161 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) in bpa10x_submit_bulk_urb() argument
163 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_bulk_urb()
169 BT_DBG("%s", hdev->name); in bpa10x_submit_bulk_urb()
184 buf, size, bpa10x_rx_complete, hdev); in bpa10x_submit_bulk_urb()
192 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); in bpa10x_submit_bulk_urb()
201 static int bpa10x_open(struct hci_dev *hdev) in bpa10x_open() argument
203 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_open()
206 BT_DBG("%s", hdev->name); in bpa10x_open()
208 err = bpa10x_submit_intr_urb(hdev); in bpa10x_open()
212 err = bpa10x_submit_bulk_urb(hdev); in bpa10x_open()
224 static int bpa10x_close(struct hci_dev *hdev) in bpa10x_close() argument
226 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_close()
228 BT_DBG("%s", hdev->name); in bpa10x_close()
235 static int bpa10x_flush(struct hci_dev *hdev) in bpa10x_flush() argument
237 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_flush()
239 BT_DBG("%s", hdev->name); in bpa10x_flush()
246 static int bpa10x_setup(struct hci_dev *hdev) in bpa10x_setup() argument
251 BT_DBG("%s", hdev->name); in bpa10x_setup()
254 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_setup()
258 bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); in bpa10x_setup()
260 hci_set_fw_info(hdev, "%s", skb->data + 1); in bpa10x_setup()
266 static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) in bpa10x_send_frame() argument
268 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_send_frame()
274 BT_DBG("%s", hdev->name); in bpa10x_send_frame()
276 skb->dev = (void *) hdev; in bpa10x_send_frame()
304 hdev->stat.cmd_tx++; in bpa10x_send_frame()
313 hdev->stat.acl_tx++; in bpa10x_send_frame()
322 hdev->stat.sco_tx++; in bpa10x_send_frame()
334 bt_dev_err(hdev, "urb %p submission failed", urb); in bpa10x_send_frame()
344 static int bpa10x_set_diag(struct hci_dev *hdev, bool enable) in bpa10x_set_diag() argument
349 BT_DBG("%s", hdev->name); in bpa10x_set_diag()
351 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_set_diag()
355 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_set_diag()
367 struct hci_dev *hdev; in bpa10x_probe() local
384 hdev = hci_alloc_dev(); in bpa10x_probe()
385 if (!hdev) in bpa10x_probe()
388 hdev->bus = HCI_USB; in bpa10x_probe()
389 hci_set_drvdata(hdev, data); in bpa10x_probe()
391 data->hdev = hdev; in bpa10x_probe()
392 data->hu.hdev = hdev; in bpa10x_probe()
394 SET_HCIDEV_DEV(hdev, &intf->dev); in bpa10x_probe()
396 hdev->open = bpa10x_open; in bpa10x_probe()
397 hdev->close = bpa10x_close; in bpa10x_probe()
398 hdev->flush = bpa10x_flush; in bpa10x_probe()
399 hdev->setup = bpa10x_setup; in bpa10x_probe()
400 hdev->send = bpa10x_send_frame; in bpa10x_probe()
401 hdev->set_diag = bpa10x_set_diag; in bpa10x_probe()
403 hci_set_quirk(hdev, HCI_QUIRK_RESET_ON_CLOSE); in bpa10x_probe()
405 err = hci_register_dev(hdev); in bpa10x_probe()
407 hci_free_dev(hdev); in bpa10x_probe()
427 hci_unregister_dev(data->hdev); in bpa10x_disconnect()
429 hci_free_dev(data->hdev); in bpa10x_disconnect()