xiaoxiang781216 commented on code in PR #18428:
URL: https://github.com/apache/nuttx/pull/18428#discussion_r2845681564


##########
drivers/usbdev/rndis.c:
##########
@@ -2860,10 +2876,16 @@ static int usbclass_setconfig(FAR struct rndis_dev_s 
*priv, uint8_t config)
   /* We are successfully configured */
 
   priv->config = config;
-  if (priv->netdev.d_ifup(&priv->netdev) == OK)
-    {
-      priv->netdev.d_flags |= IFF_UP;
-    }
+
+  priv->netdev.d_flags |= IFF_UP;
+
+  /* Schedule to work queue because netdev_carrier_on API can't be used in
+   * interrupt context. Since the current network card is not yet RUNNING,
+   * it will not be selected to trigger rndis_txavail, so pollwork can be
+   * reused.
+   */
+
+  work_queue(LPWORK, &priv->pollwork, rndis_carrier_on_work, priv, 0);

Review Comment:
   let's call work_queue inside rndis_ifup/rndis_ifdown instead



-- 
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]

Reply via email to