Lines Matching defs:hdev

26 	struct hci_dev *hdev = hu->hdev;
31 hdev->stat.cmd_tx++;
35 hdev->stat.acl_tx++;
39 hdev->stat.sco_tx++;
61 struct hci_dev *hdev = hu->hdev;
75 hdev->stat.byte_tx += len;
94 static int hci_uart_flush(struct hci_dev *hdev)
96 struct hci_uart *hu = hci_get_drvdata(hdev);
98 BT_DBG("hdev %p serdev %p", hdev, hu->serdev);
114 static int hci_uart_open(struct hci_dev *hdev)
116 struct hci_uart *hu = hci_get_drvdata(hdev);
119 BT_DBG("%s %p", hdev->name, hdev);
133 hdev->flush = hci_uart_flush;
139 static int hci_uart_close(struct hci_dev *hdev)
141 struct hci_uart *hu = hci_get_drvdata(hdev);
143 BT_DBG("hdev %p", hdev);
148 hci_uart_flush(hdev);
149 hdev->flush = NULL;
155 if (test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
164 static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
166 struct hci_uart *hu = hci_get_drvdata(hdev);
168 BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb),
178 static int hci_uart_setup(struct hci_dev *hdev)
180 struct hci_uart *hu = hci_get_drvdata(hdev);
208 bt_dev_err(hdev, "Failed to set baudrate");
219 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
222 bt_dev_err(hdev, "Reading local version info failed (%ld)",
228 bt_dev_err(hdev, "Event length mismatch for version info");
235 static bool hci_uart_wakeup(struct hci_dev *hdev)
292 if (hu->hdev)
293 hu->hdev->stat.byte_rx += count;
308 struct hci_dev *hdev;
329 hdev = hci_alloc_dev_priv(sizeof_priv);
330 if (!hdev) {
336 hu->hdev = hdev;
338 hdev->bus = HCI_UART;
339 hci_set_drvdata(hdev, hu);
349 hdev->manufacturer = hu->proto->manufacturer;
351 hdev->open = hci_uart_open;
352 hdev->close = hci_uart_close;
353 hdev->flush = hci_uart_flush;
354 hdev->send = hci_uart_send_frame;
355 hdev->setup = hci_uart_setup;
356 if (!hdev->wakeup)
357 hdev->wakeup = hci_uart_wakeup;
358 SET_HCIDEV_DEV(hdev, &hu->serdev->dev);
361 set_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks);
364 set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
367 set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
372 if (hci_register_dev(hdev) < 0) {
383 hci_free_dev(hdev);
397 struct hci_dev *hdev = hu->hdev;
401 hci_unregister_dev(hdev);
402 hci_free_dev(hdev);