xiaoxiang781216 commented on code in PR #6446:
URL: https://github.com/apache/incubator-nuttx/pull/6446#discussion_r898305195


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.h:
##########
@@ -35,6 +35,7 @@ int bcmf_netdev_register(FAR struct bcmf_dev_s *priv);
 
 void bcmf_netdev_notify_rx(FAR struct bcmf_dev_s *priv);
 
-void bcmf_netdev_notify_tx_done(FAR struct bcmf_dev_s *priv);
+void bcmf_netdev_notify_tx_done(FAR struct bcmf_dev_s *priv,
+                                clock_t delayms);

Review Comment:
   don't need timeout here, since bcmf_sdpcm_sendframe and bcmf_receive can 
guarantee to restart the transmit ASAP once some memory is free.
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -562,14 +573,14 @@ static void bcmf_rxpoll_work(FAR void *arg)
  *
  ****************************************************************************/
 
-void bcmf_netdev_notify_tx_done(FAR struct bcmf_dev_s *priv)
+void bcmf_netdev_notify_tx_done(FAR struct bcmf_dev_s *priv, clock_t delayms)
 {
   /* Schedule to perform a poll for new Tx data the worker thread. */
 
   if (work_available(&priv->bc_pollwork))
     {
       work_queue(BCMFWORK, &priv->bc_pollwork,
-                 bcmf_txdone_poll_work, priv, 0);
+                 bcmf_txdone_poll_work, priv, MSEC2TICK(delayms));

Review Comment:
   bcmf_txdone_poll_work do the same thing as bcmf_txavail_work, so we can 
merge into one.



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -187,6 +188,8 @@ static int bcmf_transmit(FAR struct bcmf_dev_s *priv,
       return -EIO;
     }
 
+  priv->bc_dev.d_buf = NULL;

Review Comment:
   we can reuse cur_tx_frame to check whether devif_poll really transmit some 
packet.



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_netdev.c:
##########
@@ -712,19 +726,26 @@ static void bcmf_txavail_work(FAR void *arg)
     {
       /* Check if there is room in the hardware to hold another packet. */
 
-      if (bcmf_netdev_alloc_tx_frame(priv))
+      if (bcmf_netdev_alloc_tx_frame(priv) == OK)
         {
-          goto exit_unlock;
-        }
+          /* If so, then poll the network for new XMIT data */
 
-      /* If so, then poll the network for new XMIT data */
+          priv->bc_dev.d_buf = priv->cur_tx_frame->data;
+          priv->bc_dev.d_len = 0;
+          devif_poll(&priv->bc_dev, bcmf_txpoll);
+          if (priv->bc_dev.d_buf == NULL)
+            {
+              bcmf_netdev_notify_tx_done(priv, 0);

Review Comment:
   let's add loop directly instead schedule tx_done work again.



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