Lines Matching defs:hdev
80 struct hci_dev *hdev = hu->hdev;
85 hdev->stat.cmd_tx++;
89 hdev->stat.acl_tx++;
93 hdev->stat.sco_tx++;
149 struct hci_dev *hdev = hu->hdev;
164 hdev->stat.byte_tx += len;
187 struct hci_dev *hdev;
192 err = hci_register_dev(hu->hdev);
197 hdev = hu->hdev;
198 hu->hdev = NULL;
199 hci_free_dev(hdev);
225 static int hci_uart_flush(struct hci_dev *hdev)
227 struct hci_uart *hu = hci_get_drvdata(hdev);
230 BT_DBG("hdev %p tty %p", hdev, tty);
251 static int hci_uart_open(struct hci_dev *hdev)
253 BT_DBG("%s %p", hdev->name, hdev);
256 hdev->flush = hci_uart_flush;
262 static int hci_uart_close(struct hci_dev *hdev)
264 BT_DBG("hdev %p", hdev);
266 hci_uart_flush(hdev);
267 hdev->flush = NULL;
272 static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
274 struct hci_uart *hu = hci_get_drvdata(hdev);
276 BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb),
385 BT_DBG("%s: New tty speeds: %d/%d", hu->hdev->name,
389 static int hci_uart_setup(struct hci_dev *hdev)
391 struct hci_uart *hu = hci_get_drvdata(hdev);
428 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
432 hdev->name, PTR_ERR(skb));
438 hdev->name);
447 hdev->set_bdaddr = btintel_set_bdaddr;
448 btintel_check_bdaddr(hdev);
453 hdev->set_bdaddr = btbcm_set_bdaddr;
454 btbcm_check_bdaddr(hdev);
527 struct hci_dev *hdev;
537 hdev = hu->hdev;
538 if (hdev)
539 hci_uart_close(hdev);
549 if (hdev) {
551 hci_unregister_dev(hdev);
552 hci_free_dev(hdev);
622 if (hu->hdev)
623 hu->hdev->stat.byte_rx += count;
630 struct hci_dev *hdev;
636 hdev = hci_alloc_dev();
637 if (!hdev) {
642 hu->hdev = hdev;
644 hdev->bus = HCI_UART;
645 hci_set_drvdata(hdev, hu);
652 hdev->manufacturer = hu->proto->manufacturer;
654 hdev->open = hci_uart_open;
655 hdev->close = hci_uart_close;
656 hdev->flush = hci_uart_flush;
657 hdev->send = hci_uart_send_frame;
658 hdev->setup = hci_uart_setup;
659 SET_HCIDEV_DEV(hdev, hu->tty->dev);
662 set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
665 set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
668 set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
671 hdev->dev_type = HCI_AMP;
673 hdev->dev_type = HCI_PRIMARY;
675 /* Only call open() for the protocol after hdev is fully initialized as
680 hu->hdev = NULL;
681 hci_free_dev(hdev);
688 if (hci_register_dev(hdev) < 0) {
691 hu->hdev = NULL;
692 hci_free_dev(hdev);
782 err = hu->hdev->id;