diff mbox series

[4/4] brcmfmac: increase dcmd maximum buffer size

Message ID 20200519110951.88998-5-chi-hsien.lin@cypress.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series brcmfmac: SoftAP creation and dcmd buffer size changes | expand

Commit Message

Chi-Hsien Lin May 19, 2020, 11:09 a.m. UTC
From: Double Lo <double.lo@cypress.com>

Increase dcmd maximum buffer size to match firmware configuration for
new chips.

Signed-off-by: Double Lo <double.lo@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.25.0


This message and any attachments may contain confidential information from Cypress or its subsidiaries. If it has been received in error, please advise the sender and immediately delete this message.

Comments

Arend van Spriel May 19, 2020, 11:29 a.m. UTC | #1
On 5/19/2020 1:09 PM, Chi-Hsien Lin wrote:
> From: Double Lo <double.lo@cypress.com>
> 
> Increase dcmd maximum buffer size to match firmware configuration for
> new chips.

 From the description I was expecting BRCMF_DCMD_MAXLEN to be increased 
but that is not the case. Please explain the need for the 
ROUND_UP_MARGIN. Is it always needed or just on some platforms?

Regards,
Arend
Chi-Hsien Lin May 20, 2020, 12:54 p.m. UTC | #2
On 05/19/2020 7:29, Arend Van Spriel wrote:
> 
> 
> On 5/19/2020 1:09 PM, Chi-Hsien Lin wrote:
>> From: Double Lo <double.lo@cypress.com>
>>
>> Increase dcmd maximum buffer size to match firmware configuration for
>> new chips.
> 
>   From the description I was expecting BRCMF_DCMD_MAXLEN to be increased
> but that is not the case. Please explain the need for the
> ROUND_UP_MARGIN. Is it always needed or just on some platforms?

Thanks for the feedback.

ROUND_UP_MARGIN is the biggest SDIO block size possible and is used to 
accomodate padding in brcmf_sdio_read_control(). This should be only 
related to SDIO block size.

The comment should be updated to "Add the padding round up value in the 
max control buffer size". Will update it in V2.

> 
> Regards,
> Arend
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
index 2c95a08a5871..705130cf27d5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
@@ -87,6 +87,8 @@  struct brcmf_proto_bcdc_header {
                                         * plus any space that might be needed
                                         * for bus alignment padding.
                                         */
+#define ROUND_UP_MARGIN 2048
+
 struct brcmf_bcdc {
        u16 reqid;
        u8 bus_header[BUS_HEADER_LEN];
@@ -471,7 +473,7 @@  int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr)

        drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES;
        drvr->bus_if->maxctl = BRCMF_DCMD_MAXLEN +
-                       sizeof(struct brcmf_proto_bcdc_dcmd);
+                       sizeof(struct brcmf_proto_bcdc_dcmd) + ROUND_UP_MARGIN;
        return 0;

 fail: