aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-03 03:15:35 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-03 03:15:35 -0500
commitb3ff29d2ccfe3af065a9b393699a8fbf2abd1b15 (patch)
tree99e5b423473097756353d038f922b2623f3edd2a /drivers/net
parent1bded710a574f20d41bc9e7fb531301db282d623 (diff)
parentfb53fde9762432d091dac209bdf4f3f850117c55 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/Kconfig
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig4
-rw-r--r--drivers/net/cassini.c4
-rw-r--r--drivers/net/fec.c2
-rw-r--r--drivers/net/ibm_newemac/phy.c4
-rw-r--r--drivers/net/igb/e1000_82575.c11
-rw-r--r--drivers/net/igb/igb.h9
-rw-r--r--drivers/net/igb/igb_main.c24
-rw-r--r--drivers/net/ps3_gelic_wireless.c2
-rw-r--r--drivers/net/qlge/qlge.h10
-rw-r--r--drivers/net/qlge/qlge_main.c25
-rw-r--r--drivers/net/smc911x.c4
-rw-r--r--drivers/net/smsc9420.c12
-rw-r--r--drivers/net/sungem.c2
-rw-r--r--drivers/net/sungem_phy.c2
-rw-r--r--drivers/net/sunqe.c2
-rw-r--r--drivers/net/tsi108_eth.c2
-rw-r--r--drivers/net/tulip/de2104x.c2
17 files changed, 68 insertions, 53 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0ec01e42e9b1..49f4d50abc56 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1828,8 +1828,8 @@ config 68360_ENET
1828 the Motorola 68360 processor. 1828 the Motorola 68360 processor.
1829 1829
1830config FEC 1830config FEC
1831 bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)" 1831 bool "FEC ethernet controller (of ColdFire CPUs)"
1832 depends on M523x || M527x || M5272 || M528x || M520x || MACH_MX27 1832 depends on M523x || M527x || M5272 || M528x || M520x || M532x || MACH_MX27
1833 help 1833 help
1834 Say Y here if you want to use the built-in 10/100 Fast ethernet 1834 Say Y here if you want to use the built-in 10/100 Fast ethernet
1835 controller on some Motorola ColdFire and Freescale i.MX processors. 1835 controller on some Motorola ColdFire and Freescale i.MX processors.
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index bb46be275339..0effefa1b882 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -806,7 +806,7 @@ static int cas_reset_mii_phy(struct cas *cp)
806 806
807 cas_phy_write(cp, MII_BMCR, BMCR_RESET); 807 cas_phy_write(cp, MII_BMCR, BMCR_RESET);
808 udelay(100); 808 udelay(100);
809 while (limit--) { 809 while (--limit) {
810 val = cas_phy_read(cp, MII_BMCR); 810 val = cas_phy_read(cp, MII_BMCR);
811 if ((val & BMCR_RESET) == 0) 811 if ((val & BMCR_RESET) == 0)
812 break; 812 break;
@@ -979,7 +979,7 @@ static void cas_phy_init(struct cas *cp)
979 writel(val, cp->regs + REG_PCS_MII_CTRL); 979 writel(val, cp->regs + REG_PCS_MII_CTRL);
980 980
981 limit = STOP_TRIES; 981 limit = STOP_TRIES;
982 while (limit-- > 0) { 982 while (--limit > 0) {
983 udelay(10); 983 udelay(10);
984 if ((readl(cp->regs + REG_PCS_MII_CTRL) & 984 if ((readl(cp->regs + REG_PCS_MII_CTRL) &
985 PCS_MII_RESET) == 0) 985 PCS_MII_RESET) == 0)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index ea23baaf0256..fe2650237e34 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1675,7 +1675,7 @@ static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_priva
1675 /* 1675 /*
1676 * Set MII speed to 2.5 MHz 1676 * Set MII speed to 2.5 MHz
1677 */ 1677 */
1678 fep->phy_speed = ((((MCF_CLK / 2) / (2500000 / 10)) + 5) / 10) * 2; 1678 fep->phy_speed = (MCF_CLK / 3) / (2500000 * 2 ) * 2;
1679 fecp->fec_mii_speed = fep->phy_speed; 1679 fecp->fec_mii_speed = fep->phy_speed;
1680 1680
1681 fec_restart(dev, 0); 1681 fec_restart(dev, 0);
diff --git a/drivers/net/ibm_newemac/phy.c b/drivers/net/ibm_newemac/phy.c
index c40cd8df2212..ac9d964e59ec 100644
--- a/drivers/net/ibm_newemac/phy.c
+++ b/drivers/net/ibm_newemac/phy.c
@@ -60,7 +60,7 @@ int emac_mii_reset_phy(struct mii_phy *phy)
60 60
61 udelay(300); 61 udelay(300);
62 62
63 while (limit--) { 63 while (--limit) {
64 val = phy_read(phy, MII_BMCR); 64 val = phy_read(phy, MII_BMCR);
65 if (val >= 0 && (val & BMCR_RESET) == 0) 65 if (val >= 0 && (val & BMCR_RESET) == 0)
66 break; 66 break;
@@ -84,7 +84,7 @@ int emac_mii_reset_gpcs(struct mii_phy *phy)
84 84
85 udelay(300); 85 udelay(300);
86 86
87 while (limit--) { 87 while (--limit) {
88 val = gpcs_phy_read(phy, MII_BMCR); 88 val = gpcs_phy_read(phy, MII_BMCR);
89 if (val >= 0 && (val & BMCR_RESET) == 0) 89 if (val >= 0 && (val & BMCR_RESET) == 0)
90 break; 90 break;
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 9b367ba8e26f..f5e4cad7971a 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -699,11 +699,18 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
699 699
700 /* SGMII link check is done through the PCS register. */ 700 /* SGMII link check is done through the PCS register. */
701 if ((hw->phy.media_type != e1000_media_type_copper) || 701 if ((hw->phy.media_type != e1000_media_type_copper) ||
702 (igb_sgmii_active_82575(hw))) 702 (igb_sgmii_active_82575(hw))) {
703 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, 703 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
704 &duplex); 704 &duplex);
705 else 705 /*
706 * Use this flag to determine if link needs to be checked or
707 * not. If we have link clear the flag so that we do not
708 * continue to check for link.
709 */
710 hw->mac.get_link_status = !hw->mac.serdes_has_link;
711 } else {
706 ret_val = igb_check_for_copper_link(hw); 712 ret_val = igb_check_for_copper_link(hw);
713 }
707 714
708 return ret_val; 715 return ret_val;
709} 716}
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 7d8c88739154..30657ddf4842 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -284,11 +284,10 @@ struct igb_adapter {
284 284
285#define IGB_FLAG_HAS_MSI (1 << 0) 285#define IGB_FLAG_HAS_MSI (1 << 0)
286#define IGB_FLAG_MSI_ENABLE (1 << 1) 286#define IGB_FLAG_MSI_ENABLE (1 << 1)
287#define IGB_FLAG_HAS_DCA (1 << 2) 287#define IGB_FLAG_DCA_ENABLED (1 << 2)
288#define IGB_FLAG_DCA_ENABLED (1 << 3) 288#define IGB_FLAG_IN_NETPOLL (1 << 3)
289#define IGB_FLAG_IN_NETPOLL (1 << 5) 289#define IGB_FLAG_QUAD_PORT_A (1 << 4)
290#define IGB_FLAG_QUAD_PORT_A (1 << 6) 290#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
291#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
292 291
293enum e1000_state_t { 292enum e1000_state_t {
294 __IGB_TESTING, 293 __IGB_TESTING,
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index cd794bac8b80..8b80fe343435 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -203,10 +203,11 @@ static int __init igb_init_module(void)
203 203
204 global_quad_port_a = 0; 204 global_quad_port_a = 0;
205 205
206 ret = pci_register_driver(&igb_driver);
207#ifdef CONFIG_IGB_DCA 206#ifdef CONFIG_IGB_DCA
208 dca_register_notify(&dca_notifier); 207 dca_register_notify(&dca_notifier);
209#endif 208#endif
209
210 ret = pci_register_driver(&igb_driver);
210 return ret; 211 return ret;
211} 212}
212 213
@@ -1153,11 +1154,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1153 1154
1154 /* set flags */ 1155 /* set flags */
1155 switch (hw->mac.type) { 1156 switch (hw->mac.type) {
1156 case e1000_82576:
1157 case e1000_82575: 1157 case e1000_82575:
1158 adapter->flags |= IGB_FLAG_HAS_DCA;
1159 adapter->flags |= IGB_FLAG_NEED_CTX_IDX; 1158 adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
1160 break; 1159 break;
1160 case e1000_82576:
1161 default: 1161 default:
1162 break; 1162 break;
1163 } 1163 }
@@ -1306,8 +1306,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1306 goto err_register; 1306 goto err_register;
1307 1307
1308#ifdef CONFIG_IGB_DCA 1308#ifdef CONFIG_IGB_DCA
1309 if ((adapter->flags & IGB_FLAG_HAS_DCA) && 1309 if (dca_add_requester(&pdev->dev) == 0) {
1310 (dca_add_requester(&pdev->dev) == 0)) {
1311 adapter->flags |= IGB_FLAG_DCA_ENABLED; 1310 adapter->flags |= IGB_FLAG_DCA_ENABLED;
1312 dev_info(&pdev->dev, "DCA enabled\n"); 1311 dev_info(&pdev->dev, "DCA enabled\n");
1313 /* Always use CB2 mode, difference is masked 1312 /* Always use CB2 mode, difference is masked
@@ -1819,11 +1818,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
1819 rctl |= E1000_RCTL_SECRC; 1818 rctl |= E1000_RCTL_SECRC;
1820 1819
1821 /* 1820 /*
1822 * disable store bad packets, long packet enable, and clear size bits. 1821 * disable store bad packets and clear size bits.
1823 */ 1822 */
1824 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); 1823 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
1825 1824
1826 if (adapter->netdev->mtu > ETH_DATA_LEN) 1825 /* enable LPE when to prevent packets larger than max_frame_size */
1827 rctl |= E1000_RCTL_LPE; 1826 rctl |= E1000_RCTL_LPE;
1828 1827
1829 /* Setup buffer sizes */ 1828 /* Setup buffer sizes */
@@ -1849,7 +1848,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
1849 */ 1848 */
1850 /* allocations using alloc_page take too long for regular MTU 1849 /* allocations using alloc_page take too long for regular MTU
1851 * so only enable packet split for jumbo frames */ 1850 * so only enable packet split for jumbo frames */
1852 if (rctl & E1000_RCTL_LPE) { 1851 if (adapter->netdev->mtu > ETH_DATA_LEN) {
1853 adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; 1852 adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
1854 srrctl |= adapter->rx_ps_hdr_size << 1853 srrctl |= adapter->rx_ps_hdr_size <<
1855 E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; 1854 E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
@@ -3442,19 +3441,16 @@ static int __igb_notify_dca(struct device *dev, void *data)
3442 struct e1000_hw *hw = &adapter->hw; 3441 struct e1000_hw *hw = &adapter->hw;
3443 unsigned long event = *(unsigned long *)data; 3442 unsigned long event = *(unsigned long *)data;
3444 3443
3445 if (!(adapter->flags & IGB_FLAG_HAS_DCA))
3446 goto out;
3447
3448 switch (event) { 3444 switch (event) {
3449 case DCA_PROVIDER_ADD: 3445 case DCA_PROVIDER_ADD:
3450 /* if already enabled, don't do it again */ 3446 /* if already enabled, don't do it again */
3451 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3447 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3452 break; 3448 break;
3453 adapter->flags |= IGB_FLAG_DCA_ENABLED;
3454 /* Always use CB2 mode, difference is masked 3449 /* Always use CB2 mode, difference is masked
3455 * in the CB driver. */ 3450 * in the CB driver. */
3456 wr32(E1000_DCA_CTRL, 2); 3451 wr32(E1000_DCA_CTRL, 2);
3457 if (dca_add_requester(dev) == 0) { 3452 if (dca_add_requester(dev) == 0) {
3453 adapter->flags |= IGB_FLAG_DCA_ENABLED;
3458 dev_info(&adapter->pdev->dev, "DCA enabled\n"); 3454 dev_info(&adapter->pdev->dev, "DCA enabled\n");
3459 igb_setup_dca(adapter); 3455 igb_setup_dca(adapter);
3460 break; 3456 break;
@@ -3471,7 +3467,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
3471 } 3467 }
3472 break; 3468 break;
3473 } 3469 }
3474out: 3470
3475 return 0; 3471 return 0;
3476} 3472}
3477 3473
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 708ae067c331..a5ac2bd58b5b 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -2168,7 +2168,7 @@ static void gelic_wl_connected_event(struct gelic_wl_info *wl,
2168 complete(&wl->assoc_done); 2168 complete(&wl->assoc_done);
2169 netif_carrier_on(port_to_netdev(wl_port(wl))); 2169 netif_carrier_on(port_to_netdev(wl_port(wl)));
2170 } else 2170 } else
2171 pr_debug("%s: event %#lx under wpa\n", 2171 pr_debug("%s: event %#llx under wpa\n",
2172 __func__, event); 2172 __func__, event);
2173} 2173}
2174 2174
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index c1dadadfab18..e6fdce9206cc 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -787,12 +787,12 @@ struct mbox_params {
787 787
788struct flash_params { 788struct flash_params {
789 u8 dev_id_str[4]; 789 u8 dev_id_str[4];
790 u16 size; 790 __le16 size;
791 u16 csum; 791 __le16 csum;
792 u16 ver; 792 __le16 ver;
793 u16 sub_dev_id; 793 __le16 sub_dev_id;
794 u8 mac_addr[6]; 794 u8 mac_addr[6];
795 u16 res; 795 __le16 res;
796}; 796};
797 797
798 798
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 4ab6e72ea95c..04bf2122264a 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -641,7 +641,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev)
641 641
642} 642}
643 643
644static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) 644static int ql_read_flash_word(struct ql_adapter *qdev, int offset, __le32 *data)
645{ 645{
646 int status = 0; 646 int status = 0;
647 /* wait for reg to come ready */ 647 /* wait for reg to come ready */
@@ -656,8 +656,11 @@ static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
656 FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR); 656 FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR);
657 if (status) 657 if (status)
658 goto exit; 658 goto exit;
659 /* get the data */ 659 /* This data is stored on flash as an array of
660 *data = ql_read32(qdev, FLASH_DATA); 660 * __le32. Since ql_read32() returns cpu endian
661 * we need to swap it back.
662 */
663 *data = cpu_to_le32(ql_read32(qdev, FLASH_DATA));
661exit: 664exit:
662 return status; 665 return status;
663} 666}
@@ -666,13 +669,20 @@ static int ql_get_flash_params(struct ql_adapter *qdev)
666{ 669{
667 int i; 670 int i;
668 int status; 671 int status;
669 u32 *p = (u32 *)&qdev->flash; 672 __le32 *p = (__le32 *)&qdev->flash;
673 u32 offset = 0;
674
675 /* Second function's parameters follow the first
676 * function's.
677 */
678 if (qdev->func)
679 offset = sizeof(qdev->flash) / sizeof(u32);
670 680
671 if (ql_sem_spinlock(qdev, SEM_FLASH_MASK)) 681 if (ql_sem_spinlock(qdev, SEM_FLASH_MASK))
672 return -ETIMEDOUT; 682 return -ETIMEDOUT;
673 683
674 for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) { 684 for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) {
675 status = ql_read_flash_word(qdev, i, p); 685 status = ql_read_flash_word(qdev, i+offset, p);
676 if (status) { 686 if (status) {
677 QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n"); 687 QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n");
678 goto exit; 688 goto exit;
@@ -3827,7 +3837,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
3827{ 3837{
3828 struct net_device *ndev = pci_get_drvdata(pdev); 3838 struct net_device *ndev = pci_get_drvdata(pdev);
3829 struct ql_adapter *qdev = netdev_priv(ndev); 3839 struct ql_adapter *qdev = netdev_priv(ndev);
3830 int err; 3840 int err, i;
3831 3841
3832 netif_device_detach(ndev); 3842 netif_device_detach(ndev);
3833 3843
@@ -3837,6 +3847,9 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
3837 return err; 3847 return err;
3838 } 3848 }
3839 3849
3850 for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++)
3851 netif_napi_del(&qdev->rx_ring[i].napi);
3852
3840 err = pci_save_state(pdev); 3853 err = pci_save_state(pdev);
3841 if (err) 3854 if (err)
3842 return err; 3855 return err;
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 211213c6ab5c..293610334a77 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev)
220 220
221 /* make sure EEPROM has finished loading before setting GPIO_CFG */ 221 /* make sure EEPROM has finished loading before setting GPIO_CFG */
222 timeout=1000; 222 timeout=1000;
223 while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) { 223 while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
224 udelay(10); 224 udelay(10);
225 } 225
226 if (timeout == 0){ 226 if (timeout == 0){
227 PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name); 227 PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
228 return; 228 return;
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index 1aa9be3975ed..da8b977a5357 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -498,7 +498,7 @@ static void smsc9420_check_mac_address(struct net_device *dev)
498static void smsc9420_stop_tx(struct smsc9420_pdata *pd) 498static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
499{ 499{
500 u32 dmac_control, mac_cr, dma_intr_ena; 500 u32 dmac_control, mac_cr, dma_intr_ena;
501 int timeOut = 1000; 501 int timeout = 1000;
502 502
503 /* disable TX DMAC */ 503 /* disable TX DMAC */
504 dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL); 504 dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL);
@@ -506,13 +506,13 @@ static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
506 smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control); 506 smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control);
507 507
508 /* Wait max 10ms for transmit process to stop */ 508 /* Wait max 10ms for transmit process to stop */
509 while (timeOut--) { 509 while (--timeout) {
510 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_) 510 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_)
511 break; 511 break;
512 udelay(10); 512 udelay(10);
513 } 513 }
514 514
515 if (!timeOut) 515 if (!timeout)
516 smsc_warn(IFDOWN, "TX DMAC failed to stop"); 516 smsc_warn(IFDOWN, "TX DMAC failed to stop");
517 517
518 /* ACK Tx DMAC stop bit */ 518 /* ACK Tx DMAC stop bit */
@@ -596,7 +596,7 @@ static void smsc9420_free_rx_ring(struct smsc9420_pdata *pd)
596 596
597static void smsc9420_stop_rx(struct smsc9420_pdata *pd) 597static void smsc9420_stop_rx(struct smsc9420_pdata *pd)
598{ 598{
599 int timeOut = 1000; 599 int timeout = 1000;
600 u32 mac_cr, dmac_control, dma_intr_ena; 600 u32 mac_cr, dmac_control, dma_intr_ena;
601 601
602 /* mask RX DMAC interrupts */ 602 /* mask RX DMAC interrupts */
@@ -617,13 +617,13 @@ static void smsc9420_stop_rx(struct smsc9420_pdata *pd)
617 smsc9420_pci_flush_write(pd); 617 smsc9420_pci_flush_write(pd);
618 618
619 /* wait up to 10ms for receive to stop */ 619 /* wait up to 10ms for receive to stop */
620 while (timeOut--) { 620 while (--timeout) {
621 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_) 621 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_)
622 break; 622 break;
623 udelay(10); 623 udelay(10);
624 } 624 }
625 625
626 if (!timeOut) 626 if (!timeout)
627 smsc_warn(IFDOWN, "RX DMAC did not stop! timeout."); 627 smsc_warn(IFDOWN, "RX DMAC did not stop! timeout.");
628 628
629 /* ACK the Rx DMAC stop bit */ 629 /* ACK the Rx DMAC stop bit */
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4942059109f3..fc1e7f1d024b 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -148,7 +148,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg)
148 cmd |= (MIF_FRAME_TAMSB); 148 cmd |= (MIF_FRAME_TAMSB);
149 writel(cmd, gp->regs + MIF_FRAME); 149 writel(cmd, gp->regs + MIF_FRAME);
150 150
151 while (limit--) { 151 while (--limit) {
152 cmd = readl(gp->regs + MIF_FRAME); 152 cmd = readl(gp->regs + MIF_FRAME);
153 if (cmd & MIF_FRAME_TALSB) 153 if (cmd & MIF_FRAME_TALSB)
154 break; 154 break;
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c
index 61843fd57525..78f8cee5fd74 100644
--- a/drivers/net/sungem_phy.c
+++ b/drivers/net/sungem_phy.c
@@ -79,7 +79,7 @@ static int reset_one_mii_phy(struct mii_phy* phy, int phy_id)
79 79
80 udelay(100); 80 udelay(100);
81 81
82 while (limit--) { 82 while (--limit) {
83 val = __phy_read(phy, phy_id, MII_BMCR); 83 val = __phy_read(phy, phy_id, MII_BMCR);
84 if ((val & BMCR_RESET) == 0) 84 if ((val & BMCR_RESET) == 0)
85 break; 85 break;
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 6e8f377355fe..fe0c3f244562 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -227,7 +227,7 @@ static int qe_init(struct sunqe *qep, int from_irq)
227 if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) { 227 if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) {
228 int tries = 50; 228 int tries = 50;
229 229
230 while (tries--) { 230 while (--tries) {
231 u8 tmp; 231 u8 tmp;
232 232
233 mdelay(5); 233 mdelay(5);
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 1138782e5611..bb43e7fb2a50 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1237,7 +1237,7 @@ static void tsi108_init_phy(struct net_device *dev)
1237 spin_lock_irqsave(&phy_lock, flags); 1237 spin_lock_irqsave(&phy_lock, flags);
1238 1238
1239 tsi108_write_mii(data, MII_BMCR, BMCR_RESET); 1239 tsi108_write_mii(data, MII_BMCR, BMCR_RESET);
1240 while (i--){ 1240 while (--i) {
1241 if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET)) 1241 if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET))
1242 break; 1242 break;
1243 udelay(10); 1243 udelay(10);
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index d5d53b633cf8..0bf2114738be 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -392,7 +392,7 @@ static void de_rx (struct de_private *de)
392 unsigned drop = 0; 392 unsigned drop = 0;
393 int rc; 393 int rc;
394 394
395 while (rx_work--) { 395 while (--rx_work) {
396 u32 status, len; 396 u32 status, len;
397 dma_addr_t mapping; 397 dma_addr_t mapping;
398 struct sk_buff *skb, *copy_skb; 398 struct sk_buff *skb, *copy_skb;