diff options
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index cd0d0873d978..df0579e386f7 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -172,10 +172,7 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = { | |||
172 | /* Number of ethtool statistics */ | 172 | /* Number of ethtool statistics */ |
173 | #define EFX_ETHTOOL_NUM_STATS ARRAY_SIZE(efx_ethtool_stats) | 173 | #define EFX_ETHTOOL_NUM_STATS ARRAY_SIZE(efx_ethtool_stats) |
174 | 174 | ||
175 | /* EEPROM range with gPXE configuration */ | ||
176 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB | 175 | #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB |
177 | #define EFX_ETHTOOL_EEPROM_MIN 0x800U | ||
178 | #define EFX_ETHTOOL_EEPROM_MAX 0x1800U | ||
179 | 176 | ||
180 | /************************************************************************** | 177 | /************************************************************************** |
181 | * | 178 | * |
@@ -545,8 +542,8 @@ static int efx_ethtool_get_eeprom_len(struct net_device *net_dev) | |||
545 | 542 | ||
546 | if (!spi) | 543 | if (!spi) |
547 | return 0; | 544 | return 0; |
548 | return min(spi->size, EFX_ETHTOOL_EEPROM_MAX) - | 545 | return min(spi->size, EFX_EEPROM_BOOTCONFIG_END) - |
549 | min(spi->size, EFX_ETHTOOL_EEPROM_MIN); | 546 | min(spi->size, EFX_EEPROM_BOOTCONFIG_START); |
550 | } | 547 | } |
551 | 548 | ||
552 | static int efx_ethtool_get_eeprom(struct net_device *net_dev, | 549 | static int efx_ethtool_get_eeprom(struct net_device *net_dev, |
@@ -557,7 +554,7 @@ static int efx_ethtool_get_eeprom(struct net_device *net_dev, | |||
557 | size_t len; | 554 | size_t len; |
558 | int rc; | 555 | int rc; |
559 | 556 | ||
560 | rc = falcon_spi_read(spi, eeprom->offset + EFX_ETHTOOL_EEPROM_MIN, | 557 | rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, |
561 | eeprom->len, &len, buf); | 558 | eeprom->len, &len, buf); |
562 | eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC; | 559 | eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC; |
563 | eeprom->len = len; | 560 | eeprom->len = len; |
@@ -575,7 +572,7 @@ static int efx_ethtool_set_eeprom(struct net_device *net_dev, | |||
575 | if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC) | 572 | if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC) |
576 | return -EINVAL; | 573 | return -EINVAL; |
577 | 574 | ||
578 | rc = falcon_spi_write(spi, eeprom->offset + EFX_ETHTOOL_EEPROM_MIN, | 575 | rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, |
579 | eeprom->len, &len, buf); | 576 | eeprom->len, &len, buf); |
580 | eeprom->len = len; | 577 | eeprom->len = len; |
581 | return rc; | 578 | return rc; |