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

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
forcedeth: fix cpu irq mask
chelsio parenthesis fix
spidernet: skb used after netif_receive_skb
meth driver renovation
remove unnecessary dependency on VIA velocity config
fix compiler warning in fixed.c
asix.c - Add Belkin F5D5055 ids
ucc_geth:trivial fix
ucc_geth: Fix MODULE_DEVICE_TABLE() duplication
[PATCH] drivers/net/wireless/libertas/rx.c: fix use-after-free
[PATCH] drivers/net/wireless/libertas/fw.c: fix use-before-check
[PATCH] libertas: skb dereferenced after netif_rx

+95 -60
+1 -1
arch/mips/sgi-ip32/Makefile
··· 3 # under Linux. 4 # 5 6 - obj-y += ip32-berr.o ip32-irq.o ip32-setup.o ip32-reset.o \ 7 crime.o ip32-memory.o
··· 3 # under Linux. 4 # 5 6 + obj-y += ip32-berr.o ip32-irq.o ip32-platform.o ip32-setup.o ip32-reset.o \ 7 crime.o ip32-memory.o
+20
arch/mips/sgi-ip32/ip32-platform.c
···
··· 1 + #include <linux/init.h> 2 + #include <linux/platform_device.h> 3 + 4 + static __init int meth_devinit(void) 5 + { 6 + struct platform_device *pd; 7 + int ret; 8 + 9 + pd = platform_device_alloc("meth", -1); 10 + if (!pd) 11 + return -ENOMEM; 12 + 13 + ret = platform_device_add(pd); 14 + if (ret) 15 + platform_device_put(pd); 16 + 17 + return ret; 18 + } 19 + 20 + device_initcall(meth_devinit);
+1 -1
drivers/net/Kconfig
··· 2218 2219 config VIA_VELOCITY 2220 tristate "VIA Velocity support" 2221 - depends on NET_PCI && PCI 2222 select CRC32 2223 select CRC_CCITT 2224 select MII
··· 2218 2219 config VIA_VELOCITY 2220 tristate "VIA Velocity support" 2221 + depends on PCI 2222 select CRC32 2223 select CRC_CCITT 2224 select MII
+1 -1
drivers/net/chelsio/suni1x10gexp_regs.h
··· 105 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_LOW(filterId) (0x204A + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 106 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_MID(filterId) (0x204B + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 107 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_HIGH(filterId)(0x204C + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 108 - #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_VID(filterId) (0x2062 + mSUNI1x10GEXP_MAC_VID_FILTER_OFFSET(filterId) 109 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_LOW 0x204A 110 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_MID 0x204B 111 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_HIGH 0x204C
··· 105 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_LOW(filterId) (0x204A + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 106 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_MID(filterId) (0x204B + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 107 #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_HIGH(filterId)(0x204C + mSUNI1x10GEXP_MAC_FILTER_OFFSET(filterId)) 108 + #define mSUNI1x10GEXP_REG_RXXG_EXACT_MATCH_VID(filterId) (0x2062 + mSUNI1x10GEXP_MAC_VID_FILTER_OFFSET(filterId)) 109 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_LOW 0x204A 110 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_MID 0x204B 111 #define SUNI1x10GEXP_REG_RXXG_EXACT_MATCH_ADDR_0_HIGH 0x204C
+1 -1
drivers/net/forcedeth.c
··· 195 #define NVREG_IRQ_TX_FORCED 0x0100 196 #define NVREG_IRQ_RECOVER_ERROR 0x8000 197 #define NVREG_IRQMASK_THROUGHPUT 0x00df 198 - #define NVREG_IRQMASK_CPU 0x0040 199 #define NVREG_IRQ_TX_ALL (NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED) 200 #define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED) 201 #define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR)
··· 195 #define NVREG_IRQ_TX_FORCED 0x0100 196 #define NVREG_IRQ_RECOVER_ERROR 0x8000 197 #define NVREG_IRQMASK_THROUGHPUT 0x00df 198 + #define NVREG_IRQMASK_CPU 0x0060 199 #define NVREG_IRQ_TX_ALL (NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED) 200 #define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED) 201 #define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR)
+45 -23
drivers/net/meth.c
··· 8 * as published by the Free Software Foundation; either version 9 * 2 of the License, or (at your option) any later version. 10 */ 11 - #include <linux/module.h> 12 - #include <linux/init.h> 13 - 14 - #include <linux/kernel.h> /* printk() */ 15 #include <linux/delay.h> 16 #include <linux/slab.h> 17 - #include <linux/errno.h> /* error codes */ 18 - #include <linux/types.h> /* size_t */ 19 - #include <linux/interrupt.h> /* mark_bh */ 20 21 #include <linux/in.h> 22 #include <linux/in6.h> ··· 34 35 #include <asm/io.h> 36 #include <asm/scatterlist.h> 37 - #include <linux/dma-mapping.h> 38 39 #include "meth.h" 40 ··· 51 52 53 static const char *meth_str="SGI O2 Fast Ethernet"; 54 - MODULE_AUTHOR("Ilya Volynets <ilya@theIlya.com>"); 55 - MODULE_DESCRIPTION("SGI O2 Builtin Fast Ethernet driver"); 56 57 #define HAVE_TX_TIMEOUT 58 /* The maximum time waited (in jiffies) before assuming a Tx failed. (400ms) */ ··· 782 /* 783 * The init function. 784 */ 785 - static struct net_device *meth_init(void) 786 { 787 struct net_device *dev; 788 struct meth_private *priv; 789 - int ret; 790 791 dev = alloc_etherdev(sizeof(struct meth_private)); 792 if (!dev) 793 - return ERR_PTR(-ENOMEM); 794 795 dev->open = meth_open; 796 dev->stop = meth_release; ··· 806 807 priv = netdev_priv(dev); 808 spin_lock_init(&priv->meth_lock); 809 810 - ret = register_netdev(dev); 811 - if (ret) { 812 free_netdev(dev); 813 - return ERR_PTR(ret); 814 } 815 816 printk(KERN_INFO "%s: SGI MACE Ethernet rev. %d\n", ··· 819 return 0; 820 } 821 822 - static struct net_device *meth_dev; 823 824 static int __init meth_init_module(void) 825 { 826 - meth_dev = meth_init(); 827 - if (IS_ERR(meth_dev)) 828 - return PTR_ERR(meth_dev); 829 - return 0; 830 } 831 832 static void __exit meth_exit_module(void) 833 { 834 - unregister_netdev(meth_dev); 835 - free_netdev(meth_dev); 836 } 837 838 module_init(meth_init_module); 839 module_exit(meth_exit_module);
··· 8 * as published by the Free Software Foundation; either version 9 * 2 of the License, or (at your option) any later version. 10 */ 11 #include <linux/delay.h> 12 + #include <linux/dma-mapping.h> 13 + #include <linux/init.h> 14 + #include <linux/kernel.h> 15 + #include <linux/module.h> 16 + #include <linux/platform_device.h> 17 #include <linux/slab.h> 18 + #include <linux/errno.h> 19 + #include <linux/types.h> 20 + #include <linux/interrupt.h> 21 22 #include <linux/in.h> 23 #include <linux/in6.h> ··· 33 34 #include <asm/io.h> 35 #include <asm/scatterlist.h> 36 37 #include "meth.h" 38 ··· 51 52 53 static const char *meth_str="SGI O2 Fast Ethernet"; 54 55 #define HAVE_TX_TIMEOUT 56 /* The maximum time waited (in jiffies) before assuming a Tx failed. (400ms) */ ··· 784 /* 785 * The init function. 786 */ 787 + static int __init meth_probe(struct platform_device *pdev) 788 { 789 struct net_device *dev; 790 struct meth_private *priv; 791 + int err; 792 793 dev = alloc_etherdev(sizeof(struct meth_private)); 794 if (!dev) 795 + return -ENOMEM; 796 797 dev->open = meth_open; 798 dev->stop = meth_release; ··· 808 809 priv = netdev_priv(dev); 810 spin_lock_init(&priv->meth_lock); 811 + SET_NETDEV_DEV(dev, &pdev->dev); 812 813 + err = register_netdev(dev); 814 + if (err) { 815 free_netdev(dev); 816 + return err; 817 } 818 819 printk(KERN_INFO "%s: SGI MACE Ethernet rev. %d\n", ··· 820 return 0; 821 } 822 823 + static int __exit meth_remove(struct platform_device *pdev) 824 + { 825 + struct net_device *dev = platform_get_drvdata(pdev); 826 + 827 + unregister_netdev(dev); 828 + free_netdev(dev); 829 + platform_set_drvdata(pdev, NULL); 830 + 831 + return 0; 832 + } 833 + 834 + static struct platform_driver meth_driver = { 835 + .probe = meth_probe, 836 + .remove = __devexit_p(meth_remove), 837 + .driver = { 838 + .name = "meth", 839 + } 840 + }; 841 842 static int __init meth_init_module(void) 843 { 844 + int err; 845 + 846 + err = platform_driver_register(&meth_driver); 847 + if (err) 848 + printk(KERN_ERR "Driver registration failed\n"); 849 + 850 + return err; 851 } 852 853 static void __exit meth_exit_module(void) 854 { 855 + platform_driver_unregister(&meth_driver); 856 } 857 858 module_init(meth_init_module); 859 module_exit(meth_exit_module); 860 + 861 + MODULE_AUTHOR("Ilya Volynets <ilya@theIlya.com>"); 862 + MODULE_DESCRIPTION("SGI O2 Builtin Fast Ethernet driver"); 863 + MODULE_LICENSE("GPL");
+4
drivers/net/phy/fixed.c
··· 89 /*----------------------------------------------------------------------------- 90 * This is used for updating internal mii regs from the status 91 *-----------------------------------------------------------------------------*/ 92 static int fixed_mdio_update_regs(struct fixed_info *fixed) 93 { 94 u16 *regs = fixed->regs; ··· 166 /*nothing here - no way/need to reset it*/ 167 return 0; 168 } 169 170 static int fixed_config_aneg(struct phy_device *phydev) 171 { ··· 196 * number is used to create multiple fixed PHYs, so that several devices can 197 * utilize them simultaneously. 198 *-----------------------------------------------------------------------------*/ 199 static int fixed_mdio_register_device(int number, int speed, int duplex) 200 { 201 struct mii_bus *new_bus; ··· 304 305 return err; 306 } 307 308 309 MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
··· 89 /*----------------------------------------------------------------------------- 90 * This is used for updating internal mii regs from the status 91 *-----------------------------------------------------------------------------*/ 92 + #if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) 93 static int fixed_mdio_update_regs(struct fixed_info *fixed) 94 { 95 u16 *regs = fixed->regs; ··· 165 /*nothing here - no way/need to reset it*/ 166 return 0; 167 } 168 + #endif 169 170 static int fixed_config_aneg(struct phy_device *phydev) 171 { ··· 194 * number is used to create multiple fixed PHYs, so that several devices can 195 * utilize them simultaneously. 196 *-----------------------------------------------------------------------------*/ 197 + #if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) 198 static int fixed_mdio_register_device(int number, int speed, int duplex) 199 { 200 struct mii_bus *new_bus; ··· 301 302 return err; 303 } 304 + #endif 305 306 307 MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
+3 -3
drivers/net/spider_net.c
··· 1014 */ 1015 } 1016 1017 - /* pass skb up to stack */ 1018 - netif_receive_skb(skb); 1019 - 1020 /* update netdevice statistics */ 1021 card->netdev_stats.rx_packets++; 1022 card->netdev_stats.rx_bytes += skb->len; 1023 } 1024 1025 #ifdef DEBUG
··· 1014 */ 1015 } 1016 1017 /* update netdevice statistics */ 1018 card->netdev_stats.rx_packets++; 1019 card->netdev_stats.rx_bytes += skb->len; 1020 + 1021 + /* pass skb up to stack */ 1022 + netif_receive_skb(skb); 1023 } 1024 1025 #ifdef DEBUG
-3
drivers/net/ucc_geth.c
··· 23 #include <linux/skbuff.h> 24 #include <linux/spinlock.h> 25 #include <linux/mm.h> 26 - #include <linux/ethtool.h> 27 - #include <linux/delay.h> 28 #include <linux/dma-mapping.h> 29 #include <linux/fsl_devices.h> 30 - #include <linux/ethtool.h> 31 #include <linux/mii.h> 32 #include <linux/phy.h> 33 #include <linux/workqueue.h>
··· 23 #include <linux/skbuff.h> 24 #include <linux/spinlock.h> 25 #include <linux/mm.h> 26 #include <linux/dma-mapping.h> 27 #include <linux/fsl_devices.h> 28 #include <linux/mii.h> 29 #include <linux/phy.h> 30 #include <linux/workqueue.h>
-2
drivers/net/ucc_geth_mii.c
··· 260 {}, 261 }; 262 263 - MODULE_DEVICE_TABLE(of, uec_mdio_match); 264 - 265 static struct of_platform_driver uec_mdio_driver = { 266 .name = DRV_NAME, 267 .probe = uec_mdio_probe,
··· 260 {}, 261 }; 262 263 static struct of_platform_driver uec_mdio_driver = { 264 .name = DRV_NAME, 265 .probe = uec_mdio_probe,
+4
drivers/net/usb/asix.c
··· 1458 // IO-DATA ETG-US2 1459 USB_DEVICE (0x04bb, 0x0930), 1460 .driver_info = (unsigned long) &ax88178_info, 1461 }, 1462 { }, // END 1463 };
··· 1458 // IO-DATA ETG-US2 1459 USB_DEVICE (0x04bb, 0x0930), 1460 .driver_info = (unsigned long) &ax88178_info, 1461 + }, { 1462 + // Belkin F5D5055 1463 + USB_DEVICE(0x050d, 0x5055), 1464 + .driver_info = (unsigned long) &ax88178_info, 1465 }, 1466 { }, // END 1467 };
+1 -1
drivers/net/wireless/libertas/decl.h
··· 46 u8 libertas_data_rate_to_index(u32 rate); 47 void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen); 48 49 - int libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb); 50 51 /** The proc fs interface */ 52 int libertas_process_rx_command(wlan_private * priv);
··· 46 u8 libertas_data_rate_to_index(u32 rate); 47 void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen); 48 49 + void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb); 50 51 /** The proc fs interface */ 52 int libertas_process_rx_command(wlan_private * priv);
+9 -5
drivers/net/wireless/libertas/fw.c
··· 333 unsigned long flags; 334 335 ptempnode = adapter->cur_cmd; 336 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; 337 338 lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); 339 340 if (!adapter->fw_ready) 341 return; 342 - 343 - if (ptempnode == NULL) { 344 - lbs_pr_debug(1, "PTempnode Empty\n"); 345 - return; 346 - } 347 348 spin_lock_irqsave(&adapter->driver_lock, flags); 349 adapter->cur_cmd = NULL;
··· 333 unsigned long flags; 334 335 ptempnode = adapter->cur_cmd; 336 + if (ptempnode == NULL) { 337 + lbs_pr_debug(1, "PTempnode Empty\n"); 338 + return; 339 + } 340 + 341 cmd = (struct cmd_ds_command *)ptempnode->bufvirtualaddr; 342 + if (!cmd) { 343 + lbs_pr_debug(1, "cmd is NULL\n"); 344 + return; 345 + } 346 347 lbs_pr_info("command_timer_fn fired (%x)\n", cmd->command); 348 349 if (!adapter->fw_ready) 350 return; 351 352 spin_lock_irqsave(&adapter->driver_lock, flags); 353 adapter->cur_cmd = NULL;
+5 -19
drivers/net/wireless/libertas/rx.c
··· 136 LEAVE(); 137 } 138 139 - int libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) 140 { 141 lbs_pr_debug(1, "skb->data=%p\n", skb->data); 142 ··· 148 skb->ip_summed = CHECKSUM_UNNECESSARY; 149 150 netif_rx(skb); 151 - 152 - return 0; 153 } 154 155 /** ··· 267 wlan_compute_rssi(priv, p_rx_pd); 268 269 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 270 - if (libertas_upload_rx_packet(priv, skb)) { 271 - lbs_pr_debug(1, "RX error: libertas_upload_rx_packet" 272 - " returns failure\n"); 273 - ret = -1; 274 - goto done; 275 - } 276 priv->stats.rx_bytes += skb->len; 277 priv->stats.rx_packets++; 278 279 ret = 0; 280 done: ··· 432 wlan_compute_rssi(priv, prxpd); 433 434 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 435 - 436 - if (libertas_upload_rx_packet(priv, skb)) { 437 - lbs_pr_debug(1, "RX error: libertas_upload_rx_packet " 438 - "returns failure\n"); 439 - ret = -1; 440 - goto done; 441 - } 442 - 443 priv->stats.rx_bytes += skb->len; 444 priv->stats.rx_packets++; 445 446 ret = 0; 447 done: 448 LEAVE(); 449 - 450 - skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */ 451 452 return (ret); 453 }
··· 136 LEAVE(); 137 } 138 139 + void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) 140 { 141 lbs_pr_debug(1, "skb->data=%p\n", skb->data); 142 ··· 148 skb->ip_summed = CHECKSUM_UNNECESSARY; 149 150 netif_rx(skb); 151 } 152 153 /** ··· 269 wlan_compute_rssi(priv, p_rx_pd); 270 271 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 272 priv->stats.rx_bytes += skb->len; 273 priv->stats.rx_packets++; 274 + 275 + libertas_upload_rx_packet(priv, skb); 276 277 ret = 0; 278 done: ··· 438 wlan_compute_rssi(priv, prxpd); 439 440 lbs_pr_debug(1, "RX Data: size of actual packet = %d\n", skb->len); 441 priv->stats.rx_bytes += skb->len; 442 priv->stats.rx_packets++; 443 + 444 + libertas_upload_rx_packet(priv, skb); 445 446 ret = 0; 447 done: 448 LEAVE(); 449 450 return (ret); 451 }