aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/spi.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-29 10:10:44 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 20:23:54 -0500
commit76884835684411264cda2f15585261eb02183541 (patch)
tree585b42235745acf3bf161838b14682428175e670 /drivers/net/sfc/spi.h
parentc1c4f453b61463df4df16f7aa5782fc0cfe05b9e (diff)
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.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/sfc/spi.h b/drivers/net/sfc/spi.h
index 1b1ceb411671..8bf4fce0813a 100644
--- a/drivers/net/sfc/spi.h
+++ b/drivers/net/sfc/spi.h
@@ -36,8 +36,6 @@
36 36
37/** 37/**
38 * struct efx_spi_device - an Efx SPI (Serial Peripheral Interface) device 38 * struct efx_spi_device - an Efx SPI (Serial Peripheral Interface) device
39 * @efx: The Efx controller that owns this device
40 * @mtd: MTD state
41 * @device_id: Controller's id for the device 39 * @device_id: Controller's id for the device
42 * @size: Size (in bytes) 40 * @size: Size (in bytes)
43 * @addr_len: Number of address bytes in read/write commands 41 * @addr_len: Number of address bytes in read/write commands
@@ -54,10 +52,6 @@
54 * Write commands are limited to blocks with this size and alignment. 52 * Write commands are limited to blocks with this size and alignment.
55 */ 53 */
56struct efx_spi_device { 54struct efx_spi_device {
57 struct efx_nic *efx;
58#ifdef CONFIG_SFC_MTD
59 void *mtd;
60#endif
61 int device_id; 55 int device_id;
62 unsigned int size; 56 unsigned int size;
63 unsigned int addr_len; 57 unsigned int addr_len;
@@ -67,12 +61,16 @@ struct efx_spi_device {
67 unsigned int block_size; 61 unsigned int block_size;
68}; 62};
69 63
70int falcon_spi_cmd(const struct efx_spi_device *spi, unsigned int command, 64int falcon_spi_cmd(struct efx_nic *efx,
65 const struct efx_spi_device *spi, unsigned int command,
71 int address, const void* in, void *out, size_t len); 66 int address, const void* in, void *out, size_t len);
72int falcon_spi_wait_write(const struct efx_spi_device *spi); 67int falcon_spi_wait_write(struct efx_nic *efx,
73int falcon_spi_read(const struct efx_spi_device *spi, loff_t start, 68 const struct efx_spi_device *spi);
69int falcon_spi_read(struct efx_nic *efx,
70 const struct efx_spi_device *spi, loff_t start,
74 size_t len, size_t *retlen, u8 *buffer); 71 size_t len, size_t *retlen, u8 *buffer);
75int falcon_spi_write(const struct efx_spi_device *spi, loff_t start, 72int falcon_spi_write(struct efx_nic *efx,
73 const struct efx_spi_device *spi, loff_t start,
76 size_t len, size_t *retlen, const u8 *buffer); 74 size_t len, size_t *retlen, const u8 *buffer);
77 75
78/* 76/*