Merge head 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

+37 -30
+7
drivers/net/8139cp.c
··· 1897 { 1898 struct net_device *dev; 1899 struct cp_private *cp; 1900 1901 dev = pci_get_drvdata (pdev); 1902 cp = netdev_priv(dev); ··· 1911 1912 cp_init_hw (cp); 1913 netif_start_queue (dev); 1914 1915 return 0; 1916 }
··· 1897 { 1898 struct net_device *dev; 1899 struct cp_private *cp; 1900 + unsigned long flags; 1901 1902 dev = pci_get_drvdata (pdev); 1903 cp = netdev_priv(dev); ··· 1910 1911 cp_init_hw (cp); 1912 netif_start_queue (dev); 1913 + 1914 + spin_lock_irqsave (&cp->lock, flags); 1915 + 1916 + mii_check_media(&cp->mii_if, netif_msg_link(cp), FALSE); 1917 + 1918 + spin_unlock_irqrestore (&cp->lock, flags); 1919 1920 return 0; 1921 }
+26 -26
drivers/net/dm9000.c
··· 48 * net_device_stats 49 * * introduced tx_timeout function 50 * * reworked locking 51 */ 52 53 #include <linux/module.h> ··· 152 static int dm9000_open(struct net_device *); 153 static int dm9000_start_xmit(struct sk_buff *, struct net_device *); 154 static int dm9000_stop(struct net_device *); 155 - static int dm9000_do_ioctl(struct net_device *, struct ifreq *, int); 156 157 158 static void dm9000_timer(unsigned long); ··· 325 326 /* Save previous register address */ 327 reg_save = readb(db->io_addr); 328 - spin_lock_irqsave(db->lock,flags); 329 330 netif_stop_queue(dev); 331 dm9000_reset(db); ··· 336 337 /* Restore previous register address */ 338 writeb(reg_save, db->io_addr); 339 - spin_unlock_irqrestore(db->lock,flags); 340 } 341 342 ··· 390 int i; 391 u32 id_val; 392 393 - printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); 394 - 395 /* Init network device */ 396 ndev = alloc_etherdev(sizeof (struct board_info)); 397 if (!ndev) { ··· 405 /* setup board info structure */ 406 db = (struct board_info *) ndev->priv; 407 memset(db, 0, sizeof (*db)); 408 409 if (pdev->num_resources < 2) { 410 ret = -ENODEV; ··· 544 ndev->stop = &dm9000_stop; 545 ndev->get_stats = &dm9000_get_stats; 546 ndev->set_multicast_list = &dm9000_hash_table; 547 - ndev->do_ioctl = &dm9000_do_ioctl; 548 549 #ifdef DM9000_PROGRAM_EEPROM 550 program_eeprom(db); ··· 614 615 /* set and active a timer process */ 616 init_timer(&db->timer); 617 - db->timer.expires = DM9000_TIMER_WUT * 2; 618 db->timer.data = (unsigned long) dev; 619 db->timer.function = &dm9000_timer; 620 add_timer(&db->timer); ··· 847 return &db->stats; 848 } 849 850 - /* 851 - * Process the upper socket ioctl command 852 - */ 853 - static int 854 - dm9000_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 855 - { 856 - PRINTK1("entering %s\n",__FUNCTION__); 857 - return 0; 858 - } 859 860 /* 861 * A periodic timer routine ··· 857 { 858 struct net_device *dev = (struct net_device *) data; 859 board_info_t *db = (board_info_t *) dev->priv; 860 - u8 reg_save; 861 - unsigned long flags; 862 863 PRINTK3("dm9000_timer()\n"); 864 865 - spin_lock_irqsave(db->lock,flags); 866 - /* Save previous register address */ 867 - reg_save = readb(db->io_addr); 868 - 869 mii_check_media(&db->mii, netif_msg_link(db), 0); 870 - 871 - /* Restore previous register address */ 872 - writeb(reg_save, db->io_addr); 873 - spin_unlock_irqrestore(db->lock,flags); 874 875 /* Set timer again */ 876 db->timer.expires = DM9000_TIMER_WUT; ··· 1081 { 1082 board_info_t *db = (board_info_t *) dev->priv; 1083 unsigned long flags; 1084 int ret; 1085 1086 spin_lock_irqsave(&db->lock,flags); 1087 /* Fill the phyxcer register into REG_0C */ 1088 iow(db, DM9000_EPAR, DM9000_PHY | reg); 1089 ··· 1098 1099 /* The read data keeps on REG_0D & REG_0E */ 1100 ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); 1101 1102 spin_unlock_irqrestore(&db->lock,flags); 1103 ··· 1115 { 1116 board_info_t *db = (board_info_t *) dev->priv; 1117 unsigned long flags; 1118 1119 spin_lock_irqsave(&db->lock,flags); 1120 1121 /* Fill the phyxcer register into REG_0C */ 1122 iow(db, DM9000_EPAR, DM9000_PHY | reg); ··· 1132 iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */ 1133 udelay(500); /* Wait write complete */ 1134 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ 1135 1136 spin_unlock_irqrestore(&db->lock,flags); 1137 } ··· 1200 static int __init 1201 dm9000_init(void) 1202 { 1203 return driver_register(&dm9000_driver); /* search board and register */ 1204 } 1205
··· 48 * net_device_stats 49 * * introduced tx_timeout function 50 * * reworked locking 51 + * 52 + * 01-Jul-2005 Ben Dooks <ben@simtec.co.uk> 53 + * * fixed spinlock call without pointer 54 + * * ensure spinlock is initialised 55 */ 56 57 #include <linux/module.h> ··· 148 static int dm9000_open(struct net_device *); 149 static int dm9000_start_xmit(struct sk_buff *, struct net_device *); 150 static int dm9000_stop(struct net_device *); 151 152 153 static void dm9000_timer(unsigned long); ··· 322 323 /* Save previous register address */ 324 reg_save = readb(db->io_addr); 325 + spin_lock_irqsave(&db->lock,flags); 326 327 netif_stop_queue(dev); 328 dm9000_reset(db); ··· 333 334 /* Restore previous register address */ 335 writeb(reg_save, db->io_addr); 336 + spin_unlock_irqrestore(&db->lock,flags); 337 } 338 339 ··· 387 int i; 388 u32 id_val; 389 390 /* Init network device */ 391 ndev = alloc_etherdev(sizeof (struct board_info)); 392 if (!ndev) { ··· 404 /* setup board info structure */ 405 db = (struct board_info *) ndev->priv; 406 memset(db, 0, sizeof (*db)); 407 + 408 + spin_lock_init(&db->lock); 409 410 if (pdev->num_resources < 2) { 411 ret = -ENODEV; ··· 541 ndev->stop = &dm9000_stop; 542 ndev->get_stats = &dm9000_get_stats; 543 ndev->set_multicast_list = &dm9000_hash_table; 544 545 #ifdef DM9000_PROGRAM_EEPROM 546 program_eeprom(db); ··· 612 613 /* set and active a timer process */ 614 init_timer(&db->timer); 615 + db->timer.expires = DM9000_TIMER_WUT; 616 db->timer.data = (unsigned long) dev; 617 db->timer.function = &dm9000_timer; 618 add_timer(&db->timer); ··· 845 return &db->stats; 846 } 847 848 849 /* 850 * A periodic timer routine ··· 864 { 865 struct net_device *dev = (struct net_device *) data; 866 board_info_t *db = (board_info_t *) dev->priv; 867 868 PRINTK3("dm9000_timer()\n"); 869 870 mii_check_media(&db->mii, netif_msg_link(db), 0); 871 872 /* Set timer again */ 873 db->timer.expires = DM9000_TIMER_WUT; ··· 1098 { 1099 board_info_t *db = (board_info_t *) dev->priv; 1100 unsigned long flags; 1101 + unsigned int reg_save; 1102 int ret; 1103 1104 spin_lock_irqsave(&db->lock,flags); 1105 + 1106 + /* Save previous register address */ 1107 + reg_save = readb(db->io_addr); 1108 + 1109 /* Fill the phyxcer register into REG_0C */ 1110 iow(db, DM9000_EPAR, DM9000_PHY | reg); 1111 ··· 1110 1111 /* The read data keeps on REG_0D & REG_0E */ 1112 ret = (ior(db, DM9000_EPDRH) << 8) | ior(db, DM9000_EPDRL); 1113 + 1114 + /* restore the previous address */ 1115 + writeb(reg_save, db->io_addr); 1116 1117 spin_unlock_irqrestore(&db->lock,flags); 1118 ··· 1124 { 1125 board_info_t *db = (board_info_t *) dev->priv; 1126 unsigned long flags; 1127 + unsigned long reg_save; 1128 1129 spin_lock_irqsave(&db->lock,flags); 1130 + 1131 + /* Save previous register address */ 1132 + reg_save = readb(db->io_addr); 1133 1134 /* Fill the phyxcer register into REG_0C */ 1135 iow(db, DM9000_EPAR, DM9000_PHY | reg); ··· 1137 iow(db, DM9000_EPCR, 0xa); /* Issue phyxcer write command */ 1138 udelay(500); /* Wait write complete */ 1139 iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */ 1140 + 1141 + /* restore the previous address */ 1142 + writeb(reg_save, db->io_addr); 1143 1144 spin_unlock_irqrestore(&db->lock,flags); 1145 } ··· 1202 static int __init 1203 dm9000_init(void) 1204 { 1205 + printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); 1206 + 1207 return driver_register(&dm9000_driver); /* search board and register */ 1208 } 1209
+4 -4
drivers/net/ioc3-eth.c
··· 499 ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); 500 while (ioc3_r_micr() & MICR_BUSY); 501 502 - return ioc3_r_micr() & MIDR_DATA_MASK; 503 } 504 505 static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) ··· 1291 dev->features = NETIF_F_IP_CSUM; 1292 #endif 1293 1294 - ioc3_setup_duplex(ip); 1295 sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); 1296 sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); 1297 ··· 1299 goto out_stop; 1300 1301 mii_check_media(&ip->mii, 1, 1); 1302 1303 vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); 1304 model = (sw_physid2 >> 4) & 0x3f; ··· 1524 struct ethtool_drvinfo *info) 1525 { 1526 struct ioc3_private *ip = netdev_priv(dev); 1527 - 1528 strcpy (info->driver, IOC3_NAME); 1529 strcpy (info->version, IOC3_VERSION); 1530 strcpy (info->bus_info, pci_name(ip->pdev)); ··· 1550 spin_lock_irq(&ip->ioc3_lock); 1551 rc = mii_ethtool_sset(&ip->mii, cmd); 1552 spin_unlock_irq(&ip->ioc3_lock); 1553 - 1554 return rc; 1555 } 1556
··· 499 ioc3_w_micr((phy << MICR_PHYADDR_SHIFT) | reg | MICR_READTRIG); 500 while (ioc3_r_micr() & MICR_BUSY); 501 502 + return ioc3_r_midr_r() & MIDR_DATA_MASK; 503 } 504 505 static void ioc3_mdio_write(struct net_device *dev, int phy, int reg, int data) ··· 1291 dev->features = NETIF_F_IP_CSUM; 1292 #endif 1293 1294 sw_physid1 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID1); 1295 sw_physid2 = ioc3_mdio_read(dev, ip->mii.phy_id, MII_PHYSID2); 1296 ··· 1300 goto out_stop; 1301 1302 mii_check_media(&ip->mii, 1, 1); 1303 + ioc3_setup_duplex(ip); 1304 1305 vendor = (sw_physid1 << 12) | (sw_physid2 >> 4); 1306 model = (sw_physid2 >> 4) & 0x3f; ··· 1524 struct ethtool_drvinfo *info) 1525 { 1526 struct ioc3_private *ip = netdev_priv(dev); 1527 + 1528 strcpy (info->driver, IOC3_NAME); 1529 strcpy (info->version, IOC3_VERSION); 1530 strcpy (info->bus_info, pci_name(ip->pdev)); ··· 1550 spin_lock_irq(&ip->ioc3_lock); 1551 rc = mii_ethtool_sset(&ip->mii, cmd); 1552 spin_unlock_irq(&ip->ioc3_lock); 1553 + 1554 return rc; 1555 } 1556