aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-11-04 15:34:28 -0500
committerJeff Garzik <jgarzik@redhat.com>2008-11-06 00:49:57 -0500
commitf41507245ef8b079685aba8da5b5b2b5e87e70bc (patch)
treebe8c8aee6a6fc3c69d946dcd3fe24306bf89775e /drivers/net/sfc/ethtool.c
parent0a95f56323ce93dac354c1b2d54bf959a985cf7d (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index df0579e386f7..abd8fcd6e62d 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,
554 size_t len; 554 size_t len;
555 int rc; 555 int rc;
556 556
557 mutex_lock(&efx->spi_lock);
557 rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, 558 rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
558 eeprom->len, &len, buf); 559 eeprom->len, &len, buf);
560 mutex_unlock(&efx->spi_lock);
559 eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC; 561 eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC;
560 eeprom->len = len; 562 eeprom->len = len;
561 return rc; 563 return rc;
@@ -572,8 +574,10 @@ static int efx_ethtool_set_eeprom(struct net_device *net_dev,
572 if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC) 574 if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC)
573 return -EINVAL; 575 return -EINVAL;
574 576
577 mutex_lock(&efx->spi_lock);
575 rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, 578 rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
576 eeprom->len, &len, buf); 579 eeprom->len, &len, buf);
580 mutex_unlock(&efx->spi_lock);
577 eeprom->len = len; 581 eeprom->len = len;
578 return rc; 582 return rc;
579} 583}