Lines Matching defs:hdev

235 static int qca_power_off(struct hci_dev *hdev);
237 static void qca_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb);
553 hci_reset_dev(hu->hdev);
640 static void qca_debugfs_init(struct hci_dev *hdev)
642 struct hci_uart *hu = hci_get_drvdata(hdev);
647 if (!hdev->debugfs)
653 ibs_dir = debugfs_create_dir("ibs", hdev->debugfs);
887 bt_dev_dbg(hu->hdev, "SSR is in progress");
945 static int qca_ibs_sleep_ind(struct hci_dev *hdev, struct sk_buff *skb)
947 struct hci_uart *hu = hci_get_drvdata(hdev);
957 static int qca_ibs_wake_ind(struct hci_dev *hdev, struct sk_buff *skb)
959 struct hci_uart *hu = hci_get_drvdata(hdev);
969 static int qca_ibs_wake_ack(struct hci_dev *hdev, struct sk_buff *skb)
971 struct hci_uart *hu = hci_get_drvdata(hdev);
981 static int qca_recv_acl_data(struct hci_dev *hdev, struct sk_buff *skb)
989 return hci_recv_diag(hdev, skb);
991 return hci_recv_frame(hdev, skb);
994 static void qca_dmp_hdr(struct hci_dev *hdev, struct sk_buff *skb)
996 struct hci_uart *hu = hci_get_drvdata(hdev);
1071 bt_dev_err(hu->hdev, "Rx invalid memdump size");
1084 ret = hci_devcd_init(hu->hdev, qca_memdump->ram_dump_size);
1085 bt_dev_info(hu->hdev, "hci_devcd_init Return:%d",
1097 bt_dev_info(hu->hdev, "QCA collecting dump of size:%u",
1106 bt_dev_err(hu->hdev, "QCA: Discarding other packets");
1123 bt_dev_err(hu->hdev, "QCA controller missed packet:%d",
1128 bt_dev_err(hu->hdev,
1133 hci_devcd_append_pattern(hu->hdev, 0x00,
1143 bt_dev_err(hu->hdev,
1147 bt_dev_dbg(hu->hdev,
1150 hci_devcd_append(hu->hdev, skb);
1154 bt_dev_err(hu->hdev,
1160 bt_dev_info(hu->hdev,
1164 hci_devcd_complete(hu->hdev);
1177 static int qca_controller_memdump_event(struct hci_dev *hdev,
1180 struct hci_uart *hu = hci_get_drvdata(hdev);
1190 static int qca_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
1192 struct hci_uart *hu = hci_get_drvdata(hdev);
1222 return qca_controller_memdump_event(hdev, skb);
1224 return hci_recv_frame(hdev, skb);
1264 qca->rx_skb = h4_recv_buf(hu->hdev, qca->rx_skb, data, count,
1268 bt_dev_err(hu->hdev, "Frame reassembly failed (%d)", err);
1319 static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
1321 struct hci_uart *hu = hci_get_drvdata(hdev);
1333 bt_dev_err(hdev, "Failed to allocate baudrate packet");
1396 bt_dev_dbg(hu->hdev, "sending power pulse %02x to controller", cmd);
1402 bt_dev_err(hu->hdev, "failed to send power pulse %02x", cmd);
1508 bt_dev_dbg(hu->hdev, "Set UART speed to %d", speed);
1509 ret = qca_set_baudrate(hu->hdev, qca_baudrate);
1538 bt_dev_err(hu->hdev,
1561 bt_dev_err(hu->hdev, "Failed to allocate memory for skb packet");
1572 bt_dev_info(hu->hdev, "crash the soc to collect controller dump");
1579 static void qca_wait_for_dump_collection(struct hci_dev *hdev)
1581 struct hci_uart *hu = hci_get_drvdata(hdev);
1590 static void qca_hw_error(struct hci_dev *hdev, u8 code)
1592 struct hci_uart *hu = hci_get_drvdata(hdev);
1597 bt_dev_info(hdev, "mem_dump_status: %d", qca->memdump_state);
1608 qca_wait_for_dump_collection(hdev);
1613 bt_dev_info(hdev, "waiting for dump to complete");
1614 qca_wait_for_dump_collection(hdev);
1619 bt_dev_err(hu->hdev, "clearing allocated memory due to memdump timeout");
1620 hci_devcd_abort(hu->hdev);
1639 static void qca_cmd_timeout(struct hci_dev *hdev)
1641 struct hci_uart *hu = hci_get_drvdata(hdev);
1648 qca_wait_for_dump_collection(hdev);
1653 bt_dev_info(hdev, "waiting for dump to complete");
1654 qca_wait_for_dump_collection(hdev);
1664 hci_reset_dev(hu->hdev);
1670 static bool qca_wakeup(struct hci_dev *hdev)
1672 struct hci_uart *hu = hci_get_drvdata(hdev);
1680 bt_dev_dbg(hu->hdev, "wakeup status : %d", wakeup);
1704 bt_dev_err(hu->hdev, "failed to open port");
1733 bt_dev_dbg(hu->hdev, "SW_CTRL is %d", sw_ctrl_state);
1761 bt_dev_err(hu->hdev, "failed to open port");
1770 static int qca_power_on(struct hci_dev *hdev)
1772 struct hci_uart *hu = hci_get_drvdata(hdev);
1808 static void hci_coredump_qca(struct hci_dev *hdev)
1813 err = __hci_cmd_send(hdev, 0xfc0c, 1, param);
1815 bt_dev_err(hdev, "%s: trigger crash failed (%d)", __func__, err);
1820 struct hci_dev *hdev = hu->hdev;
1841 set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
1866 bt_dev_info(hdev, "setting up %s", soc_name);
1871 ret = qca_power_on(hdev);
1889 if (fwnode_property_present(dev_fwnode(hdev->dev.parent), "local-bd-address")) {
1890 set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
1891 bt_dev_info(hdev, "setting quirk bit to read BDA from fwnode later");
1893 bt_dev_dbg(hdev, "local-bd-address` is not present in the devicetree so not setting quirk bit for BDA");
1896 hci_set_aosp_capable(hdev);
1898 ret = qca_read_soc_version(hdev, &ver, soc_type);
1929 ret = qca_read_soc_version(hdev, &ver, soc_type);
1935 ret = qca_uart_setup(hdev, qca_baudrate, soc_type, ver,
1939 qca_debugfs_init(hdev);
1940 hu->hdev->hw_error = qca_hw_error;
1941 hu->hdev->cmd_timeout = qca_cmd_timeout;
1943 hu->hdev->wakeup = qca_wakeup;
1959 bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
1965 bt_dev_err(hdev, "failed to open port");
1975 hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
1977 hu->hdev->set_bdaddr = qca_set_bdaddr;
1980 hci_devcd_register(hdev, hci_coredump_qca, qca_dmp_hdr, NULL);
2138 bt_dev_dbg(hu->hdev, "SW_CTRL is %d", sw_ctrl_state);
2149 static int qca_power_off(struct hci_dev *hdev)
2151 struct hci_uart *hu = hci_get_drvdata(hdev);
2155 hu->hdev->hw_error = NULL;
2156 hu->hdev->cmd_timeout = NULL;
2164 qca_send_pre_shutdown_cmd(hdev);
2248 struct hci_dev *hdev;
2355 hdev = qcadev->serdev_hu.hdev;
2358 set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks);
2359 hdev->shutdown = qca_power_off;
2368 &hdev->quirks);
2371 set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
2411 struct hci_dev *hdev = hu->hdev;
2418 !test_bit(HCI_RUNNING, &hdev->flags))
2485 bt_dev_err(hu->hdev, "SSR or FW download time out");
2605 struct hci_dev *hdev = hu->hdev;
2607 if (hdev->dump.coredump)
2608 hdev->dump.coredump(hdev);