aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-12-02 08:47:10 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-03 12:08:06 -0500
commit6a8872c54d177abd900a0cf165b76ecb4803f052 (patch)
treebefd3690b9c73a7ae6342345c2a205a345d78028 /drivers/net/sfc/ethtool.c
parent6c88b0b6dc886e49c0e6ee21d677c2e380bde688 (diff)
sfc: Expose Falcon BootROM config through MTD, not ethtool
The ethtool EEPROM interface is really meant for exposing chip configuration, not BootROM configuration. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r--drivers/net/sfc/ethtool.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index edb9d16b8b47..00fb6743c8a6 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -17,7 +17,6 @@
17#include "efx.h" 17#include "efx.h"
18#include "filter.h" 18#include "filter.h"
19#include "nic.h" 19#include "nic.h"
20#include "spi.h"
21#include "mdio_10g.h" 20#include "mdio_10g.h"
22 21
23struct ethtool_string { 22struct ethtool_string {
@@ -629,61 +628,6 @@ static u32 efx_ethtool_get_link(struct net_device *net_dev)
629 return efx->link_state.up; 628 return efx->link_state.up;
630} 629}
631 630
632static int efx_ethtool_get_eeprom_len(struct net_device *net_dev)
633{
634 struct efx_nic *efx = netdev_priv(net_dev);
635 struct efx_spi_device *spi = efx->spi_eeprom;
636
637 if (!spi)
638 return 0;
639 return min(spi->size, EFX_EEPROM_BOOTCONFIG_END) -
640 min(spi->size, EFX_EEPROM_BOOTCONFIG_START);
641}
642
643static int efx_ethtool_get_eeprom(struct net_device *net_dev,
644 struct ethtool_eeprom *eeprom, u8 *buf)
645{
646 struct efx_nic *efx = netdev_priv(net_dev);
647 struct efx_spi_device *spi = efx->spi_eeprom;
648 size_t len;
649 int rc;
650
651 rc = mutex_lock_interruptible(&efx->spi_lock);
652 if (rc)
653 return rc;
654 rc = falcon_spi_read(efx, spi,
655 eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
656 eeprom->len, &len, buf);
657 mutex_unlock(&efx->spi_lock);
658
659 eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC;
660 eeprom->len = len;
661 return rc;
662}
663
664static int efx_ethtool_set_eeprom(struct net_device *net_dev,
665 struct ethtool_eeprom *eeprom, u8 *buf)
666{
667 struct efx_nic *efx = netdev_priv(net_dev);
668 struct efx_spi_device *spi = efx->spi_eeprom;
669 size_t len;
670 int rc;
671
672 if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC)
673 return -EINVAL;
674
675 rc = mutex_lock_interruptible(&efx->spi_lock);
676 if (rc)
677 return rc;
678 rc = falcon_spi_write(efx, spi,
679 eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
680 eeprom->len, &len, buf);
681 mutex_unlock(&efx->spi_lock);
682
683 eeprom->len = len;
684 return rc;
685}
686
687static int efx_ethtool_get_coalesce(struct net_device *net_dev, 631static int efx_ethtool_get_coalesce(struct net_device *net_dev,
688 struct ethtool_coalesce *coalesce) 632 struct ethtool_coalesce *coalesce)
689{ 633{
@@ -1116,9 +1060,6 @@ const struct ethtool_ops efx_ethtool_ops = {
1116 .set_msglevel = efx_ethtool_set_msglevel, 1060 .set_msglevel = efx_ethtool_set_msglevel,
1117 .nway_reset = efx_ethtool_nway_reset, 1061 .nway_reset = efx_ethtool_nway_reset,
1118 .get_link = efx_ethtool_get_link, 1062 .get_link = efx_ethtool_get_link,
1119 .get_eeprom_len = efx_ethtool_get_eeprom_len,
1120 .get_eeprom = efx_ethtool_get_eeprom,
1121 .set_eeprom = efx_ethtool_set_eeprom,
1122 .get_coalesce = efx_ethtool_get_coalesce, 1063 .get_coalesce = efx_ethtool_get_coalesce,
1123 .set_coalesce = efx_ethtool_set_coalesce, 1064 .set_coalesce = efx_ethtool_set_coalesce,
1124 .get_ringparam = efx_ethtool_get_ringparam, 1065 .get_ringparam = efx_ethtool_get_ringparam,