Lines Matching refs:hu

76 	struct hci_uart *hu;  member
131 static void serial_clock_vote(unsigned long vote, struct hci_uart *hu) in serial_clock_vote() argument
133 struct qca_data *qca = hu->priv; in serial_clock_vote()
180 __serial_clock_on(hu->tty); in serial_clock_vote()
182 __serial_clock_off(hu->tty); in serial_clock_vote()
203 static int send_hci_ibs_cmd(u8 cmd, struct hci_uart *hu) in send_hci_ibs_cmd() argument
207 struct qca_data *qca = hu->priv; in send_hci_ibs_cmd()
209 BT_DBG("hu %p send hci ibs cmd 0x%x", hu, cmd); in send_hci_ibs_cmd()
229 struct hci_uart *hu = qca->hu; in qca_wq_awake_device() local
232 BT_DBG("hu %p wq awake device", hu); in qca_wq_awake_device()
235 serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_ON, hu); in qca_wq_awake_device()
240 if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) in qca_wq_awake_device()
252 hci_uart_tx_wakeup(hu); in qca_wq_awake_device()
259 struct hci_uart *hu = qca->hu; in qca_wq_awake_rx() local
261 BT_DBG("hu %p wq awake rx", hu); in qca_wq_awake_rx()
263 serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_ON, hu); in qca_wq_awake_rx()
271 if (send_hci_ibs_cmd(HCI_IBS_WAKE_ACK, hu) < 0) in qca_wq_awake_rx()
279 hci_uart_tx_wakeup(hu); in qca_wq_awake_rx()
286 struct hci_uart *hu = qca->hu; in qca_wq_serial_rx_clock_vote_off() local
288 BT_DBG("hu %p rx clock vote off", hu); in qca_wq_serial_rx_clock_vote_off()
290 serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_OFF, hu); in qca_wq_serial_rx_clock_vote_off()
297 struct hci_uart *hu = qca->hu; in qca_wq_serial_tx_clock_vote_off() local
299 BT_DBG("hu %p tx clock vote off", hu); in qca_wq_serial_tx_clock_vote_off()
302 hci_uart_tx_wakeup(hu); in qca_wq_serial_tx_clock_vote_off()
307 serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_OFF, hu); in qca_wq_serial_tx_clock_vote_off()
312 struct hci_uart *hu = (struct hci_uart *)arg; in hci_ibs_tx_idle_timeout() local
313 struct qca_data *qca = hu->priv; in hci_ibs_tx_idle_timeout()
316 BT_DBG("hu %p idle timeout in %d state", hu, qca->tx_ibs_state); in hci_ibs_tx_idle_timeout()
324 if (send_hci_ibs_cmd(HCI_IBS_SLEEP_IND, hu) < 0) { in hci_ibs_tx_idle_timeout()
347 struct hci_uart *hu = (struct hci_uart *)arg; in hci_ibs_wake_retrans_timeout() local
348 struct qca_data *qca = hu->priv; in hci_ibs_wake_retrans_timeout()
353 hu, qca->tx_ibs_state); in hci_ibs_wake_retrans_timeout()
362 if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) { in hci_ibs_wake_retrans_timeout()
383 hci_uart_tx_wakeup(hu); in hci_ibs_wake_retrans_timeout()
387 static int qca_open(struct hci_uart *hu) in qca_open() argument
391 BT_DBG("hu %p qca_open", hu); in qca_open()
412 qca->hu = hu; in qca_open()
439 hu->priv = qca; in qca_open()
443 qca->wake_retrans_timer.data = (u_long)hu; in qca_open()
448 qca->tx_idle_timer.data = (u_long)hu; in qca_open()
459 struct hci_uart *hu = hci_get_drvdata(hdev); in qca_debugfs_init() local
460 struct qca_data *qca = hu->priv; in qca_debugfs_init()
504 static int qca_flush(struct hci_uart *hu) in qca_flush() argument
506 struct qca_data *qca = hu->priv; in qca_flush()
508 BT_DBG("hu %p qca flush", hu); in qca_flush()
517 static int qca_close(struct hci_uart *hu) in qca_close() argument
519 struct qca_data *qca = hu->priv; in qca_close()
521 BT_DBG("hu %p qca close", hu); in qca_close()
523 serial_clock_vote(HCI_IBS_VOTE_STATS_UPDATE, hu); in qca_close()
530 qca->hu = NULL; in qca_close()
534 hu->priv = NULL; in qca_close()
543 static void device_want_to_wakeup(struct hci_uart *hu) in device_want_to_wakeup() argument
546 struct qca_data *qca = hu->priv; in device_want_to_wakeup()
548 BT_DBG("hu %p want to wake up", hu); in device_want_to_wakeup()
567 if (send_hci_ibs_cmd(HCI_IBS_WAKE_ACK, hu) < 0) { in device_want_to_wakeup()
584 hci_uart_tx_wakeup(hu); in device_want_to_wakeup()
589 static void device_want_to_sleep(struct hci_uart *hu) in device_want_to_sleep() argument
592 struct qca_data *qca = hu->priv; in device_want_to_sleep()
594 BT_DBG("hu %p want to sleep", hu); in device_want_to_sleep()
623 static void device_woke_up(struct hci_uart *hu) in device_woke_up() argument
626 struct qca_data *qca = hu->priv; in device_woke_up()
629 BT_DBG("hu %p woke up", hu); in device_woke_up()
666 hci_uart_tx_wakeup(hu); in device_woke_up()
672 static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) in qca_enqueue() argument
675 struct qca_data *qca = hu->priv; in qca_enqueue()
677 BT_DBG("hu %p qca enq skb %p tx_ibs_state %d", hu, skb, in qca_enqueue()
732 struct hci_uart *hu = hci_get_drvdata(hdev); in qca_ibs_sleep_ind() local
734 BT_DBG("hu %p recv hci ibs cmd 0x%x", hu, HCI_IBS_SLEEP_IND); in qca_ibs_sleep_ind()
736 device_want_to_sleep(hu); in qca_ibs_sleep_ind()
744 struct hci_uart *hu = hci_get_drvdata(hdev); in qca_ibs_wake_ind() local
746 BT_DBG("hu %p recv hci ibs cmd 0x%x", hu, HCI_IBS_WAKE_IND); in qca_ibs_wake_ind()
748 device_want_to_wakeup(hu); in qca_ibs_wake_ind()
756 struct hci_uart *hu = hci_get_drvdata(hdev); in qca_ibs_wake_ack() local
758 BT_DBG("hu %p recv hci ibs cmd 0x%x", hu, HCI_IBS_WAKE_ACK); in qca_ibs_wake_ack()
760 device_woke_up(hu); in qca_ibs_wake_ack()
796 static int qca_recv(struct hci_uart *hu, const void *data, int count) in qca_recv() argument
798 struct qca_data *qca = hu->priv; in qca_recv()
800 if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) in qca_recv()
803 qca->rx_skb = h4_recv_buf(hu->hdev, qca->rx_skb, data, count, in qca_recv()
807 BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err); in qca_recv()
815 static struct sk_buff *qca_dequeue(struct hci_uart *hu) in qca_dequeue() argument
817 struct qca_data *qca = hu->priv; in qca_dequeue()
858 struct hci_uart *hu = hci_get_drvdata(hdev); in qca_set_baudrate() local
859 struct qca_data *qca = hu->priv; in qca_set_baudrate()
879 hci_uart_tx_wakeup(hu); in qca_set_baudrate()
892 static int qca_setup(struct hci_uart *hu) in qca_setup() argument
894 struct hci_dev *hdev = hu->hdev; in qca_setup()
895 struct qca_data *qca = hu->priv; in qca_setup()
906 if (hu->init_speed) in qca_setup()
907 speed = hu->init_speed; in qca_setup()
908 else if (hu->proto->init_speed) in qca_setup()
909 speed = hu->proto->init_speed; in qca_setup()
912 hci_uart_set_baudrate(hu, speed); in qca_setup()
916 if (hu->oper_speed) in qca_setup()
917 speed = hu->oper_speed; in qca_setup()
918 else if (hu->proto->oper_speed) in qca_setup()
919 speed = hu->proto->oper_speed; in qca_setup()
931 hci_uart_set_baudrate(hu, speed); in qca_setup()
942 hu->hdev->set_bdaddr = qca_set_bdaddr_rome; in qca_setup()