/* When Quirk HCI_QUIRK_NON_PERSISTENT_SETUP is set by *driver,BTSoCiscompletelyturnedOFFduring *BTOFF.UponnextBTONUARTportshouldbeopened.
*/ if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) {
err = serdev_device_open(hu->serdev); if (err) return err;
set_bit(HCI_UART_PROTO_READY, &hu->flags);
}
/* Undo clearing this from hci_uart_close() */
hdev->flush = hci_uart_flush;
if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) return0;
hci_uart_flush(hdev);
hdev->flush = NULL;
/* When QUIRK HCI_QUIRK_NON_PERSISTENT_SETUP is set by driver, *BTSOCiscompletelypoweredOFFduringBTOFF,holdingport *openmaydrainthebattery.
*/ if (hci_test_quirk(hdev, HCI_QUIRK_NON_PERSISTENT_SETUP)) {
clear_bit(HCI_UART_PROTO_READY, &hu->flags);
serdev_device_close(hu->serdev);
}
/* Init speed if any */ if (hu->init_speed)
speed = hu->init_speed; elseif (hu->proto->init_speed)
speed = hu->proto->init_speed; else
speed = 0;
if (speed)
serdev_device_set_baudrate(hu->serdev, speed);
/* Operational speed if any */ if (hu->oper_speed)
speed = hu->oper_speed; elseif (hu->proto->oper_speed)
speed = hu->proto->oper_speed; else
speed = 0;
if (hu->proto->set_baudrate && speed) {
err = hu->proto->set_baudrate(hu, speed); if (err)
bt_dev_err(hdev, "Failed to set baudrate"); else
serdev_device_set_baudrate(hu->serdev, speed);
}
if (hu->proto->setup) return hu->proto->setup(hu);
if (!test_bit(HCI_UART_VND_DETECT, &hu->hdev_flags)) return0;
skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
HCI_INIT_TIMEOUT); if (IS_ERR(skb)) {
bt_dev_err(hdev, "Reading local version info failed (%ld)",
PTR_ERR(skb)); return0;
}
if (skb->len != sizeof(*ver))
bt_dev_err(hdev, "Event length mismatch for version info");
kfree_skb(skb); return0;
}
/* Check if the device is wakeable */ staticbool hci_uart_wakeup(struct hci_dev *hdev)
{ /* HCI UART devices are assumed to be wakeable by default. *Implementwakeupcallbacktooverridethisbehavior.
*/ returntrue;
}
/* Only when vendor specific setup callback is provided, consider *themanufacturerinformationvalid.Thisavoidsfillinginthe *valueforEricssonwhennothingisspecified.
*/ if (hu->proto->setup)
hdev->manufacturer = hu->proto->manufacturer;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.