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>
This commit is contained in:
Ben Hutchings 2009-11-29 15:10:44 +00:00 committed by David S. Miller
parent c1c4f453b6
commit 7688483568
6 changed files with 261 additions and 130 deletions

View file

@ -567,7 +567,8 @@ static int efx_ethtool_get_eeprom(struct net_device *net_dev,
rc = mutex_lock_interruptible(&efx->spi_lock);
if (rc)
return rc;
rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
rc = falcon_spi_read(efx, spi,
eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
eeprom->len, &len, buf);
mutex_unlock(&efx->spi_lock);
@ -590,7 +591,8 @@ static int efx_ethtool_set_eeprom(struct net_device *net_dev,
rc = mutex_lock_interruptible(&efx->spi_lock);
if (rc)
return rc;
rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
rc = falcon_spi_write(efx, spi,
eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
eeprom->len, &len, buf);
mutex_unlock(&efx->spi_lock);