aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/fs_enet-main.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-10-01 15:20:17 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:00 -0400
commit0fb300fa9d54118c6dce772a29362d896775eff2 (patch)
tree39871f8e06d1733d55ce4e04e255783f4520f02b /drivers/net/fs_enet/fs_enet-main.c
parent3de96471bd7fb76406e975ef6387abe3a0698149 (diff)
fs_enet: Whitespace cleanup.
Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/fs_enet/fs_enet-main.c')
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c85
1 files changed, 39 insertions, 46 deletions
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index dcbe83c773ee..a15345ba1e59 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -343,7 +343,6 @@ static void fs_enet_tx(struct net_device *dev)
343 343
344 do_wake = do_restart = 0; 344 do_wake = do_restart = 0;
345 while (((sc = CBDR_SC(bdp)) & BD_ENET_TX_READY) == 0) { 345 while (((sc = CBDR_SC(bdp)) & BD_ENET_TX_READY) == 0) {
346
347 dirtyidx = bdp - fep->tx_bd_base; 346 dirtyidx = bdp - fep->tx_bd_base;
348 347
349 if (fep->tx_free == fep->tx_ring) 348 if (fep->tx_free == fep->tx_ring)
@@ -444,7 +443,6 @@ fs_enet_interrupt(int irq, void *dev_id)
444 443
445 nr = 0; 444 nr = 0;
446 while ((int_events = (*fep->ops->get_int_events)(dev)) != 0) { 445 while ((int_events = (*fep->ops->get_int_events)(dev)) != 0) {
447
448 nr++; 446 nr++;
449 447
450 int_clr_events = int_events; 448 int_clr_events = int_events;
@@ -700,45 +698,43 @@ static void fs_timeout(struct net_device *dev)
700 *-----------------------------------------------------------------------------*/ 698 *-----------------------------------------------------------------------------*/
701static void generic_adjust_link(struct net_device *dev) 699static void generic_adjust_link(struct net_device *dev)
702{ 700{
703 struct fs_enet_private *fep = netdev_priv(dev); 701 struct fs_enet_private *fep = netdev_priv(dev);
704 struct phy_device *phydev = fep->phydev; 702 struct phy_device *phydev = fep->phydev;
705 int new_state = 0; 703 int new_state = 0;
706 704
707 if (phydev->link) { 705 if (phydev->link) {
708 706 /* adjust to duplex mode */
709 /* adjust to duplex mode */ 707 if (phydev->duplex != fep->oldduplex) {
710 if (phydev->duplex != fep->oldduplex){ 708 new_state = 1;
711 new_state = 1; 709 fep->oldduplex = phydev->duplex;
712 fep->oldduplex = phydev->duplex; 710 }
713 } 711
714 712 if (phydev->speed != fep->oldspeed) {
715 if (phydev->speed != fep->oldspeed) { 713 new_state = 1;
716 new_state = 1; 714 fep->oldspeed = phydev->speed;
717 fep->oldspeed = phydev->speed; 715 }
718 } 716
719 717 if (!fep->oldlink) {
720 if (!fep->oldlink) { 718 new_state = 1;
721 new_state = 1; 719 fep->oldlink = 1;
722 fep->oldlink = 1; 720 netif_schedule(dev);
723 netif_schedule(dev); 721 netif_carrier_on(dev);
724 netif_carrier_on(dev); 722 netif_start_queue(dev);
725 netif_start_queue(dev); 723 }
726 } 724
727 725 if (new_state)
728 if (new_state) 726 fep->ops->restart(dev);
729 fep->ops->restart(dev); 727 } else if (fep->oldlink) {
730 728 new_state = 1;
731 } else if (fep->oldlink) { 729 fep->oldlink = 0;
732 new_state = 1; 730 fep->oldspeed = 0;
733 fep->oldlink = 0; 731 fep->oldduplex = -1;
734 fep->oldspeed = 0; 732 netif_carrier_off(dev);
735 fep->oldduplex = -1; 733 netif_stop_queue(dev);
736 netif_carrier_off(dev); 734 }
737 netif_stop_queue(dev); 735
738 } 736 if (new_state && netif_msg_link(fep))
739 737 phy_print_status(phydev);
740 if (new_state && netif_msg_link(fep))
741 phy_print_status(phydev);
742} 738}
743 739
744 740
@@ -782,7 +778,6 @@ static int fs_init_phy(struct net_device *dev)
782 return 0; 778 return 0;
783} 779}
784 780
785
786static int fs_enet_open(struct net_device *dev) 781static int fs_enet_open(struct net_device *dev)
787{ 782{
788 struct fs_enet_private *fep = netdev_priv(dev); 783 struct fs_enet_private *fep = netdev_priv(dev);
@@ -971,7 +966,7 @@ static struct net_device *fs_init_instance(struct device *dev,
971#endif 966#endif
972 967
973#ifdef CONFIG_FS_ENET_HAS_SCC 968#ifdef CONFIG_FS_ENET_HAS_SCC
974 if (fs_get_scc_index(fpi->fs_no) >=0 ) 969 if (fs_get_scc_index(fpi->fs_no) >=0)
975 fep->ops = &fs_scc_ops; 970 fep->ops = &fs_scc_ops;
976#endif 971#endif
977 972
@@ -1066,9 +1061,8 @@ static struct net_device *fs_init_instance(struct device *dev,
1066 1061
1067 return ndev; 1062 return ndev;
1068 1063
1069 err: 1064err:
1070 if (ndev != NULL) { 1065 if (ndev != NULL) {
1071
1072 if (registered) 1066 if (registered)
1073 unregister_netdev(ndev); 1067 unregister_netdev(ndev);
1074 1068
@@ -1259,7 +1253,6 @@ static int __init fs_init(void)
1259err: 1253err:
1260 cleanup_immap(); 1254 cleanup_immap();
1261 return r; 1255 return r;
1262
1263} 1256}
1264 1257
1265static void __exit fs_cleanup(void) 1258static void __exit fs_cleanup(void)