brcmfmac: fix size of the struct msgbuf_ring_status
PATCH 1/2 brcmfmac: fix size of the struct msgbuf_ring_status
From: Rafał Miłecki <[email protected]>
This updates host struct to match the in-firmawre definition. It's a cosmetic change as it only applies to the reserved struct space.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +1 -1
@@ -139,7 +139,7 @@ struct msgbuf_ring_status {struct msgbuf_common_hdr msg;struct msgbuf_completion_hdr compl_hdr;__le16 write_idx; -__le32 rsvd0[5 ]; +__le16 rsvd0[5 ]; };struct msgbuf_rx_event {
Signature · 1 line
2.20.1
PATCH 2/2 brcmfmac: print firmware reported general status errors
From: Rafał Miłecki <[email protected]>
Firmware may report general errors using a special message type. Add basic support for it by simply decoding & printing an error number.
A sample situation in which firmware reports a buf error:
CONSOLE: 027084.733 no host response IOCTL buffer available..so fail the request will now produce a "Firmware reported general error: 9" on the host.
--- .../broadcom/brcm80211/brcmfmac/msgbuf.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +24 -0
@@ -134,6 +134,14 @@ struct msgbuf_completion_hdr {__le16 flow_ring_id; }; +/* Data struct for the MSGBUF_TYPE_GEN_STATUS */ +struct msgbuf_gen_status { +struct msgbuf_common_hdr msg; +struct msgbuf_completion_hdr compl_hdr; +__le16 write_idx; +__le32 rsvd0[3 ]; +}; +/* Data struct for the MSGBUF_TYPE_RING_STATUS */ struct msgbuf_ring_status {struct msgbuf_common_hdr msg;
@@ -1194,6 +1202,18 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)brcmf_netif_rx (ifp, skb); } +static void brcmf_msgbuf_process_gen_status (struct brcmf_msgbuf *msgbuf, +void *buf) +{ +struct msgbuf_gen_status *gen_status = buf; +struct brcmf_pub *drvr = msgbuf->drvr; +int err; + + err =le16_to_cpu (gen_status->compl_hdr.status); +if (err) +bphy_err (drvr,"Firmware reported general error: %d\n" , err); +} +static void brcmf_msgbuf_process_ring_status (struct brcmf_msgbuf *msgbuf,void *buf) {
@@ -1273,6 +1293,10 @@ static void brcmf_msgbuf_process_msgtype(struct brcmf_msgbuf *msgbuf, void *buf) msg = (struct msgbuf_common_hdr *)buf;switch (msg->msgtype) { +case MSGBUF_TYPE_GEN_STATUS : +brcmf_dbg (MSGBUF ,"MSGBUF_TYPE_GEN_STATUS\n" ); +brcmf_msgbuf_process_gen_status (msgbuf, buf); +break ;case MSGBUF_TYPE_RING_STATUS :brcmf_dbg (MSGBUF ,"MSGBUF_TYPE_RING_STATUS\n" );brcmf_msgbuf_process_ring_status (msgbuf, buf);
Signature · 1 line
2.20.1
Re: [PATCH wireless-drivers-next 2/2] brcmfmac: print firmware reported general status errors
Quoted 8 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Firmware may report general errors using a special message type. Add basic support for it by simply decoding & printing an error number.
A sample situation in which firmware reports a buf error:
CONSOLE: 027084.733 no host response IOCTL buffer available..so fail the request will now produce a "Firmware reported general error: 9" on the host.
Could have meaningful message instead of a number. I can do that in follow up patch if you do not have the information.
Quoted 55 lines
Signed-off-by Rafał Miłecki <[email protected]>--- .../broadcom/brcm80211/brcmfmac/msgbuf.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +24
-0@@ -134,6 +134,14 @@ struct msgbuf_completion_hdr {__le16 flow_ring_id; }; +/* Data struct for the MSGBUF_TYPE_GEN_STATUS */ +struct msgbuf_gen_status { +struct msgbuf_common_hdr msg; +struct msgbuf_completion_hdr compl_hdr; +__le16 write_idx; +__le32 rsvd0[3 ]; +}; +/* Data struct for the MSGBUF_TYPE_RING_STATUS */ struct msgbuf_ring_status {struct msgbuf_common_hdr msg;@@ -1194,6 +1202,18 @@ brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)brcmf_netif_rx (ifp, skb); } +static void brcmf_msgbuf_process_gen_status (struct brcmf_msgbuf *msgbuf, +void *buf) +{ +struct msgbuf_gen_status *gen_status = buf; +struct brcmf_pub *drvr = msgbuf->drvr; +int err; + + err =le16_to_cpu (gen_status->compl_hdr.status); +if (err) +bphy_err (drvr,"Firmware reported general error: %d\n" , err); +} +static void brcmf_msgbuf_process_ring_status (struct brcmf_msgbuf *msgbuf,void *buf) {@@ -1273,6 +1293,10 @@ static void brcmf_msgbuf_process_msgtype(struct brcmf_msgbuf *msgbuf, void *buf) msg = (struct msgbuf_common_hdr *)buf;switch (msg->msgtype) { +case MSGBUF_TYPE_GEN_STATUS : +brcmf_dbg (MSGBUF ,"MSGBUF_TYPE_GEN_STATUS\n" ); +brcmf_msgbuf_process_gen_status (msgbuf, buf); +break ;case MSGBUF_TYPE_RING_STATUS :brcmf_dbg (MSGBUF ,"MSGBUF_TYPE_RING_STATUS\n" );brcmf_msgbuf_process_ring_status (msgbuf, buf);
Re: [PATCH wireless-drivers-next 2/2] brcmfmac: print firmware reported general status errors
Quoted 6 lines · Arend Van Spriel
Quoted 5 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
Firmware may report general errors using a special message type. Add basic support for it by simply decoding & printing an error number.
Quoted 6 lines
Quoted 3 lines
A sample situation in which firmware reports a buf error:
CONSOLE: 027084.733 no host response IOCTL buffer available..so fail the request will now produce a "Firmware reported general error: 9" on the host.Could have meaningful message instead of a number. I can do that in follow up patch if you do not have the information.
That would be nice, thanks!
Quoted 7 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
This updates host struct to match the in-firmawre definition. It's a cosmetic change as it only applies to the reserved struct space.
Fixes c988b78244df ("brcmfmac: print firmware reported ring status errors")Signed-off-by Rafał Miłecki <[email protected]>
2 patches applied to wireless-drivers-next.git, thanks.
0c7051610c57 brcmfmac: fix size of the struct msgbuf_ring_status c91377495192 brcmfmac: print firmware reported general status errors
Signature · 3 lines
https://patchwork.kernel.org/patch/10823623/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches