summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211/brcmfmac/commonring.c
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2015-06-08 15:38:32 +0300
committerKalle Valo <kvalo@codeaurora.org>2015-06-15 12:42:25 +0300
commitdf738c2f0cbf52df563c0f9427f386a362158aa9 (patch)
treea2c3649ae153ceb58ba58725ddbdbe1be197db73 /drivers/net/wireless/brcm80211/brcmfmac/commonring.c
parente996db69833a81915fa8c4bed8331af644f14408 (diff)
downloadlinux-df738c2f0cbf52df563c0f9427f386a362158aa9.tar.xz
brcmfmac: Update msgbuf read pointer quicker.
On device to host data using msgbuf the read pointer gets updated once all data is processed. Updating this pointer more frequently allows the firmware to add more data quicker. This will result in slightly higher and more stable throughput on CPU bounded host processors. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/commonring.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/commonring.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/commonring.c b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c
index 26c65872dae3..7b0e52195a85 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.c
@@ -223,8 +223,6 @@ void brcmf_commonring_write_cancel(struct brcmf_commonring *commonring,
void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring,
u16 *n_items)
{
- void *ret_addr;
-
if (commonring->cr_update_wptr)
commonring->cr_update_wptr(commonring->cr_ctx);
@@ -235,19 +233,18 @@ void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring,
if (*n_items == 0)
return NULL;
- ret_addr = commonring->buf_addr +
- (commonring->r_ptr * commonring->item_len);
-
- commonring->r_ptr += *n_items;
- if (commonring->r_ptr == commonring->depth)
- commonring->r_ptr = 0;
-
- return ret_addr;
+ return commonring->buf_addr +
+ (commonring->r_ptr * commonring->item_len);
}
-int brcmf_commonring_read_complete(struct brcmf_commonring *commonring)
+int brcmf_commonring_read_complete(struct brcmf_commonring *commonring,
+ u16 n_items)
{
+ commonring->r_ptr += n_items;
+ if (commonring->r_ptr == commonring->depth)
+ commonring->r_ptr = 0;
+
if (commonring->cr_write_rptr)
return commonring->cr_write_rptr(commonring->cr_ctx);