From 1909a42ad4ad297c4cee989c9e9dd5f99e37af4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 21 Jun 2015 12:07:33 +0000 Subject: mac80211: backport some brcmfmac patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are two important patches in this patchset: updating read pointer quicker & rework of .get_station(). There are few more upstream patches that are p2p-related and weren't backported in this commit. Signed-off-by: Rafał Miłecki SVN-Revision: 46084 --- ...cmfmac-Update-msgbuf-read-pointer-quicker.patch | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch (limited to 'package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch') diff --git a/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch b/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch new file mode 100644 index 0000000000..74df9f93f7 --- /dev/null +++ b/package/kernel/mac80211/patches/385-brcmfmac-Update-msgbuf-read-pointer-quicker.patch @@ -0,0 +1,109 @@ +From: Hante Meuleman +Date: Mon, 8 Jun 2015 14:38:32 +0200 +Subject: [PATCH] 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 +Reviewed-by: Franky (Zhenhui) Lin +Reviewed-by: Pieter-Paul Giesberts +Signed-off-by: Hante Meuleman +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + +--- 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(struc + 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(stru + 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); + +--- a/drivers/net/wireless/brcm80211/brcmfmac/commonring.h ++++ b/drivers/net/wireless/brcm80211/brcmfmac/commonring.h +@@ -62,7 +62,8 @@ void brcmf_commonring_write_cancel(struc + u16 n_items); + void *brcmf_commonring_get_read_ptr(struct brcmf_commonring *commonring, + u16 *n_items); +-int brcmf_commonring_read_complete(struct brcmf_commonring *commonring); ++int brcmf_commonring_read_complete(struct brcmf_commonring *commonring, ++ u16 n_items); + + #define brcmf_commonring_n_items(commonring) (commonring->depth) + #define brcmf_commonring_len_item(commonring) (commonring->item_len) +--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c +@@ -75,6 +75,8 @@ + + #define BRCMF_MSGBUF_DELAY_TXWORKER_THRS 96 + #define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS 32 ++#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS 48 ++ + + struct msgbuf_common_hdr { + u8 msgtype; +@@ -1257,19 +1259,27 @@ static void brcmf_msgbuf_process_rx(stru + { + void *buf; + u16 count; ++ u16 processed; + + again: + buf = brcmf_commonring_get_read_ptr(commonring, &count); + if (buf == NULL) + return; + ++ processed = 0; + while (count) { + brcmf_msgbuf_process_msgtype(msgbuf, + buf + msgbuf->rx_dataoffset); + buf += brcmf_commonring_len_item(commonring); ++ processed++; ++ if (processed == BRCMF_MSGBUF_UPDATE_RX_PTR_THRS) { ++ brcmf_commonring_read_complete(commonring, processed); ++ processed = 0; ++ } + count--; + } +- brcmf_commonring_read_complete(commonring); ++ if (processed) ++ brcmf_commonring_read_complete(commonring, processed); + + if (commonring->r_ptr == 0) + goto again; -- cgit v1.2.3