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_ERR("%s corrupted event packet", hdev->name); in bpa10x_rx_complete()
121 hdev->stat.err_rx++; in bpa10x_rx_complete()
131 hdev->name, urb, -err); in bpa10x_rx_complete()
136 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) in bpa10x_submit_intr_urb() argument
138 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_intr_urb()
144 BT_DBG("%s", hdev->name); in bpa10x_submit_intr_urb()
159 bpa10x_rx_complete, hdev, 1); in bpa10x_submit_intr_urb()
168 hdev->name, urb, -err); in bpa10x_submit_intr_urb()
177 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) in bpa10x_submit_bulk_urb() argument
179 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_bulk_urb()
185 BT_DBG("%s", hdev->name); in bpa10x_submit_bulk_urb()
200 buf, size, bpa10x_rx_complete, hdev); in bpa10x_submit_bulk_urb()
209 hdev->name, urb, -err); in bpa10x_submit_bulk_urb()
218 static int bpa10x_open(struct hci_dev *hdev) in bpa10x_open() argument
220 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_open()
223 BT_DBG("%s", hdev->name); in bpa10x_open()
225 err = bpa10x_submit_intr_urb(hdev); in bpa10x_open()
229 err = bpa10x_submit_bulk_urb(hdev); in bpa10x_open()
241 static int bpa10x_close(struct hci_dev *hdev) in bpa10x_close() argument
243 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_close()
245 BT_DBG("%s", hdev->name); in bpa10x_close()
252 static int bpa10x_flush(struct hci_dev *hdev) in bpa10x_flush() argument
254 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_flush()
256 BT_DBG("%s", hdev->name); in bpa10x_flush()
263 static int bpa10x_setup(struct hci_dev *hdev) in bpa10x_setup() argument
268 BT_DBG("%s", hdev->name); in bpa10x_setup()
271 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_setup()
275 BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1)); in bpa10x_setup()
281 static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) in bpa10x_send_frame() argument
283 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_send_frame()
289 BT_DBG("%s", hdev->name); in bpa10x_send_frame()
291 skb->dev = (void *) hdev; in bpa10x_send_frame()
319 hdev->stat.cmd_tx++; in bpa10x_send_frame()
328 hdev->stat.acl_tx++; in bpa10x_send_frame()
337 hdev->stat.sco_tx++; in bpa10x_send_frame()
349 BT_ERR("%s urb %p submission failed", hdev->name, urb); in bpa10x_send_frame()
359 static int bpa10x_set_diag(struct hci_dev *hdev, bool enable) in bpa10x_set_diag() argument
364 BT_DBG("%s", hdev->name); in bpa10x_set_diag()
366 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_set_diag()
370 skb = __hci_cmd_sync(hdev, 0xfc0e, sizeof(req), req, HCI_INIT_TIMEOUT); in bpa10x_set_diag()
381 struct hci_dev *hdev; in bpa10x_probe() local
398 hdev = hci_alloc_dev(); in bpa10x_probe()
399 if (!hdev) in bpa10x_probe()
402 hdev->bus = HCI_USB; in bpa10x_probe()
403 hci_set_drvdata(hdev, data); in bpa10x_probe()
405 data->hdev = hdev; in bpa10x_probe()
407 SET_HCIDEV_DEV(hdev, &intf->dev); in bpa10x_probe()
409 hdev->open = bpa10x_open; in bpa10x_probe()
410 hdev->close = bpa10x_close; in bpa10x_probe()
411 hdev->flush = bpa10x_flush; in bpa10x_probe()
412 hdev->setup = bpa10x_setup; in bpa10x_probe()
413 hdev->send = bpa10x_send_frame; in bpa10x_probe()
414 hdev->set_diag = bpa10x_set_diag; in bpa10x_probe()
416 set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); in bpa10x_probe()
418 err = hci_register_dev(hdev); in bpa10x_probe()
420 hci_free_dev(hdev); in bpa10x_probe()
440 hci_unregister_dev(data->hdev); in bpa10x_disconnect()
442 hci_free_dev(data->hdev); in bpa10x_disconnect()