aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2014-01-06 06:40:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-06 15:47:59 -0500
commitd453399229cefff985391f079066ac5a84955537 (patch)
treeb6a3daa58c293b06e09b13b3840df95fd785755e /drivers/net/wireless/brcm80211/brcmfmac
parent75b39dd2408833ed4eaa16fe76473d1391ca49ee (diff)
brcmfmac: Limit control message length from host to device.
An control request or set message length is restricted to ETH frame length for the buffer from host to device. This is limitation is imposed by the firmware. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcdc.c10
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd.h5
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
index 12c27d13df7f..c229210d50ba 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
@@ -41,9 +41,6 @@ struct brcmf_proto_bcdc_dcmd {
41 __le32 status; /* status code returned from the device */ 41 __le32 status; /* status code returned from the device */
42}; 42};
43 43
44/* Max valid buffer size that can be sent to the dongle */
45#define BCDC_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
46
47/* BCDC flag definitions */ 44/* BCDC flag definitions */
48#define BCDC_DCMD_ERROR 0x01 /* 1=cmd failed */ 45#define BCDC_DCMD_ERROR 0x01 /* 1=cmd failed */
49#define BCDC_DCMD_SET 0x02 /* 0=get, 1=set cmd */ 46#define BCDC_DCMD_SET 0x02 /* 0=get, 1=set cmd */
@@ -133,9 +130,12 @@ brcmf_proto_bcdc_msg(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
133 if (buf) 130 if (buf)
134 memcpy(bcdc->buf, buf, len); 131 memcpy(bcdc->buf, buf, len);
135 132
133 len += sizeof(*msg);
134 if (len > BRCMF_TX_IOCTL_MAX_MSG_SIZE)
135 len = BRCMF_TX_IOCTL_MAX_MSG_SIZE;
136
136 /* Send request */ 137 /* Send request */
137 return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&bcdc->msg, 138 return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&bcdc->msg, len);
138 len + sizeof(struct brcmf_proto_bcdc_dcmd));
139} 139}
140 140
141static int brcmf_proto_bcdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len) 141static int brcmf_proto_bcdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
index e29965744b71..939d6b132922 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
@@ -37,6 +37,11 @@
37#define BRCMF_DCMD_MEDLEN 1536 37#define BRCMF_DCMD_MEDLEN 1536
38#define BRCMF_DCMD_MAXLEN 8192 38#define BRCMF_DCMD_MAXLEN 8192
39 39
40/* IOCTL from host to device are limited in lenght. A device can only handle
41 * ethernet frame size. This limitation is to be applied by protocol layer.
42 */
43#define BRCMF_TX_IOCTL_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
44
40#define BRCMF_AMPDU_RX_REORDER_MAXFLOWS 256 45#define BRCMF_AMPDU_RX_REORDER_MAXFLOWS 256
41 46
42/* Length of firmware version string stored for 47/* Length of firmware version string stored for