Jackson-gjh commented on code in PR #21536:
URL: https://github.com/apache/nuttx/pull/21536#discussion_r4500673022
##########
wireless/bluetooth/bt_netdev.c:
##########
@@ -1288,6 +1288,13 @@ int bt_netdev_register(FAR struct bt_driver_s *btdev)
ret = netdev_register(&priv->bd_dev.r_dev, NET_LL_BLUETOOTH);
if (ret >= 0)
{
+#ifndef CONFIG_WIRELESS_BLUETOOTH_HOST
+ /* A raw HCI interface is ready as soon as it is registered. It has
+ * no network configuration step that would invoke btnet_ifup().
+ */
+
+ netdev_carrier_on(&priv->bd_dev.r_dev);
Review Comment:
Thanks, you are right. Registration only makes the Controller netdev
available; it does not mean that an external raw HCI Host has attached.
The A/B test showed that keeping IFF_RUNNING clear blocks raw HCI RX and TX,
but enabling the carrier in bt_netdev_register() is too early.
For BTPROTO_HCI, would it be appropriate to enable the carrier after a
successful bind() to hci_dev and disable it when the last bound HCI socket
is closed? I can rework the patch and repeat the same A/B test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]