pkarashchenko commented on code in PR #6533:
URL: https://github.com/apache/incubator-nuttx/pull/6533#discussion_r908270303


##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -1108,5 +1118,10 @@ void bcmf_sdio_free_frame(FAR struct bcmf_dev_s *priv,
 
   bcmf_dqueue_push(&sbus->free_queue, &sframe->list_entry);
 
+  if (sframe->tx)
+    {
+      sbus->tx_queue_count -= 1;

Review Comment:
   ```suggestion
         sbus->tx_queue_count--;
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -1065,10 +1065,20 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR 
struct bcmf_dev_s *priv,
           DEBUGPANIC();
         }
 
-      if ((entry = bcmf_dqueue_pop_tail(&sbus->free_queue)) != NULL)
+      if (!tx ||
+          sbus->tx_queue_count <
+            CONFIG_IEEE80211_BROADCOM_FRAME_POOL_SIZE / 2)
         {
-          nxsem_post(&sbus->queue_mutex);
-          break;
+          if ((entry = bcmf_dqueue_pop_tail(&sbus->free_queue)) != NULL)
+            {
+              if (tx)
+                {
+                  sbus->tx_queue_count += 1;

Review Comment:
   ```suggestion
                     sbus->tx_queue_count++;
   ```



##########
drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c:
##########
@@ -1065,10 +1065,20 @@ struct bcmf_sdio_frame *bcmf_sdio_allocate_frame(FAR 
struct bcmf_dev_s *priv,
           DEBUGPANIC();
         }
 
-      if ((entry = bcmf_dqueue_pop_tail(&sbus->free_queue)) != NULL)
+      if (!tx ||
+          sbus->tx_queue_count <

Review Comment:
   do we need set to zero `tx_queue_count` during init, or `struct 
bcmf_sdio_dev_s` use `zalloc` / static allocation?



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to