From 2a36703af228bd10d50a31daec96072fe3a992a3 Mon Sep 17 00:00:00 2001 From: Thomas Miletich Date: Fri, 16 Apr 2010 18:11:39 +0200 Subject: [PATCH] [eepro100] Remove link-state checking Christopher Armenio reported link detection problems with an integrated eepro100 NIC. Thomas Miletich removed link detection code from the eepro100 driver and verified that the driver continued to function. Christopher verified Thomas' patch on his integrated eepro100 NIC. Reported-by: Christopher Armenio Signed-off-by: Thomas Miletich Signed-off-by: Marty Connor --- src/drivers/net/eepro100.c | 47 +------------------------------------- src/drivers/net/eepro100.h | 2 -- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/drivers/net/eepro100.c b/src/drivers/net/eepro100.c index 8a75608c..3ad45bf2 100644 --- a/src/drivers/net/eepro100.c +++ b/src/drivers/net/eepro100.c @@ -209,7 +209,7 @@ static int ifec_pci_probe ( struct pci_device *pci, nvs_read ( &priv->eeprom.nvs, EEPROM_ADDR_MDIO_REGISTER, &priv->mdio_register, 2 ); - ifec_link_update ( netdev ); /* Update link state */ + netdev_link_up ( netdev ); if ( ( rc = register_netdev ( netdev ) ) != 0 ) goto error; @@ -400,7 +400,6 @@ error: static void ifec_net_poll ( struct net_device *netdev ) { struct ifec_private *priv = netdev->priv; - static int linkpoll = 0; unsigned short intr_status; DBGP ( "ifec_net_poll\n" ); @@ -412,11 +411,6 @@ static void ifec_net_poll ( struct net_device *netdev ) DBG2 ( "poll - status: 0x%04X\n", intr_status ); - if ( ++linkpoll > LINK_CHECK_PERIOD ) { - linkpoll = 0; - ifec_link_update ( netdev ); /* Update link state */ - } - /* anything to do here? */ if ( ( intr_status & ( ~INTERRUPT_MASK ) ) == 0 ) return; @@ -568,45 +562,6 @@ static void ifec_init_eeprom ( struct net_device *netdev ) init_at93c66 ( &priv->eeprom, 16 ); } -/* - * Check if the network cable is plugged in. - * - * @v netdev Network device to check. - * @ret retval greater 0 if linkup. - */ -static int ifec_link_check ( struct net_device *netdev ) -{ - struct ifec_private *priv = netdev->priv; - unsigned short mdio_register = priv->mdio_register; - - DBGP ( "ifec_link_check\n" ); - - /* Read the status register once to discard stale data */ - ifec_mdio_read ( netdev, mdio_register & 0x1f, 1 ); - /* Check to see if network cable is plugged in. */ - if ( ! ( ifec_mdio_read ( netdev, mdio_register & 0x1f, 1 ) - & ( 1 << 2 ) ) ) { - return 0; - } - return 1; -} - -/* - * Check network cable link, inform gPXE as appropriate. - * - * @v netdev Network device to check. - */ -static void ifec_link_update ( struct net_device *netdev ) -{ - DBGP ( "ifec_link_update\n" ); - - /* Update link state */ - if ( ifec_link_check ( netdev ) ) - netdev_link_up ( netdev ); - else - netdev_link_down ( netdev ); -} - /* * Support function: ifec_mdio_read * diff --git a/src/drivers/net/eepro100.h b/src/drivers/net/eepro100.h index 17a22dfd..1592c631 100644 --- a/src/drivers/net/eepro100.h +++ b/src/drivers/net/eepro100.h @@ -183,8 +183,6 @@ static int ifec_net_transmit ( struct net_device*, struct io_buffer *iobuf ); /* Local function prototypes */ static void ifec_init_eeprom ( struct net_device * ); -static int ifec_link_check ( struct net_device * ); -static void ifec_link_update ( struct net_device * ); static int ifec_mdio_read ( struct net_device *, int phy, int location ); static void ifec_mdio_setup ( struct net_device *, int options ); static int ifec_mdio_write ( struct net_device *, int phy, int loc, int val);