|
@@ -209,7 +209,7 @@ static int ifec_pci_probe ( struct pci_device *pci,
|
209
|
209
|
nvs_read ( &priv->eeprom.nvs, EEPROM_ADDR_MDIO_REGISTER,
|
210
|
210
|
&priv->mdio_register, 2 );
|
211
|
211
|
|
212
|
|
- ifec_link_update ( netdev ); /* Update link state */
|
|
212
|
+ netdev_link_up ( netdev );
|
213
|
213
|
|
214
|
214
|
if ( ( rc = register_netdev ( netdev ) ) != 0 )
|
215
|
215
|
goto error;
|
|
@@ -400,7 +400,6 @@ error:
|
400
|
400
|
static void ifec_net_poll ( struct net_device *netdev )
|
401
|
401
|
{
|
402
|
402
|
struct ifec_private *priv = netdev->priv;
|
403
|
|
- static int linkpoll = 0;
|
404
|
403
|
unsigned short intr_status;
|
405
|
404
|
|
406
|
405
|
DBGP ( "ifec_net_poll\n" );
|
|
@@ -412,11 +411,6 @@ static void ifec_net_poll ( struct net_device *netdev )
|
412
|
411
|
|
413
|
412
|
DBG2 ( "poll - status: 0x%04X\n", intr_status );
|
414
|
413
|
|
415
|
|
- if ( ++linkpoll > LINK_CHECK_PERIOD ) {
|
416
|
|
- linkpoll = 0;
|
417
|
|
- ifec_link_update ( netdev ); /* Update link state */
|
418
|
|
- }
|
419
|
|
-
|
420
|
414
|
/* anything to do here? */
|
421
|
415
|
if ( ( intr_status & ( ~INTERRUPT_MASK ) ) == 0 )
|
422
|
416
|
return;
|
|
@@ -568,45 +562,6 @@ static void ifec_init_eeprom ( struct net_device *netdev )
|
568
|
562
|
init_at93c66 ( &priv->eeprom, 16 );
|
569
|
563
|
}
|
570
|
564
|
|
571
|
|
-/*
|
572
|
|
- * Check if the network cable is plugged in.
|
573
|
|
- *
|
574
|
|
- * @v netdev Network device to check.
|
575
|
|
- * @ret retval greater 0 if linkup.
|
576
|
|
- */
|
577
|
|
-static int ifec_link_check ( struct net_device *netdev )
|
578
|
|
-{
|
579
|
|
- struct ifec_private *priv = netdev->priv;
|
580
|
|
- unsigned short mdio_register = priv->mdio_register;
|
581
|
|
-
|
582
|
|
- DBGP ( "ifec_link_check\n" );
|
583
|
|
-
|
584
|
|
- /* Read the status register once to discard stale data */
|
585
|
|
- ifec_mdio_read ( netdev, mdio_register & 0x1f, 1 );
|
586
|
|
- /* Check to see if network cable is plugged in. */
|
587
|
|
- if ( ! ( ifec_mdio_read ( netdev, mdio_register & 0x1f, 1 )
|
588
|
|
- & ( 1 << 2 ) ) ) {
|
589
|
|
- return 0;
|
590
|
|
- }
|
591
|
|
- return 1;
|
592
|
|
-}
|
593
|
|
-
|
594
|
|
-/*
|
595
|
|
- * Check network cable link, inform gPXE as appropriate.
|
596
|
|
- *
|
597
|
|
- * @v netdev Network device to check.
|
598
|
|
- */
|
599
|
|
-static void ifec_link_update ( struct net_device *netdev )
|
600
|
|
-{
|
601
|
|
- DBGP ( "ifec_link_update\n" );
|
602
|
|
-
|
603
|
|
- /* Update link state */
|
604
|
|
- if ( ifec_link_check ( netdev ) )
|
605
|
|
- netdev_link_up ( netdev );
|
606
|
|
- else
|
607
|
|
- netdev_link_down ( netdev );
|
608
|
|
-}
|
609
|
|
-
|
610
|
565
|
/*
|
611
|
566
|
* Support function: ifec_mdio_read
|
612
|
567
|
*
|