summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/mcdi.h
diff options
context:
space:
mode:
authorBen Hutchings2010-01-26 00:49:59 +0100
committerDavid S. Miller2010-01-26 00:49:59 +0100
commit5a27e86babe79cf5f575394bb1055448458df6c7 (patch)
treefa64f367db6367525ed6fb3097e6a509ec93c581 /drivers/net/sfc/mcdi.h
parentsfc: Add workspace for GMAC bug workaround to MCDI MAC_STATS buffer (diff)
downloadkernel-qcow2-linux-5a27e86babe79cf5f575394bb1055448458df6c7.tar.gz
kernel-qcow2-linux-5a27e86babe79cf5f575394bb1055448458df6c7.tar.xz
kernel-qcow2-linux-5a27e86babe79cf5f575394bb1055448458df6c7.zip
sfc: Use fixed-size buffers for MCDI NVRAM requests
The low-level MCDI code always uses 32-bit MMIO operations, and callers must pad input and output buffers to multiples of 4 bytes. The MCDI NVRAM functions are not doing this. Also, their buffers are declared as variable-length arrays with no explicit maximum length. Switch to a fixed buffer size based on the chunk size used by the MTD driver (which is a multiple of 4). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/mcdi.h')
-rw-r--r--drivers/net/sfc/mcdi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/sfc/mcdi.h b/drivers/net/sfc/mcdi.h
index de916728c2e3..10ce98f4c0fb 100644
--- a/drivers/net/sfc/mcdi.h
+++ b/drivers/net/sfc/mcdi.h
@@ -111,6 +111,7 @@ extern int efx_mcdi_nvram_read(struct efx_nic *efx, unsigned int type,
extern int efx_mcdi_nvram_write(struct efx_nic *efx, unsigned int type,
loff_t offset, const u8 *buffer,
size_t length);
+#define EFX_MCDI_NVRAM_LEN_MAX 128
extern int efx_mcdi_nvram_erase(struct efx_nic *efx, unsigned int type,
loff_t offset, size_t length);
extern int efx_mcdi_nvram_update_finish(struct efx_nic *efx,