Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireless/bcm43xxx: enable tx flow control to improve performance #6533

Merged
merged 2 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <
anchao marked this conversation as resolved.
Show resolved Hide resolved
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++;
}

nxsem_post(&sbus->queue_mutex);
break;
}
}

nxsem_post(&sbus->queue_mutex);
Expand Down Expand Up @@ -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--;
}

nxsem_post(&sbus->queue_mutex);
}
1 change: 1 addition & 0 deletions drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct bcmf_sdio_dev_s
dq_queue_t free_queue; /* Queue of available frames */
dq_queue_t tx_queue; /* Queue of frames to transmit */
dq_queue_t rx_queue; /* Queue of frames used to receive */
volatile int tx_queue_count; /* Count of items in TX queue */
};

/* Structure used to manage SDIO frames */
Expand Down