mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[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 <christopher.armenio@resquared.com> Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
This commit is contained in:
committed by
Marty Connor
parent
70537cbe35
commit
2a36703af2
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user