Lines Matching refs:hdev

52 	struct hci_dev    *hdev;  member
64 struct hci_dev *hdev = (struct hci_dev *) skb->dev; in bpa10x_tx_complete() local
66 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_tx_complete()
69 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_tx_complete()
73 hdev->stat.byte_tx += urb->transfer_buffer_length; in bpa10x_tx_complete()
75 hdev->stat.err_tx++; in bpa10x_tx_complete()
101 struct hci_dev *hdev = urb->context; in bpa10x_rx_complete() local
102 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_rx_complete()
105 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_rx_complete()
108 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_rx_complete()
114 data->rx_skb[idx] = h4_recv_buf(hdev, data->rx_skb[idx], in bpa10x_rx_complete()
120 bt_dev_err(hdev, "corrupted event packet"); in bpa10x_rx_complete()
121 hdev->stat.err_rx++; in bpa10x_rx_complete()
130 bt_dev_err(hdev, "urb %p failed to resubmit (%d)", urb, -err); in bpa10x_rx_complete()
135 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) in bpa10x_submit_intr_urb() argument
137 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_intr_urb()
143 BT_DBG("%s", hdev->name); in bpa10x_submit_intr_urb()
158 bpa10x_rx_complete, hdev, 1); in bpa10x_submit_intr_urb()
166 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); in bpa10x_submit_intr_urb()
175 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) in bpa10x_submit_bulk_urb() argument
177 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_bulk_urb()
183 BT_DBG("%s", hdev->name); in bpa10x_submit_bulk_urb()
198 buf, size, bpa10x_rx_complete, hdev); in bpa10x_submit_bulk_urb()
206 bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); in bpa10x_submit_bulk_urb()
215 static int bpa10x_open(struct hci_dev *hdev) in bpa10x_open() argument
217 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_open()
220 BT_DBG("%s", hdev->name); in bpa10x_open()
222 err = bpa10x_submit_intr_urb(hdev); in bpa10x_open()
226 err = bpa10x_submit_bulk_urb(hdev); in bpa10x_open()
238 static int bpa10x_close(struct hci_dev *hdev) in bpa10x_close() argument
240 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_close()
242 BT_DBG("%s", hdev->name); in bpa10x_close()
249 static int bpa10x_flush(struct hci_dev *hdev) in bpa10x_flush() argument
251 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_flush()
253 BT_DBG("%s", hdev->name); in bpa10x_flush()
260 static int bpa10x_setup(struct hci_dev *hdev) in bpa10x_setup() argument
265 BT_DBG("%s", hdev->name); in bpa10x_setup()
268 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_setup()
272 bt_dev_info(hdev, "%s", (char *)(skb->data + 1)); in bpa10x_setup()
274 hci_set_fw_info(hdev, "%s", skb->data + 1); in bpa10x_setup()
280 static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) in bpa10x_send_frame() argument
282 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_send_frame()
288 BT_DBG("%s", hdev->name); in bpa10x_send_frame()
290 skb->dev = (void *) hdev; in bpa10x_send_frame()
318 hdev->stat.cmd_tx++; in bpa10x_send_frame()
327 hdev->stat.acl_tx++; in bpa10x_send_frame()
336 hdev->stat.sco_tx++; in bpa10x_send_frame()
348 bt_dev_err(hdev, "urb %p submission failed", urb); in bpa10x_send_frame()
358 static int bpa10x_set_diag(struct hci_dev *hdev, bool enable) in bpa10x_set_diag() argument
363 BT_DBG("%s", hdev->name); in bpa10x_set_diag()
365 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_set_diag()
369 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_set_diag()
380 struct hci_dev *hdev; in bpa10x_probe() local
397 hdev = hci_alloc_dev(); in bpa10x_probe()
398 if (!hdev) in bpa10x_probe()
401 hdev->bus = HCI_USB; in bpa10x_probe()
402 hci_set_drvdata(hdev, data); in bpa10x_probe()
404 data->hdev = hdev; in bpa10x_probe()
406 SET_HCIDEV_DEV(hdev, &intf->dev); in bpa10x_probe()
408 hdev->open = bpa10x_open; in bpa10x_probe()
409 hdev->close = bpa10x_close; in bpa10x_probe()
410 hdev->flush = bpa10x_flush; in bpa10x_probe()
411 hdev->setup = bpa10x_setup; in bpa10x_probe()
412 hdev->send = bpa10x_send_frame; in bpa10x_probe()
413 hdev->set_diag = bpa10x_set_diag; in bpa10x_probe()
415 set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); in bpa10x_probe()
417 err = hci_register_dev(hdev); in bpa10x_probe()
419 hci_free_dev(hdev); in bpa10x_probe()
439 hci_unregister_dev(data->hdev); in bpa10x_disconnect()
441 hci_free_dev(data->hdev); in bpa10x_disconnect()