diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-11-04 20:34:28 +0000 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-11-06 00:49:57 -0500 |
commit | f41507245ef8b079685aba8da5b5b2b5e87e70bc (patch) | |
tree | be8c8aee6a6fc3c69d946dcd3fe24306bf89775e /drivers/net/sfc/ethtool.c | |
parent | 0a95f56323ce93dac354c1b2d54bf959a985cf7d (diff) |
sfc: Expose flash region storing boot code as MTD
The boot code that appears as a PCI expansion ROM on the SFC4000 is
stored in flash. Expose this as a standard MTD device to allow for
in-place upgrades.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index df0579e386f..abd8fcd6e62 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c @@ -554,8 +554,10 @@ static int efx_ethtool_get_eeprom(struct net_device *net_dev, size_t len; int rc; + mutex_lock(&efx->spi_lock); rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, eeprom->len, &len, buf); + mutex_unlock(&efx->spi_lock); eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC; eeprom->len = len; return rc; @@ -572,8 +574,10 @@ static int efx_ethtool_set_eeprom(struct net_device *net_dev, if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC) return -EINVAL; + mutex_lock(&efx->spi_lock); rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, eeprom->len, &len, buf); + mutex_unlock(&efx->spi_lock); eeprom->len = len; return rc; } |