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