diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-01-25 18:49:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-25 18:49:59 -0500 |
commit | 5a27e86babe79cf5f575394bb1055448458df6c7 (patch) | |
tree | fa64f367db6367525ed6fb3097e6a509ec93c581 /drivers/net/sfc/mcdi.h | |
parent | 8704a2c8e9db24157a7b08d1678bf840f2318779 (diff) |
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.h | 1 |
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, | |||
111 | extern int efx_mcdi_nvram_write(struct efx_nic *efx, unsigned int type, | 111 | extern int efx_mcdi_nvram_write(struct efx_nic *efx, unsigned int type, |
112 | loff_t offset, const u8 *buffer, | 112 | loff_t offset, const u8 *buffer, |
113 | size_t length); | 113 | size_t length); |
114 | #define EFX_MCDI_NVRAM_LEN_MAX 128 | ||
114 | extern int efx_mcdi_nvram_erase(struct efx_nic *efx, unsigned int type, | 115 | extern int efx_mcdi_nvram_erase(struct efx_nic *efx, unsigned int type, |
115 | loff_t offset, size_t length); | 116 | loff_t offset, size_t length); |
116 | extern int efx_mcdi_nvram_update_finish(struct efx_nic *efx, | 117 | extern int efx_mcdi_nvram_update_finish(struct efx_nic *efx, |