aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/atm/eni.h1
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c1
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c4
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c29
-rw-r--r--drivers/net/7990.c6
-rw-r--r--drivers/net/atlx/atl1.c17
-rw-r--r--drivers/net/ehea/ehea_main.c16
-rw-r--r--drivers/net/forcedeth.c20
-rw-r--r--drivers/net/irda/Kconfig1
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c4
-rw-r--r--drivers/net/pppoe.c37
-rw-r--r--drivers/net/pppol2tp.c20
-rw-r--r--drivers/net/sfc/falcon.c4
-rw-r--r--drivers/net/sky2.c2
-rw-r--r--drivers/net/tg3.c33
-rw-r--r--drivers/net/virtio_net.c52
-rw-r--r--drivers/net/wireless/ipw2200.c176
-rw-r--r--drivers/net/wireless/ipw2200.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-led.c5
-rw-r--r--drivers/net/wireless/libertas/cmd.c5
-rw-r--r--drivers/net/wireless/libertas/main.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c2
-rw-r--r--drivers/s390/net/qeth_core_main.c49
-rw-r--r--drivers/s390/net/qeth_core_offl.c6
-rw-r--r--drivers/s390/net/qeth_core_sys.c12
-rw-r--r--drivers/s390/net/qeth_l2_main.c41
-rw-r--r--drivers/s390/net/qeth_l3_main.c75
-rw-r--r--drivers/s390/net/qeth_l3_sys.c24
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/linux/ssb/ssb_driver_gige.h2
-rw-r--r--include/linux/virtio_net.h2
-rw-r--r--include/net/inet_sock.h10
-rw-r--r--include/net/tcp.h1
-rw-r--r--net/dccp/ipv4.c3
-rw-r--r--net/dccp/ipv6.c1
-rw-r--r--net/ipv4/fib_semantics.c5
-rw-r--r--net/ipv4/syncookies.c3
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/syncookies.c1
-rw-r--r--net/ipv6/tcp_ipv6.c1
-rw-r--r--net/key/af_key.c3
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c1
-rw-r--r--net/mac80211/mlme.c18
-rw-r--r--net/mac80211/wext.c15
47 files changed, 361 insertions, 366 deletions
diff --git a/drivers/atm/eni.h b/drivers/atm/eni.h
index d04fefb0841f..e4c9525e60b3 100644
--- a/drivers/atm/eni.h
+++ b/drivers/atm/eni.h
@@ -18,7 +18,6 @@
18#include "midway.h" 18#include "midway.h"
19 19
20 20
21#define KERNEL_OFFSET 0xC0000000 /* kernel 0x0 is at phys 0xC0000000 */
22#define DEV_LABEL "eni" 21#define DEV_LABEL "eni"
23 22
24#define UBR_BUFFER (128*1024) /* UBR buffer size */ 23#define UBR_BUFFER (128*1024) /* UBR buffer size */
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index 5fcbdccd7a53..16a874bb1561 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)
806 806
807 if (!create_divas_proc()) { 807 if (!create_divas_proc()) {
808#ifdef MODULE 808#ifdef MODULE
809 remove_divas_proc();
810 divas_unregister_chrdev(); 809 divas_unregister_chrdev();
811 divasfunc_exit(); 810 divasfunc_exit();
812#endif 811#endif
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index fae895828a17..040827288ec9 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -125,8 +125,8 @@ static const struct file_operations divas_fops = {
125 125
126int create_divas_proc(void) 126int create_divas_proc(void)
127{ 127{
128 proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon, 128 divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO,
129 &divas_fops); 129 proc_net_eicon, &divas_fops);
130 if (!divas_proc_entry) 130 if (!divas_proc_entry)
131 return (0); 131 return (0);
132 132
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index 15906d005b05..484299b031f8 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
207/* read conf file -> output card info data */ 207/* read conf file -> output card info data */
208/*******************************************/ 208/*******************************************/
209static ssize_t 209static ssize_t
210hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off) 210hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off)
211{ 211{
212 char *cp; 212 char *cp;
213 int i;
214 213
215 if (file->f_mode & FMODE_READ) { 214 if (!(file->f_mode & FMODE_READ))
216 if (!(cp = file->private_data)) 215 return -EPERM; /* no permission to read */
217 return (-EFAULT); /* should never happen */ 216
218 i = strlen(cp); /* get total string length */ 217 if (!(cp = file->private_data))
219 if (*off < i) { 218 return -EFAULT; /* should never happen */
220 /* still bytes to transfer */ 219
221 cp += *off; /* point to desired data offset */ 220 return simple_read_from_buffer(buf, count, off, cp, strlen(cp));
222 i -= *off; /* remaining length */
223 if (i > count)
224 i = count; /* limit length to transfer */
225 if (copy_to_user(buf, cp, i))
226 return (-EFAULT); /* copy error */
227 *off += i; /* adjust offset */
228 } else
229 return (0);
230 } else
231 return (-EPERM); /* no permission to read */
232
233 return (i);
234} /* hysdn_conf_read */ 221} /* hysdn_conf_read */
235 222
236/******************/ 223/******************/
diff --git a/drivers/net/7990.c b/drivers/net/7990.c
index 750a46f4bc58..ad6b8a5b6574 100644
--- a/drivers/net/7990.c
+++ b/drivers/net/7990.c
@@ -506,6 +506,7 @@ int lance_open (struct net_device *dev)
506 506
507 return res; 507 return res;
508} 508}
509EXPORT_SYMBOL_GPL(lance_open);
509 510
510int lance_close (struct net_device *dev) 511int lance_close (struct net_device *dev)
511{ 512{
@@ -521,6 +522,7 @@ int lance_close (struct net_device *dev)
521 522
522 return 0; 523 return 0;
523} 524}
525EXPORT_SYMBOL_GPL(lance_close);
524 526
525void lance_tx_timeout(struct net_device *dev) 527void lance_tx_timeout(struct net_device *dev)
526{ 528{
@@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev)
529 dev->trans_start = jiffies; 531 dev->trans_start = jiffies;
530 netif_wake_queue (dev); 532 netif_wake_queue (dev);
531} 533}
532 534EXPORT_SYMBOL_GPL(lance_tx_timeout);
533 535
534int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) 536int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
535{ 537{
@@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
586 588
587 return 0; 589 return 0;
588} 590}
591EXPORT_SYMBOL_GPL(lance_start_xmit);
589 592
590/* taken from the depca driver via a2065.c */ 593/* taken from the depca driver via a2065.c */
591static void lance_load_multicast (struct net_device *dev) 594static void lance_load_multicast (struct net_device *dev)
@@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev)
654 if (!stopped) 657 if (!stopped)
655 netif_start_queue (dev); 658 netif_start_queue (dev);
656} 659}
660EXPORT_SYMBOL_GPL(lance_set_multicast);
657 661
658#ifdef CONFIG_NET_POLL_CONTROLLER 662#ifdef CONFIG_NET_POLL_CONTROLLER
659void lance_poll(struct net_device *dev) 663void lance_poll(struct net_device *dev)
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 6ddc911e7d15..99e0b4cdc56f 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -637,22 +637,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
637} 637}
638 638
639/* 639/*
640 * Force the PHY into power saving mode using vendor magic.
641 */
642#ifdef CONFIG_PM
643static void atl1_phy_enter_power_saving(struct atl1_hw *hw)
644{
645 atl1_write_phy_reg(hw, MII_DBG_ADDR, 0);
646 atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E);
647 atl1_write_phy_reg(hw, MII_DBG_ADDR, 2);
648 atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000);
649 atl1_write_phy_reg(hw, MII_DBG_ADDR, 3);
650 atl1_write_phy_reg(hw, MII_DBG_DATA, 0);
651
652}
653#endif
654
655/*
656 * Resets the PHY and make all config validate 640 * Resets the PHY and make all config validate
657 * hw - Struct containing variables accessed by shared code 641 * hw - Struct containing variables accessed by shared code
658 * 642 *
@@ -2860,7 +2844,6 @@ disable_wol:
2860 ctrl |= PCIE_PHYMISC_FORCE_RCV_DET; 2844 ctrl |= PCIE_PHYMISC_FORCE_RCV_DET;
2861 iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC); 2845 iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC);
2862 ioread32(hw->hw_addr + REG_PCIE_PHYMISC); 2846 ioread32(hw->hw_addr + REG_PCIE_PHYMISC);
2863 atl1_phy_enter_power_saving(hw);
2864 hw->phy_configured = false; 2847 hw->phy_configured = false;
2865 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); 2848 pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
2866exit: 2849exit:
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 287a61918739..faae01dc1c4b 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
1766 mutex_lock(&ehea_bcmc_regs.lock); 1766 mutex_lock(&ehea_bcmc_regs.lock);
1767 1767
1768 /* Deregister old MAC in pHYP */ 1768 /* Deregister old MAC in pHYP */
1769 ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); 1769 if (port->state == EHEA_PORT_UP) {
1770 if (ret) 1770 ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
1771 goto out_upregs; 1771 if (ret)
1772 goto out_upregs;
1773 }
1772 1774
1773 port->mac_addr = cb0->port_mac_addr << 16; 1775 port->mac_addr = cb0->port_mac_addr << 16;
1774 1776
1775 /* Register new MAC in pHYP */ 1777 /* Register new MAC in pHYP */
1776 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); 1778 if (port->state == EHEA_PORT_UP) {
1777 if (ret) 1779 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
1778 goto out_upregs; 1780 if (ret)
1781 goto out_upregs;
1782 }
1779 1783
1780 ret = 0; 1784 ret = 0;
1781 1785
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 9eca97fb0a54..2cb244763292 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev)
3273 dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name); 3273 dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
3274} 3274}
3275 3275
3276static void nv_msi_workaround(struct fe_priv *np)
3277{
3278
3279 /* Need to toggle the msi irq mask within the ethernet device,
3280 * otherwise, future interrupts will not be detected.
3281 */
3282 if (np->msi_flags & NV_MSI_ENABLED) {
3283 u8 __iomem *base = np->base;
3284
3285 writel(0, base + NvRegMSIIrqMask);
3286 writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
3287 }
3288}
3289
3276static irqreturn_t nv_nic_irq(int foo, void *data) 3290static irqreturn_t nv_nic_irq(int foo, void *data)
3277{ 3291{
3278 struct net_device *dev = (struct net_device *) data; 3292 struct net_device *dev = (struct net_device *) data;
@@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3295 if (!(events & np->irqmask)) 3309 if (!(events & np->irqmask))
3296 break; 3310 break;
3297 3311
3312 nv_msi_workaround(np);
3313
3298 spin_lock(&np->lock); 3314 spin_lock(&np->lock);
3299 nv_tx_done(dev); 3315 nv_tx_done(dev);
3300 spin_unlock(&np->lock); 3316 spin_unlock(&np->lock);
@@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3410 if (!(events & np->irqmask)) 3426 if (!(events & np->irqmask))
3411 break; 3427 break;
3412 3428
3429 nv_msi_workaround(np);
3430
3413 spin_lock(&np->lock); 3431 spin_lock(&np->lock);
3414 nv_tx_done_optimized(dev, TX_WORK_PER_LOOP); 3432 nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
3415 spin_unlock(&np->lock); 3433 spin_unlock(&np->lock);
@@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
3750 if (!(events & NVREG_IRQ_TIMER)) 3768 if (!(events & NVREG_IRQ_TIMER))
3751 return IRQ_RETVAL(0); 3769 return IRQ_RETVAL(0);
3752 3770
3771 nv_msi_workaround(np);
3772
3753 spin_lock(&np->lock); 3773 spin_lock(&np->lock);
3754 np->intr_test = 1; 3774 np->intr_test = 1;
3755 spin_unlock(&np->lock); 3775 spin_unlock(&np->lock);
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index ce816ba9c40d..e6317557a531 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -329,6 +329,7 @@ config PXA_FICP
329config MCS_FIR 329config MCS_FIR
330 tristate "MosChip MCS7780 IrDA-USB dongle" 330 tristate "MosChip MCS7780 IrDA-USB dongle"
331 depends on IRDA && USB && EXPERIMENTAL 331 depends on IRDA && USB && EXPERIMENTAL
332 select CRC32
332 help 333 help
333 Say Y or M here if you want to build support for the MosChip 334 Say Y or M here if you want to build support for the MosChip
334 MCS7780 IrDA-USB bridge device driver. 335 MCS7780 IrDA-USB bridge device driver.
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 6321b059ce13..2f38e847e2cd 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);
58 58
59static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw) 59static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
60{ 60{
61 hw->mac.num_rx_queues = IXGBE_82598_MAX_TX_QUEUES; 61 hw->mac.num_rx_queues = IXGBE_82598_MAX_RX_QUEUES;
62 hw->mac.num_tx_queues = IXGBE_82598_MAX_RX_QUEUES; 62 hw->mac.num_tx_queues = IXGBE_82598_MAX_TX_QUEUES;
63 hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES; 63 hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES;
64 64
65 /* PHY ops are filled in by default properly for Fiber only */ 65 /* PHY ops are filled in by default properly for Fiber only */
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 58a26a47af29..bafb69b6f7cb 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -341,12 +341,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
341 struct pppox_sock *relay_po; 341 struct pppox_sock *relay_po;
342 342
343 if (sk->sk_state & PPPOX_BOUND) { 343 if (sk->sk_state & PPPOX_BOUND) {
344 struct pppoe_hdr *ph = pppoe_hdr(skb);
345 int len = ntohs(ph->length);
346 skb_pull_rcsum(skb, sizeof(struct pppoe_hdr));
347 if (pskb_trim_rcsum(skb, len))
348 goto abort_kfree;
349
350 ppp_input(&po->chan, skb); 344 ppp_input(&po->chan, skb);
351 } else if (sk->sk_state & PPPOX_RELAY) { 345 } else if (sk->sk_state & PPPOX_RELAY) {
352 relay_po = get_item_by_addr(&po->pppoe_relay); 346 relay_po = get_item_by_addr(&po->pppoe_relay);
@@ -357,7 +351,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
357 if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0) 351 if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0)
358 goto abort_put; 352 goto abort_put;
359 353
360 skb_pull(skb, sizeof(struct pppoe_hdr));
361 if (!__pppoe_xmit(sk_pppox(relay_po), skb)) 354 if (!__pppoe_xmit(sk_pppox(relay_po), skb))
362 goto abort_put; 355 goto abort_put;
363 } else { 356 } else {
@@ -388,6 +381,7 @@ static int pppoe_rcv(struct sk_buff *skb,
388{ 381{
389 struct pppoe_hdr *ph; 382 struct pppoe_hdr *ph;
390 struct pppox_sock *po; 383 struct pppox_sock *po;
384 int len;
391 385
392 if (!(skb = skb_share_check(skb, GFP_ATOMIC))) 386 if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
393 goto out; 387 goto out;
@@ -399,10 +393,21 @@ static int pppoe_rcv(struct sk_buff *skb,
399 goto drop; 393 goto drop;
400 394
401 ph = pppoe_hdr(skb); 395 ph = pppoe_hdr(skb);
396 len = ntohs(ph->length);
397
398 skb_pull_rcsum(skb, sizeof(*ph));
399 if (skb->len < len)
400 goto drop;
402 401
403 po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); 402 po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
404 if (po != NULL) 403 if (!po)
405 return sk_receive_skb(sk_pppox(po), skb, 0); 404 goto drop;
405
406 if (pskb_trim_rcsum(skb, len))
407 goto drop;
408
409 return sk_receive_skb(sk_pppox(po), skb, 0);
410
406drop: 411drop:
407 kfree_skb(skb); 412 kfree_skb(skb);
408out: 413out:
@@ -427,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
427 if (dev_net(dev) != &init_net) 432 if (dev_net(dev) != &init_net)
428 goto abort; 433 goto abort;
429 434
430 if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
431 goto abort;
432
433 if (!(skb = skb_share_check(skb, GFP_ATOMIC))) 435 if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
434 goto out; 436 goto out;
435 437
438 if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
439 goto abort;
440
436 ph = pppoe_hdr(skb); 441 ph = pppoe_hdr(skb);
437 if (ph->code != PADT_CODE) 442 if (ph->code != PADT_CODE)
438 goto abort; 443 goto abort;
@@ -937,12 +942,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
937 m->msg_namelen = 0; 942 m->msg_namelen = 0;
938 943
939 if (skb) { 944 if (skb) {
940 struct pppoe_hdr *ph = pppoe_hdr(skb); 945 total_len = min(total_len, skb->len);
941 const int len = ntohs(ph->length); 946 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
942
943 error = memcpy_toiovec(m->msg_iov, (unsigned char *) &ph->tag[0], len);
944 if (error == 0) 947 if (error == 0)
945 error = len; 948 error = total_len;
946 } 949 }
947 950
948 kfree_skb(skb); 951 kfree_skb(skb);
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 70cfdb46aa27..f9298827a76c 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -783,14 +783,18 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock,
783 err = 0; 783 err = 0;
784 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, 784 skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
785 flags & MSG_DONTWAIT, &err); 785 flags & MSG_DONTWAIT, &err);
786 if (skb) { 786 if (!skb)
787 err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data, 787 goto end;
788 skb->len); 788
789 if (err < 0) 789 if (len > skb->len)
790 goto do_skb_free; 790 len = skb->len;
791 err = skb->len; 791 else if (len < skb->len)
792 } 792 msg->msg_flags |= MSG_TRUNC;
793do_skb_free: 793
794 err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len);
795 if (likely(err == 0))
796 err = len;
797
794 kfree_skb(skb); 798 kfree_skb(skb);
795end: 799end:
796 return err; 800 return err;
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index d3f749c72d41..790db89db345 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
733 continue; 733 continue;
734 break; 734 break;
735 } 735 }
736 if (rc) 736 if (rc) {
737 EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue); 737 EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue);
738 efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
739 }
738 740
739 /* Remove RX descriptor ring from card */ 741 /* Remove RX descriptor ring from card */
740 EFX_ZERO_OWORD(rx_desc_ptr); 742 EFX_ZERO_OWORD(rx_desc_ptr);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3bb60530d4d7..62436b3a18c6 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev)
4404 if (err) { 4404 if (err) {
4405 printk(KERN_ERR PFX "%s: could not up: %d\n", 4405 printk(KERN_ERR PFX "%s: could not up: %d\n",
4406 dev->name, err); 4406 dev->name, err);
4407 rtnl_lock();
4407 dev_close(dev); 4408 dev_close(dev);
4409 rtnl_unlock();
4408 goto out; 4410 goto out;
4409 } 4411 }
4410 } 4412 }
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 07b3f77e7626..cc4bde852542 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.92" 67#define DRV_MODULE_VERSION "3.92.1"
68#define DRV_MODULE_RELDATE "May 2, 2008" 68#define DRV_MODULE_RELDATE "June 9, 2008"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -1295,6 +1295,21 @@ static void tg3_frob_aux_power(struct tg3 *tp)
1295 GRC_LCLCTRL_GPIO_OUTPUT0 | 1295 GRC_LCLCTRL_GPIO_OUTPUT0 |
1296 GRC_LCLCTRL_GPIO_OUTPUT1), 1296 GRC_LCLCTRL_GPIO_OUTPUT1),
1297 100); 1297 100);
1298 } else if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) {
1299 /* The 5761 non-e device swaps GPIO 0 and GPIO 2. */
1300 u32 grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 |
1301 GRC_LCLCTRL_GPIO_OE1 |
1302 GRC_LCLCTRL_GPIO_OE2 |
1303 GRC_LCLCTRL_GPIO_OUTPUT0 |
1304 GRC_LCLCTRL_GPIO_OUTPUT1 |
1305 tp->grc_local_ctrl;
1306 tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
1307
1308 grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT2;
1309 tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
1310
1311 grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT0;
1312 tw32_wait_f(GRC_LOCAL_CTRL, grc_local_ctrl, 100);
1298 } else { 1313 } else {
1299 u32 no_gpio2; 1314 u32 no_gpio2;
1300 u32 grc_local_ctrl = 0; 1315 u32 grc_local_ctrl = 0;
@@ -3168,8 +3183,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
3168 err |= tg3_readphy(tp, MII_BMCR, &bmcr); 3183 err |= tg3_readphy(tp, MII_BMCR, &bmcr);
3169 3184
3170 if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset && 3185 if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset &&
3171 (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT) && 3186 (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
3172 tp->link_config.flowctrl == tp->link_config.active_flowctrl) {
3173 /* do nothing, just check for link up at the end */ 3187 /* do nothing, just check for link up at the end */
3174 } else if (tp->link_config.autoneg == AUTONEG_ENABLE) { 3188 } else if (tp->link_config.autoneg == AUTONEG_ENABLE) {
3175 u32 adv, new_adv; 3189 u32 adv, new_adv;
@@ -8599,7 +8613,7 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
8599 (cmd->speed == SPEED_1000)) 8613 (cmd->speed == SPEED_1000))
8600 return -EINVAL; 8614 return -EINVAL;
8601 else if ((cmd->speed == SPEED_1000) && 8615 else if ((cmd->speed == SPEED_1000) &&
8602 (tp->tg3_flags2 & TG3_FLAG_10_100_ONLY)) 8616 (tp->tg3_flags & TG3_FLAG_10_100_ONLY))
8603 return -EINVAL; 8617 return -EINVAL;
8604 8618
8605 tg3_full_lock(tp, 0); 8619 tg3_full_lock(tp, 0);
@@ -11768,6 +11782,15 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
11768 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) 11782 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
11769 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL; 11783 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
11770 11784
11785 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761) {
11786 /* Turn off the debug UART. */
11787 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_UART_SEL;
11788 if (tp->tg3_flags2 & TG3_FLG2_IS_NIC)
11789 /* Keep VMain power. */
11790 tp->grc_local_ctrl |= GRC_LCLCTRL_GPIO_OE0 |
11791 GRC_LCLCTRL_GPIO_OUTPUT0;
11792 }
11793
11771 /* Force the chip into D0. */ 11794 /* Force the chip into D0. */
11772 err = tg3_set_power_state(tp, PCI_D0); 11795 err = tg3_set_power_state(tp, PCI_D0);
11773 if (err) { 11796 if (err) {
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 5450eac9e263..4452306d5328 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -44,11 +44,15 @@ struct virtnet_info
44 /* The skb we couldn't send because buffers were full. */ 44 /* The skb we couldn't send because buffers were full. */
45 struct sk_buff *last_xmit_skb; 45 struct sk_buff *last_xmit_skb;
46 46
47 /* If we need to free in a timer, this is it. */
48 struct timer_list xmit_free_timer;
49
47 /* Number of input buffers, and max we've ever had. */ 50 /* Number of input buffers, and max we've ever had. */
48 unsigned int num, max; 51 unsigned int num, max;
49 52
50 /* For cleaning up after transmission. */ 53 /* For cleaning up after transmission. */
51 struct tasklet_struct tasklet; 54 struct tasklet_struct tasklet;
55 bool free_in_tasklet;
52 56
53 /* Receive & send queues. */ 57 /* Receive & send queues. */
54 struct sk_buff_head recv; 58 struct sk_buff_head recv;
@@ -72,7 +76,7 @@ static void skb_xmit_done(struct virtqueue *svq)
72 /* Suppress further interrupts. */ 76 /* Suppress further interrupts. */
73 svq->vq_ops->disable_cb(svq); 77 svq->vq_ops->disable_cb(svq);
74 78
75 /* We were waiting for more output buffers. */ 79 /* We were probably waiting for more output buffers. */
76 netif_wake_queue(vi->dev); 80 netif_wake_queue(vi->dev);
77 81
78 /* Make sure we re-xmit last_xmit_skb: if there are no more packets 82 /* Make sure we re-xmit last_xmit_skb: if there are no more packets
@@ -94,9 +98,7 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
94 BUG_ON(len > MAX_PACKET_LEN); 98 BUG_ON(len > MAX_PACKET_LEN);
95 99
96 skb_trim(skb, len); 100 skb_trim(skb, len);
97 skb->protocol = eth_type_trans(skb, dev); 101
98 pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
99 ntohs(skb->protocol), skb->len, skb->pkt_type);
100 dev->stats.rx_bytes += skb->len; 102 dev->stats.rx_bytes += skb->len;
101 dev->stats.rx_packets++; 103 dev->stats.rx_packets++;
102 104
@@ -106,6 +108,10 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
106 goto frame_err; 108 goto frame_err;
107 } 109 }
108 110
111 skb->protocol = eth_type_trans(skb, dev);
112 pr_debug("Receiving skb proto 0x%04x len %i type %i\n",
113 ntohs(skb->protocol), skb->len, skb->pkt_type);
114
109 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { 115 if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
110 pr_debug("GSO!\n"); 116 pr_debug("GSO!\n");
111 switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { 117 switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -238,9 +244,25 @@ static void free_old_xmit_skbs(struct virtnet_info *vi)
238 } 244 }
239} 245}
240 246
247/* If the virtio transport doesn't always notify us when all in-flight packets
248 * are consumed, we fall back to using this function on a timer to free them. */
249static void xmit_free(unsigned long data)
250{
251 struct virtnet_info *vi = (void *)data;
252
253 netif_tx_lock(vi->dev);
254
255 free_old_xmit_skbs(vi);
256
257 if (!skb_queue_empty(&vi->send))
258 mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
259
260 netif_tx_unlock(vi->dev);
261}
262
241static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) 263static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
242{ 264{
243 int num; 265 int num, err;
244 struct scatterlist sg[2+MAX_SKB_FRAGS]; 266 struct scatterlist sg[2+MAX_SKB_FRAGS];
245 struct virtio_net_hdr *hdr; 267 struct virtio_net_hdr *hdr;
246 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; 268 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
@@ -283,7 +305,11 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
283 vnet_hdr_to_sg(sg, skb); 305 vnet_hdr_to_sg(sg, skb);
284 num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; 306 num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
285 307
286 return vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb); 308 err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
309 if (!err && !vi->free_in_tasklet)
310 mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
311
312 return err;
287} 313}
288 314
289static void xmit_tasklet(unsigned long data) 315static void xmit_tasklet(unsigned long data)
@@ -295,6 +321,8 @@ static void xmit_tasklet(unsigned long data)
295 vi->svq->vq_ops->kick(vi->svq); 321 vi->svq->vq_ops->kick(vi->svq);
296 vi->last_xmit_skb = NULL; 322 vi->last_xmit_skb = NULL;
297 } 323 }
324 if (vi->free_in_tasklet)
325 free_old_xmit_skbs(vi);
298 netif_tx_unlock_bh(vi->dev); 326 netif_tx_unlock_bh(vi->dev);
299} 327}
300 328
@@ -435,6 +463,10 @@ static int virtnet_probe(struct virtio_device *vdev)
435 vi->vdev = vdev; 463 vi->vdev = vdev;
436 vdev->priv = vi; 464 vdev->priv = vi;
437 465
466 /* If they give us a callback when all buffers are done, we don't need
467 * the timer. */
468 vi->free_in_tasklet = virtio_has_feature(vdev,VIRTIO_F_NOTIFY_ON_EMPTY);
469
438 /* We expect two virtqueues, receive then send. */ 470 /* We expect two virtqueues, receive then send. */
439 vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done); 471 vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
440 if (IS_ERR(vi->rvq)) { 472 if (IS_ERR(vi->rvq)) {
@@ -454,6 +486,9 @@ static int virtnet_probe(struct virtio_device *vdev)
454 486
455 tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi); 487 tasklet_init(&vi->tasklet, xmit_tasklet, (unsigned long)vi);
456 488
489 if (!vi->free_in_tasklet)
490 setup_timer(&vi->xmit_free_timer, xmit_free, (unsigned long)vi);
491
457 err = register_netdev(dev); 492 err = register_netdev(dev);
458 if (err) { 493 if (err) {
459 pr_debug("virtio_net: registering device failed\n"); 494 pr_debug("virtio_net: registering device failed\n");
@@ -491,6 +526,9 @@ static void virtnet_remove(struct virtio_device *vdev)
491 /* Stop all the virtqueues. */ 526 /* Stop all the virtqueues. */
492 vdev->config->reset(vdev); 527 vdev->config->reset(vdev);
493 528
529 if (!vi->free_in_tasklet)
530 del_timer_sync(&vi->xmit_free_timer);
531
494 /* Free our skbs in send and recv queues, if any. */ 532 /* Free our skbs in send and recv queues, if any. */
495 while ((skb = __skb_dequeue(&vi->recv)) != NULL) { 533 while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
496 kfree_skb(skb); 534 kfree_skb(skb);
@@ -514,7 +552,7 @@ static struct virtio_device_id id_table[] = {
514static unsigned int features[] = { 552static unsigned int features[] = {
515 VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, 553 VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC,
516 VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, 554 VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6,
517 VIRTIO_NET_F_HOST_ECN, 555 VIRTIO_NET_F_HOST_ECN, VIRTIO_F_NOTIFY_ON_EMPTY,
518}; 556};
519 557
520static struct virtio_driver virtio_net = { 558static struct virtio_driver virtio_net = {
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 729336774828..6e704608947c 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1753,6 +1753,8 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio)
1753 1753
1754 if (priv->workqueue) { 1754 if (priv->workqueue) {
1755 cancel_delayed_work(&priv->request_scan); 1755 cancel_delayed_work(&priv->request_scan);
1756 cancel_delayed_work(&priv->request_direct_scan);
1757 cancel_delayed_work(&priv->request_passive_scan);
1756 cancel_delayed_work(&priv->scan_event); 1758 cancel_delayed_work(&priv->scan_event);
1757 } 1759 }
1758 queue_work(priv->workqueue, &priv->down); 1760 queue_work(priv->workqueue, &priv->down);
@@ -2005,6 +2007,8 @@ static void ipw_irq_tasklet(struct ipw_priv *priv)
2005 wake_up_interruptible(&priv->wait_command_queue); 2007 wake_up_interruptible(&priv->wait_command_queue);
2006 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2008 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
2007 cancel_delayed_work(&priv->request_scan); 2009 cancel_delayed_work(&priv->request_scan);
2010 cancel_delayed_work(&priv->request_direct_scan);
2011 cancel_delayed_work(&priv->request_passive_scan);
2008 cancel_delayed_work(&priv->scan_event); 2012 cancel_delayed_work(&priv->scan_event);
2009 schedule_work(&priv->link_down); 2013 schedule_work(&priv->link_down);
2010 queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ); 2014 queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ);
@@ -4712,6 +4716,12 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4712 priv->status &= ~STATUS_SCAN_FORCED; 4716 priv->status &= ~STATUS_SCAN_FORCED;
4713#endif /* CONFIG_IPW2200_MONITOR */ 4717#endif /* CONFIG_IPW2200_MONITOR */
4714 4718
4719 /* Do queued direct scans first */
4720 if (priv->status & STATUS_DIRECT_SCAN_PENDING) {
4721 queue_delayed_work(priv->workqueue,
4722 &priv->request_direct_scan, 0);
4723 }
4724
4715 if (!(priv->status & (STATUS_ASSOCIATED | 4725 if (!(priv->status & (STATUS_ASSOCIATED |
4716 STATUS_ASSOCIATING | 4726 STATUS_ASSOCIATING |
4717 STATUS_ROAMING | 4727 STATUS_ROAMING |
@@ -6267,7 +6277,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6267 } 6277 }
6268} 6278}
6269 6279
6270static int ipw_request_scan_helper(struct ipw_priv *priv, int type) 6280static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
6271{ 6281{
6272 struct ipw_scan_request_ext scan; 6282 struct ipw_scan_request_ext scan;
6273 int err = 0, scan_type; 6283 int err = 0, scan_type;
@@ -6278,22 +6288,31 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
6278 6288
6279 mutex_lock(&priv->mutex); 6289 mutex_lock(&priv->mutex);
6280 6290
6291 if (direct && (priv->direct_scan_ssid_len == 0)) {
6292 IPW_DEBUG_HC("Direct scan requested but no SSID to scan for\n");
6293 priv->status &= ~STATUS_DIRECT_SCAN_PENDING;
6294 goto done;
6295 }
6296
6281 if (priv->status & STATUS_SCANNING) { 6297 if (priv->status & STATUS_SCANNING) {
6282 IPW_DEBUG_HC("Concurrent scan requested. Ignoring.\n"); 6298 IPW_DEBUG_HC("Concurrent scan requested. Queuing.\n");
6283 priv->status |= STATUS_SCAN_PENDING; 6299 priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
6300 STATUS_SCAN_PENDING;
6284 goto done; 6301 goto done;
6285 } 6302 }
6286 6303
6287 if (!(priv->status & STATUS_SCAN_FORCED) && 6304 if (!(priv->status & STATUS_SCAN_FORCED) &&
6288 priv->status & STATUS_SCAN_ABORTING) { 6305 priv->status & STATUS_SCAN_ABORTING) {
6289 IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n"); 6306 IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n");
6290 priv->status |= STATUS_SCAN_PENDING; 6307 priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
6308 STATUS_SCAN_PENDING;
6291 goto done; 6309 goto done;
6292 } 6310 }
6293 6311
6294 if (priv->status & STATUS_RF_KILL_MASK) { 6312 if (priv->status & STATUS_RF_KILL_MASK) {
6295 IPW_DEBUG_HC("Aborting scan due to RF Kill activation\n"); 6313 IPW_DEBUG_HC("Queuing scan due to RF Kill activation\n");
6296 priv->status |= STATUS_SCAN_PENDING; 6314 priv->status |= direct ? STATUS_DIRECT_SCAN_PENDING :
6315 STATUS_SCAN_PENDING;
6297 goto done; 6316 goto done;
6298 } 6317 }
6299 6318
@@ -6321,6 +6340,7 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
6321 cpu_to_le16(20); 6340 cpu_to_le16(20);
6322 6341
6323 scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120); 6342 scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120);
6343 scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20);
6324 6344
6325#ifdef CONFIG_IPW2200_MONITOR 6345#ifdef CONFIG_IPW2200_MONITOR
6326 if (priv->ieee->iw_mode == IW_MODE_MONITOR) { 6346 if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
@@ -6360,13 +6380,23 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type)
6360 cpu_to_le16(2000); 6380 cpu_to_le16(2000);
6361 } else { 6381 } else {
6362#endif /* CONFIG_IPW2200_MONITOR */ 6382#endif /* CONFIG_IPW2200_MONITOR */
6363 /* If we are roaming, then make this a directed scan for the 6383 /* Honor direct scans first, otherwise if we are roaming make
6364 * current network. Otherwise, ensure that every other scan 6384 * this a direct scan for the current network. Finally,
6365 * is a fast channel hop scan */ 6385 * ensure that every other scan is a fast channel hop scan */
6366 if ((priv->status & STATUS_ROAMING) 6386 if (direct) {
6367 || (!(priv->status & STATUS_ASSOCIATED) 6387 err = ipw_send_ssid(priv, priv->direct_scan_ssid,
6368 && (priv->config & CFG_STATIC_ESSID) 6388 priv->direct_scan_ssid_len);
6369 && (le32_to_cpu(scan.full_scan_index) % 2))) { 6389 if (err) {
6390 IPW_DEBUG_HC("Attempt to send SSID command "
6391 "failed\n");
6392 goto done;
6393 }
6394
6395 scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN;
6396 } else if ((priv->status & STATUS_ROAMING)
6397 || (!(priv->status & STATUS_ASSOCIATED)
6398 && (priv->config & CFG_STATIC_ESSID)
6399 && (le32_to_cpu(scan.full_scan_index) % 2))) {
6370 err = ipw_send_ssid(priv, priv->essid, priv->essid_len); 6400 err = ipw_send_ssid(priv, priv->essid, priv->essid_len);
6371 if (err) { 6401 if (err) {
6372 IPW_DEBUG_HC("Attempt to send SSID command " 6402 IPW_DEBUG_HC("Attempt to send SSID command "
@@ -6391,7 +6421,12 @@ send_request:
6391 } 6421 }
6392 6422
6393 priv->status |= STATUS_SCANNING; 6423 priv->status |= STATUS_SCANNING;
6394 priv->status &= ~STATUS_SCAN_PENDING; 6424 if (direct) {
6425 priv->status &= ~STATUS_DIRECT_SCAN_PENDING;
6426 priv->direct_scan_ssid_len = 0;
6427 } else
6428 priv->status &= ~STATUS_SCAN_PENDING;
6429
6395 queue_delayed_work(priv->workqueue, &priv->scan_check, 6430 queue_delayed_work(priv->workqueue, &priv->scan_check,
6396 IPW_SCAN_CHECK_WATCHDOG); 6431 IPW_SCAN_CHECK_WATCHDOG);
6397done: 6432done:
@@ -6402,15 +6437,22 @@ done:
6402static void ipw_request_passive_scan(struct work_struct *work) 6437static void ipw_request_passive_scan(struct work_struct *work)
6403{ 6438{
6404 struct ipw_priv *priv = 6439 struct ipw_priv *priv =
6405 container_of(work, struct ipw_priv, request_passive_scan); 6440 container_of(work, struct ipw_priv, request_passive_scan.work);
6406 ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); 6441 ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE, 0);
6407} 6442}
6408 6443
6409static void ipw_request_scan(struct work_struct *work) 6444static void ipw_request_scan(struct work_struct *work)
6410{ 6445{
6411 struct ipw_priv *priv = 6446 struct ipw_priv *priv =
6412 container_of(work, struct ipw_priv, request_scan.work); 6447 container_of(work, struct ipw_priv, request_scan.work);
6413 ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); 6448 ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 0);
6449}
6450
6451static void ipw_request_direct_scan(struct work_struct *work)
6452{
6453 struct ipw_priv *priv =
6454 container_of(work, struct ipw_priv, request_direct_scan.work);
6455 ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE, 1);
6414} 6456}
6415 6457
6416static void ipw_bg_abort_scan(struct work_struct *work) 6458static void ipw_bg_abort_scan(struct work_struct *work)
@@ -9477,99 +9519,38 @@ static int ipw_wx_get_retry(struct net_device *dev,
9477 return 0; 9519 return 0;
9478} 9520}
9479 9521
9480static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid,
9481 int essid_len)
9482{
9483 struct ipw_scan_request_ext scan;
9484 int err = 0, scan_type;
9485
9486 if (!(priv->status & STATUS_INIT) ||
9487 (priv->status & STATUS_EXIT_PENDING))
9488 return 0;
9489
9490 mutex_lock(&priv->mutex);
9491
9492 if (priv->status & STATUS_RF_KILL_MASK) {
9493 IPW_DEBUG_HC("Aborting scan due to RF kill activation\n");
9494 priv->status |= STATUS_SCAN_PENDING;
9495 goto done;
9496 }
9497
9498 IPW_DEBUG_HC("starting request direct scan!\n");
9499
9500 if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) {
9501 /* We should not sleep here; otherwise we will block most
9502 * of the system (for instance, we hold rtnl_lock when we
9503 * get here).
9504 */
9505 err = -EAGAIN;
9506 goto done;
9507 }
9508 memset(&scan, 0, sizeof(scan));
9509
9510 if (priv->config & CFG_SPEED_SCAN)
9511 scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] =
9512 cpu_to_le16(30);
9513 else
9514 scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_SCAN] =
9515 cpu_to_le16(20);
9516
9517 scan.dwell_time[IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN] =
9518 cpu_to_le16(20);
9519 scan.dwell_time[IPW_SCAN_PASSIVE_FULL_DWELL_SCAN] = cpu_to_le16(120);
9520 scan.dwell_time[IPW_SCAN_ACTIVE_DIRECT_SCAN] = cpu_to_le16(20);
9521
9522 scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee));
9523
9524 err = ipw_send_ssid(priv, essid, essid_len);
9525 if (err) {
9526 IPW_DEBUG_HC("Attempt to send SSID command failed\n");
9527 goto done;
9528 }
9529 scan_type = IPW_SCAN_ACTIVE_BROADCAST_AND_DIRECT_SCAN;
9530
9531 ipw_add_scan_channels(priv, &scan, scan_type);
9532
9533 err = ipw_send_scan_request_ext(priv, &scan);
9534 if (err) {
9535 IPW_DEBUG_HC("Sending scan command failed: %08X\n", err);
9536 goto done;
9537 }
9538
9539 priv->status |= STATUS_SCANNING;
9540
9541 done:
9542 mutex_unlock(&priv->mutex);
9543 return err;
9544}
9545
9546static int ipw_wx_set_scan(struct net_device *dev, 9522static int ipw_wx_set_scan(struct net_device *dev,
9547 struct iw_request_info *info, 9523 struct iw_request_info *info,
9548 union iwreq_data *wrqu, char *extra) 9524 union iwreq_data *wrqu, char *extra)
9549{ 9525{
9550 struct ipw_priv *priv = ieee80211_priv(dev); 9526 struct ipw_priv *priv = ieee80211_priv(dev);
9551 struct iw_scan_req *req = (struct iw_scan_req *)extra; 9527 struct iw_scan_req *req = (struct iw_scan_req *)extra;
9528 struct delayed_work *work = NULL;
9552 9529
9553 mutex_lock(&priv->mutex); 9530 mutex_lock(&priv->mutex);
9531
9554 priv->user_requested_scan = 1; 9532 priv->user_requested_scan = 1;
9555 mutex_unlock(&priv->mutex);
9556 9533
9557 if (wrqu->data.length == sizeof(struct iw_scan_req)) { 9534 if (wrqu->data.length == sizeof(struct iw_scan_req)) {
9558 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { 9535 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
9559 ipw_request_direct_scan(priv, req->essid, 9536 int len = min((int)req->essid_len,
9560 req->essid_len); 9537 (int)sizeof(priv->direct_scan_ssid));
9561 return 0; 9538 memcpy(priv->direct_scan_ssid, req->essid, len);
9562 } 9539 priv->direct_scan_ssid_len = len;
9563 if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { 9540 work = &priv->request_direct_scan;
9564 queue_work(priv->workqueue, 9541 } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) {
9565 &priv->request_passive_scan); 9542 work = &priv->request_passive_scan;
9566 return 0;
9567 } 9543 }
9544 } else {
9545 /* Normal active broadcast scan */
9546 work = &priv->request_scan;
9568 } 9547 }
9569 9548
9549 mutex_unlock(&priv->mutex);
9550
9570 IPW_DEBUG_WX("Start scan\n"); 9551 IPW_DEBUG_WX("Start scan\n");
9571 9552
9572 queue_delayed_work(priv->workqueue, &priv->request_scan, 0); 9553 queue_delayed_work(priv->workqueue, work, 0);
9573 9554
9574 return 0; 9555 return 0;
9575} 9556}
@@ -10731,6 +10712,8 @@ static void ipw_link_up(struct ipw_priv *priv)
10731 } 10712 }
10732 10713
10733 cancel_delayed_work(&priv->request_scan); 10714 cancel_delayed_work(&priv->request_scan);
10715 cancel_delayed_work(&priv->request_direct_scan);
10716 cancel_delayed_work(&priv->request_passive_scan);
10734 cancel_delayed_work(&priv->scan_event); 10717 cancel_delayed_work(&priv->scan_event);
10735 ipw_reset_stats(priv); 10718 ipw_reset_stats(priv);
10736 /* Ensure the rate is updated immediately */ 10719 /* Ensure the rate is updated immediately */
@@ -10761,6 +10744,8 @@ static void ipw_link_down(struct ipw_priv *priv)
10761 10744
10762 /* Cancel any queued work ... */ 10745 /* Cancel any queued work ... */
10763 cancel_delayed_work(&priv->request_scan); 10746 cancel_delayed_work(&priv->request_scan);
10747 cancel_delayed_work(&priv->request_direct_scan);
10748 cancel_delayed_work(&priv->request_passive_scan);
10764 cancel_delayed_work(&priv->adhoc_check); 10749 cancel_delayed_work(&priv->adhoc_check);
10765 cancel_delayed_work(&priv->gather_stats); 10750 cancel_delayed_work(&priv->gather_stats);
10766 10751
@@ -10800,8 +10785,9 @@ static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv)
10800 INIT_WORK(&priv->up, ipw_bg_up); 10785 INIT_WORK(&priv->up, ipw_bg_up);
10801 INIT_WORK(&priv->down, ipw_bg_down); 10786 INIT_WORK(&priv->down, ipw_bg_down);
10802 INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); 10787 INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan);
10788 INIT_DELAYED_WORK(&priv->request_direct_scan, ipw_request_direct_scan);
10789 INIT_DELAYED_WORK(&priv->request_passive_scan, ipw_request_passive_scan);
10803 INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event); 10790 INIT_DELAYED_WORK(&priv->scan_event, ipw_scan_event);
10804 INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan);
10805 INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); 10791 INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats);
10806 INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); 10792 INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan);
10807 INIT_WORK(&priv->roam, ipw_bg_roam); 10793 INIT_WORK(&priv->roam, ipw_bg_roam);
@@ -11835,6 +11821,8 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
11835 cancel_delayed_work(&priv->adhoc_check); 11821 cancel_delayed_work(&priv->adhoc_check);
11836 cancel_delayed_work(&priv->gather_stats); 11822 cancel_delayed_work(&priv->gather_stats);
11837 cancel_delayed_work(&priv->request_scan); 11823 cancel_delayed_work(&priv->request_scan);
11824 cancel_delayed_work(&priv->request_direct_scan);
11825 cancel_delayed_work(&priv->request_passive_scan);
11838 cancel_delayed_work(&priv->scan_event); 11826 cancel_delayed_work(&priv->scan_event);
11839 cancel_delayed_work(&priv->rf_kill); 11827 cancel_delayed_work(&priv->rf_kill);
11840 cancel_delayed_work(&priv->scan_check); 11828 cancel_delayed_work(&priv->scan_check);
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index cd3295b66dd6..d4ab28b73b32 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -1037,6 +1037,7 @@ struct ipw_cmd { /* XXX */
1037#define STATUS_DISASSOC_PENDING (1<<12) 1037#define STATUS_DISASSOC_PENDING (1<<12)
1038#define STATUS_STATE_PENDING (1<<13) 1038#define STATUS_STATE_PENDING (1<<13)
1039 1039
1040#define STATUS_DIRECT_SCAN_PENDING (1<<19)
1040#define STATUS_SCAN_PENDING (1<<20) 1041#define STATUS_SCAN_PENDING (1<<20)
1041#define STATUS_SCANNING (1<<21) 1042#define STATUS_SCANNING (1<<21)
1042#define STATUS_SCAN_ABORTING (1<<22) 1043#define STATUS_SCAN_ABORTING (1<<22)
@@ -1292,6 +1293,8 @@ struct ipw_priv {
1292 struct iw_public_data wireless_data; 1293 struct iw_public_data wireless_data;
1293 1294
1294 int user_requested_scan; 1295 int user_requested_scan;
1296 u8 direct_scan_ssid[IW_ESSID_MAX_SIZE];
1297 u8 direct_scan_ssid_len;
1295 1298
1296 struct workqueue_struct *workqueue; 1299 struct workqueue_struct *workqueue;
1297 1300
@@ -1301,8 +1304,9 @@ struct ipw_priv {
1301 struct work_struct system_config; 1304 struct work_struct system_config;
1302 struct work_struct rx_replenish; 1305 struct work_struct rx_replenish;
1303 struct delayed_work request_scan; 1306 struct delayed_work request_scan;
1307 struct delayed_work request_direct_scan;
1308 struct delayed_work request_passive_scan;
1304 struct delayed_work scan_event; 1309 struct delayed_work scan_event;
1305 struct work_struct request_passive_scan;
1306 struct work_struct adapter_restart; 1310 struct work_struct adapter_restart;
1307 struct delayed_work rf_kill; 1311 struct delayed_work rf_kill;
1308 struct work_struct up; 1312 struct work_struct up;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
index d200d08fb086..8b1528e52d43 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c
@@ -229,14 +229,15 @@ static int iwl3945_led_register_led(struct iwl3945_priv *priv,
229 led->led_dev.brightness_set = iwl3945_led_brightness_set; 229 led->led_dev.brightness_set = iwl3945_led_brightness_set;
230 led->led_dev.default_trigger = trigger; 230 led->led_dev.default_trigger = trigger;
231 231
232 led->priv = priv;
233 led->type = type;
234
232 ret = led_classdev_register(device, &led->led_dev); 235 ret = led_classdev_register(device, &led->led_dev);
233 if (ret) { 236 if (ret) {
234 IWL_ERROR("Error: failed to register led handler.\n"); 237 IWL_ERROR("Error: failed to register led handler.\n");
235 return ret; 238 return ret;
236 } 239 }
237 240
238 led->priv = priv;
239 led->type = type;
240 led->registered = 1; 241 led->registered = 1;
241 242
242 if (set_led && led->led_on) 243 if (set_led && led->led_on)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 6328b9593877..8124fd9b1353 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1842,6 +1842,9 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
1842 1842
1843 spin_lock_irqsave(&priv->driver_lock, flags); 1843 spin_lock_irqsave(&priv->driver_lock, flags);
1844 1844
1845 /* We don't get a response on the sleep-confirmation */
1846 priv->dnld_sent = DNLD_RES_RECEIVED;
1847
1845 /* If nothing to do, go back to sleep (?) */ 1848 /* If nothing to do, go back to sleep (?) */
1846 if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx]) 1849 if (!__kfifo_len(priv->event_fifo) && !priv->resp_len[priv->resp_idx])
1847 priv->psstate = PS_STATE_SLEEP; 1850 priv->psstate = PS_STATE_SLEEP;
@@ -1904,12 +1907,12 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
1904 1907
1905 lbs_deb_enter(LBS_DEB_HOST); 1908 lbs_deb_enter(LBS_DEB_HOST);
1906 1909
1910 spin_lock_irqsave(&priv->driver_lock, flags);
1907 if (priv->dnld_sent) { 1911 if (priv->dnld_sent) {
1908 allowed = 0; 1912 allowed = 0;
1909 lbs_deb_host("dnld_sent was set\n"); 1913 lbs_deb_host("dnld_sent was set\n");
1910 } 1914 }
1911 1915
1912 spin_lock_irqsave(&priv->driver_lock, flags);
1913 /* In-progress command? */ 1916 /* In-progress command? */
1914 if (priv->cur_cmd) { 1917 if (priv->cur_cmd) {
1915 allowed = 0; 1918 allowed = 0;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index e1f066068590..acfc4bfcc262 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -732,8 +732,8 @@ static int lbs_thread(void *data)
732 lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n", 732 lbs_deb_thread("4: currenttxskb %p, dnld_sent %d\n",
733 priv->currenttxskb, priv->dnld_sent); 733 priv->currenttxskb, priv->dnld_sent);
734 734
735 spin_lock_irq(&priv->driver_lock);
736 /* Process any pending command response */ 735 /* Process any pending command response */
736 spin_lock_irq(&priv->driver_lock);
737 resp_idx = priv->resp_idx; 737 resp_idx = priv->resp_idx;
738 if (priv->resp_len[resp_idx]) { 738 if (priv->resp_len[resp_idx]) {
739 spin_unlock_irq(&priv->driver_lock); 739 spin_unlock_irq(&priv->driver_lock);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 6424e5a2c83d..418606ac1c3b 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -719,7 +719,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
719 fc = le16_to_cpu(*((__le16 *) buffer)); 719 fc = le16_to_cpu(*((__le16 *) buffer));
720 720
721 is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && 721 is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
722 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_QOS_DATA); 722 (fc & IEEE80211_STYPE_QOS_DATA);
723 is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 723 is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
724 (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); 724 (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
725 need_padding = is_qos ^ is_4addr; 725 need_padding = is_qos ^ is_4addr;
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 436bf1f6d4a6..9a71dae223e8 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -290,9 +290,6 @@ int qeth_set_large_send(struct qeth_card *card,
290 card->dev->features |= NETIF_F_TSO | NETIF_F_SG | 290 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
291 NETIF_F_HW_CSUM; 291 NETIF_F_HW_CSUM;
292 } else { 292 } else {
293 PRINT_WARN("TSO not supported on %s. "
294 "large_send set to 'no'.\n",
295 card->dev->name);
296 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG | 293 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
297 NETIF_F_HW_CSUM); 294 NETIF_F_HW_CSUM);
298 card->options.large_send = QETH_LARGE_SEND_NO; 295 card->options.large_send = QETH_LARGE_SEND_NO;
@@ -1407,12 +1404,6 @@ static void qeth_init_func_level(struct qeth_card *card)
1407 } 1404 }
1408} 1405}
1409 1406
1410static inline __u16 qeth_raw_devno_from_bus_id(char *id)
1411{
1412 id += (strlen(id) - 4);
1413 return (__u16) simple_strtoul(id, &id, 16);
1414}
1415
1416static int qeth_idx_activate_get_answer(struct qeth_channel *channel, 1407static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
1417 void (*idx_reply_cb)(struct qeth_channel *, 1408 void (*idx_reply_cb)(struct qeth_channel *,
1418 struct qeth_cmd_buffer *)) 1409 struct qeth_cmd_buffer *))
@@ -1439,7 +1430,7 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
1439 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 1430 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
1440 1431
1441 if (rc) { 1432 if (rc) {
1442 PRINT_ERR("Error2 in activating channel rc=%d\n", rc); 1433 QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc);
1443 QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); 1434 QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
1444 atomic_set(&channel->irq_pending, 0); 1435 atomic_set(&channel->irq_pending, 0);
1445 wake_up(&card->wait_q); 1436 wake_up(&card->wait_q);
@@ -1468,6 +1459,7 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
1468 __u16 temp; 1459 __u16 temp;
1469 __u8 tmp; 1460 __u8 tmp;
1470 int rc; 1461 int rc;
1462 struct ccw_dev_id temp_devid;
1471 1463
1472 card = CARD_FROM_CDEV(channel->ccwdev); 1464 card = CARD_FROM_CDEV(channel->ccwdev);
1473 1465
@@ -1494,8 +1486,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
1494 &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH); 1486 &card->token.issuer_rm_w, QETH_MPC_TOKEN_LENGTH);
1495 memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data), 1487 memcpy(QETH_IDX_ACT_FUNC_LEVEL(iob->data),
1496 &card->info.func_level, sizeof(__u16)); 1488 &card->info.func_level, sizeof(__u16));
1497 temp = qeth_raw_devno_from_bus_id(CARD_DDEV_ID(card)); 1489 ccw_device_get_id(CARD_DDEV(card), &temp_devid);
1498 memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp, 2); 1490 memcpy(QETH_IDX_ACT_QDIO_DEV_CUA(iob->data), &temp_devid.devno, 2);
1499 temp = (card->info.cula << 8) + card->info.unit_addr2; 1491 temp = (card->info.cula << 8) + card->info.unit_addr2;
1500 memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2); 1492 memcpy(QETH_IDX_ACT_QDIO_DEV_REALADDR(iob->data), &temp, 2);
1501 1493
@@ -1508,7 +1500,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
1508 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 1500 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
1509 1501
1510 if (rc) { 1502 if (rc) {
1511 PRINT_ERR("Error1 in activating channel. rc=%d\n", rc); 1503 QETH_DBF_MESSAGE(2, "Error1 in activating channel. rc=%d\n",
1504 rc);
1512 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); 1505 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
1513 atomic_set(&channel->irq_pending, 0); 1506 atomic_set(&channel->irq_pending, 0);
1514 wake_up(&card->wait_q); 1507 wake_up(&card->wait_q);
@@ -1658,7 +1651,6 @@ int qeth_send_control_data(struct qeth_card *card, int len,
1658 1651
1659 reply = qeth_alloc_reply(card); 1652 reply = qeth_alloc_reply(card);
1660 if (!reply) { 1653 if (!reply) {
1661 PRINT_WARN("Could not alloc qeth_reply!\n");
1662 return -ENOMEM; 1654 return -ENOMEM;
1663 } 1655 }
1664 reply->callback = reply_cb; 1656 reply->callback = reply_cb;
@@ -2612,15 +2604,9 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
2612 if (newcount < count) { 2604 if (newcount < count) {
2613 /* we are in memory shortage so we switch back to 2605 /* we are in memory shortage so we switch back to
2614 traditional skb allocation and drop packages */ 2606 traditional skb allocation and drop packages */
2615 if (!atomic_read(&card->force_alloc_skb) &&
2616 net_ratelimit())
2617 PRINT_WARN("Switch to alloc skb\n");
2618 atomic_set(&card->force_alloc_skb, 3); 2607 atomic_set(&card->force_alloc_skb, 3);
2619 count = newcount; 2608 count = newcount;
2620 } else { 2609 } else {
2621 if ((atomic_read(&card->force_alloc_skb) == 1) &&
2622 net_ratelimit())
2623 PRINT_WARN("Switch to sg\n");
2624 atomic_add_unless(&card->force_alloc_skb, -1, 0); 2610 atomic_add_unless(&card->force_alloc_skb, -1, 0);
2625 } 2611 }
2626 2612
@@ -3034,7 +3020,7 @@ int qeth_get_elements_no(struct qeth_card *card, void *hdr,
3034 elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) 3020 elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE)
3035 + skb->len) >> PAGE_SHIFT); 3021 + skb->len) >> PAGE_SHIFT);
3036 if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) { 3022 if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)) {
3037 PRINT_ERR("Invalid size of IP packet " 3023 QETH_DBF_MESSAGE(2, "Invalid size of IP packet "
3038 "(Number=%d / Length=%d). Discarded.\n", 3024 "(Number=%d / Length=%d). Discarded.\n",
3039 (elements_needed+elems), skb->len); 3025 (elements_needed+elems), skb->len);
3040 return 0; 3026 return 0;
@@ -3247,8 +3233,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
3247 * free buffers) to handle eddp context */ 3233 * free buffers) to handle eddp context */
3248 if (qeth_eddp_check_buffers_for_context(queue, ctx) 3234 if (qeth_eddp_check_buffers_for_context(queue, ctx)
3249 < 0) { 3235 < 0) {
3250 if (net_ratelimit())
3251 PRINT_WARN("eddp tx_dropped 1\n");
3252 rc = -EBUSY; 3236 rc = -EBUSY;
3253 goto out; 3237 goto out;
3254 } 3238 }
@@ -3260,7 +3244,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
3260 tmp = qeth_eddp_fill_buffer(queue, ctx, 3244 tmp = qeth_eddp_fill_buffer(queue, ctx,
3261 queue->next_buf_to_fill); 3245 queue->next_buf_to_fill);
3262 if (tmp < 0) { 3246 if (tmp < 0) {
3263 PRINT_ERR("eddp tx_dropped 2\n");
3264 rc = -EBUSY; 3247 rc = -EBUSY;
3265 goto out; 3248 goto out;
3266 } 3249 }
@@ -3602,8 +3585,6 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
3602 3585
3603 if ((!qeth_adp_supported(card, IPA_SETADP_SET_SNMP_CONTROL)) && 3586 if ((!qeth_adp_supported(card, IPA_SETADP_SET_SNMP_CONTROL)) &&
3604 (!card->options.layer2)) { 3587 (!card->options.layer2)) {
3605 PRINT_WARN("SNMP Query MIBS not supported "
3606 "on %s!\n", QETH_CARD_IFNAME(card));
3607 return -EOPNOTSUPP; 3588 return -EOPNOTSUPP;
3608 } 3589 }
3609 /* skip 4 bytes (data_len struct member) to get req_len */ 3590 /* skip 4 bytes (data_len struct member) to get req_len */
@@ -3634,7 +3615,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
3634 rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len, 3615 rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len,
3635 qeth_snmp_command_cb, (void *)&qinfo); 3616 qeth_snmp_command_cb, (void *)&qinfo);
3636 if (rc) 3617 if (rc)
3637 PRINT_WARN("SNMP command failed on %s: (0x%x)\n", 3618 QETH_DBF_MESSAGE(2, "SNMP command failed on %s: (0x%x)\n",
3638 QETH_CARD_IFNAME(card), rc); 3619 QETH_CARD_IFNAME(card), rc);
3639 else { 3620 else {
3640 if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) 3621 if (copy_to_user(udata, qinfo.udata, qinfo.udata_len))
@@ -3807,8 +3788,8 @@ retry:
3807 if (mpno) 3788 if (mpno)
3808 mpno = min(mpno - 1, QETH_MAX_PORTNO); 3789 mpno = min(mpno - 1, QETH_MAX_PORTNO);
3809 if (card->info.portno > mpno) { 3790 if (card->info.portno > mpno) {
3810 PRINT_ERR("Device %s does not offer port number %d \n.", 3791 QETH_DBF_MESSAGE(2, "Device %s does not offer port number %d"
3811 CARD_BUS_ID(card), card->info.portno); 3792 "\n.", CARD_BUS_ID(card), card->info.portno);
3812 rc = -ENODEV; 3793 rc = -ENODEV;
3813 goto out; 3794 goto out;
3814 } 3795 }
@@ -3985,8 +3966,6 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
3985 return skb; 3966 return skb;
3986no_mem: 3967no_mem:
3987 if (net_ratelimit()) { 3968 if (net_ratelimit()) {
3988 PRINT_WARN("No memory for packet received on %s.\n",
3989 QETH_CARD_IFNAME(card));
3990 QETH_DBF_TEXT(TRACE, 2, "noskbmem"); 3969 QETH_DBF_TEXT(TRACE, 2, "noskbmem");
3991 QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card)); 3970 QETH_DBF_TEXT_(TRACE, 2, "%s", CARD_BUS_ID(card));
3992 } 3971 }
@@ -4004,15 +3983,17 @@ static void qeth_unregister_dbf_views(void)
4004 } 3983 }
4005} 3984}
4006 3985
4007void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...) 3986void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *fmt, ...)
4008{ 3987{
4009 char dbf_txt_buf[32]; 3988 char dbf_txt_buf[32];
3989 va_list args;
4010 3990
4011 if (level > (qeth_dbf[dbf_nix].id)->level) 3991 if (level > (qeth_dbf[dbf_nix].id)->level)
4012 return; 3992 return;
4013 snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text); 3993 va_start(args, fmt);
3994 vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
3995 va_end(args);
4014 debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf); 3996 debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf);
4015
4016} 3997}
4017EXPORT_SYMBOL_GPL(qeth_dbf_longtext); 3998EXPORT_SYMBOL_GPL(qeth_dbf_longtext);
4018 3999
diff --git a/drivers/s390/net/qeth_core_offl.c b/drivers/s390/net/qeth_core_offl.c
index 822df8362856..452874e89740 100644
--- a/drivers/s390/net/qeth_core_offl.c
+++ b/drivers/s390/net/qeth_core_offl.c
@@ -122,8 +122,8 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
122 if (element == 0) 122 if (element == 0)
123 return -EBUSY; 123 return -EBUSY;
124 else { 124 else {
125 PRINT_WARN("could only partially fill eddp " 125 QETH_DBF_MESSAGE(2, "could only partially fill"
126 "buffer!\n"); 126 "eddp buffer!\n");
127 goto out; 127 goto out;
128 } 128 }
129 } 129 }
@@ -143,8 +143,6 @@ int qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
143 if (must_refcnt) { 143 if (must_refcnt) {
144 must_refcnt = 0; 144 must_refcnt = 0;
145 if (qeth_eddp_buf_ref_context(buf, ctx)) { 145 if (qeth_eddp_buf_ref_context(buf, ctx)) {
146 PRINT_WARN("no memory to create eddp context "
147 "reference\n");
148 goto out_check; 146 goto out_check;
149 } 147 }
150 } 148 }
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index 08a50f057284..c26e842ad905 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -129,7 +129,6 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
129 129
130 portno = simple_strtoul(buf, &tmp, 16); 130 portno = simple_strtoul(buf, &tmp, 16);
131 if (portno > QETH_MAX_PORTNO) { 131 if (portno > QETH_MAX_PORTNO) {
132 PRINT_WARN("portno 0x%X is out of range\n", portno);
133 return -EINVAL; 132 return -EINVAL;
134 } 133 }
135 134
@@ -223,8 +222,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
223 * if though we have to permit priority queueing 222 * if though we have to permit priority queueing
224 */ 223 */
225 if (card->qdio.no_out_queues == 1) { 224 if (card->qdio.no_out_queues == 1) {
226 PRINT_WARN("Priority queueing disabled due "
227 "to hardware limitations!\n");
228 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; 225 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
229 return -EPERM; 226 return -EPERM;
230 } 227 }
@@ -250,7 +247,6 @@ static ssize_t qeth_dev_prioqing_store(struct device *dev,
250 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; 247 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING;
251 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; 248 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
252 } else { 249 } else {
253 PRINT_WARN("Unknown queueing type '%s'\n", tmp);
254 return -EINVAL; 250 return -EINVAL;
255 } 251 }
256 return count; 252 return count;
@@ -291,9 +287,6 @@ static ssize_t qeth_dev_bufcnt_store(struct device *dev,
291 ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt); 287 ((cnt > QETH_IN_BUF_COUNT_MAX) ? QETH_IN_BUF_COUNT_MAX : cnt);
292 if (old_cnt != cnt) { 288 if (old_cnt != cnt) {
293 rc = qeth_realloc_buffer_pool(card, cnt); 289 rc = qeth_realloc_buffer_pool(card, cnt);
294 if (rc)
295 PRINT_WARN("Error (%d) while setting "
296 "buffer count.\n", rc);
297 } 290 }
298 return count; 291 return count;
299} 292}
@@ -355,7 +348,6 @@ static ssize_t qeth_dev_performance_stats_store(struct device *dev,
355 card->perf_stats.initial_rx_packets = card->stats.rx_packets; 348 card->perf_stats.initial_rx_packets = card->stats.rx_packets;
356 card->perf_stats.initial_tx_packets = card->stats.tx_packets; 349 card->perf_stats.initial_tx_packets = card->stats.tx_packets;
357 } else { 350 } else {
358 PRINT_WARN("performance_stats: write 0 or 1 to this file!\n");
359 return -EINVAL; 351 return -EINVAL;
360 } 352 }
361 return count; 353 return count;
@@ -399,7 +391,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
399 newdis = QETH_DISCIPLINE_LAYER2; 391 newdis = QETH_DISCIPLINE_LAYER2;
400 break; 392 break;
401 default: 393 default:
402 PRINT_WARN("layer2: write 0 or 1 to this file!\n");
403 return -EINVAL; 394 return -EINVAL;
404 } 395 }
405 396
@@ -463,7 +454,6 @@ static ssize_t qeth_dev_large_send_store(struct device *dev,
463 } else if (!strcmp(tmp, "TSO")) { 454 } else if (!strcmp(tmp, "TSO")) {
464 type = QETH_LARGE_SEND_TSO; 455 type = QETH_LARGE_SEND_TSO;
465 } else { 456 } else {
466 PRINT_WARN("large_send: invalid mode %s!\n", tmp);
467 return -EINVAL; 457 return -EINVAL;
468 } 458 }
469 if (card->options.large_send == type) 459 if (card->options.large_send == type)
@@ -503,8 +493,6 @@ static ssize_t qeth_dev_blkt_store(struct qeth_card *card,
503 if (i <= max_value) { 493 if (i <= max_value) {
504 *value = i; 494 *value = i;
505 } else { 495 } else {
506 PRINT_WARN("blkt total time: write values between"
507 " 0 and %d to this file!\n", max_value);
508 return -EINVAL; 496 return -EINVAL;
509 } 497 }
510 return count; 498 return count;
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 86ec50ddae13..f682f7b14480 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -101,19 +101,16 @@ static struct net_device *qeth_l2_netdev_by_devno(unsigned char *read_dev_no)
101{ 101{
102 struct qeth_card *card; 102 struct qeth_card *card;
103 struct net_device *ndev; 103 struct net_device *ndev;
104 unsigned char *readno; 104 __u16 temp_dev_no;
105 __u16 temp_dev_no, card_dev_no;
106 char *endp;
107 unsigned long flags; 105 unsigned long flags;
106 struct ccw_dev_id read_devid;
108 107
109 ndev = NULL; 108 ndev = NULL;
110 memcpy(&temp_dev_no, read_dev_no, 2); 109 memcpy(&temp_dev_no, read_dev_no, 2);
111 read_lock_irqsave(&qeth_core_card_list.rwlock, flags); 110 read_lock_irqsave(&qeth_core_card_list.rwlock, flags);
112 list_for_each_entry(card, &qeth_core_card_list.list, list) { 111 list_for_each_entry(card, &qeth_core_card_list.list, list) {
113 readno = CARD_RDEV_ID(card); 112 ccw_device_get_id(CARD_RDEV(card), &read_devid);
114 readno += (strlen(readno) - 4); 113 if (read_devid.devno == temp_dev_no) {
115 card_dev_no = simple_strtoul(readno, &endp, 16);
116 if (card_dev_no == temp_dev_no) {
117 ndev = card->dev; 114 ndev = card->dev;
118 break; 115 break;
119 } 116 }
@@ -134,14 +131,14 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
134 mac = &cmd->data.setdelmac.mac[0]; 131 mac = &cmd->data.setdelmac.mac[0];
135 /* MAC already registered, needed in couple/uncouple case */ 132 /* MAC already registered, needed in couple/uncouple case */
136 if (cmd->hdr.return_code == 0x2005) { 133 if (cmd->hdr.return_code == 0x2005) {
137 PRINT_WARN("Group MAC %02x:%02x:%02x:%02x:%02x:%02x " \ 134 QETH_DBF_MESSAGE(2, "Group MAC %02x:%02x:%02x:%02x:%02x:%02x "
138 "already existing on %s \n", 135 "already existing on %s \n",
139 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], 136 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
140 QETH_CARD_IFNAME(card)); 137 QETH_CARD_IFNAME(card));
141 cmd->hdr.return_code = 0; 138 cmd->hdr.return_code = 0;
142 } 139 }
143 if (cmd->hdr.return_code) 140 if (cmd->hdr.return_code)
144 PRINT_ERR("Could not set group MAC " \ 141 QETH_DBF_MESSAGE(2, "Could not set group MAC "
145 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", 142 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n",
146 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], 143 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
147 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 144 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
@@ -166,7 +163,7 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
166 cmd = (struct qeth_ipa_cmd *) data; 163 cmd = (struct qeth_ipa_cmd *) data;
167 mac = &cmd->data.setdelmac.mac[0]; 164 mac = &cmd->data.setdelmac.mac[0];
168 if (cmd->hdr.return_code) 165 if (cmd->hdr.return_code)
169 PRINT_ERR("Could not delete group MAC " \ 166 QETH_DBF_MESSAGE(2, "Could not delete group MAC "
170 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", 167 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n",
171 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], 168 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
172 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 169 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
@@ -186,10 +183,8 @@ static void qeth_l2_add_mc(struct qeth_card *card, __u8 *mac)
186 183
187 mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC); 184 mc = kmalloc(sizeof(struct qeth_mc_mac), GFP_ATOMIC);
188 185
189 if (!mc) { 186 if (!mc)
190 PRINT_ERR("no mem vor mc mac address\n");
191 return; 187 return;
192 }
193 188
194 memcpy(mc->mc_addr, mac, OSA_ADDR_LEN); 189 memcpy(mc->mc_addr, mac, OSA_ADDR_LEN);
195 mc->mc_addrlen = OSA_ADDR_LEN; 190 mc->mc_addrlen = OSA_ADDR_LEN;
@@ -280,7 +275,7 @@ static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card,
280 QETH_DBF_TEXT(TRACE, 2, "L2sdvcb"); 275 QETH_DBF_TEXT(TRACE, 2, "L2sdvcb");
281 cmd = (struct qeth_ipa_cmd *) data; 276 cmd = (struct qeth_ipa_cmd *) data;
282 if (cmd->hdr.return_code) { 277 if (cmd->hdr.return_code) {
283 PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " 278 QETH_DBF_MESSAGE(2, "Error in processing VLAN %i on %s: 0x%x. "
284 "Continuing\n", cmd->data.setdelvlan.vlan_id, 279 "Continuing\n", cmd->data.setdelvlan.vlan_id,
285 QETH_CARD_IFNAME(card), cmd->hdr.return_code); 280 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
286 QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command); 281 QETH_DBF_TEXT_(TRACE, 2, "L2VL%4x", cmd->hdr.command);
@@ -333,8 +328,6 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
333 spin_lock_bh(&card->vlanlock); 328 spin_lock_bh(&card->vlanlock);
334 list_add_tail(&id->list, &card->vid_list); 329 list_add_tail(&id->list, &card->vid_list);
335 spin_unlock_bh(&card->vlanlock); 330 spin_unlock_bh(&card->vlanlock);
336 } else {
337 PRINT_ERR("no memory for vid\n");
338 } 331 }
339} 332}
340 333
@@ -550,16 +543,15 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
550 543
551 rc = qeth_query_setadapterparms(card); 544 rc = qeth_query_setadapterparms(card);
552 if (rc) { 545 if (rc) {
553 PRINT_WARN("could not query adapter parameters on device %s: " 546 QETH_DBF_MESSAGE(2, "could not query adapter parameters on "
554 "x%x\n", CARD_BUS_ID(card), rc); 547 "device %s: x%x\n", CARD_BUS_ID(card), rc);
555 } 548 }
556 549
557 if (card->info.guestlan) { 550 if (card->info.guestlan) {
558 rc = qeth_setadpparms_change_macaddr(card); 551 rc = qeth_setadpparms_change_macaddr(card);
559 if (rc) { 552 if (rc) {
560 PRINT_WARN("couldn't get MAC address on " 553 QETH_DBF_MESSAGE(2, "couldn't get MAC address on "
561 "device %s: x%x\n", 554 "device %s: x%x\n", CARD_BUS_ID(card), rc);
562 CARD_BUS_ID(card), rc);
563 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); 555 QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
564 return rc; 556 return rc;
565 } 557 }
@@ -585,8 +577,6 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
585 } 577 }
586 578
587 if (card->info.type == QETH_CARD_TYPE_OSN) { 579 if (card->info.type == QETH_CARD_TYPE_OSN) {
588 PRINT_WARN("Setting MAC address on %s is not supported.\n",
589 dev->name);
590 QETH_DBF_TEXT(TRACE, 3, "setmcOSN"); 580 QETH_DBF_TEXT(TRACE, 3, "setmcOSN");
591 return -EOPNOTSUPP; 581 return -EOPNOTSUPP;
592 } 582 }
@@ -666,7 +656,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
666 ctx = qeth_eddp_create_context(card, new_skb, hdr, 656 ctx = qeth_eddp_create_context(card, new_skb, hdr,
667 skb->sk->sk_protocol); 657 skb->sk->sk_protocol);
668 if (ctx == NULL) { 658 if (ctx == NULL) {
669 PRINT_WARN("could not create eddp context\n"); 659 QETH_DBF_MESSAGE(2, "could not create eddp context\n");
670 goto tx_drop; 660 goto tx_drop;
671 } 661 }
672 } else { 662 } else {
@@ -731,6 +721,7 @@ tx_drop:
731 if ((new_skb != skb) && new_skb) 721 if ((new_skb != skb) && new_skb)
732 dev_kfree_skb_any(new_skb); 722 dev_kfree_skb_any(new_skb);
733 dev_kfree_skb_any(skb); 723 dev_kfree_skb_any(skb);
724 netif_wake_queue(dev);
734 return NETDEV_TX_OK; 725 return NETDEV_TX_OK;
735} 726}
736 727
@@ -1155,7 +1146,7 @@ static int qeth_osn_send_control_data(struct qeth_card *card, int len,
1155 (addr_t) iob, 0, 0); 1146 (addr_t) iob, 0, 0);
1156 spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags); 1147 spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags);
1157 if (rc) { 1148 if (rc) {
1158 PRINT_WARN("qeth_osn_send_control_data: " 1149 QETH_DBF_MESSAGE(2, "qeth_osn_send_control_data: "
1159 "ccw_device_start rc = %i\n", rc); 1150 "ccw_device_start rc = %i\n", rc);
1160 QETH_DBF_TEXT_(TRACE, 2, " err%d", rc); 1151 QETH_DBF_TEXT_(TRACE, 2, " err%d", rc);
1161 qeth_release_buffer(iob->channel, iob); 1152 qeth_release_buffer(iob->channel, iob);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 94a8ead64ed4..999552c83bbe 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -311,7 +311,6 @@ static struct qeth_ipaddr *qeth_l3_get_addr_buffer(
311 311
312 addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); 312 addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC);
313 if (addr == NULL) { 313 if (addr == NULL) {
314 PRINT_WARN("Not enough memory to add address\n");
315 return NULL; 314 return NULL;
316 } 315 }
317 addr->type = QETH_IP_TYPE_NORMAL; 316 addr->type = QETH_IP_TYPE_NORMAL;
@@ -649,15 +648,6 @@ static void qeth_l3_correct_routing_type(struct qeth_card *card,
649 } 648 }
650 } 649 }
651out_inval: 650out_inval:
652 PRINT_WARN("Routing type '%s' not supported for interface %s.\n"
653 "Router status set to 'no router'.\n",
654 ((*type == PRIMARY_ROUTER)? "primary router" :
655 (*type == SECONDARY_ROUTER)? "secondary router" :
656 (*type == PRIMARY_CONNECTOR)? "primary connector" :
657 (*type == SECONDARY_CONNECTOR)? "secondary connector" :
658 (*type == MULTICAST_ROUTER)? "multicast router" :
659 "unknown"),
660 card->dev->name);
661 *type = NO_ROUTER; 651 *type = NO_ROUTER;
662} 652}
663 653
@@ -674,9 +664,9 @@ int qeth_l3_setrouting_v4(struct qeth_card *card)
674 QETH_PROT_IPV4); 664 QETH_PROT_IPV4);
675 if (rc) { 665 if (rc) {
676 card->options.route4.type = NO_ROUTER; 666 card->options.route4.type = NO_ROUTER;
677 PRINT_WARN("Error (0x%04x) while setting routing type on %s. " 667 QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type"
678 "Type set to 'no router'.\n", 668 " on %s. Type set to 'no router'.\n", rc,
679 rc, QETH_CARD_IFNAME(card)); 669 QETH_CARD_IFNAME(card));
680 } 670 }
681 return rc; 671 return rc;
682} 672}
@@ -697,9 +687,9 @@ int qeth_l3_setrouting_v6(struct qeth_card *card)
697 QETH_PROT_IPV6); 687 QETH_PROT_IPV6);
698 if (rc) { 688 if (rc) {
699 card->options.route6.type = NO_ROUTER; 689 card->options.route6.type = NO_ROUTER;
700 PRINT_WARN("Error (0x%04x) while setting routing type on %s. " 690 QETH_DBF_MESSAGE(2, "Error (0x%04x) while setting routing type"
701 "Type set to 'no router'.\n", 691 " on %s. Type set to 'no router'.\n", rc,
702 rc, QETH_CARD_IFNAME(card)); 692 QETH_CARD_IFNAME(card));
703 } 693 }
704#endif 694#endif
705 return rc; 695 return rc;
@@ -737,7 +727,6 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
737 if (!memcmp(ipatoe->addr, new->addr, 727 if (!memcmp(ipatoe->addr, new->addr,
738 (ipatoe->proto == QETH_PROT_IPV4)? 4:16) && 728 (ipatoe->proto == QETH_PROT_IPV4)? 4:16) &&
739 (ipatoe->mask_bits == new->mask_bits)) { 729 (ipatoe->mask_bits == new->mask_bits)) {
740 PRINT_WARN("ipato entry already exists!\n");
741 rc = -EEXIST; 730 rc = -EEXIST;
742 break; 731 break;
743 } 732 }
@@ -802,7 +791,6 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
802 rc = -EEXIST; 791 rc = -EEXIST;
803 spin_unlock_irqrestore(&card->ip_lock, flags); 792 spin_unlock_irqrestore(&card->ip_lock, flags);
804 if (rc) { 793 if (rc) {
805 PRINT_WARN("Cannot add VIPA. Address already exists!\n");
806 return rc; 794 return rc;
807 } 795 }
808 if (!qeth_l3_add_ip(card, ipaddr)) 796 if (!qeth_l3_add_ip(card, ipaddr))
@@ -867,7 +855,6 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
867 rc = -EEXIST; 855 rc = -EEXIST;
868 spin_unlock_irqrestore(&card->ip_lock, flags); 856 spin_unlock_irqrestore(&card->ip_lock, flags);
869 if (rc) { 857 if (rc) {
870 PRINT_WARN("Cannot add RXIP. Address already exists!\n");
871 return rc; 858 return rc;
872 } 859 }
873 if (!qeth_l3_add_ip(card, ipaddr)) 860 if (!qeth_l3_add_ip(card, ipaddr))
@@ -1020,23 +1007,23 @@ static int qeth_l3_setadapter_hstr(struct qeth_card *card)
1020 IPA_SETADP_SET_BROADCAST_MODE, 1007 IPA_SETADP_SET_BROADCAST_MODE,
1021 card->options.broadcast_mode); 1008 card->options.broadcast_mode);
1022 if (rc) 1009 if (rc)
1023 PRINT_WARN("couldn't set broadcast mode on " 1010 QETH_DBF_MESSAGE(2, "couldn't set broadcast mode on "
1024 "device %s: x%x\n", 1011 "device %s: x%x\n",
1025 CARD_BUS_ID(card), rc); 1012 CARD_BUS_ID(card), rc);
1026 rc = qeth_l3_send_setadp_mode(card, 1013 rc = qeth_l3_send_setadp_mode(card,
1027 IPA_SETADP_ALTER_MAC_ADDRESS, 1014 IPA_SETADP_ALTER_MAC_ADDRESS,
1028 card->options.macaddr_mode); 1015 card->options.macaddr_mode);
1029 if (rc) 1016 if (rc)
1030 PRINT_WARN("couldn't set macaddr mode on " 1017 QETH_DBF_MESSAGE(2, "couldn't set macaddr mode on "
1031 "device %s: x%x\n", CARD_BUS_ID(card), rc); 1018 "device %s: x%x\n", CARD_BUS_ID(card), rc);
1032 return rc; 1019 return rc;
1033 } 1020 }
1034 if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL) 1021 if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL)
1035 PRINT_WARN("set adapter parameters not available " 1022 QETH_DBF_MESSAGE(2, "set adapter parameters not available "
1036 "to set broadcast mode, using ALLRINGS " 1023 "to set broadcast mode, using ALLRINGS "
1037 "on device %s:\n", CARD_BUS_ID(card)); 1024 "on device %s:\n", CARD_BUS_ID(card));
1038 if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL) 1025 if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL)
1039 PRINT_WARN("set adapter parameters not available " 1026 QETH_DBF_MESSAGE(2, "set adapter parameters not available "
1040 "to set macaddr mode, using NONCANONICAL " 1027 "to set macaddr mode, using NONCANONICAL "
1041 "on device %s:\n", CARD_BUS_ID(card)); 1028 "on device %s:\n", CARD_BUS_ID(card));
1042 return 0; 1029 return 0;
@@ -2070,7 +2057,7 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
2070 card = netdev_priv(dev); 2057 card = netdev_priv(dev);
2071 else if (rc == QETH_VLAN_CARD) 2058 else if (rc == QETH_VLAN_CARD)
2072 card = netdev_priv(vlan_dev_info(dev)->real_dev); 2059 card = netdev_priv(vlan_dev_info(dev)->real_dev);
2073 if (card->options.layer2) 2060 if (card && card->options.layer2)
2074 card = NULL; 2061 card = NULL;
2075 QETH_DBF_TEXT_(TRACE, 4, "%d", rc); 2062 QETH_DBF_TEXT_(TRACE, 4, "%d", rc);
2076 return card ; 2063 return card ;
@@ -2182,8 +2169,6 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
2182 if (card->info.guestlan) 2169 if (card->info.guestlan)
2183 return -EOPNOTSUPP; 2170 return -EOPNOTSUPP;
2184 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { 2171 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
2185 PRINT_WARN("ARP processing not supported "
2186 "on %s!\n", QETH_CARD_IFNAME(card));
2187 return -EOPNOTSUPP; 2172 return -EOPNOTSUPP;
2188 } 2173 }
2189 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, 2174 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING,
@@ -2191,8 +2176,8 @@ static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries)
2191 no_entries); 2176 no_entries);
2192 if (rc) { 2177 if (rc) {
2193 tmp = rc; 2178 tmp = rc;
2194 PRINT_WARN("Could not set number of ARP entries on %s: " 2179 QETH_DBF_MESSAGE(2, "Could not set number of ARP entries on "
2195 "%s (0x%x/%d)\n", QETH_CARD_IFNAME(card), 2180 "%s: %s (0x%x/%d)\n", QETH_CARD_IFNAME(card),
2196 qeth_l3_arp_get_error_cause(&rc), tmp, tmp); 2181 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2197 } 2182 }
2198 return rc; 2183 return rc;
@@ -2260,9 +2245,6 @@ static int qeth_l3_arp_query_cb(struct qeth_card *card,
2260 qdata->no_entries * uentry_size){ 2245 qdata->no_entries * uentry_size){
2261 QETH_DBF_TEXT_(TRACE, 4, "qaer3%i", -ENOMEM); 2246 QETH_DBF_TEXT_(TRACE, 4, "qaer3%i", -ENOMEM);
2262 cmd->hdr.return_code = -ENOMEM; 2247 cmd->hdr.return_code = -ENOMEM;
2263 PRINT_WARN("query ARP user space buffer is too small for "
2264 "the returned number of ARP entries. "
2265 "Aborting query!\n");
2266 goto out_error; 2248 goto out_error;
2267 } 2249 }
2268 QETH_DBF_TEXT_(TRACE, 4, "anore%i", 2250 QETH_DBF_TEXT_(TRACE, 4, "anore%i",
@@ -2324,8 +2306,6 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
2324 2306
2325 if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ 2307 if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/
2326 IPA_ARP_PROCESSING)) { 2308 IPA_ARP_PROCESSING)) {
2327 PRINT_WARN("ARP processing not supported "
2328 "on %s!\n", QETH_CARD_IFNAME(card));
2329 return -EOPNOTSUPP; 2309 return -EOPNOTSUPP;
2330 } 2310 }
2331 /* get size of userspace buffer and mask_bits -> 6 bytes */ 2311 /* get size of userspace buffer and mask_bits -> 6 bytes */
@@ -2344,7 +2324,7 @@ static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata)
2344 qeth_l3_arp_query_cb, (void *)&qinfo); 2324 qeth_l3_arp_query_cb, (void *)&qinfo);
2345 if (rc) { 2325 if (rc) {
2346 tmp = rc; 2326 tmp = rc;
2347 PRINT_WARN("Error while querying ARP cache on %s: %s " 2327 QETH_DBF_MESSAGE(2, "Error while querying ARP cache on %s: %s "
2348 "(0x%x/%d)\n", QETH_CARD_IFNAME(card), 2328 "(0x%x/%d)\n", QETH_CARD_IFNAME(card),
2349 qeth_l3_arp_get_error_cause(&rc), tmp, tmp); 2329 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2350 if (copy_to_user(udata, qinfo.udata, 4)) 2330 if (copy_to_user(udata, qinfo.udata, 4))
@@ -2375,8 +2355,6 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
2375 if (card->info.guestlan) 2355 if (card->info.guestlan)
2376 return -EOPNOTSUPP; 2356 return -EOPNOTSUPP;
2377 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { 2357 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
2378 PRINT_WARN("ARP processing not supported "
2379 "on %s!\n", QETH_CARD_IFNAME(card));
2380 return -EOPNOTSUPP; 2358 return -EOPNOTSUPP;
2381 } 2359 }
2382 2360
@@ -2391,10 +2369,9 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
2391 if (rc) { 2369 if (rc) {
2392 tmp = rc; 2370 tmp = rc;
2393 qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); 2371 qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
2394 PRINT_WARN("Could not add ARP entry for address %s on %s: " 2372 QETH_DBF_MESSAGE(2, "Could not add ARP entry for address %s "
2395 "%s (0x%x/%d)\n", 2373 "on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card),
2396 buf, QETH_CARD_IFNAME(card), 2374 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2397 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2398 } 2375 }
2399 return rc; 2376 return rc;
2400} 2377}
@@ -2417,8 +2394,6 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
2417 if (card->info.guestlan) 2394 if (card->info.guestlan)
2418 return -EOPNOTSUPP; 2395 return -EOPNOTSUPP;
2419 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { 2396 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
2420 PRINT_WARN("ARP processing not supported "
2421 "on %s!\n", QETH_CARD_IFNAME(card));
2422 return -EOPNOTSUPP; 2397 return -EOPNOTSUPP;
2423 } 2398 }
2424 memcpy(buf, entry, 12); 2399 memcpy(buf, entry, 12);
@@ -2433,10 +2408,9 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
2433 tmp = rc; 2408 tmp = rc;
2434 memset(buf, 0, 16); 2409 memset(buf, 0, 16);
2435 qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf); 2410 qeth_l3_ipaddr4_to_string((u8 *)entry->ipaddr, buf);
2436 PRINT_WARN("Could not delete ARP entry for address %s on %s: " 2411 QETH_DBF_MESSAGE(2, "Could not delete ARP entry for address %s"
2437 "%s (0x%x/%d)\n", 2412 " on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card),
2438 buf, QETH_CARD_IFNAME(card), 2413 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2439 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2440 } 2414 }
2441 return rc; 2415 return rc;
2442} 2416}
@@ -2456,16 +2430,14 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card)
2456 if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) 2430 if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD))
2457 return -EOPNOTSUPP; 2431 return -EOPNOTSUPP;
2458 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { 2432 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) {
2459 PRINT_WARN("ARP processing not supported "
2460 "on %s!\n", QETH_CARD_IFNAME(card));
2461 return -EOPNOTSUPP; 2433 return -EOPNOTSUPP;
2462 } 2434 }
2463 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, 2435 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING,
2464 IPA_CMD_ASS_ARP_FLUSH_CACHE, 0); 2436 IPA_CMD_ASS_ARP_FLUSH_CACHE, 0);
2465 if (rc) { 2437 if (rc) {
2466 tmp = rc; 2438 tmp = rc;
2467 PRINT_WARN("Could not flush ARP cache on %s: %s (0x%x/%d)\n", 2439 QETH_DBF_MESSAGE(2, "Could not flush ARP cache on %s: %s "
2468 QETH_CARD_IFNAME(card), 2440 "(0x%x/%d)\n", QETH_CARD_IFNAME(card),
2469 qeth_l3_arp_get_error_cause(&rc), tmp, tmp); 2441 qeth_l3_arp_get_error_cause(&rc), tmp, tmp);
2470 } 2442 }
2471 return rc; 2443 return rc;
@@ -2724,7 +2696,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
2724 ctx = qeth_eddp_create_context(card, new_skb, hdr, 2696 ctx = qeth_eddp_create_context(card, new_skb, hdr,
2725 skb->sk->sk_protocol); 2697 skb->sk->sk_protocol);
2726 if (ctx == NULL) { 2698 if (ctx == NULL) {
2727 PRINT_WARN("could not create eddp context\n"); 2699 QETH_DBF_MESSAGE(2, "could not create eddp context\n");
2728 goto tx_drop; 2700 goto tx_drop;
2729 } 2701 }
2730 } else { 2702 } else {
@@ -2792,6 +2764,7 @@ tx_drop:
2792 if ((new_skb != skb) && new_skb) 2764 if ((new_skb != skb) && new_skb)
2793 dev_kfree_skb_any(new_skb); 2765 dev_kfree_skb_any(new_skb);
2794 dev_kfree_skb_any(skb); 2766 dev_kfree_skb_any(skb);
2767 netif_wake_queue(dev);
2795 return NETDEV_TX_OK; 2768 return NETDEV_TX_OK;
2796} 2769}
2797 2770
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 08f51fd902c4..ac1993708ae9 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -85,7 +85,6 @@ static ssize_t qeth_l3_dev_route_store(struct qeth_card *card,
85 } else if (!strcmp(tmp, "multicast_router")) { 85 } else if (!strcmp(tmp, "multicast_router")) {
86 route->type = MULTICAST_ROUTER; 86 route->type = MULTICAST_ROUTER;
87 } else { 87 } else {
88 PRINT_WARN("Invalid routing type '%s'.\n", tmp);
89 return -EINVAL; 88 return -EINVAL;
90 } 89 }
91 if (((card->state == CARD_STATE_SOFTSETUP) || 90 if (((card->state == CARD_STATE_SOFTSETUP) ||
@@ -137,9 +136,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev,
137 return -EINVAL; 136 return -EINVAL;
138 137
139 if (!qeth_is_supported(card, IPA_IPV6)) { 138 if (!qeth_is_supported(card, IPA_IPV6)) {
140 PRINT_WARN("IPv6 not supported for interface %s.\n"
141 "Routing status no changed.\n",
142 QETH_CARD_IFNAME(card));
143 return -ENOTSUPP; 139 return -ENOTSUPP;
144 } 140 }
145 141
@@ -179,7 +175,6 @@ static ssize_t qeth_l3_dev_fake_broadcast_store(struct device *dev,
179 if ((i == 0) || (i == 1)) 175 if ((i == 0) || (i == 1))
180 card->options.fake_broadcast = i; 176 card->options.fake_broadcast = i;
181 else { 177 else {
182 PRINT_WARN("fake_broadcast: write 0 or 1 to this file!\n");
183 return -EINVAL; 178 return -EINVAL;
184 } 179 }
185 return count; 180 return count;
@@ -220,7 +215,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
220 215
221 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || 216 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
222 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { 217 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
223 PRINT_WARN("Device is not a tokenring device!\n");
224 return -EINVAL; 218 return -EINVAL;
225 } 219 }
226 220
@@ -233,8 +227,6 @@ static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
233 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS; 227 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
234 return count; 228 return count;
235 } else { 229 } else {
236 PRINT_WARN("broadcast_mode: invalid mode %s!\n",
237 tmp);
238 return -EINVAL; 230 return -EINVAL;
239 } 231 }
240 return count; 232 return count;
@@ -275,7 +267,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
275 267
276 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) || 268 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
277 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) { 269 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
278 PRINT_WARN("Device is not a tokenring device!\n");
279 return -EINVAL; 270 return -EINVAL;
280 } 271 }
281 272
@@ -285,7 +276,6 @@ static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
285 QETH_TR_MACADDR_CANONICAL : 276 QETH_TR_MACADDR_CANONICAL :
286 QETH_TR_MACADDR_NONCANONICAL; 277 QETH_TR_MACADDR_NONCANONICAL;
287 else { 278 else {
288 PRINT_WARN("canonical_macaddr: write 0 or 1 to this file!\n");
289 return -EINVAL; 279 return -EINVAL;
290 } 280 }
291 return count; 281 return count;
@@ -327,7 +317,6 @@ static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
327 else if (!strcmp(tmp, "no_checksumming")) 317 else if (!strcmp(tmp, "no_checksumming"))
328 card->options.checksum_type = NO_CHECKSUMMING; 318 card->options.checksum_type = NO_CHECKSUMMING;
329 else { 319 else {
330 PRINT_WARN("Unknown checksumming type '%s'\n", tmp);
331 return -EINVAL; 320 return -EINVAL;
332 } 321 }
333 return count; 322 return count;
@@ -382,8 +371,6 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
382 } else if (!strcmp(tmp, "0")) { 371 } else if (!strcmp(tmp, "0")) {
383 card->ipato.enabled = 0; 372 card->ipato.enabled = 0;
384 } else { 373 } else {
385 PRINT_WARN("ipato_enable: write 0, 1 or 'toggle' to "
386 "this file\n");
387 return -EINVAL; 374 return -EINVAL;
388 } 375 }
389 return count; 376 return count;
@@ -422,8 +409,6 @@ static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev,
422 } else if (!strcmp(tmp, "0")) { 409 } else if (!strcmp(tmp, "0")) {
423 card->ipato.invert4 = 0; 410 card->ipato.invert4 = 0;
424 } else { 411 } else {
425 PRINT_WARN("ipato_invert4: write 0, 1 or 'toggle' to "
426 "this file\n");
427 return -EINVAL; 412 return -EINVAL;
428 } 413 }
429 return count; 414 return count;
@@ -486,13 +471,10 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
486 /* get address string */ 471 /* get address string */
487 end = strchr(start, '/'); 472 end = strchr(start, '/');
488 if (!end || (end - start >= 40)) { 473 if (!end || (end - start >= 40)) {
489 PRINT_WARN("Invalid format for ipato_addx/delx. "
490 "Use <ip addr>/<mask bits>\n");
491 return -EINVAL; 474 return -EINVAL;
492 } 475 }
493 strncpy(buffer, start, end - start); 476 strncpy(buffer, start, end - start);
494 if (qeth_l3_string_to_ipaddr(buffer, proto, addr)) { 477 if (qeth_l3_string_to_ipaddr(buffer, proto, addr)) {
495 PRINT_WARN("Invalid IP address format!\n");
496 return -EINVAL; 478 return -EINVAL;
497 } 479 }
498 start = end + 1; 480 start = end + 1;
@@ -500,7 +482,6 @@ static int qeth_l3_parse_ipatoe(const char *buf, enum qeth_prot_versions proto,
500 if (!strlen(start) || 482 if (!strlen(start) ||
501 (tmp == start) || 483 (tmp == start) ||
502 (*mask_bits > ((proto == QETH_PROT_IPV4) ? 32 : 128))) { 484 (*mask_bits > ((proto == QETH_PROT_IPV4) ? 32 : 128))) {
503 PRINT_WARN("Invalid mask bits for ipato_addx/delx !\n");
504 return -EINVAL; 485 return -EINVAL;
505 } 486 }
506 return 0; 487 return 0;
@@ -520,7 +501,6 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count,
520 501
521 ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL); 502 ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL);
522 if (!ipatoe) { 503 if (!ipatoe) {
523 PRINT_WARN("No memory to allocate ipato entry\n");
524 return -ENOMEM; 504 return -ENOMEM;
525 } 505 }
526 ipatoe->proto = proto; 506 ipatoe->proto = proto;
@@ -609,8 +589,6 @@ static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev,
609 } else if (!strcmp(tmp, "0")) { 589 } else if (!strcmp(tmp, "0")) {
610 card->ipato.invert6 = 0; 590 card->ipato.invert6 = 0;
611 } else { 591 } else {
612 PRINT_WARN("ipato_invert6: write 0, 1 or 'toggle' to "
613 "this file\n");
614 return -EINVAL; 592 return -EINVAL;
615 } 593 }
616 return count; 594 return count;
@@ -724,7 +702,6 @@ static int qeth_l3_parse_vipae(const char *buf, enum qeth_prot_versions proto,
724 u8 *addr) 702 u8 *addr)
725{ 703{
726 if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { 704 if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
727 PRINT_WARN("Invalid IP address format!\n");
728 return -EINVAL; 705 return -EINVAL;
729 } 706 }
730 return 0; 707 return 0;
@@ -891,7 +868,6 @@ static int qeth_l3_parse_rxipe(const char *buf, enum qeth_prot_versions proto,
891 u8 *addr) 868 u8 *addr)
892{ 869{
893 if (qeth_l3_string_to_ipaddr(buf, proto, addr)) { 870 if (qeth_l3_string_to_ipaddr(buf, proto, addr)) {
894 PRINT_WARN("Invalid IP address format!\n");
895 return -EINVAL; 871 return -EINVAL;
896 } 872 }
897 return 0; 873 return 0;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 10b666b61add..cde056e08181 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -396,8 +396,10 @@ static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *op
396{ 396{
397 struct request_sock *req = reqsk_alloc(ops); 397 struct request_sock *req = reqsk_alloc(ops);
398 398
399 if (req != NULL) 399 if (req != NULL) {
400 inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req); 400 inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req);
401 inet6_rsk(req)->pktopts = NULL;
402 }
401 403
402 return req; 404 return req;
403} 405}
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index a2aec2c0cfb5..b358c704d102 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -246,6 +246,7 @@ enum rt_class_t
246{ 246{
247 RT_TABLE_UNSPEC=0, 247 RT_TABLE_UNSPEC=0,
248/* User defined values */ 248/* User defined values */
249 RT_TABLE_COMPAT=252,
249 RT_TABLE_DEFAULT=253, 250 RT_TABLE_DEFAULT=253,
250 RT_TABLE_MAIN=254, 251 RT_TABLE_MAIN=254,
251 RT_TABLE_LOCAL=255, 252 RT_TABLE_LOCAL=255,
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index 01fbdf5fef22..942e38736901 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -100,7 +100,7 @@ extern char * nvram_get(const char *name);
100/* Get the device MAC address */ 100/* Get the device MAC address */
101static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) 101static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr)
102{ 102{
103#ifdef CONFIG_BCM947XX 103#ifdef CONFIG_BCM47XX
104 char *res = nvram_get("et0macaddr"); 104 char *res = nvram_get("et0macaddr");
105 if (res) 105 if (res)
106 memcpy(macaddr, res, 6); 106 memcpy(macaddr, res, 6);
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 9405aa6cdf26..38c0571820fb 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -38,7 +38,7 @@ struct virtio_net_hdr
38#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set 38#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set
39 __u8 gso_type; 39 __u8 gso_type;
40 __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */ 40 __u16 hdr_len; /* Ethernet + IP + tcp/udp hdrs */
41 __u16 gso_size; /* Bytes to append to gso_hdr_len per frame */ 41 __u16 gso_size; /* Bytes to append to hdr_len per frame */
42 __u16 csum_start; /* Position to start checksumming from */ 42 __u16 csum_start; /* Position to start checksumming from */
43 __u16 csum_offset; /* Offset after that to place checksum */ 43 __u16 csum_offset; /* Offset after that to place checksum */
44}; 44};
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index a42cd63d241a..9fabe5b38912 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -197,4 +197,14 @@ static inline int inet_iif(const struct sk_buff *skb)
197 return skb->rtable->rt_iif; 197 return skb->rtable->rt_iif;
198} 198}
199 199
200static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops)
201{
202 struct request_sock *req = reqsk_alloc(ops);
203
204 if (req != NULL)
205 inet_rsk(req)->opt = NULL;
206
207 return req;
208}
209
200#endif /* _INET_SOCK_H */ 210#endif /* _INET_SOCK_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 633147cb6bbc..d448310c82c1 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -433,7 +433,6 @@ extern struct sk_buff * tcp_make_synack(struct sock *sk,
433 433
434extern int tcp_disconnect(struct sock *sk, int flags); 434extern int tcp_disconnect(struct sock *sk, int flags);
435 435
436extern void tcp_unhash(struct sock *sk);
437 436
438/* From syncookies.c */ 437/* From syncookies.c */
439extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 438extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index c22a3780c14e..37d27bcb361f 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -589,7 +589,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
589 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) 589 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
590 goto drop; 590 goto drop;
591 591
592 req = reqsk_alloc(&dccp_request_sock_ops); 592 req = inet_reqsk_alloc(&dccp_request_sock_ops);
593 if (req == NULL) 593 if (req == NULL)
594 goto drop; 594 goto drop;
595 595
@@ -605,7 +605,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
605 ireq = inet_rsk(req); 605 ireq = inet_rsk(req);
606 ireq->loc_addr = ip_hdr(skb)->daddr; 606 ireq->loc_addr = ip_hdr(skb)->daddr;
607 ireq->rmt_addr = ip_hdr(skb)->saddr; 607 ireq->rmt_addr = ip_hdr(skb)->saddr;
608 ireq->opt = NULL;
609 608
610 /* 609 /*
611 * Step 3: Process LISTEN state 610 * Step 3: Process LISTEN state
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 9b1129bb7ece..f7fe2a572d7b 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -421,7 +421,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
421 ireq6 = inet6_rsk(req); 421 ireq6 = inet6_rsk(req);
422 ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr); 422 ipv6_addr_copy(&ireq6->rmt_addr, &ipv6_hdr(skb)->saddr);
423 ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr); 423 ipv6_addr_copy(&ireq6->loc_addr, &ipv6_hdr(skb)->daddr);
424 ireq6->pktopts = NULL;
425 424
426 if (ipv6_opt_accepted(sk, skb) || 425 if (ipv6_opt_accepted(sk, skb) ||
427 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || 426 np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 3b83c34019fc..0d4d72827e4b 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -960,7 +960,10 @@ int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
960 rtm->rtm_dst_len = dst_len; 960 rtm->rtm_dst_len = dst_len;
961 rtm->rtm_src_len = 0; 961 rtm->rtm_src_len = 0;
962 rtm->rtm_tos = tos; 962 rtm->rtm_tos = tos;
963 rtm->rtm_table = tb_id; 963 if (tb_id < 256)
964 rtm->rtm_table = tb_id;
965 else
966 rtm->rtm_table = RT_TABLE_COMPAT;
964 NLA_PUT_U32(skb, RTA_TABLE, tb_id); 967 NLA_PUT_U32(skb, RTA_TABLE, tb_id);
965 rtm->rtm_type = type; 968 rtm->rtm_type = type;
966 rtm->rtm_flags = fi->fib_flags; 969 rtm->rtm_flags = fi->fib_flags;
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 73ba98921d64..d182a2a26291 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -285,7 +285,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
285 cookie_check_timestamp(&tcp_opt); 285 cookie_check_timestamp(&tcp_opt);
286 286
287 ret = NULL; 287 ret = NULL;
288 req = reqsk_alloc(&tcp_request_sock_ops); /* for safety */ 288 req = inet_reqsk_alloc(&tcp_request_sock_ops); /* for safety */
289 if (!req) 289 if (!req)
290 goto out; 290 goto out;
291 291
@@ -301,7 +301,6 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
301 ireq->rmt_port = th->source; 301 ireq->rmt_port = th->source;
302 ireq->loc_addr = ip_hdr(skb)->daddr; 302 ireq->loc_addr = ip_hdr(skb)->daddr;
303 ireq->rmt_addr = ip_hdr(skb)->saddr; 303 ireq->rmt_addr = ip_hdr(skb)->saddr;
304 ireq->opt = NULL;
305 ireq->snd_wscale = tcp_opt.snd_wscale; 304 ireq->snd_wscale = tcp_opt.snd_wscale;
306 ireq->rcv_wscale = tcp_opt.rcv_wscale; 305 ireq->rcv_wscale = tcp_opt.rcv_wscale;
307 ireq->sack_ok = tcp_opt.sack_ok; 306 ireq->sack_ok = tcp_opt.sack_ok;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index cd601a866c2f..4f8485c67d1a 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1285,7 +1285,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1285 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) 1285 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
1286 goto drop; 1286 goto drop;
1287 1287
1288 req = reqsk_alloc(&tcp_request_sock_ops); 1288 req = inet_reqsk_alloc(&tcp_request_sock_ops);
1289 if (!req) 1289 if (!req)
1290 goto drop; 1290 goto drop;
1291 1291
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 3c6aafb02183..e84b3fd17fb4 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -191,7 +191,7 @@ lookup_protocol:
191 np->mcast_hops = -1; 191 np->mcast_hops = -1;
192 np->mc_loop = 1; 192 np->mc_loop = 1;
193 np->pmtudisc = IPV6_PMTUDISC_WANT; 193 np->pmtudisc = IPV6_PMTUDISC_WANT;
194 np->ipv6only = init_net.ipv6.sysctl.bindv6only; 194 np->ipv6only = net->ipv6.sysctl.bindv6only;
195 195
196 /* Init the ipv4 part of the socket since we can have sockets 196 /* Init the ipv4 part of the socket since we can have sockets
197 * using v6 API for ipv4. 197 * using v6 API for ipv4.
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 938ce4ecde55..3ecc1157994e 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -198,7 +198,6 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
198 ireq = inet_rsk(req); 198 ireq = inet_rsk(req);
199 ireq6 = inet6_rsk(req); 199 ireq6 = inet6_rsk(req);
200 treq = tcp_rsk(req); 200 treq = tcp_rsk(req);
201 ireq6->pktopts = NULL;
202 201
203 if (security_inet_conn_request(sk, skb, req)) { 202 if (security_inet_conn_request(sk, skb, req)) {
204 reqsk_free(req); 203 reqsk_free(req);
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 715965f0fac0..cb46749d4c32 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1299,7 +1299,6 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1299 treq = inet6_rsk(req); 1299 treq = inet6_rsk(req);
1300 ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr); 1300 ipv6_addr_copy(&treq->rmt_addr, &ipv6_hdr(skb)->saddr);
1301 ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr); 1301 ipv6_addr_copy(&treq->loc_addr, &ipv6_hdr(skb)->daddr);
1302 treq->pktopts = NULL;
1303 if (!want_cookie) 1302 if (!want_cookie)
1304 TCP_ECN_create_request(req, tcp_hdr(skb)); 1303 TCP_ECN_create_request(req, tcp_hdr(skb));
1305 1304
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 9bba7ac5fee0..7470e367272b 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3030,6 +3030,9 @@ static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c)
3030 3030
3031static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c) 3031static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c)
3032{ 3032{
3033 if (atomic_read(&pfkey_socks_nr) == 0)
3034 return 0;
3035
3033 switch (c->event) { 3036 switch (c->event) {
3034 case XFRM_MSG_EXPIRE: 3037 case XFRM_MSG_EXPIRE:
3035 return key_notify_sa_expire(x, c); 3038 return key_notify_sa_expire(x, c);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c7314bf4bec2..006486b26726 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -899,7 +899,7 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;
899 899
900 900
901/* ieee80211_ioctl.c */ 901/* ieee80211_ioctl.c */
902int ieee80211_set_freq(struct ieee80211_local *local, int freq); 902int ieee80211_set_freq(struct net_device *dev, int freq);
903/* ieee80211_sta.c */ 903/* ieee80211_sta.c */
904void ieee80211_sta_timer(unsigned long data); 904void ieee80211_sta_timer(unsigned long data);
905void ieee80211_sta_work(struct work_struct *work); 905void ieee80211_sta_work(struct work_struct *work);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5c876450b14c..98c0b5e56ecc 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -511,6 +511,7 @@ static int ieee80211_stop(struct net_device *dev)
511 case IEEE80211_IF_TYPE_STA: 511 case IEEE80211_IF_TYPE_STA:
512 case IEEE80211_IF_TYPE_IBSS: 512 case IEEE80211_IF_TYPE_IBSS:
513 sdata->u.sta.state = IEEE80211_DISABLED; 513 sdata->u.sta.state = IEEE80211_DISABLED;
514 memset(sdata->u.sta.bssid, 0, ETH_ALEN);
514 del_timer_sync(&sdata->u.sta.timer); 515 del_timer_sync(&sdata->u.sta.timer);
515 /* 516 /*
516 * When we get here, the interface is marked down. 517 * When we get here, the interface is marked down.
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 841278f1df8e..4d2b582dd055 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -44,7 +44,7 @@
44#define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ) 44#define IEEE80211_RETRY_AUTH_INTERVAL (1 * HZ)
45#define IEEE80211_SCAN_INTERVAL (2 * HZ) 45#define IEEE80211_SCAN_INTERVAL (2 * HZ)
46#define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ) 46#define IEEE80211_SCAN_INTERVAL_SLOW (15 * HZ)
47#define IEEE80211_IBSS_JOIN_TIMEOUT (20 * HZ) 47#define IEEE80211_IBSS_JOIN_TIMEOUT (7 * HZ)
48 48
49#define IEEE80211_PROBE_DELAY (HZ / 33) 49#define IEEE80211_PROBE_DELAY (HZ / 33)
50#define IEEE80211_CHANNEL_TIME (HZ / 33) 50#define IEEE80211_CHANNEL_TIME (HZ / 33)
@@ -2336,6 +2336,7 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2336 u8 *pos; 2336 u8 *pos;
2337 struct ieee80211_sub_if_data *sdata; 2337 struct ieee80211_sub_if_data *sdata;
2338 struct ieee80211_supported_band *sband; 2338 struct ieee80211_supported_band *sband;
2339 union iwreq_data wrqu;
2339 2340
2340 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 2341 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
2341 2342
@@ -2358,13 +2359,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2358 sdata->drop_unencrypted = bss->capability & 2359 sdata->drop_unencrypted = bss->capability &
2359 WLAN_CAPABILITY_PRIVACY ? 1 : 0; 2360 WLAN_CAPABILITY_PRIVACY ? 1 : 0;
2360 2361
2361 res = ieee80211_set_freq(local, bss->freq); 2362 res = ieee80211_set_freq(dev, bss->freq);
2362 2363
2363 if (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS) { 2364 if (res)
2364 printk(KERN_DEBUG "%s: IBSS not allowed on frequency " 2365 return res;
2365 "%d MHz\n", dev->name, local->oper_channel->center_freq);
2366 return -1;
2367 }
2368 2366
2369 /* Set beacon template */ 2367 /* Set beacon template */
2370 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); 2368 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
@@ -2479,6 +2477,10 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
2479 ifsta->state = IEEE80211_IBSS_JOINED; 2477 ifsta->state = IEEE80211_IBSS_JOINED;
2480 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); 2478 mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);
2481 2479
2480 memset(&wrqu, 0, sizeof(wrqu));
2481 memcpy(wrqu.ap_addr.sa_data, bss->bssid, ETH_ALEN);
2482 wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
2483
2482 return res; 2484 return res;
2483} 2485}
2484 2486
@@ -3486,7 +3488,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3486 spin_unlock_bh(&local->sta_bss_lock); 3488 spin_unlock_bh(&local->sta_bss_lock);
3487 3489
3488 if (selected) { 3490 if (selected) {
3489 ieee80211_set_freq(local, selected->freq); 3491 ieee80211_set_freq(dev, selected->freq);
3490 if (!(ifsta->flags & IEEE80211_STA_SSID_SET)) 3492 if (!(ifsta->flags & IEEE80211_STA_SSID_SET))
3491 ieee80211_sta_set_ssid(dev, selected->ssid, 3493 ieee80211_sta_set_ssid(dev, selected->ssid,
3492 selected->ssid_len); 3494 selected->ssid_len);
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 8311bb24f9f3..a8bb8e31b1ec 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -290,14 +290,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev,
290 return 0; 290 return 0;
291} 291}
292 292
293int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz) 293int ieee80211_set_freq(struct net_device *dev, int freqMHz)
294{ 294{
295 int ret = -EINVAL; 295 int ret = -EINVAL;
296 struct ieee80211_channel *chan; 296 struct ieee80211_channel *chan;
297 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
298 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
297 299
298 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); 300 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
299 301
300 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { 302 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
303 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS &&
304 chan->flags & IEEE80211_CHAN_NO_IBSS) {
305 printk(KERN_DEBUG "%s: IBSS not allowed on frequency "
306 "%d MHz\n", dev->name, chan->center_freq);
307 return ret;
308 }
301 local->oper_channel = chan; 309 local->oper_channel = chan;
302 310
303 if (local->sta_sw_scanning || local->sta_hw_scanning) 311 if (local->sta_sw_scanning || local->sta_hw_scanning)
@@ -315,7 +323,6 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
315 struct iw_request_info *info, 323 struct iw_request_info *info,
316 struct iw_freq *freq, char *extra) 324 struct iw_freq *freq, char *extra)
317{ 325{
318 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
319 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 326 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
320 327
321 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) 328 if (sdata->vif.type == IEEE80211_IF_TYPE_STA)
@@ -329,14 +336,14 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev,
329 IEEE80211_STA_AUTO_CHANNEL_SEL; 336 IEEE80211_STA_AUTO_CHANNEL_SEL;
330 return 0; 337 return 0;
331 } else 338 } else
332 return ieee80211_set_freq(local, 339 return ieee80211_set_freq(dev,
333 ieee80211_channel_to_frequency(freq->m)); 340 ieee80211_channel_to_frequency(freq->m));
334 } else { 341 } else {
335 int i, div = 1000000; 342 int i, div = 1000000;
336 for (i = 0; i < freq->e; i++) 343 for (i = 0; i < freq->e; i++)
337 div /= 10; 344 div /= 10;
338 if (div > 0) 345 if (div > 0)
339 return ieee80211_set_freq(local, freq->m / div); 346 return ieee80211_set_freq(dev, freq->m / div);
340 else 347 else
341 return -EINVAL; 348 return -EINVAL;
342 } 349 }