aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/powermac/feature.c6
-rw-r--r--arch/ppc/syslib/mv64x60.c4
-rw-r--r--arch/sparc/kernel/entry.S2
-rw-r--r--arch/sparc/math-emu/math.c10
-rw-r--r--arch/sparc64/kernel/entry.S2
-rw-r--r--arch/sparc64/kernel/sys32.S1
-rw-r--r--arch/sparc64/kernel/systbls.S2
-rw-r--r--drivers/net/Kconfig28
-rw-r--r--drivers/net/acenic.c4
-rw-r--r--drivers/net/b44.c5
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/mv643xx_eth.c108
-rw-r--r--drivers/net/s2io.c2
-rw-r--r--drivers/net/sungem.c55
-rw-r--r--drivers/net/wireless/hostap/Kconfig2
-rw-r--r--drivers/net/wireless/ipw2100.c49
-rw-r--r--drivers/net/wireless/ipw2200.c7
-rw-r--r--drivers/net/wireless/orinoco_cs.c4
-rw-r--r--include/asm-sparc64/spinlock.h24
-rw-r--r--include/linux/netfilter/x_tables.h16
-rw-r--r--include/net/ieee80211.h4
-rw-r--r--kernel/sched.c6
-rw-r--r--kernel/time.c2
-rw-r--r--net/core/dev.c5
-rw-r--r--net/core/filter.c6
-rw-r--r--net/core/skbuff.c8
-rw-r--r--net/ieee80211/ieee80211_rx.c26
-rw-r--r--net/ieee80211/ieee80211_wx.c12
-rw-r--r--net/ipv4/igmp.c1
-rw-r--r--net/ipv4/tcp_htcp.c1
-rw-r--r--net/ipv6/mcast.c56
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/packet/af_packet.c16
-rw-r--r--net/sctp/sm_statefuns.c8
-rw-r--r--net/sctp/socket.c2
-rw-r--r--security/seclvl.c4
36 files changed, 302 insertions, 190 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 558dd0692092..2296f3d46ca8 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -910,16 +910,18 @@ core99_gmac_phy_reset(struct device_node *node, long param, long value)
910 macio->type != macio_intrepid) 910 macio->type != macio_intrepid)
911 return -ENODEV; 911 return -ENODEV;
912 912
913 printk(KERN_DEBUG "Hard reset of PHY chip ...\n");
914
913 LOCK(flags); 915 LOCK(flags);
914 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE); 916 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
915 (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET); 917 (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET);
916 UNLOCK(flags); 918 UNLOCK(flags);
917 mdelay(10); 919 msleep(10);
918 LOCK(flags); 920 LOCK(flags);
919 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */ 921 MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */
920 KEYLARGO_GPIO_OUTOUT_DATA); 922 KEYLARGO_GPIO_OUTOUT_DATA);
921 UNLOCK(flags); 923 UNLOCK(flags);
922 mdelay(10); 924 msleep(10);
923 925
924 return 0; 926 return 0;
925} 927}
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c
index 94ea346b7b4b..1f01b7e2376b 100644
--- a/arch/ppc/syslib/mv64x60.c
+++ b/arch/ppc/syslib/mv64x60.c
@@ -313,7 +313,7 @@ static struct platform_device mpsc1_device = {
313}; 313};
314#endif 314#endif
315 315
316#ifdef CONFIG_MV643XX_ETH 316#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
317static struct resource mv64x60_eth_shared_resources[] = { 317static struct resource mv64x60_eth_shared_resources[] = {
318 [0] = { 318 [0] = {
319 .name = "ethernet shared base", 319 .name = "ethernet shared base",
@@ -456,7 +456,7 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = {
456 &mpsc0_device, 456 &mpsc0_device,
457 &mpsc1_device, 457 &mpsc1_device,
458#endif 458#endif
459#ifdef CONFIG_MV643XX_ETH 459#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
460 &mv64x60_eth_shared_device, 460 &mv64x60_eth_shared_device,
461#endif 461#endif
462#ifdef CONFIG_MV643XX_ETH_0 462#ifdef CONFIG_MV643XX_ETH_0
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index c51d08d218ef..267ec8f6fb58 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -38,7 +38,7 @@
38 38
39#define curptr g6 39#define curptr g6
40 40
41#define NR_SYSCALLS 284 /* Each OS is different... */ 41#define NR_SYSCALLS 299 /* Each OS is different... */
42 42
43/* These are just handy. */ 43/* These are just handy. */
44#define _SV save %sp, -STACKFRAME_SZ, %sp 44#define _SV save %sp, -STACKFRAME_SZ, %sp
diff --git a/arch/sparc/math-emu/math.c b/arch/sparc/math-emu/math.c
index be2c80932e26..8613b3eb877c 100644
--- a/arch/sparc/math-emu/math.c
+++ b/arch/sparc/math-emu/math.c
@@ -323,11 +323,6 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
323 case FMOVS: 323 case FMOVS:
324 case FABSS: 324 case FABSS:
325 case FNEGS: TYPE(2,1,0,1,0,0,0); break; 325 case FNEGS: TYPE(2,1,0,1,0,0,0); break;
326 default:
327#ifdef DEBUG_MATHEMU
328 printk("unknown FPop1: %03lx\n",(insn>>5)&0x1ff);
329#endif
330 break;
331 } 326 }
332 } else if ((insn & 0xc1f80000) == 0x81a80000) /* FPOP2 */ { 327 } else if ((insn & 0xc1f80000) == 0x81a80000) /* FPOP2 */ {
333 switch ((insn >> 5) & 0x1ff) { 328 switch ((insn >> 5) & 0x1ff) {
@@ -337,11 +332,6 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)
337 case FCMPED: TYPE(3,0,0,2,1,2,1); break; 332 case FCMPED: TYPE(3,0,0,2,1,2,1); break;
338 case FCMPQ: TYPE(3,0,0,3,1,3,1); break; 333 case FCMPQ: TYPE(3,0,0,3,1,3,1); break;
339 case FCMPEQ: TYPE(3,0,0,3,1,3,1); break; 334 case FCMPEQ: TYPE(3,0,0,3,1,3,1); break;
340 default:
341#ifdef DEBUG_MATHEMU
342 printk("unknown FPop2: %03lx\n",(insn>>5)&0x1ff);
343#endif
344 break;
345 } 335 }
346 } 336 }
347 337
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index e50e56e4ab61..12911e7463f2 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -25,7 +25,7 @@
25 25
26#define curptr g6 26#define curptr g6
27 27
28#define NR_SYSCALLS 284 /* Each OS is different... */ 28#define NR_SYSCALLS 299 /* Each OS is different... */
29 29
30 .text 30 .text
31 .align 32 31 .align 32
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index 9cd272ac3ac1..60b59375aa78 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -84,7 +84,6 @@ SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5)
84SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) 84SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1)
85SIGN1(sys32_mlockall, sys_mlockall, %o0) 85SIGN1(sys32_mlockall, sys_mlockall, %o0)
86SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0) 86SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0)
87SIGN1(sys32_clock_settime, compat_sys_clock_settime, %o1)
88SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) 87SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1)
89SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) 88SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1)
90SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) 89SIGN1(sys32_io_submit, compat_sys_io_submit, %o1)
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index bf0fc5bfbfbe..2881faf36635 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -71,7 +71,7 @@ sys_call_table32:
71/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler 71/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
72 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep 72 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 73/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
74 .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 74 .word sys_ni_syscall, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 75/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 76 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink 77/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 626508afe1b1..6a6a08441804 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2034,13 +2034,28 @@ config SKGE
2034 It does not support the link failover and network management 2034 It does not support the link failover and network management
2035 features that "portable" vendor supplied sk98lin driver does. 2035 features that "portable" vendor supplied sk98lin driver does.
2036 2036
2037 This driver supports adapters based on the original Yukon chipset:
2038 Marvell 88E8001, Belkin F5D5005, CNet GigaCard, DLink DGE-530T,
2039 Linksys EG1032/EG1064, 3Com 3C940/3C940B, SysKonnect SK-9871/9872.
2040
2041 It does not support the newer Yukon2 chipset: a separate driver,
2042 sky2, is provided for Yukon2-based adapters.
2043
2044 To compile this driver as a module, choose M here: the module
2045 will be called skge. This is recommended.
2037 2046
2038config SKY2 2047config SKY2
2039 tristate "SysKonnect Yukon2 support (EXPERIMENTAL)" 2048 tristate "SysKonnect Yukon2 support (EXPERIMENTAL)"
2040 depends on PCI && EXPERIMENTAL 2049 depends on PCI && EXPERIMENTAL
2041 select CRC32 2050 select CRC32
2042 ---help--- 2051 ---help---
2043 This driver support the Marvell Yukon 2 Gigabit Ethernet adapter. 2052 This driver supports Gigabit Ethernet adapters based on the the
2053 Marvell Yukon 2 chipset:
2054 Marvell 88E8021/88E8022/88E8035/88E8036/88E8038/88E8050/88E8052/
2055 88E8053/88E8055/88E8061/88E8062, SysKonnect SK-9E21D/SK-9S21
2056
2057 This driver does not support the original Yukon chipset: a seperate
2058 driver, skge, is provided for Yukon-based adapters.
2044 2059
2045 To compile this driver as a module, choose M here: the module 2060 To compile this driver as a module, choose M here: the module
2046 will be called sky2. This is recommended. 2061 will be called sky2. This is recommended.
@@ -2050,8 +2065,15 @@ config SK98LIN
2050 depends on PCI 2065 depends on PCI
2051 ---help--- 2066 ---help---
2052 Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx 2067 Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx
2053 compliant Gigabit Ethernet Adapter. The following adapters are supported 2068 compliant Gigabit Ethernet Adapter.
2054 by this driver: 2069
2070 This driver supports the original Yukon chipset. A cleaner driver is
2071 also available (skge) which seems to work better than this one.
2072
2073 This driver does not support the newer Yukon2 chipset. A seperate
2074 driver, sky2, is provided to support Yukon2-based adapters.
2075
2076 The following adapters are supported by this driver:
2055 - 3Com 3C940 Gigabit LOM Ethernet Adapter 2077 - 3Com 3C940 Gigabit LOM Ethernet Adapter
2056 - 3Com 3C941 Gigabit LOM Ethernet Adapter 2078 - 3Com 3C941 Gigabit LOM Ethernet Adapter
2057 - Allied Telesyn AT-2970LX Gigabit Ethernet Adapter 2079 - Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index b8953de5664a..b508812e97ac 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -1002,6 +1002,8 @@ static int __devinit ace_init(struct net_device *dev)
1002 1002
1003 mac1 = 0; 1003 mac1 = 0;
1004 for(i = 0; i < 4; i++) { 1004 for(i = 0; i < 4; i++) {
1005 int tmp;
1006
1005 mac1 = mac1 << 8; 1007 mac1 = mac1 << 8;
1006 tmp = read_eeprom_byte(dev, 0x8c+i); 1008 tmp = read_eeprom_byte(dev, 0x8c+i);
1007 if (tmp < 0) { 1009 if (tmp < 0) {
@@ -1012,6 +1014,8 @@ static int __devinit ace_init(struct net_device *dev)
1012 } 1014 }
1013 mac2 = 0; 1015 mac2 = 0;
1014 for(i = 4; i < 8; i++) { 1016 for(i = 4; i < 8; i++) {
1017 int tmp;
1018
1015 mac2 = mac2 << 8; 1019 mac2 = mac2 << 8;
1016 tmp = read_eeprom_byte(dev, 0x8c+i); 1020 tmp = read_eeprom_byte(dev, 0x8c+i);
1017 if (tmp < 0) { 1021 if (tmp < 0) {
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index df9d6e80c4f2..c3267e4e1bb0 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -1399,7 +1399,6 @@ static int b44_open(struct net_device *dev)
1399 b44_init_rings(bp); 1399 b44_init_rings(bp);
1400 b44_init_hw(bp); 1400 b44_init_hw(bp);
1401 1401
1402 netif_carrier_off(dev);
1403 b44_check_phy(bp); 1402 b44_check_phy(bp);
1404 1403
1405 err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev); 1404 err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
@@ -1464,7 +1463,7 @@ static int b44_close(struct net_device *dev)
1464#endif 1463#endif
1465 b44_halt(bp); 1464 b44_halt(bp);
1466 b44_free_rings(bp); 1465 b44_free_rings(bp);
1467 netif_carrier_off(bp->dev); 1466 netif_carrier_off(dev);
1468 1467
1469 spin_unlock_irq(&bp->lock); 1468 spin_unlock_irq(&bp->lock);
1470 1469
@@ -2000,6 +1999,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2000 dev->irq = pdev->irq; 1999 dev->irq = pdev->irq;
2001 SET_ETHTOOL_OPS(dev, &b44_ethtool_ops); 2000 SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);
2002 2001
2002 netif_carrier_off(dev);
2003
2003 err = b44_get_invariants(bp); 2004 err = b44_get_invariants(bp);
2004 if (err) { 2005 if (err) {
2005 printk(KERN_ERR PFX "Problem fetching invariants of chip, " 2006 printk(KERN_ERR PFX "Problem fetching invariants of chip, "
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2582d98ef5c3..4ff006c37626 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -576,7 +576,7 @@ static int bond_update_speed_duplex(struct slave *slave)
576 slave->duplex = DUPLEX_FULL; 576 slave->duplex = DUPLEX_FULL;
577 577
578 if (slave_dev->ethtool_ops) { 578 if (slave_dev->ethtool_ops) {
579 u32 res; 579 int res;
580 580
581 if (!slave_dev->ethtool_ops->get_settings) { 581 if (!slave_dev->ethtool_ops->get_settings) {
582 return -1; 582 return -1;
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 40ae36b20c9d..7ef4b0434a3f 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -444,6 +444,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
444 netif_rx(skb); 444 netif_rx(skb);
445#endif 445#endif
446 } 446 }
447 dev->last_rx = jiffies;
447 } 448 }
448 449
449 return received_packets; 450 return received_packets;
@@ -461,7 +462,7 @@ static int mv643xx_eth_receive_queue(struct net_device *dev)
461 */ 462 */
462 463
463static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id, 464static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id,
464 struct pt_regs *regs) 465 struct pt_regs *regs)
465{ 466{
466 struct net_device *dev = (struct net_device *)dev_id; 467 struct net_device *dev = (struct net_device *)dev_id;
467 struct mv643xx_private *mp = netdev_priv(dev); 468 struct mv643xx_private *mp = netdev_priv(dev);
@@ -1047,16 +1048,15 @@ static int mv643xx_poll(struct net_device *dev, int *budget)
1047 1048
1048static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb) 1049static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb)
1049{ 1050{
1050 unsigned int frag; 1051 unsigned int frag;
1051 skb_frag_t *fragp; 1052 skb_frag_t *fragp;
1052 1053
1053 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) { 1054 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
1054 fragp = &skb_shinfo(skb)->frags[frag]; 1055 fragp = &skb_shinfo(skb)->frags[frag];
1055 if (fragp->size <= 8 && fragp->page_offset & 0x7) 1056 if (fragp->size <= 8 && fragp->page_offset & 0x7)
1056 return 1; 1057 return 1;
1057 1058 }
1058 } 1059 return 0;
1059 return 0;
1060} 1060}
1061 1061
1062 1062
@@ -2137,26 +2137,26 @@ static void eth_port_set_multicast_list(struct net_device *dev)
2137 */ 2137 */
2138 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI)) { 2138 if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI)) {
2139 for (table_index = 0; table_index <= 0xFC; table_index += 4) { 2139 for (table_index = 0; table_index <= 0xFC; table_index += 4) {
2140 /* Set all entries in DA filter special multicast 2140 /* Set all entries in DA filter special multicast
2141 * table (Ex_dFSMT) 2141 * table (Ex_dFSMT)
2142 * Set for ETH_Q0 for now 2142 * Set for ETH_Q0 for now
2143 * Bits 2143 * Bits
2144 * 0 Accept=1, Drop=0 2144 * 0 Accept=1, Drop=0
2145 * 3-1 Queue ETH_Q0=0 2145 * 3-1 Queue ETH_Q0=0
2146 * 7-4 Reserved = 0; 2146 * 7-4 Reserved = 0;
2147 */ 2147 */
2148 mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); 2148 mv_write(MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);
2149 2149
2150 /* Set all entries in DA filter other multicast 2150 /* Set all entries in DA filter other multicast
2151 * table (Ex_dFOMT) 2151 * table (Ex_dFOMT)
2152 * Set for ETH_Q0 for now 2152 * Set for ETH_Q0 for now
2153 * Bits 2153 * Bits
2154 * 0 Accept=1, Drop=0 2154 * 0 Accept=1, Drop=0
2155 * 3-1 Queue ETH_Q0=0 2155 * 3-1 Queue ETH_Q0=0
2156 * 7-4 Reserved = 0; 2156 * 7-4 Reserved = 0;
2157 */ 2157 */
2158 mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101); 2158 mv_write(MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(eth_port_num) + table_index, 0x01010101);
2159 } 2159 }
2160 return; 2160 return;
2161 } 2161 }
2162 2162
@@ -2617,7 +2617,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
2617 struct eth_tx_desc *current_descriptor; 2617 struct eth_tx_desc *current_descriptor;
2618 struct eth_tx_desc *first_descriptor; 2618 struct eth_tx_desc *first_descriptor;
2619 u32 command; 2619 u32 command;
2620 unsigned long flags;
2621 2620
2622 /* Do not process Tx ring in case of Tx ring resource error */ 2621 /* Do not process Tx ring in case of Tx ring resource error */
2623 if (mp->tx_resource_err) 2622 if (mp->tx_resource_err)
@@ -2634,8 +2633,6 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
2634 return ETH_ERROR; 2633 return ETH_ERROR;
2635 } 2634 }
2636 2635
2637 spin_lock_irqsave(&mp->lock, flags);
2638
2639 mp->tx_ring_skbs++; 2636 mp->tx_ring_skbs++;
2640 BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); 2637 BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);
2641 2638
@@ -2685,15 +2682,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
2685 mp->tx_resource_err = 1; 2682 mp->tx_resource_err = 1;
2686 mp->tx_curr_desc_q = tx_first_desc; 2683 mp->tx_curr_desc_q = tx_first_desc;
2687 2684
2688 spin_unlock_irqrestore(&mp->lock, flags);
2689
2690 return ETH_QUEUE_LAST_RESOURCE; 2685 return ETH_QUEUE_LAST_RESOURCE;
2691 } 2686 }
2692 2687
2693 mp->tx_curr_desc_q = tx_next_desc; 2688 mp->tx_curr_desc_q = tx_next_desc;
2694 2689
2695 spin_unlock_irqrestore(&mp->lock, flags);
2696
2697 return ETH_OK; 2690 return ETH_OK;
2698} 2691}
2699#else 2692#else
@@ -2704,14 +2697,11 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
2704 int tx_desc_used; 2697 int tx_desc_used;
2705 struct eth_tx_desc *current_descriptor; 2698 struct eth_tx_desc *current_descriptor;
2706 unsigned int command_status; 2699 unsigned int command_status;
2707 unsigned long flags;
2708 2700
2709 /* Do not process Tx ring in case of Tx ring resource error */ 2701 /* Do not process Tx ring in case of Tx ring resource error */
2710 if (mp->tx_resource_err) 2702 if (mp->tx_resource_err)
2711 return ETH_QUEUE_FULL; 2703 return ETH_QUEUE_FULL;
2712 2704
2713 spin_lock_irqsave(&mp->lock, flags);
2714
2715 mp->tx_ring_skbs++; 2705 mp->tx_ring_skbs++;
2716 BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size); 2706 BUG_ON(mp->tx_ring_skbs > mp->tx_ring_size);
2717 2707
@@ -2742,12 +2732,9 @@ static ETH_FUNC_RET_STATUS eth_port_send(struct mv643xx_private *mp,
2742 /* Check for ring index overlap in the Tx desc ring */ 2732 /* Check for ring index overlap in the Tx desc ring */
2743 if (tx_desc_curr == tx_desc_used) { 2733 if (tx_desc_curr == tx_desc_used) {
2744 mp->tx_resource_err = 1; 2734 mp->tx_resource_err = 1;
2745
2746 spin_unlock_irqrestore(&mp->lock, flags);
2747 return ETH_QUEUE_LAST_RESOURCE; 2735 return ETH_QUEUE_LAST_RESOURCE;
2748 } 2736 }
2749 2737
2750 spin_unlock_irqrestore(&mp->lock, flags);
2751 return ETH_OK; 2738 return ETH_OK;
2752} 2739}
2753#endif 2740#endif
@@ -2898,8 +2885,10 @@ static ETH_FUNC_RET_STATUS eth_port_receive(struct mv643xx_private *mp,
2898 p_pkt_info->return_info = mp->rx_skb[rx_curr_desc]; 2885 p_pkt_info->return_info = mp->rx_skb[rx_curr_desc];
2899 p_pkt_info->l4i_chk = p_rx_desc->buf_size; 2886 p_pkt_info->l4i_chk = p_rx_desc->buf_size;
2900 2887
2901 /* Clean the return info field to indicate that the packet has been */ 2888 /*
2902 /* moved to the upper layers */ 2889 * Clean the return info field to indicate that the
2890 * packet has been moved to the upper layers
2891 */
2903 mp->rx_skb[rx_curr_desc] = NULL; 2892 mp->rx_skb[rx_curr_desc] = NULL;
2904 2893
2905 /* Update current index in data structure */ 2894 /* Update current index in data structure */
@@ -2980,7 +2969,7 @@ struct mv643xx_stats {
2980}; 2969};
2981 2970
2982#define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \ 2971#define MV643XX_STAT(m) sizeof(((struct mv643xx_private *)0)->m), \
2983 offsetof(struct mv643xx_private, m) 2972 offsetof(struct mv643xx_private, m)
2984 2973
2985static const struct mv643xx_stats mv643xx_gstrings_stats[] = { 2974static const struct mv643xx_stats mv643xx_gstrings_stats[] = {
2986 { "rx_packets", MV643XX_STAT(stats.rx_packets) }, 2975 { "rx_packets", MV643XX_STAT(stats.rx_packets) },
@@ -3131,9 +3120,8 @@ mv643xx_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
3131 return 0; 3120 return 0;
3132} 3121}
3133 3122
3134static void 3123static void mv643xx_get_drvinfo(struct net_device *netdev,
3135mv643xx_get_drvinfo(struct net_device *netdev, 3124 struct ethtool_drvinfo *drvinfo)
3136 struct ethtool_drvinfo *drvinfo)
3137{ 3125{
3138 strncpy(drvinfo->driver, mv643xx_driver_name, 32); 3126 strncpy(drvinfo->driver, mv643xx_driver_name, 32);
3139 strncpy(drvinfo->version, mv643xx_driver_version, 32); 3127 strncpy(drvinfo->version, mv643xx_driver_version, 32);
@@ -3142,39 +3130,37 @@ mv643xx_get_drvinfo(struct net_device *netdev,
3142 drvinfo->n_stats = MV643XX_STATS_LEN; 3130 drvinfo->n_stats = MV643XX_STATS_LEN;
3143} 3131}
3144 3132
3145static int 3133static int mv643xx_get_stats_count(struct net_device *netdev)
3146mv643xx_get_stats_count(struct net_device *netdev)
3147{ 3134{
3148 return MV643XX_STATS_LEN; 3135 return MV643XX_STATS_LEN;
3149} 3136}
3150 3137
3151static void 3138static void mv643xx_get_ethtool_stats(struct net_device *netdev,
3152mv643xx_get_ethtool_stats(struct net_device *netdev, 3139 struct ethtool_stats *stats, uint64_t *data)
3153 struct ethtool_stats *stats, uint64_t *data)
3154{ 3140{
3155 struct mv643xx_private *mp = netdev->priv; 3141 struct mv643xx_private *mp = netdev->priv;
3156 int i; 3142 int i;
3157 3143
3158 eth_update_mib_counters(mp); 3144 eth_update_mib_counters(mp);
3159 3145
3160 for(i = 0; i < MV643XX_STATS_LEN; i++) { 3146 for (i = 0; i < MV643XX_STATS_LEN; i++) {
3161 char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset; 3147 char *p = (char *)mp+mv643xx_gstrings_stats[i].stat_offset;
3162 data[i] = (mv643xx_gstrings_stats[i].sizeof_stat == 3148 data[i] = (mv643xx_gstrings_stats[i].sizeof_stat ==
3163 sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p; 3149 sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
3164 } 3150 }
3165} 3151}
3166 3152
3167static void 3153static void mv643xx_get_strings(struct net_device *netdev, uint32_t stringset,
3168mv643xx_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) 3154 uint8_t *data)
3169{ 3155{
3170 int i; 3156 int i;
3171 3157
3172 switch(stringset) { 3158 switch(stringset) {
3173 case ETH_SS_STATS: 3159 case ETH_SS_STATS:
3174 for (i=0; i < MV643XX_STATS_LEN; i++) { 3160 for (i=0; i < MV643XX_STATS_LEN; i++) {
3175 memcpy(data + i * ETH_GSTRING_LEN, 3161 memcpy(data + i * ETH_GSTRING_LEN,
3176 mv643xx_gstrings_stats[i].stat_string, 3162 mv643xx_gstrings_stats[i].stat_string,
3177 ETH_GSTRING_LEN); 3163 ETH_GSTRING_LEN);
3178 } 3164 }
3179 break; 3165 break;
3180 } 3166 }
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 89c46787676c..49b597cbc19a 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3586,7 +3586,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3586 txdp->Buffer_Pointer = (u64) pci_map_page 3586 txdp->Buffer_Pointer = (u64) pci_map_page
3587 (sp->pdev, frag->page, frag->page_offset, 3587 (sp->pdev, frag->page, frag->page_offset,
3588 frag->size, PCI_DMA_TODEVICE); 3588 frag->size, PCI_DMA_TODEVICE);
3589 txdp->Control_1 |= TXD_BUFFER0_SIZE(frag->size); 3589 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);
3590 if (skb_shinfo(skb)->ufo_size) 3590 if (skb_shinfo(skb)->ufo_size)
3591 txdp->Control_1 |= TXD_UFO_EN; 3591 txdp->Control_1 |= TXD_UFO_EN;
3592 } 3592 }
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 28ce47a02408..55f3b856236e 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1653,36 +1653,40 @@ static void gem_init_rings(struct gem *gp)
1653/* Init PHY interface and start link poll state machine */ 1653/* Init PHY interface and start link poll state machine */
1654static void gem_init_phy(struct gem *gp) 1654static void gem_init_phy(struct gem *gp)
1655{ 1655{
1656 u32 mifcfg; 1656 u32 mif_cfg;
1657 1657
1658 /* Revert MIF CFG setting done on stop_phy */ 1658 /* Revert MIF CFG setting done on stop_phy */
1659 mifcfg = readl(gp->regs + MIF_CFG); 1659 mif_cfg = readl(gp->regs + MIF_CFG);
1660 mifcfg &= ~MIF_CFG_BBMODE; 1660 mif_cfg &= ~(MIF_CFG_PSELECT|MIF_CFG_POLL|MIF_CFG_BBMODE|MIF_CFG_MDI1);
1661 writel(mifcfg, gp->regs + MIF_CFG); 1661 mif_cfg |= MIF_CFG_MDI0;
1662 writel(mif_cfg, gp->regs + MIF_CFG);
1663 writel(PCS_DMODE_MGM, gp->regs + PCS_DMODE);
1664 writel(MAC_XIFCFG_OE, gp->regs + MAC_XIFCFG);
1662 1665
1663 if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) { 1666 if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) {
1664 int i; 1667 int i;
1668 u16 ctrl;
1665 1669
1666 /* Those delay sucks, the HW seem to love them though, I'll
1667 * serisouly consider breaking some locks here to be able
1668 * to schedule instead
1669 */
1670 for (i = 0; i < 3; i++) {
1671#ifdef CONFIG_PPC_PMAC 1670#ifdef CONFIG_PPC_PMAC
1672 pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0); 1671 pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0);
1673 msleep(20);
1674#endif 1672#endif
1675 /* Some PHYs used by apple have problem getting back to us, 1673
1676 * we do an additional reset here 1674 /* Some PHYs used by apple have problem getting back
1677 */ 1675 * to us, we do an additional reset here
1678 phy_write(gp, MII_BMCR, BMCR_RESET); 1676 */
1679 msleep(20); 1677 phy_write(gp, MII_BMCR, BMCR_RESET);
1680 if (phy_read(gp, MII_BMCR) != 0xffff) 1678 for (i = 0; i < 50; i++) {
1679 if ((phy_read(gp, MII_BMCR) & BMCR_RESET) == 0)
1681 break; 1680 break;
1682 if (i == 2) 1681 msleep(10);
1683 printk(KERN_WARNING "%s: GMAC PHY not responding !\n",
1684 gp->dev->name);
1685 } 1682 }
1683 if (i == 50)
1684 printk(KERN_WARNING "%s: GMAC PHY not responding !\n",
1685 gp->dev->name);
1686 /* Make sure isolate is off */
1687 ctrl = phy_read(gp, MII_BMCR);
1688 if (ctrl & BMCR_ISOLATE)
1689 phy_write(gp, MII_BMCR, ctrl & ~BMCR_ISOLATE);
1686 } 1690 }
1687 1691
1688 if (gp->pdev->vendor == PCI_VENDOR_ID_SUN && 1692 if (gp->pdev->vendor == PCI_VENDOR_ID_SUN &&
@@ -2119,7 +2123,7 @@ static void gem_reinit_chip(struct gem *gp)
2119/* Must be invoked with no lock held. */ 2123/* Must be invoked with no lock held. */
2120static void gem_stop_phy(struct gem *gp, int wol) 2124static void gem_stop_phy(struct gem *gp, int wol)
2121{ 2125{
2122 u32 mifcfg; 2126 u32 mif_cfg;
2123 unsigned long flags; 2127 unsigned long flags;
2124 2128
2125 /* Let the chip settle down a bit, it seems that helps 2129 /* Let the chip settle down a bit, it seems that helps
@@ -2130,9 +2134,9 @@ static void gem_stop_phy(struct gem *gp, int wol)
2130 /* Make sure we aren't polling PHY status change. We 2134 /* Make sure we aren't polling PHY status change. We
2131 * don't currently use that feature though 2135 * don't currently use that feature though
2132 */ 2136 */
2133 mifcfg = readl(gp->regs + MIF_CFG); 2137 mif_cfg = readl(gp->regs + MIF_CFG);
2134 mifcfg &= ~MIF_CFG_POLL; 2138 mif_cfg &= ~MIF_CFG_POLL;
2135 writel(mifcfg, gp->regs + MIF_CFG); 2139 writel(mif_cfg, gp->regs + MIF_CFG);
2136 2140
2137 if (wol && gp->has_wol) { 2141 if (wol && gp->has_wol) {
2138 unsigned char *e = &gp->dev->dev_addr[0]; 2142 unsigned char *e = &gp->dev->dev_addr[0];
@@ -2182,7 +2186,8 @@ static void gem_stop_phy(struct gem *gp, int wol)
2182 /* According to Apple, we must set the MDIO pins to this begnign 2186 /* According to Apple, we must set the MDIO pins to this begnign
2183 * state or we may 1) eat more current, 2) damage some PHYs 2187 * state or we may 1) eat more current, 2) damage some PHYs
2184 */ 2188 */
2185 writel(mifcfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG); 2189 mif_cfg = 0;
2190 writel(mif_cfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG);
2186 writel(0, gp->regs + MIF_BBCLK); 2191 writel(0, gp->regs + MIF_BBCLK);
2187 writel(0, gp->regs + MIF_BBDATA); 2192 writel(0, gp->regs + MIF_BBDATA);
2188 writel(0, gp->regs + MIF_BBOENAB); 2193 writel(0, gp->regs + MIF_BBOENAB);
diff --git a/drivers/net/wireless/hostap/Kconfig b/drivers/net/wireless/hostap/Kconfig
index c8f6286dd35f..308f773ad566 100644
--- a/drivers/net/wireless/hostap/Kconfig
+++ b/drivers/net/wireless/hostap/Kconfig
@@ -75,7 +75,7 @@ config HOSTAP_PCI
75 75
76config HOSTAP_CS 76config HOSTAP_CS
77 tristate "Host AP driver for Prism2/2.5/3 PC Cards" 77 tristate "Host AP driver for Prism2/2.5/3 PC Cards"
78 depends on PCMCIA!=n && HOSTAP 78 depends on PCMCIA && HOSTAP
79 ---help--- 79 ---help---
80 Host AP driver's version for Prism2/2.5/3 PC Cards. 80 Host AP driver's version for Prism2/2.5/3 PC Cards.
81 81
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 8bf02763b5c7..6290c9f7e939 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2201,6 +2201,17 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv,
2201#define SEARCH_SNAPSHOT 1 2201#define SEARCH_SNAPSHOT 1
2202 2202
2203#define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) 2203#define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff))
2204static void ipw2100_snapshot_free(struct ipw2100_priv *priv)
2205{
2206 int i;
2207 if (!priv->snapshot[0])
2208 return;
2209 for (i = 0; i < 0x30; i++)
2210 kfree(priv->snapshot[i]);
2211 priv->snapshot[0] = NULL;
2212}
2213
2214#ifdef CONFIG_IPW2100_DEBUG_C3
2204static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) 2215static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
2205{ 2216{
2206 int i; 2217 int i;
@@ -2221,16 +2232,6 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
2221 return 1; 2232 return 1;
2222} 2233}
2223 2234
2224static void ipw2100_snapshot_free(struct ipw2100_priv *priv)
2225{
2226 int i;
2227 if (!priv->snapshot[0])
2228 return;
2229 for (i = 0; i < 0x30; i++)
2230 kfree(priv->snapshot[i]);
2231 priv->snapshot[0] = NULL;
2232}
2233
2234static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, 2235static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,
2235 size_t len, int mode) 2236 size_t len, int mode)
2236{ 2237{
@@ -2269,6 +2270,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,
2269 2270
2270 return ret; 2271 return ret;
2271} 2272}
2273#endif
2272 2274
2273/* 2275/*
2274 * 2276 *
@@ -7112,11 +7114,17 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7112{ 7114{
7113 struct ipw2100_priv *priv = ieee80211_priv(dev); 7115 struct ipw2100_priv *priv = ieee80211_priv(dev);
7114 int err = 0, value; 7116 int err = 0, value;
7117
7118 if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled))
7119 return -EINPROGRESS;
7115 7120
7116 if (priv->ieee->iw_mode != IW_MODE_ADHOC) 7121 if (priv->ieee->iw_mode != IW_MODE_ADHOC)
7122 return 0;
7123
7124 if ((wrqu->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
7117 return -EINVAL; 7125 return -EINVAL;
7118 7126
7119 if (wrqu->txpower.disabled == 1 || wrqu->txpower.fixed == 0) 7127 if (wrqu->txpower.fixed == 0)
7120 value = IPW_TX_POWER_DEFAULT; 7128 value = IPW_TX_POWER_DEFAULT;
7121 else { 7129 else {
7122 if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || 7130 if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM ||
@@ -7151,24 +7159,19 @@ static int ipw2100_wx_get_txpow(struct net_device *dev,
7151 7159
7152 struct ipw2100_priv *priv = ieee80211_priv(dev); 7160 struct ipw2100_priv *priv = ieee80211_priv(dev);
7153 7161
7154 if (priv->ieee->iw_mode != IW_MODE_ADHOC) { 7162 wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0;
7155 wrqu->power.disabled = 1;
7156 return 0;
7157 }
7158 7163
7159 if (priv->tx_power == IPW_TX_POWER_DEFAULT) { 7164 if (priv->tx_power == IPW_TX_POWER_DEFAULT) {
7160 wrqu->power.fixed = 0; 7165 wrqu->txpower.fixed = 0;
7161 wrqu->power.value = IPW_TX_POWER_MAX_DBM; 7166 wrqu->txpower.value = IPW_TX_POWER_MAX_DBM;
7162 wrqu->power.disabled = 1;
7163 } else { 7167 } else {
7164 wrqu->power.disabled = 0; 7168 wrqu->txpower.fixed = 1;
7165 wrqu->power.fixed = 1; 7169 wrqu->txpower.value = priv->tx_power;
7166 wrqu->power.value = priv->tx_power;
7167 } 7170 }
7168 7171
7169 wrqu->power.flags = IW_TXPOW_DBM; 7172 wrqu->txpower.flags = IW_TXPOW_DBM;
7170 7173
7171 IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->power.value); 7174 IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->txpower.value);
7172 7175
7173 return 0; 7176 return 0;
7174} 7177}
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 4c28e332ecc3..916b24c544e2 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8012,6 +8012,10 @@ static int ipw_sw_reset(struct ipw_priv *priv, int init)
8012 else 8012 else
8013 IPW_DEBUG_INFO("Auto adhoc creation disabled.\n"); 8013 IPW_DEBUG_INFO("Auto adhoc creation disabled.\n");
8014 8014
8015 priv->config &= ~CFG_STATIC_ESSID;
8016 priv->essid_len = 0;
8017 memset(priv->essid, 0, IW_ESSID_MAX_SIZE);
8018
8015 if (disable) { 8019 if (disable) {
8016 priv->status |= STATUS_RF_KILL_SW; 8020 priv->status |= STATUS_RF_KILL_SW;
8017 IPW_DEBUG_INFO("Radio disabled.\n"); 8021 IPW_DEBUG_INFO("Radio disabled.\n");
@@ -11035,7 +11039,6 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
11035 net_dev->set_multicast_list = ipw_net_set_multicast_list; 11039 net_dev->set_multicast_list = ipw_net_set_multicast_list;
11036 net_dev->set_mac_address = ipw_net_set_mac_address; 11040 net_dev->set_mac_address = ipw_net_set_mac_address;
11037 priv->wireless_data.spy_data = &priv->ieee->spy_data; 11041 priv->wireless_data.spy_data = &priv->ieee->spy_data;
11038 priv->wireless_data.ieee80211 = priv->ieee;
11039 net_dev->wireless_data = &priv->wireless_data; 11042 net_dev->wireless_data = &priv->wireless_data;
11040 net_dev->wireless_handlers = &ipw_wx_handler_def; 11043 net_dev->wireless_handlers = &ipw_wx_handler_def;
11041 net_dev->ethtool_ops = &ipw_ethtool_ops; 11044 net_dev->ethtool_ops = &ipw_ethtool_ops;
@@ -11121,8 +11124,8 @@ static void ipw_pci_remove(struct pci_dev *pdev)
11121 /* Free MAC hash list for ADHOC */ 11124 /* Free MAC hash list for ADHOC */
11122 for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { 11125 for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) {
11123 list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) { 11126 list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) {
11124 kfree(list_entry(p, struct ipw_ibss_seq, list));
11125 list_del(p); 11127 list_del(p);
11128 kfree(list_entry(p, struct ipw_ibss_seq, list));
11126 } 11129 }
11127 } 11130 }
11128 11131
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
index b664708481cc..3c128b692bce 100644
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -261,13 +261,13 @@ orinoco_cs_config(dev_link_t *link)
261 /* Note that the CIS values need to be rescaled */ 261 /* Note that the CIS values need to be rescaled */
262 if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 262 if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
263 if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { 263 if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
264 DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); 264 DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, cfg CIS = %d)\n", conf.Vcc, cfg->vcc.param[CISTPL_POWER_VNOM] / 10000);
265 if (!ignore_cis_vcc) 265 if (!ignore_cis_vcc)
266 goto next_entry; 266 goto next_entry;
267 } 267 }
268 } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { 268 } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) {
269 if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) { 269 if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM] / 10000) {
270 DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000); 270 DEBUG(2, "orinoco_cs_config: Vcc mismatch (conf.Vcc = %d, dflt CIS = %d)\n", conf.Vcc, dflt.vcc.param[CISTPL_POWER_VNOM] / 10000);
271 if(!ignore_cis_vcc) 271 if(!ignore_cis_vcc)
272 goto next_entry; 272 goto next_entry;
273 } 273 }
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index ec85d12d73b9..508c416e9d6a 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -131,6 +131,28 @@ static void inline __read_lock(raw_rwlock_t *lock)
131 : "memory"); 131 : "memory");
132} 132}
133 133
134static int inline __read_trylock(raw_rwlock_t *lock)
135{
136 int tmp1, tmp2;
137
138 __asm__ __volatile__ (
139"1: ldsw [%2], %0\n"
140" brlz,a,pn %0, 2f\n"
141" mov 0, %0\n"
142" add %0, 1, %1\n"
143" cas [%2], %0, %1\n"
144" cmp %0, %1\n"
145" membar #StoreLoad | #StoreStore\n"
146" bne,pn %%icc, 1b\n"
147" mov 1, %0\n"
148"2:"
149 : "=&r" (tmp1), "=&r" (tmp2)
150 : "r" (lock)
151 : "memory");
152
153 return tmp1;
154}
155
134static void inline __read_unlock(raw_rwlock_t *lock) 156static void inline __read_unlock(raw_rwlock_t *lock)
135{ 157{
136 unsigned long tmp1, tmp2; 158 unsigned long tmp1, tmp2;
@@ -211,12 +233,12 @@ static int inline __write_trylock(raw_rwlock_t *lock)
211} 233}
212 234
213#define __raw_read_lock(p) __read_lock(p) 235#define __raw_read_lock(p) __read_lock(p)
236#define __raw_read_trylock(p) __read_trylock(p)
214#define __raw_read_unlock(p) __read_unlock(p) 237#define __raw_read_unlock(p) __read_unlock(p)
215#define __raw_write_lock(p) __write_lock(p) 238#define __raw_write_lock(p) __write_lock(p)
216#define __raw_write_unlock(p) __write_unlock(p) 239#define __raw_write_unlock(p) __write_unlock(p)
217#define __raw_write_trylock(p) __write_trylock(p) 240#define __raw_write_trylock(p) __write_trylock(p)
218 241
219#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
220#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) 242#define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL))
221#define __raw_write_can_lock(rw) (!(rw)->lock) 243#define __raw_write_can_lock(rw) (!(rw)->lock)
222 244
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 59ff6c430cf6..6500d4e59d46 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -19,7 +19,21 @@ struct xt_get_revision
19/* For standard target */ 19/* For standard target */
20#define XT_RETURN (-NF_REPEAT - 1) 20#define XT_RETURN (-NF_REPEAT - 1)
21 21
22#define XT_ALIGN(s) (((s) + (__alignof__(u_int64_t)-1)) & ~(__alignof__(u_int64_t)-1)) 22/* this is a dummy structure to find out the alignment requirement for a struct
23 * containing all the fundamental data types that are used in ipt_entry,
24 * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my
25 * personal pleasure to remove it -HW
26 */
27struct _xt_align
28{
29 u_int8_t u8;
30 u_int16_t u16;
31 u_int32_t u32;
32 u_int64_t u64;
33};
34
35#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \
36 & ~(__alignof__(struct _xt_align)-1))
23 37
24/* Standard return verdict, or do jump. */ 38/* Standard return verdict, or do jump. */
25#define XT_STANDARD_TARGET "" 39#define XT_STANDARD_TARGET ""
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index df05f468fa5c..9a92aef8b0b2 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -803,9 +803,9 @@ enum ieee80211_state {
803#define IEEE80211_24GHZ_MAX_CHANNEL 14 803#define IEEE80211_24GHZ_MAX_CHANNEL 14
804#define IEEE80211_24GHZ_CHANNELS 14 804#define IEEE80211_24GHZ_CHANNELS 14
805 805
806#define IEEE80211_52GHZ_MIN_CHANNEL 36 806#define IEEE80211_52GHZ_MIN_CHANNEL 34
807#define IEEE80211_52GHZ_MAX_CHANNEL 165 807#define IEEE80211_52GHZ_MAX_CHANNEL 165
808#define IEEE80211_52GHZ_CHANNELS 32 808#define IEEE80211_52GHZ_CHANNELS 131
809 809
810enum { 810enum {
811 IEEE80211_CH_PASSIVE_ONLY = (1 << 0), 811 IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
diff --git a/kernel/sched.c b/kernel/sched.c
index 3ee2ae45125f..ec7fd9cee306 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5141,7 +5141,7 @@ static void init_sched_build_groups(struct sched_group groups[], cpumask_t span,
5141#define SEARCH_SCOPE 2 5141#define SEARCH_SCOPE 2
5142#define MIN_CACHE_SIZE (64*1024U) 5142#define MIN_CACHE_SIZE (64*1024U)
5143#define DEFAULT_CACHE_SIZE (5*1024*1024U) 5143#define DEFAULT_CACHE_SIZE (5*1024*1024U)
5144#define ITERATIONS 2 5144#define ITERATIONS 1
5145#define SIZE_THRESH 130 5145#define SIZE_THRESH 130
5146#define COST_THRESH 130 5146#define COST_THRESH 130
5147 5147
@@ -5480,9 +5480,9 @@ static unsigned long long measure_migration_cost(int cpu1, int cpu2)
5480 break; 5480 break;
5481 } 5481 }
5482 /* 5482 /*
5483 * Increase the cachesize in 5% steps: 5483 * Increase the cachesize in 10% steps:
5484 */ 5484 */
5485 size = size * 20 / 19; 5485 size = size * 10 / 9;
5486 } 5486 }
5487 5487
5488 if (migration_debug) 5488 if (migration_debug)
diff --git a/kernel/time.c b/kernel/time.c
index 7477b1d2079e..1f23e683d6aa 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -155,7 +155,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz)
155 static int firsttime = 1; 155 static int firsttime = 1;
156 int error = 0; 156 int error = 0;
157 157
158 if (!timespec_valid(tv)) 158 if (tv && !timespec_valid(tv))
159 return -EINVAL; 159 return -EINVAL;
160 160
161 error = security_settime(tv, tz); 161 error = security_settime(tv, tz);
diff --git a/net/core/dev.c b/net/core/dev.c
index fd070a098f20..ffb82073056e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2543,13 +2543,14 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
2543 case SIOCBONDENSLAVE: 2543 case SIOCBONDENSLAVE:
2544 case SIOCBONDRELEASE: 2544 case SIOCBONDRELEASE:
2545 case SIOCBONDSETHWADDR: 2545 case SIOCBONDSETHWADDR:
2546 case SIOCBONDSLAVEINFOQUERY:
2547 case SIOCBONDINFOQUERY:
2548 case SIOCBONDCHANGEACTIVE: 2546 case SIOCBONDCHANGEACTIVE:
2549 case SIOCBRADDIF: 2547 case SIOCBRADDIF:
2550 case SIOCBRDELIF: 2548 case SIOCBRDELIF:
2551 if (!capable(CAP_NET_ADMIN)) 2549 if (!capable(CAP_NET_ADMIN))
2552 return -EPERM; 2550 return -EPERM;
2551 /* fall through */
2552 case SIOCBONDSLAVEINFOQUERY:
2553 case SIOCBONDINFOQUERY:
2553 dev_load(ifr.ifr_name); 2554 dev_load(ifr.ifr_name);
2554 rtnl_lock(); 2555 rtnl_lock();
2555 ret = dev_ifsioc(&ifr, cmd); 2556 ret = dev_ifsioc(&ifr, cmd);
diff --git a/net/core/filter.c b/net/core/filter.c
index 9540946a48f3..93fbd01d2259 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -64,7 +64,7 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
64} 64}
65 65
66/** 66/**
67 * sk_run_filter - run a filter on a socket 67 * sk_run_filter - run a filter on a socket
68 * @skb: buffer to run the filter on 68 * @skb: buffer to run the filter on
69 * @filter: filter to apply 69 * @filter: filter to apply
70 * @flen: length of filter 70 * @flen: length of filter
@@ -78,8 +78,8 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
78{ 78{
79 struct sock_filter *fentry; /* We walk down these */ 79 struct sock_filter *fentry; /* We walk down these */
80 void *ptr; 80 void *ptr;
81 u32 A = 0; /* Accumulator */ 81 u32 A = 0; /* Accumulator */
82 u32 X = 0; /* Index Register */ 82 u32 X = 0; /* Index Register */
83 u32 mem[BPF_MEMWORDS]; /* Scratch Memory Store */ 83 u32 mem[BPF_MEMWORDS]; /* Scratch Memory Store */
84 u32 tmp; 84 u32 tmp;
85 int k; 85 int k;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d0732e9c8560..6766f118f070 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -135,13 +135,15 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here)
135struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, 135struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
136 int fclone) 136 int fclone)
137{ 137{
138 kmem_cache_t *cache;
138 struct skb_shared_info *shinfo; 139 struct skb_shared_info *shinfo;
139 struct sk_buff *skb; 140 struct sk_buff *skb;
140 u8 *data; 141 u8 *data;
141 142
143 cache = fclone ? skbuff_fclone_cache : skbuff_head_cache;
144
142 /* Get the HEAD */ 145 /* Get the HEAD */
143 skb = kmem_cache_alloc(fclone ? skbuff_fclone_cache : skbuff_head_cache, 146 skb = kmem_cache_alloc(cache, gfp_mask & ~__GFP_DMA);
144 gfp_mask & ~__GFP_DMA);
145 if (!skb) 147 if (!skb)
146 goto out; 148 goto out;
147 149
@@ -180,7 +182,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
180out: 182out:
181 return skb; 183 return skb;
182nodata: 184nodata:
183 kmem_cache_free(skbuff_head_cache, skb); 185 kmem_cache_free(cache, skb);
184 skb = NULL; 186 skb = NULL;
185 goto out; 187 goto out;
186} 188}
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 7a121802faa9..960aa78cdb97 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -350,6 +350,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
350 u8 src[ETH_ALEN]; 350 u8 src[ETH_ALEN];
351 struct ieee80211_crypt_data *crypt = NULL; 351 struct ieee80211_crypt_data *crypt = NULL;
352 int keyidx = 0; 352 int keyidx = 0;
353 int can_be_decrypted = 0;
353 354
354 hdr = (struct ieee80211_hdr_4addr *)skb->data; 355 hdr = (struct ieee80211_hdr_4addr *)skb->data;
355 stats = &ieee->stats; 356 stats = &ieee->stats;
@@ -410,12 +411,23 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
410 return 1; 411 return 1;
411 } 412 }
412 413
413 if (is_multicast_ether_addr(hdr->addr1) 414 can_be_decrypted = (is_multicast_ether_addr(hdr->addr1) ||
414 ? ieee->host_mc_decrypt : ieee->host_decrypt) { 415 is_broadcast_ether_addr(hdr->addr2)) ?
416 ieee->host_mc_decrypt : ieee->host_decrypt;
417
418 if (can_be_decrypted) {
415 int idx = 0; 419 int idx = 0;
416 if (skb->len >= hdrlen + 3) 420 if (skb->len >= hdrlen + 3) {
421 /* Top two-bits of byte 3 are the key index */
417 idx = skb->data[hdrlen + 3] >> 6; 422 idx = skb->data[hdrlen + 3] >> 6;
423 }
424
425 /* ieee->crypt[] is WEP_KEY (4) in length. Given that idx
426 * is only allowed 2-bits of storage, no value of idx can
427 * be provided via above code that would result in idx
428 * being out of range */
418 crypt = ieee->crypt[idx]; 429 crypt = ieee->crypt[idx];
430
419#ifdef NOT_YET 431#ifdef NOT_YET
420 sta = NULL; 432 sta = NULL;
421 433
@@ -553,7 +565,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
553 565
554 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 566 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
555 567
556 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && 568 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
557 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) 569 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
558 goto rx_dropped; 570 goto rx_dropped;
559 571
@@ -617,7 +629,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
617 629
618 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 630 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
619 * encrypted/authenticated */ 631 * encrypted/authenticated */
620 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && 632 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
621 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) 633 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
622 goto rx_dropped; 634 goto rx_dropped;
623 635
@@ -1439,7 +1451,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1439 break; 1451 break;
1440 1452
1441 case IEEE80211_STYPE_PROBE_REQ: 1453 case IEEE80211_STYPE_PROBE_REQ:
1442 IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", 1454 IEEE80211_DEBUG_MGMT("received auth (%d)\n",
1443 WLAN_FC_GET_STYPE(le16_to_cpu 1455 WLAN_FC_GET_STYPE(le16_to_cpu
1444 (header->frame_ctl))); 1456 (header->frame_ctl)));
1445 1457
@@ -1473,7 +1485,7 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1473 break; 1485 break;
1474 case IEEE80211_STYPE_AUTH: 1486 case IEEE80211_STYPE_AUTH:
1475 1487
1476 IEEE80211_DEBUG_MGMT("recieved auth (%d)\n", 1488 IEEE80211_DEBUG_MGMT("received auth (%d)\n",
1477 WLAN_FC_GET_STYPE(le16_to_cpu 1489 WLAN_FC_GET_STYPE(le16_to_cpu
1478 (header->frame_ctl))); 1490 (header->frame_ctl)));
1479 1491
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 23e1630f50b7..f87c6b89f845 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -232,15 +232,18 @@ static char *ipw2100_translate_scan(struct ieee80211_device *ieee,
232 return start; 232 return start;
233} 233}
234 234
235#define SCAN_ITEM_SIZE 128
236
235int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 237int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
236 struct iw_request_info *info, 238 struct iw_request_info *info,
237 union iwreq_data *wrqu, char *extra) 239 union iwreq_data *wrqu, char *extra)
238{ 240{
239 struct ieee80211_network *network; 241 struct ieee80211_network *network;
240 unsigned long flags; 242 unsigned long flags;
243 int err = 0;
241 244
242 char *ev = extra; 245 char *ev = extra;
243 char *stop = ev + IW_SCAN_MAX_DATA; 246 char *stop = ev + wrqu->data.length;
244 int i = 0; 247 int i = 0;
245 248
246 IEEE80211_DEBUG_WX("Getting scan\n"); 249 IEEE80211_DEBUG_WX("Getting scan\n");
@@ -249,6 +252,11 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
249 252
250 list_for_each_entry(network, &ieee->network_list, list) { 253 list_for_each_entry(network, &ieee->network_list, list) {
251 i++; 254 i++;
255 if (stop - ev < SCAN_ITEM_SIZE) {
256 err = -E2BIG;
257 break;
258 }
259
252 if (ieee->scan_age == 0 || 260 if (ieee->scan_age == 0 ||
253 time_after(network->last_scanned + ieee->scan_age, jiffies)) 261 time_after(network->last_scanned + ieee->scan_age, jiffies))
254 ev = ipw2100_translate_scan(ieee, ev, stop, network); 262 ev = ipw2100_translate_scan(ieee, ev, stop, network);
@@ -270,7 +278,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
270 278
271 IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i); 279 IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i);
272 280
273 return 0; 281 return err;
274} 282}
275 283
276int ieee80211_wx_set_encode(struct ieee80211_device *ieee, 284int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d8ce7133cd8f..f70ba622c856 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -970,7 +970,6 @@ int igmp_rcv(struct sk_buff *skb)
970 case IGMP_MTRACE_RESP: 970 case IGMP_MTRACE_RESP:
971 break; 971 break;
972 default: 972 default:
973 NETDEBUG(KERN_DEBUG "New IGMP type=%d, why we do not know about it?\n", ih->type);
974 } 973 }
975 974
976drop: 975drop:
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 3284cfb993e6..128de4d7c0b7 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -230,7 +230,6 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
230 if (tp->snd_cwnd < tp->snd_cwnd_clamp) 230 if (tp->snd_cwnd < tp->snd_cwnd_clamp)
231 tp->snd_cwnd++; 231 tp->snd_cwnd++;
232 tp->snd_cwnd_cnt = 0; 232 tp->snd_cwnd_cnt = 0;
233 ca->ccount++;
234 } 233 }
235 } 234 }
236} 235}
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 6c05c7978bef..4420948a1bfe 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1252,8 +1252,7 @@ int igmp6_event_query(struct sk_buff *skb)
1252 } 1252 }
1253 } else { 1253 } else {
1254 for (ma = idev->mc_list; ma; ma=ma->next) { 1254 for (ma = idev->mc_list; ma; ma=ma->next) {
1255 if (group_type != IPV6_ADDR_ANY && 1255 if (!ipv6_addr_equal(group, &ma->mca_addr))
1256 !ipv6_addr_equal(group, &ma->mca_addr))
1257 continue; 1256 continue;
1258 spin_lock_bh(&ma->mca_lock); 1257 spin_lock_bh(&ma->mca_lock);
1259 if (ma->mca_flags & MAF_TIMER_RUNNING) { 1258 if (ma->mca_flags & MAF_TIMER_RUNNING) {
@@ -1268,11 +1267,10 @@ int igmp6_event_query(struct sk_buff *skb)
1268 ma->mca_flags &= ~MAF_GSQUERY; 1267 ma->mca_flags &= ~MAF_GSQUERY;
1269 } 1268 }
1270 if (!(ma->mca_flags & MAF_GSQUERY) || 1269 if (!(ma->mca_flags & MAF_GSQUERY) ||
1271 mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs)) 1270 mld_marksources(ma, ntohs(mlh2->nsrcs), mlh2->srcs))
1272 igmp6_group_queried(ma, max_delay); 1271 igmp6_group_queried(ma, max_delay);
1273 spin_unlock_bh(&ma->mca_lock); 1272 spin_unlock_bh(&ma->mca_lock);
1274 if (group_type != IPV6_ADDR_ANY) 1273 break;
1275 break;
1276 } 1274 }
1277 } 1275 }
1278 read_unlock_bh(&idev->lock); 1276 read_unlock_bh(&idev->lock);
@@ -1351,7 +1349,7 @@ static int is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type,
1351 * in all filters 1349 * in all filters
1352 */ 1350 */
1353 if (psf->sf_count[MCAST_INCLUDE]) 1351 if (psf->sf_count[MCAST_INCLUDE])
1354 return 0; 1352 return type == MLD2_MODE_IS_INCLUDE;
1355 return pmc->mca_sfcount[MCAST_EXCLUDE] == 1353 return pmc->mca_sfcount[MCAST_EXCLUDE] ==
1356 psf->sf_count[MCAST_EXCLUDE]; 1354 psf->sf_count[MCAST_EXCLUDE];
1357 } 1355 }
@@ -1966,7 +1964,7 @@ static void sf_markstate(struct ifmcaddr6 *pmc)
1966 1964
1967static int sf_setstate(struct ifmcaddr6 *pmc) 1965static int sf_setstate(struct ifmcaddr6 *pmc)
1968{ 1966{
1969 struct ip6_sf_list *psf; 1967 struct ip6_sf_list *psf, *dpsf;
1970 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; 1968 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE];
1971 int qrv = pmc->idev->mc_qrv; 1969 int qrv = pmc->idev->mc_qrv;
1972 int new_in, rv; 1970 int new_in, rv;
@@ -1978,8 +1976,48 @@ static int sf_setstate(struct ifmcaddr6 *pmc)
1978 !psf->sf_count[MCAST_INCLUDE]; 1976 !psf->sf_count[MCAST_INCLUDE];
1979 } else 1977 } else
1980 new_in = psf->sf_count[MCAST_INCLUDE] != 0; 1978 new_in = psf->sf_count[MCAST_INCLUDE] != 0;
1981 if (new_in != psf->sf_oldin) { 1979 if (new_in) {
1982 psf->sf_crcount = qrv; 1980 if (!psf->sf_oldin) {
1981 struct ip6_sf_list *prev = 0;
1982
1983 for (dpsf=pmc->mca_tomb; dpsf;
1984 dpsf=dpsf->sf_next) {
1985 if (ipv6_addr_equal(&dpsf->sf_addr,
1986 &psf->sf_addr))
1987 break;
1988 prev = dpsf;
1989 }
1990 if (dpsf) {
1991 if (prev)
1992 prev->sf_next = dpsf->sf_next;
1993 else
1994 pmc->mca_tomb = dpsf->sf_next;
1995 kfree(dpsf);
1996 }
1997 psf->sf_crcount = qrv;
1998 rv++;
1999 }
2000 } else if (psf->sf_oldin) {
2001 psf->sf_crcount = 0;
2002 /*
2003 * add or update "delete" records if an active filter
2004 * is now inactive
2005 */
2006 for (dpsf=pmc->mca_tomb; dpsf; dpsf=dpsf->sf_next)
2007 if (ipv6_addr_equal(&dpsf->sf_addr,
2008 &psf->sf_addr))
2009 break;
2010 if (!dpsf) {
2011 dpsf = (struct ip6_sf_list *)
2012 kmalloc(sizeof(*dpsf), GFP_ATOMIC);
2013 if (!dpsf)
2014 continue;
2015 *dpsf = *psf;
2016 /* pmc->mca_lock held by callers */
2017 dpsf->sf_next = pmc->mca_tomb;
2018 pmc->mca_tomb = dpsf;
2019 }
2020 dpsf->sf_crcount = qrv;
1983 rv++; 2021 rv++;
1984 } 2022 }
1985 } 2023 }
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 43f1ce74187d..ae86d237a456 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1620,6 +1620,7 @@ static int key_notify_sa_flush(struct km_event *c)
1620 return -ENOBUFS; 1620 return -ENOBUFS;
1621 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg)); 1621 hdr = (struct sadb_msg *) skb_put(skb, sizeof(struct sadb_msg));
1622 hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto); 1622 hdr->sadb_msg_satype = pfkey_proto2satype(c->data.proto);
1623 hdr->sadb_msg_type = SADB_FLUSH;
1623 hdr->sadb_msg_seq = c->seq; 1624 hdr->sadb_msg_seq = c->seq;
1624 hdr->sadb_msg_pid = c->pid; 1625 hdr->sadb_msg_pid = c->pid;
1625 hdr->sadb_msg_version = PF_KEY_V2; 1626 hdr->sadb_msg_version = PF_KEY_V2;
@@ -2385,6 +2386,7 @@ static int key_notify_policy_flush(struct km_event *c)
2385 if (!skb_out) 2386 if (!skb_out)
2386 return -ENOBUFS; 2387 return -ENOBUFS;
2387 hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg)); 2388 hdr = (struct sadb_msg *) skb_put(skb_out, sizeof(struct sadb_msg));
2389 hdr->sadb_msg_type = SADB_X_SPDFLUSH;
2388 hdr->sadb_msg_seq = c->seq; 2390 hdr->sadb_msg_seq = c->seq;
2389 hdr->sadb_msg_pid = c->pid; 2391 hdr->sadb_msg_pid = c->pid;
2390 hdr->sadb_msg_version = PF_KEY_V2; 2392 hdr->sadb_msg_version = PF_KEY_V2;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ee93abc71cb8..9db7dbdb16e6 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -365,7 +365,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
365 */ 365 */
366 366
367 err = -EMSGSIZE; 367 err = -EMSGSIZE;
368 if(len>dev->mtu+dev->hard_header_len) 368 if (len > dev->mtu + dev->hard_header_len)
369 goto out_unlock; 369 goto out_unlock;
370 370
371 err = -ENOBUFS; 371 err = -ENOBUFS;
@@ -935,7 +935,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
935 * Check legality 935 * Check legality
936 */ 936 */
937 937
938 if(addr_len!=sizeof(struct sockaddr)) 938 if (addr_len != sizeof(struct sockaddr))
939 return -EINVAL; 939 return -EINVAL;
940 strlcpy(name,uaddr->sa_data,sizeof(name)); 940 strlcpy(name,uaddr->sa_data,sizeof(name));
941 941
@@ -1092,7 +1092,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
1092 * retries. 1092 * retries.
1093 */ 1093 */
1094 1094
1095 if(skb==NULL) 1095 if (skb == NULL)
1096 goto out; 1096 goto out;
1097 1097
1098 /* 1098 /*
@@ -1392,8 +1392,8 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
1392 if (level != SOL_PACKET) 1392 if (level != SOL_PACKET)
1393 return -ENOPROTOOPT; 1393 return -ENOPROTOOPT;
1394 1394
1395 if (get_user(len,optlen)) 1395 if (get_user(len, optlen))
1396 return -EFAULT; 1396 return -EFAULT;
1397 1397
1398 if (len < 0) 1398 if (len < 0)
1399 return -EINVAL; 1399 return -EINVAL;
@@ -1419,9 +1419,9 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
1419 return -ENOPROTOOPT; 1419 return -ENOPROTOOPT;
1420 } 1420 }
1421 1421
1422 if (put_user(len, optlen)) 1422 if (put_user(len, optlen))
1423 return -EFAULT; 1423 return -EFAULT;
1424 return 0; 1424 return 0;
1425} 1425}
1426 1426
1427 1427
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 71c9a961c321..2b9a832b29a7 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -884,7 +884,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
884{ 884{
885 struct sctp_transport *transport = (struct sctp_transport *) arg; 885 struct sctp_transport *transport = (struct sctp_transport *) arg;
886 886
887 if (asoc->overall_error_count > asoc->max_retrans) { 887 if (asoc->overall_error_count >= asoc->max_retrans) {
888 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 888 /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
889 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 889 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
890 SCTP_U32(SCTP_ERROR_NO_ERROR)); 890 SCTP_U32(SCTP_ERROR_NO_ERROR));
@@ -2122,7 +2122,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
2122 struct sctp_bind_addr *bp; 2122 struct sctp_bind_addr *bp;
2123 int attempts = asoc->init_err_counter + 1; 2123 int attempts = asoc->init_err_counter + 1;
2124 2124
2125 if (attempts >= asoc->max_init_attempts) { 2125 if (attempts > asoc->max_init_attempts) {
2126 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 2126 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
2127 SCTP_U32(SCTP_ERROR_STALE_COOKIE)); 2127 SCTP_U32(SCTP_ERROR_STALE_COOKIE));
2128 return SCTP_DISPOSITION_DELETE_TCB; 2128 return SCTP_DISPOSITION_DELETE_TCB;
@@ -4640,7 +4640,7 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(const struct sctp_endpoint *ep,
4640 4640
4641 SCTP_DEBUG_PRINTK("Timer T1 expired (INIT).\n"); 4641 SCTP_DEBUG_PRINTK("Timer T1 expired (INIT).\n");
4642 4642
4643 if (attempts < asoc->max_init_attempts) { 4643 if (attempts <= asoc->max_init_attempts) {
4644 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; 4644 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
4645 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0); 4645 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0);
4646 if (!repl) 4646 if (!repl)
@@ -4697,7 +4697,7 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep
4697 4697
4698 SCTP_DEBUG_PRINTK("Timer T1 expired (COOKIE-ECHO).\n"); 4698 SCTP_DEBUG_PRINTK("Timer T1 expired (COOKIE-ECHO).\n");
4699 4699
4700 if (attempts < asoc->max_init_attempts) { 4700 if (attempts <= asoc->max_init_attempts) {
4701 repl = sctp_make_cookie_echo(asoc, NULL); 4701 repl = sctp_make_cookie_echo(asoc, NULL);
4702 if (!repl) 4702 if (!repl)
4703 return SCTP_DISPOSITION_NOMEM; 4703 return SCTP_DISPOSITION_NOMEM;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index fb1821d9f338..0ea947eb6813 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5426,7 +5426,7 @@ out:
5426 return err; 5426 return err;
5427 5427
5428do_error: 5428do_error:
5429 if (asoc->init_err_counter + 1 >= asoc->max_init_attempts) 5429 if (asoc->init_err_counter + 1 > asoc->max_init_attempts)
5430 err = -ETIMEDOUT; 5430 err = -ETIMEDOUT;
5431 else 5431 else
5432 err = -ECONNREFUSED; 5432 err = -ECONNREFUSED;
diff --git a/security/seclvl.c b/security/seclvl.c
index 1caac0164643..8529ea6f7aa8 100644
--- a/security/seclvl.c
+++ b/security/seclvl.c
@@ -368,8 +368,8 @@ static int seclvl_capable(struct task_struct *tsk, int cap)
368 */ 368 */
369static int seclvl_settime(struct timespec *tv, struct timezone *tz) 369static int seclvl_settime(struct timespec *tv, struct timezone *tz)
370{ 370{
371 struct timespec now; 371 if (tv && seclvl > 1) {
372 if (seclvl > 1) { 372 struct timespec now;
373 now = current_kernel_time(); 373 now = current_kernel_time();
374 if (tv->tv_sec < now.tv_sec || 374 if (tv->tv_sec < now.tv_sec ||
375 (tv->tv_sec == now.tv_sec && tv->tv_nsec < now.tv_nsec)) { 375 (tv->tv_sec == now.tv_sec && tv->tv_nsec < now.tv_nsec)) {