Lines Matching refs:hdev

50 	struct hci_dev    *hdev;  member
67 static int bpa10x_recv(struct hci_dev *hdev, int queue, void *buf, int count) in bpa10x_recv() argument
69 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_recv()
71 BT_DBG("%s queue %d buffer %p count %d", hdev->name, in bpa10x_recv()
77 hdev->stat.byte_rx += count; in bpa10x_recv()
128 BT_ERR("%s no memory for packet", hdev->name); in bpa10x_recv()
156 hci_recv_frame(hdev, skb); in bpa10x_recv()
168 struct hci_dev *hdev = (struct hci_dev *) skb->dev; in bpa10x_tx_complete() local
170 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_tx_complete()
173 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_tx_complete()
177 hdev->stat.byte_tx += urb->transfer_buffer_length; in bpa10x_tx_complete()
179 hdev->stat.err_tx++; in bpa10x_tx_complete()
189 struct hci_dev *hdev = urb->context; in bpa10x_rx_complete() local
190 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_rx_complete()
193 BT_DBG("%s urb %p status %d count %d", hdev->name, in bpa10x_rx_complete()
196 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_rx_complete()
200 if (bpa10x_recv(hdev, usb_pipebulk(urb->pipe), in bpa10x_rx_complete()
203 BT_ERR("%s corrupted event packet", hdev->name); in bpa10x_rx_complete()
204 hdev->stat.err_rx++; in bpa10x_rx_complete()
213 hdev->name, urb, -err); in bpa10x_rx_complete()
218 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) in bpa10x_submit_intr_urb() argument
220 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_intr_urb()
226 BT_DBG("%s", hdev->name); in bpa10x_submit_intr_urb()
241 bpa10x_rx_complete, hdev, 1); in bpa10x_submit_intr_urb()
250 hdev->name, urb, -err); in bpa10x_submit_intr_urb()
259 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) in bpa10x_submit_bulk_urb() argument
261 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_submit_bulk_urb()
267 BT_DBG("%s", hdev->name); in bpa10x_submit_bulk_urb()
282 buf, size, bpa10x_rx_complete, hdev); in bpa10x_submit_bulk_urb()
291 hdev->name, urb, -err); in bpa10x_submit_bulk_urb()
300 static int bpa10x_open(struct hci_dev *hdev) in bpa10x_open() argument
302 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_open()
305 BT_DBG("%s", hdev->name); in bpa10x_open()
307 if (test_and_set_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_open()
310 err = bpa10x_submit_intr_urb(hdev); in bpa10x_open()
314 err = bpa10x_submit_bulk_urb(hdev); in bpa10x_open()
323 clear_bit(HCI_RUNNING, &hdev->flags); in bpa10x_open()
328 static int bpa10x_close(struct hci_dev *hdev) in bpa10x_close() argument
330 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_close()
332 BT_DBG("%s", hdev->name); in bpa10x_close()
334 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_close()
342 static int bpa10x_flush(struct hci_dev *hdev) in bpa10x_flush() argument
344 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_flush()
346 BT_DBG("%s", hdev->name); in bpa10x_flush()
353 static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb) in bpa10x_send_frame() argument
355 struct bpa10x_data *data = hci_get_drvdata(hdev); in bpa10x_send_frame()
361 BT_DBG("%s", hdev->name); in bpa10x_send_frame()
363 if (!test_bit(HCI_RUNNING, &hdev->flags)) in bpa10x_send_frame()
366 skb->dev = (void *) hdev; in bpa10x_send_frame()
394 hdev->stat.cmd_tx++; in bpa10x_send_frame()
403 hdev->stat.acl_tx++; in bpa10x_send_frame()
412 hdev->stat.sco_tx++; in bpa10x_send_frame()
424 BT_ERR("%s urb %p submission failed", hdev->name, urb); in bpa10x_send_frame()
437 struct hci_dev *hdev; in bpa10x_probe() local
454 hdev = hci_alloc_dev(); in bpa10x_probe()
455 if (!hdev) in bpa10x_probe()
458 hdev->bus = HCI_USB; in bpa10x_probe()
459 hci_set_drvdata(hdev, data); in bpa10x_probe()
461 data->hdev = hdev; in bpa10x_probe()
463 SET_HCIDEV_DEV(hdev, &intf->dev); in bpa10x_probe()
465 hdev->open = bpa10x_open; in bpa10x_probe()
466 hdev->close = bpa10x_close; in bpa10x_probe()
467 hdev->flush = bpa10x_flush; in bpa10x_probe()
468 hdev->send = bpa10x_send_frame; in bpa10x_probe()
470 set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks); in bpa10x_probe()
472 err = hci_register_dev(hdev); in bpa10x_probe()
474 hci_free_dev(hdev); in bpa10x_probe()
494 hci_unregister_dev(data->hdev); in bpa10x_disconnect()
496 hci_free_dev(data->hdev); in bpa10x_disconnect()