Lines Matching refs:hu
124 struct hci_uart *hu; member
148 static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) in host_set_baudrate() argument
150 if (hu->serdev) in host_set_baudrate()
151 serdev_device_set_baudrate(hu->serdev, speed); in host_set_baudrate()
153 hci_uart_set_baudrate(hu, speed); in host_set_baudrate()
156 static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed) in bcm_set_baudrate() argument
158 struct hci_dev *hdev = hu->hdev; in bcm_set_baudrate()
212 if (device && device->hu && device->hu->serdev) in bcm_device_exists()
369 static int bcm_setup_sleep(struct hci_uart *hu) in bcm_setup_sleep() argument
371 struct bcm_data *bcm = hu->priv; in bcm_setup_sleep()
377 skb = __hci_cmd_sync(hu->hdev, 0xfc27, sizeof(sleep_params), in bcm_setup_sleep()
381 bt_dev_err(hu->hdev, "Sleep VSC failed (%d)", err); in bcm_setup_sleep()
386 bt_dev_dbg(hu->hdev, "Set Sleep Parameters VSC succeeded"); in bcm_setup_sleep()
392 static inline int bcm_setup_sleep(struct hci_uart *hu) { return 0; } in bcm_setup_sleep() argument
397 struct hci_uart *hu = hci_get_drvdata(hdev); in bcm_set_diag() local
398 struct bcm_data *bcm = hu->priv; in bcm_set_diag()
413 hci_uart_tx_wakeup(hu); in bcm_set_diag()
418 static int bcm_open(struct hci_uart *hu) in bcm_open() argument
424 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_open()
426 if (!hci_uart_has_flow_control(hu)) in bcm_open()
435 hu->priv = bcm; in bcm_open()
439 if (hu->serdev) { in bcm_open()
440 bcm->dev = serdev_device_get_drvdata(hu->serdev); in bcm_open()
444 if (!hu->tty->dev) in bcm_open()
454 if (hu->tty->dev->parent == dev->dev->parent) { in bcm_open()
457 dev->hu = hu; in bcm_open()
466 hci_uart_set_flow_control(hu, true); in bcm_open()
468 hu->init_speed = bcm->dev->init_speed; in bcm_open()
474 hu->oper_speed = bcm->dev->oper_speed; in bcm_open()
479 hci_uart_set_flow_control(hu, false); in bcm_open()
490 if (!hu->serdev) in bcm_open()
491 bcm->dev->hu = NULL; in bcm_open()
494 hu->priv = NULL; in bcm_open()
499 static int bcm_close(struct hci_uart *hu) in bcm_close() argument
501 struct bcm_data *bcm = hu->priv; in bcm_close()
505 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_close()
510 if (hu->serdev) { in bcm_close()
511 bdev = serdev_device_get_drvdata(hu->serdev); in bcm_close()
515 bdev->hu = NULL; in bcm_close()
528 bt_dev_err(hu->hdev, "Failed to power down"); in bcm_close()
538 hu->priv = NULL; in bcm_close()
542 static int bcm_flush(struct hci_uart *hu) in bcm_flush() argument
544 struct bcm_data *bcm = hu->priv; in bcm_flush()
546 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_flush()
553 static int bcm_setup(struct hci_uart *hu) in bcm_setup() argument
555 struct bcm_data *bcm = hu->priv; in bcm_setup()
560 bt_dev_dbg(hu->hdev, "hu %p", hu); in bcm_setup()
562 hu->hdev->set_diag = bcm_set_diag; in bcm_setup()
563 hu->hdev->set_bdaddr = btbcm_set_bdaddr; in bcm_setup()
565 err = btbcm_initialize(hu->hdev, &fw_load_done); in bcm_setup()
573 if (hu->init_speed) in bcm_setup()
574 speed = hu->init_speed; in bcm_setup()
575 else if (hu->proto->init_speed) in bcm_setup()
576 speed = hu->proto->init_speed; in bcm_setup()
581 host_set_baudrate(hu, speed); in bcm_setup()
584 if (hu->oper_speed) in bcm_setup()
585 speed = hu->oper_speed; in bcm_setup()
588 else if (hu->proto->oper_speed) in bcm_setup()
589 speed = hu->proto->oper_speed; in bcm_setup()
594 err = bcm_set_baudrate(hu, speed); in bcm_setup()
596 host_set_baudrate(hu, speed); in bcm_setup()
603 btbcm_read_pcm_int_params(hu->hdev, ¶ms); in bcm_setup()
606 btbcm_write_pcm_int_params(hu->hdev, ¶ms); in bcm_setup()
609 err = btbcm_finalize(hu->hdev, &fw_load_done); in bcm_setup()
617 set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks); in bcm_setup()
620 err = bcm_setup_sleep(hu); in bcm_setup()
663 static int bcm_recv(struct hci_uart *hu, const void *data, int count) in bcm_recv() argument
665 struct bcm_data *bcm = hu->priv; in bcm_recv()
667 if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) in bcm_recv()
670 bcm->rx_skb = h4_recv_buf(hu->hdev, bcm->rx_skb, data, count, in bcm_recv()
674 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err); in bcm_recv()
691 static int bcm_enqueue(struct hci_uart *hu, struct sk_buff *skb) in bcm_enqueue() argument
693 struct bcm_data *bcm = hu->priv; in bcm_enqueue()
695 bt_dev_dbg(hu->hdev, "hu %p skb %p", hu, skb); in bcm_enqueue()
704 static struct sk_buff *bcm_dequeue(struct hci_uart *hu) in bcm_dequeue() argument
706 struct bcm_data *bcm = hu->priv; in bcm_dequeue()
738 if (!bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
739 hci_uart_set_flow_control(bdev->hu, true); in bcm_suspend_device()
748 if (bdev->is_suspended && bdev->hu) { in bcm_suspend_device()
750 hci_uart_set_flow_control(bdev->hu, false); in bcm_suspend_device()
778 if (bdev->is_suspended && bdev->hu) { in bcm_resume_device()
781 hci_uart_set_flow_control(bdev->hu, false); in bcm_resume_device()
805 if (!bdev->hu) in bcm_suspend()
839 if (!bdev->hu) in bcm_resume()
1427 bcmdev->hu = &bcmdev->serdev_hu; in bcm_serdev_probe()