diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-29 15:10:44 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 17:23:54 -0800 |
commit | 76884835684411264cda2f15585261eb02183541 (patch) | |
tree | 585b42235745acf3bf161838b14682428175e670 /drivers/net/sfc/spi.h | |
parent | c1c4f453b61463df4df16f7aa5782fc0cfe05b9e (diff) | |
download | op-kernel-dev-76884835684411264cda2f15585261eb02183541.zip op-kernel-dev-76884835684411264cda2f15585261eb02183541.tar.gz |
sfc: Extend MTD driver for use with new NICs
In new NICs flash is managed by firmware and we will use high-level
operations on partitions rather than direct SPI commands. Add support
for multiple MTD partitions per flash device and remove the direct
link between MTD and SPI devices. Maintain a list of MTD partitions
in struct efx_nic.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/spi.h')
-rw-r--r-- | drivers/net/sfc/spi.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/sfc/spi.h b/drivers/net/sfc/spi.h index 1b1ceb4..8bf4fce 100644 --- a/drivers/net/sfc/spi.h +++ b/drivers/net/sfc/spi.h @@ -36,8 +36,6 @@ /** * struct efx_spi_device - an Efx SPI (Serial Peripheral Interface) device - * @efx: The Efx controller that owns this device - * @mtd: MTD state * @device_id: Controller's id for the device * @size: Size (in bytes) * @addr_len: Number of address bytes in read/write commands @@ -54,10 +52,6 @@ * Write commands are limited to blocks with this size and alignment. */ struct efx_spi_device { - struct efx_nic *efx; -#ifdef CONFIG_SFC_MTD - void *mtd; -#endif int device_id; unsigned int size; unsigned int addr_len; @@ -67,12 +61,16 @@ struct efx_spi_device { unsigned int block_size; }; -int falcon_spi_cmd(const struct efx_spi_device *spi, unsigned int command, +int falcon_spi_cmd(struct efx_nic *efx, + const struct efx_spi_device *spi, unsigned int command, int address, const void* in, void *out, size_t len); -int falcon_spi_wait_write(const struct efx_spi_device *spi); -int falcon_spi_read(const struct efx_spi_device *spi, loff_t start, +int falcon_spi_wait_write(struct efx_nic *efx, + const struct efx_spi_device *spi); +int falcon_spi_read(struct efx_nic *efx, + const struct efx_spi_device *spi, loff_t start, size_t len, size_t *retlen, u8 *buffer); -int falcon_spi_write(const struct efx_spi_device *spi, loff_t start, +int falcon_spi_write(struct efx_nic *efx, + const struct efx_spi_device *spi, loff_t start, size_t len, size_t *retlen, const u8 *buffer); /* |