Skip to content

Commit

Permalink
[eepro100] Remove link-state checking
Browse files Browse the repository at this point in the history
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 <christopher.armenio@resquared.com>
Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
  • Loading branch information
thomil authored and Marty Connor committed Apr 19, 2010
1 parent 70537cb commit 2a36703
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
47 changes: 1 addition & 46 deletions src/drivers/net/eepro100.c
Expand Up @@ -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;
Expand Down Expand Up @@ -400,7 +400,6 @@ static int ifec_net_open ( struct net_device *netdev )
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" );
Expand All @@ -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;
Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/net/eepro100.h
Expand Up @@ -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);
Expand Down

0 comments on commit 2a36703

Please sign in to comment.