Lines Matching refs:hdev

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