Lines Matching refs:hu
74 struct hci_uart *hu; member
86 struct hci_uart *hu; member
122 static int intel_wait_booting(struct hci_uart *hu) in intel_wait_booting() argument
124 struct intel_data *intel = hu->priv; in intel_wait_booting()
132 bt_dev_err(hu->hdev, "Device boot interrupted"); in intel_wait_booting()
137 bt_dev_err(hu->hdev, "Device boot timeout"); in intel_wait_booting()
145 static int intel_wait_lpm_transaction(struct hci_uart *hu) in intel_wait_lpm_transaction() argument
147 struct intel_data *intel = hu->priv; in intel_wait_lpm_transaction()
155 bt_dev_err(hu->hdev, "LPM transaction interrupted"); in intel_wait_lpm_transaction()
160 bt_dev_err(hu->hdev, "LPM transaction timeout"); in intel_wait_lpm_transaction()
167 static int intel_lpm_suspend(struct hci_uart *hu) in intel_lpm_suspend() argument
170 struct intel_data *intel = hu->priv; in intel_lpm_suspend()
180 bt_dev_dbg(hu->hdev, "Suspending"); in intel_lpm_suspend()
184 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); in intel_lpm_suspend()
195 hci_uart_tx_wakeup(hu); in intel_lpm_suspend()
197 intel_wait_lpm_transaction(hu); in intel_lpm_suspend()
203 bt_dev_err(hu->hdev, "Device suspend error"); in intel_lpm_suspend()
207 bt_dev_dbg(hu->hdev, "Suspended"); in intel_lpm_suspend()
209 hci_uart_set_flow_control(hu, true); in intel_lpm_suspend()
214 static int intel_lpm_resume(struct hci_uart *hu) in intel_lpm_resume() argument
216 struct intel_data *intel = hu->priv; in intel_lpm_resume()
223 bt_dev_dbg(hu->hdev, "Resuming"); in intel_lpm_resume()
225 hci_uart_set_flow_control(hu, false); in intel_lpm_resume()
229 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); in intel_lpm_resume()
239 hci_uart_tx_wakeup(hu); in intel_lpm_resume()
241 intel_wait_lpm_transaction(hu); in intel_lpm_resume()
247 bt_dev_err(hu->hdev, "Device resume error"); in intel_lpm_resume()
251 bt_dev_dbg(hu->hdev, "Resumed"); in intel_lpm_resume()
257 static int intel_lpm_host_wake(struct hci_uart *hu) in intel_lpm_host_wake() argument
260 struct intel_data *intel = hu->priv; in intel_lpm_host_wake()
263 hci_uart_set_flow_control(hu, false); in intel_lpm_host_wake()
269 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet"); in intel_lpm_host_wake()
279 hci_uart_tx_wakeup(hu); in intel_lpm_host_wake()
281 bt_dev_dbg(hu->hdev, "Resumed by controller"); in intel_lpm_host_wake()
293 if (idev->hu) in intel_irq()
294 intel_lpm_host_wake(idev->hu); in intel_irq()
305 static int intel_set_power(struct hci_uart *hu, bool powered) in intel_set_power() argument
319 if (hu->tty->dev->parent != idev->pdev->dev.parent) in intel_set_power()
328 hu, dev_name(&idev->pdev->dev), powered); in intel_set_power()
338 idev->hu = powered ? hu : NULL; in intel_set_power()
352 hu, idev->irq); in intel_set_power()
388 if (intel->hu->tty->dev->parent == idev->pdev->dev.parent) { in intel_busy_work()
398 static int intel_open(struct hci_uart *hu) in intel_open() argument
402 BT_DBG("hu %p", hu); in intel_open()
411 intel->hu = hu; in intel_open()
413 hu->priv = intel; in intel_open()
415 if (!intel_set_power(hu, true)) in intel_open()
421 static int intel_close(struct hci_uart *hu) in intel_close() argument
423 struct intel_data *intel = hu->priv; in intel_close()
425 BT_DBG("hu %p", hu); in intel_close()
429 intel_set_power(hu, false); in intel_close()
435 hu->priv = NULL; in intel_close()
439 static int intel_flush(struct hci_uart *hu) in intel_flush() argument
441 struct intel_data *intel = hu->priv; in intel_flush()
443 BT_DBG("hu %p", hu); in intel_flush()
475 static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed) in intel_set_baudrate() argument
477 struct intel_data *intel = hu->priv; in intel_set_baudrate()
478 struct hci_dev *hdev = hu->hdev; in intel_set_baudrate()
486 err = intel_wait_booting(hu); in intel_set_baudrate()
522 hci_uart_set_flow_control(hu, true); in intel_set_baudrate()
525 hci_uart_tx_wakeup(hu); in intel_set_baudrate()
530 hci_uart_set_baudrate(hu, speed); in intel_set_baudrate()
531 hci_uart_set_flow_control(hu, false); in intel_set_baudrate()
536 static int intel_setup(struct hci_uart *hu) in intel_setup() argument
541 struct intel_data *intel = hu->priv; in intel_setup()
543 struct hci_dev *hdev = hu->hdev; in intel_setup()
560 hu->hdev->set_diag = btintel_set_diag; in intel_setup()
561 hu->hdev->set_bdaddr = btintel_set_bdaddr; in intel_setup()
565 if (hu->init_speed) in intel_setup()
566 init_speed = hu->init_speed; in intel_setup()
568 init_speed = hu->proto->init_speed; in intel_setup()
570 if (hu->oper_speed) in intel_setup()
571 oper_speed = hu->oper_speed; in intel_setup()
573 oper_speed = hu->proto->oper_speed; in intel_setup()
579 err = intel_wait_booting(hu); in intel_setup()
874 err = intel_set_baudrate(hu, init_speed); in intel_setup()
899 err = intel_wait_booting(hu); in intel_setup()
916 if (hu->tty->dev->parent == dev->pdev->dev.parent) { in intel_setup()
949 err = intel_set_baudrate(hu, oper_speed); in intel_setup()
963 struct hci_uart *hu = hci_get_drvdata(hdev); in intel_recv_event() local
964 struct intel_data *intel = hu->priv; in intel_recv_event()
1005 struct hci_uart *hu = hci_get_drvdata(hdev); in intel_recv_lpm_notify() local
1006 struct intel_data *intel = hu->priv; in intel_recv_lpm_notify()
1021 struct hci_uart *hu = hci_get_drvdata(hdev); in intel_recv_lpm() local
1022 struct intel_data *intel = hu->priv; in intel_recv_lpm()
1027 bt_dev_err(hu->hdev, "Invalid LPM notification packet"); in intel_recv_lpm()
1070 static int intel_recv(struct hci_uart *hu, const void *data, int count) in intel_recv() argument
1072 struct intel_data *intel = hu->priv; in intel_recv()
1074 if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) in intel_recv()
1077 intel->rx_skb = h4_recv_buf(hu->hdev, intel->rx_skb, data, count, in intel_recv()
1082 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); in intel_recv()
1090 static int intel_enqueue(struct hci_uart *hu, struct sk_buff *skb) in intel_enqueue() argument
1092 struct intel_data *intel = hu->priv; in intel_enqueue()
1095 BT_DBG("hu %p skb %p", hu, skb); in intel_enqueue()
1105 if (hu->tty->dev->parent == idev->pdev->dev.parent) { in intel_enqueue()
1119 static struct sk_buff *intel_dequeue(struct hci_uart *hu) in intel_dequeue() argument
1121 struct intel_data *intel = hu->priv; in intel_dequeue()
1139 inject_cmd_complete(hu->hdev, opcode); in intel_dequeue()
1178 if (idev->hu) in intel_suspend_device()
1179 intel_lpm_suspend(idev->hu); in intel_suspend_device()
1190 if (idev->hu) in intel_resume_device()
1191 intel_lpm_resume(idev->hu); in intel_resume_device()