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