Lines Matching refs:hu

59 	struct hci_uart *hu;
71 struct hci_uart *hu;
107 static int intel_wait_booting(struct hci_uart *hu)
109 struct intel_data *intel = hu->priv;
117 bt_dev_err(hu->hdev, "Device boot interrupted");
122 bt_dev_err(hu->hdev, "Device boot timeout");
130 static int intel_wait_lpm_transaction(struct hci_uart *hu)
132 struct intel_data *intel = hu->priv;
140 bt_dev_err(hu->hdev, "LPM transaction interrupted");
145 bt_dev_err(hu->hdev, "LPM transaction timeout");
152 static int intel_lpm_suspend(struct hci_uart *hu)
155 struct intel_data *intel = hu->priv;
165 bt_dev_dbg(hu->hdev, "Suspending");
169 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet");
180 hci_uart_tx_wakeup(hu);
182 intel_wait_lpm_transaction(hu);
188 bt_dev_err(hu->hdev, "Device suspend error");
192 bt_dev_dbg(hu->hdev, "Suspended");
194 hci_uart_set_flow_control(hu, true);
199 static int intel_lpm_resume(struct hci_uart *hu)
201 struct intel_data *intel = hu->priv;
208 bt_dev_dbg(hu->hdev, "Resuming");
210 hci_uart_set_flow_control(hu, false);
214 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet");
224 hci_uart_tx_wakeup(hu);
226 intel_wait_lpm_transaction(hu);
232 bt_dev_err(hu->hdev, "Device resume error");
236 bt_dev_dbg(hu->hdev, "Resumed");
242 static int intel_lpm_host_wake(struct hci_uart *hu)
245 struct intel_data *intel = hu->priv;
248 hci_uart_set_flow_control(hu, false);
254 bt_dev_err(hu->hdev, "Failed to alloc memory for LPM packet");
263 hci_uart_tx_wakeup(hu);
265 bt_dev_dbg(hu->hdev, "Resumed by controller");
277 if (idev->hu)
278 intel_lpm_host_wake(idev->hu);
289 static int intel_set_power(struct hci_uart *hu, bool powered)
294 if (!hu->tty->dev)
303 if (hu->tty->dev->parent != idev->pdev->dev.parent)
311 BT_INFO("hu %p, Switching compatible pm device (%s) to %u",
312 hu, dev_name(&idev->pdev->dev), powered);
316 /* Provide to idev a hu reference which is used to run LPM
318 * hu needs to be protected against concurrent removing during
322 idev->hu = powered ? hu : NULL;
335 BT_ERR("hu %p, unable to allocate irq-%d",
336 hu, idev->irq);
366 if (!intel->hu->tty->dev)
372 if (intel->hu->tty->dev->parent == idev->pdev->dev.parent) {
382 static int intel_open(struct hci_uart *hu)
386 BT_DBG("hu %p", hu);
388 if (!hci_uart_has_flow_control(hu))
398 intel->hu = hu;
400 hu->priv = intel;
402 if (!intel_set_power(hu, true))
408 static int intel_close(struct hci_uart *hu)
410 struct intel_data *intel = hu->priv;
412 BT_DBG("hu %p", hu);
416 intel_set_power(hu, false);
422 hu->priv = NULL;
426 static int intel_flush(struct hci_uart *hu)
428 struct intel_data *intel = hu->priv;
430 BT_DBG("hu %p", hu);
462 static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed)
464 struct intel_data *intel = hu->priv;
465 struct hci_dev *hdev = hu->hdev;
473 err = intel_wait_booting(hu);
509 hci_uart_set_flow_control(hu, true);
512 hci_uart_tx_wakeup(hu);
517 hci_uart_set_baudrate(hu, speed);
518 hci_uart_set_flow_control(hu, false);
523 static int intel_setup(struct hci_uart *hu)
525 struct intel_data *intel = hu->priv;
526 struct hci_dev *hdev = hu->hdev;
542 hu->hdev->set_diag = btintel_set_diag;
543 hu->hdev->set_bdaddr = btintel_set_bdaddr;
553 if (hu->init_speed)
554 init_speed = hu->init_speed;
556 init_speed = hu->proto->init_speed;
558 if (hu->oper_speed)
559 oper_speed = hu->oper_speed;
561 oper_speed = hu->proto->oper_speed;
567 err = intel_wait_booting(hu);
795 err = intel_set_baudrate(hu, init_speed);
817 err = intel_wait_booting(hu);
834 if (!hu->tty->dev)
836 if (hu->tty->dev->parent == idev->pdev->dev.parent) {
855 err = intel_set_baudrate(hu, oper_speed);
869 struct hci_uart *hu = hci_get_drvdata(hdev);
870 struct intel_data *intel = hu->priv;
907 struct hci_uart *hu = hci_get_drvdata(hdev);
908 struct intel_data *intel = hu->priv;
923 struct hci_uart *hu = hci_get_drvdata(hdev);
924 struct intel_data *intel = hu->priv;
929 bt_dev_err(hu->hdev, "Invalid LPM notification packet");
968 static int intel_recv(struct hci_uart *hu, const void *data, int count)
970 struct intel_data *intel = hu->priv;
972 if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
975 intel->rx_skb = h4_recv_buf(hu->hdev, intel->rx_skb, data, count,
980 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err);
988 static int intel_enqueue(struct hci_uart *hu, struct sk_buff *skb)
990 struct intel_data *intel = hu->priv;
993 BT_DBG("hu %p skb %p", hu, skb);
995 if (!hu->tty->dev)
1003 if (hu->tty->dev->parent == idev->pdev->dev.parent) {
1017 static struct sk_buff *intel_dequeue(struct hci_uart *hu)
1019 struct intel_data *intel = hu->priv;
1037 inject_cmd_complete(hu->hdev, opcode);
1077 if (idev->hu)
1078 intel_lpm_suspend(idev->hu);
1089 if (idev->hu)
1090 intel_lpm_resume(idev->hu);