]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
authorDavid S. Miller <davem@davemloft.net>
Sun, 15 Feb 2009 07:12:00 +0000 (23:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Feb 2009 07:12:00 +0000 (23:12 -0800)
Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

1  2 
drivers/net/3c505.c
drivers/net/bnx2.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/phy/mdio-gpio.c
drivers/net/qlge/qlge_main.c
drivers/net/tg3.c
fs/compat_ioctl.c
include/net/sock.h
net/core/sock.c
net/mac80211/tx.c

diff --combined drivers/net/3c505.c
index ea1ad8ce883640cf73e9ddfcbcff00e491c6f670,a8107f992fb4b03a243287ecadf879dbc21e024d..2de1c9cd7bdeffaff03be9c88a024047b31ec1ae
@@@ -493,21 -493,27 +493,27 @@@ static bool receive_pcb(struct net_devi
        }
        /* read the data */
        spin_lock_irqsave(&adapter->lock, flags);
-       i = 0;
-       do {
-               j = 0;
-               while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && j++ < 20000);
-               pcb->data.raw[i++] = inb_command(dev->base_addr);
-               if (i > MAX_PCB_DATA)
-                       INVALID_PCB_MSG(i);
-       } while ((stat & ASF_PCB_MASK) != ASF_PCB_END && j < 20000);
+       for (i = 0; i < MAX_PCB_DATA; i++) {
+               for (j = 0; j < 20000; j++) {
+                       stat = get_status(dev->base_addr);
+                       if (stat & ACRF)
+                               break;
+               }
+               pcb->data.raw[i] = inb_command(dev->base_addr);
+               if ((stat & ASF_PCB_MASK) == ASF_PCB_END || j >= 20000)
+                       break;
+       }
        spin_unlock_irqrestore(&adapter->lock, flags);
+       if (i >= MAX_PCB_DATA) {
+               INVALID_PCB_MSG(i);
+               return false;
+       }
        if (j >= 20000) {
                TIMEOUT_MSG(__LINE__);
                return false;
        }
-       /* woops, the last "data" byte was really the length! */
-       total_length = pcb->data.raw[--i];
+       /* the last "data" byte was really the length! */
+       total_length = pcb->data.raw[i];
  
        /* safety check total length vs data length */
        if (total_length != (pcb->length + 2)) {
@@@ -1348,17 -1354,6 +1354,17 @@@ static int __init elp_autodetect(struc
        return 0;               /* Because of this, the layer above will return -ENODEV */
  }
  
 +static const struct net_device_ops elp_netdev_ops = {
 +      .ndo_open               = elp_open,
 +      .ndo_stop               = elp_close,
 +      .ndo_get_stats          = elp_get_stats,
 +      .ndo_start_xmit         = elp_start_xmit,
 +      .ndo_tx_timeout         = elp_timeout,
 +      .ndo_set_multicast_list = elp_set_mc_list,
 +      .ndo_change_mtu         = eth_change_mtu,
 +      .ndo_set_mac_address    = eth_mac_addr,
 +      .ndo_validate_addr      = eth_validate_addr,
 +};
  
  /******************************************************
   *
@@@ -1563,8 -1558,13 +1569,8 @@@ static int __init elplus_setup(struct n
                printk(KERN_ERR "%s: adapter configuration failed\n", dev->name);
        }
  
 -      dev->open = elp_open;                           /* local */
 -      dev->stop = elp_close;                          /* local */
 -      dev->get_stats = elp_get_stats;                 /* local */
 -      dev->hard_start_xmit = elp_start_xmit;          /* local */
 -      dev->tx_timeout = elp_timeout;                  /* local */
 +      dev->netdev_ops = &elp_netdev_ops;
        dev->watchdog_timeo = 10*HZ;
 -      dev->set_multicast_list = elp_set_mc_list;      /* local */
        dev->ethtool_ops = &netdev_ethtool_ops;         /* local */
  
        dev->mem_start = dev->mem_end = 0;
diff --combined drivers/net/bnx2.c
index 49e0e51a9dfc5655bbaaab14b3ca6096ed7445cb,6500b7c4739ffde3ed86c00819962cfc79c86a56..8466d351a70375b7e733d4498862086302cca349
@@@ -1,6 -1,6 +1,6 @@@
  /* bnx2.c: Broadcom NX2 network driver.
   *
-  * Copyright (c) 2004-2008 Broadcom Corporation
+  * Copyright (c) 2004-2009 Broadcom Corporation
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
@@@ -57,8 -57,8 +57,8 @@@
  
  #define DRV_MODULE_NAME               "bnx2"
  #define PFX DRV_MODULE_NAME   ": "
- #define DRV_MODULE_VERSION    "1.9.0"
- #define DRV_MODULE_RELDATE    "Dec 16, 2008"
+ #define DRV_MODULE_VERSION    "1.9.2"
+ #define DRV_MODULE_RELDATE    "Feb 11, 2009"
  
  #define RUN_AT(x) (jiffies + (x))
  
@@@ -1497,8 -1497,6 +1497,8 @@@ static int bnx2_fw_sync(struct bnx2 *, 
  
  static int
  bnx2_setup_remote_phy(struct bnx2 *bp, u8 port)
 +__releases(&bp->phy_lock)
 +__acquires(&bp->phy_lock)
  {
        u32 speed_arg = 0, pause_adv;
  
  
  static int
  bnx2_setup_serdes_phy(struct bnx2 *bp, u8 port)
 +__releases(&bp->phy_lock)
 +__acquires(&bp->phy_lock)
  {
        u32 adv, bmcr;
        u32 new_adv = 0;
@@@ -1870,8 -1866,6 +1870,8 @@@ bnx2_set_remote_link(struct bnx2 *bp
  
  static int
  bnx2_setup_copper_phy(struct bnx2 *bp)
 +__releases(&bp->phy_lock)
 +__acquires(&bp->phy_lock)
  {
        u32 bmcr;
        u32 new_bmcr;
  
  static int
  bnx2_setup_phy(struct bnx2 *bp, u8 port)
 +__releases(&bp->phy_lock)
 +__acquires(&bp->phy_lock)
  {
        if (bp->loopback == MAC_LOOPBACK)
                return 0;
@@@ -2184,8 -2176,6 +2184,8 @@@ bnx2_init_copper_phy(struct bnx2 *bp, i
  
  static int
  bnx2_init_phy(struct bnx2 *bp, int reset_phy)
 +__releases(&bp->phy_lock)
 +__acquires(&bp->phy_lock)
  {
        u32 val;
        int rc = 0;
@@@ -2920,18 -2910,8 +2920,8 @@@ bnx2_rx_int(struct bnx2 *bp, struct bnx
  
                rx_hdr = (struct l2_fhdr *) skb->data;
                len = rx_hdr->l2_fhdr_pkt_len;
+               status = rx_hdr->l2_fhdr_status;
  
-               if ((status = rx_hdr->l2_fhdr_status) &
-                       (L2_FHDR_ERRORS_BAD_CRC |
-                       L2_FHDR_ERRORS_PHY_DECODE |
-                       L2_FHDR_ERRORS_ALIGNMENT |
-                       L2_FHDR_ERRORS_TOO_SHORT |
-                       L2_FHDR_ERRORS_GIANT_FRAME)) {
-                       bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
-                                         sw_ring_prod);
-                       goto next_rx;
-               }
                hdr_len = 0;
                if (status & L2_FHDR_STATUS_SPLIT) {
                        hdr_len = rx_hdr->l2_fhdr_ip_xsum;
                        pg_ring_used = 1;
                }
  
+               if (unlikely(status & (L2_FHDR_ERRORS_BAD_CRC |
+                                      L2_FHDR_ERRORS_PHY_DECODE |
+                                      L2_FHDR_ERRORS_ALIGNMENT |
+                                      L2_FHDR_ERRORS_TOO_SHORT |
+                                      L2_FHDR_ERRORS_GIANT_FRAME))) {
+                       bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
+                                         sw_ring_prod);
+                       if (pg_ring_used) {
+                               int pages;
+                               pages = PAGE_ALIGN(len - hdr_len) >> PAGE_SHIFT;
+                               bnx2_reuse_rx_skb_pages(bp, rxr, NULL, pages);
+                       }
+                       goto next_rx;
+               }
                len -= 4;
  
                if (len <= bp->rx_copy_thresh) {
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
                }
  
 +              skb_record_rx_queue(skb, bnapi - &bp->bnx2_napi[0]);
 +
  #ifdef BCM_VLAN
                if (hw_vlan)
                        vlan_hwaccel_receive_skb(skb, bp->vlgrp, vtag);
@@@ -3065,7 -3061,7 +3073,7 @@@ bnx2_msi(int irq, void *dev_instance
        if (unlikely(atomic_read(&bp->intr_sem) != 0))
                return IRQ_HANDLED;
  
 -      netif_rx_schedule(&bnapi->napi);
 +      napi_schedule(&bnapi->napi);
  
        return IRQ_HANDLED;
  }
@@@ -3082,7 -3078,7 +3090,7 @@@ bnx2_msi_1shot(int irq, void *dev_insta
        if (unlikely(atomic_read(&bp->intr_sem) != 0))
                return IRQ_HANDLED;
  
 -      netif_rx_schedule(&bnapi->napi);
 +      napi_schedule(&bnapi->napi);
  
        return IRQ_HANDLED;
  }
@@@ -3118,9 -3114,9 +3126,9 @@@ bnx2_interrupt(int irq, void *dev_insta
        if (unlikely(atomic_read(&bp->intr_sem) != 0))
                return IRQ_HANDLED;
  
 -      if (netif_rx_schedule_prep(&bnapi->napi)) {
 +      if (napi_schedule_prep(&bnapi->napi)) {
                bnapi->last_status_idx = sblk->status_idx;
 -              __netif_rx_schedule(&bnapi->napi);
 +              __napi_schedule(&bnapi->napi);
        }
  
        return IRQ_HANDLED;
@@@ -3230,7 -3226,7 +3238,7 @@@ static int bnx2_poll_msix(struct napi_s
                rmb();
                if (likely(!bnx2_has_fast_work(bnapi))) {
  
 -                      netif_rx_complete(napi);
 +                      napi_complete(napi);
                        REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
                               BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
                               bnapi->last_status_idx);
@@@ -3263,7 -3259,7 +3271,7 @@@ static int bnx2_poll(struct napi_struc
  
                rmb();
                if (likely(!bnx2_has_work(bnapi))) {
 -                      netif_rx_complete(napi);
 +                      napi_complete(napi);
                        if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {
                                REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
                                       BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
index 5597c754f127a6cd9afb0024cca7d684c90f6700,9f33e442f40339f0d4d862c05c7be39f29502694..4fe20ecdbc6b075194d3f15aa50d8a904883c920
@@@ -201,9 -201,9 +201,9 @@@ static int nx_set_dma_mask(struct netxe
                adapter->pci_using_dac = 1;
                return 0;
        }
+ set_32_bit_mask:
  #endif /* CONFIG_IA64 */
  
- set_32_bit_mask:
        err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        if (!err)
                err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
@@@ -372,67 -372,6 +372,6 @@@ static void netxen_set_port_mode(struc
        }
  }
  
- #define PCI_CAP_ID_GEN  0x10
- static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
- {
-       u32 pdevfuncsave;
-       u32 c8c9value = 0;
-       u32 chicken = 0;
-       u32 control = 0;
-       int i, pos;
-       struct pci_dev *pdev;
-       pdev = adapter->pdev;
-       adapter->hw_read_wx(adapter,
-               NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
-       /* clear chicken3.25:24 */
-       chicken &= 0xFCFFFFFF;
-       /*
-        * if gen1 and B0, set F1020 - if gen 2, do nothing
-        * if gen2 set to F1000
-        */
-       pos = pci_find_capability(pdev, PCI_CAP_ID_GEN);
-       if (pos == 0xC0) {
-               pci_read_config_dword(pdev, pos + 0x10, &control);
-               if ((control & 0x000F0000) != 0x00020000) {
-                       /*  set chicken3.24 if gen1 */
-                       chicken |= 0x01000000;
-               }
-               printk(KERN_INFO "%s Gen2 strapping detected\n",
-                               netxen_nic_driver_name);
-               c8c9value = 0xF1000;
-       } else {
-               /* set chicken3.24 if gen1 */
-               chicken |= 0x01000000;
-               printk(KERN_INFO "%s Gen1 strapping detected\n",
-                               netxen_nic_driver_name);
-               if (adapter->ahw.revision_id == NX_P3_B0)
-                       c8c9value = 0xF1020;
-               else
-                       c8c9value = 0;
-       }
-       adapter->hw_write_wx(adapter,
-               NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
-       if (!c8c9value)
-               return;
-       pdevfuncsave = pdev->devfn;
-       if (pdevfuncsave & 0x07)
-               return;
-       for (i = 0; i < 8; i++) {
-               pci_read_config_dword(pdev, pos + 8, &control);
-               pci_read_config_dword(pdev, pos + 8, &control);
-               pci_write_config_dword(pdev, pos + 8, c8c9value);
-               pdev->devfn++;
-       }
-       pdev->devfn = pdevfuncsave;
- }
  static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
  {
        u32 control;
@@@ -812,9 -751,6 +751,6 @@@ netxen_nic_probe(struct pci_dev *pdev, 
                }
                netxen_load_firmware(adapter);
  
-               if (NX_IS_REVISION_P3(revision_id))
-                       netxen_pcie_strap_init(adapter);
                if (NX_IS_REVISION_P2(revision_id)) {
  
                        /* Initialize multicast addr pool owners */
@@@ -1173,7 -1109,7 +1109,7 @@@ static bool netxen_tso_check(struct net
        __be16 protocol = skb->protocol;
        u16 flags = 0;
  
 -      if (protocol == __constant_htons(ETH_P_8021Q)) {
 +      if (protocol == cpu_to_be16(ETH_P_8021Q)) {
                struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data;
                protocol = vh->h_vlan_encapsulated_proto;
                flags = FLAGS_VLAN_TAGGED;
                desc->total_hdr_length =
                        skb_transport_offset(skb) + tcp_hdrlen(skb);
  
 -              opcode = (protocol == __constant_htons(ETH_P_IPV6)) ?
 +              opcode = (protocol == cpu_to_be16(ETH_P_IPV6)) ?
                                TX_TCP_LSO6 : TX_TCP_LSO;
                tso = true;
  
        } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u8 l4proto;
  
 -              if (protocol == __constant_htons(ETH_P_IP)) {
 +              if (protocol == cpu_to_be16(ETH_P_IP)) {
                        l4proto = ip_hdr(skb)->protocol;
  
                        if (l4proto == IPPROTO_TCP)
                                opcode = TX_TCP_PKT;
                        else if(l4proto == IPPROTO_UDP)
                                opcode = TX_UDP_PKT;
 -              } else if (protocol == __constant_htons(ETH_P_IPV6)) {
 +              } else if (protocol == cpu_to_be16(ETH_P_IPV6)) {
                        l4proto = ipv6_hdr(skb)->nexthdr;
  
                        if (l4proto == IPPROTO_TCP)
@@@ -1651,7 -1587,7 +1587,7 @@@ static int netxen_nic_poll(struct napi_
        }
  
        if ((work_done < budget) && tx_complete) {
 -              netif_rx_complete(&adapter->napi);
 +              napi_complete(&adapter->napi);
                netxen_nic_enable_int(adapter);
        }
  
index 3f460c564927e202bb2c4abf76a34e82a0bc918a,af28ff7ae1767a2c9ec6491c36d48b5797286197..33984b737233c8cb13d9d0dbf9a2e0d6d915601e
@@@ -125,6 -125,8 +125,8 @@@ static int __devinit mdio_gpio_bus_init
        if (gpio_request(bitbang->mdio, "mdio"))
                goto out_free_mdc;
  
+       gpio_direction_output(bitbang->mdc, 0);
        dev_set_drvdata(dev, new_bus);
  
        ret = mdiobus_register(new_bus);
@@@ -200,21 -202,16 +202,21 @@@ static int __devinit mdio_ofgpio_probe(
  {
        struct device_node *np = NULL;
        struct mdio_gpio_platform_data *pdata;
 +      int ret;
  
        pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
                return -ENOMEM;
  
 -      pdata->mdc = of_get_gpio(ofdev->node, 0);
 -      pdata->mdio = of_get_gpio(ofdev->node, 1);
 -
 -      if (pdata->mdc < 0 || pdata->mdio < 0)
 +      ret = of_get_gpio(ofdev->node, 0);
 +      if (ret < 0)
                goto out_free;
 +      pdata->mdc = ret;
 +
 +      ret = of_get_gpio(ofdev->node, 1);
 +      if (ret < 0)
 +                goto out_free;
 +      pdata->mdio = ret;
  
        while ((np = of_get_next_child(ofdev->node, np)))
                if (!strcmp(np->type, "ethernet-phy"))
index 04bf2122264a84cf6b23bc30f73d0a18ec14f267,8ea72dc60f79f96276659da86ad5c6a9228f30d3..fd515afb1aa5421ba6764fded89d2c7769d8399e
@@@ -898,6 -898,7 +898,7 @@@ static void ql_update_lbq(struct ql_ada
                                        lbq_desc->index);
                                lbq_desc->p.lbq_page = alloc_page(GFP_ATOMIC);
                                if (lbq_desc->p.lbq_page == NULL) {
+                                       rx_ring->lbq_clean_idx = clean_idx;
                                        QPRINTK(qdev, RX_STATUS, ERR,
                                                "Couldn't get a page.\n");
                                        return;
                                                   0, PAGE_SIZE,
                                                   PCI_DMA_FROMDEVICE);
                                if (pci_dma_mapping_error(qdev->pdev, map)) {
+                                       rx_ring->lbq_clean_idx = clean_idx;
+                                       put_page(lbq_desc->p.lbq_page);
+                                       lbq_desc->p.lbq_page = NULL;
                                        QPRINTK(qdev, RX_STATUS, ERR,
                                                "PCI mapping failed.\n");
                                        return;
@@@ -968,6 -972,8 +972,8 @@@ static void ql_update_sbq(struct ql_ada
                                if (pci_dma_mapping_error(qdev->pdev, map)) {
                                        QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n");
                                        rx_ring->sbq_clean_idx = clean_idx;
+                                       dev_kfree_skb_any(sbq_desc->p.skb);
+                                       sbq_desc->p.skb = NULL;
                                        return;
                                }
                                pci_unmap_addr_set(sbq_desc, mapaddr, map);
@@@ -1446,16 -1452,15 +1452,16 @@@ static void ql_process_mac_rx_intr(stru
        qdev->stats.rx_packets++;
        qdev->stats.rx_bytes += skb->len;
        skb->protocol = eth_type_trans(skb, ndev);
 +      skb_record_rx_queue(skb, rx_ring - &qdev->rx_ring[0]);
        if (qdev->vlgrp && (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V)) {
                QPRINTK(qdev, RX_STATUS, DEBUG,
                        "Passing a VLAN packet upstream.\n");
-               vlan_hwaccel_rx(skb, qdev->vlgrp,
+               vlan_hwaccel_receive_skb(skb, qdev->vlgrp,
                                le16_to_cpu(ib_mac_rsp->vlan_id));
        } else {
                QPRINTK(qdev, RX_STATUS, DEBUG,
                        "Passing a normal packet upstream.\n");
-               netif_rx(skb);
+               netif_receive_skb(skb);
        }
  }
  
@@@ -1512,6 -1517,11 +1518,11 @@@ void ql_queue_asic_error(struct ql_adap
        netif_stop_queue(qdev->ndev);
        netif_carrier_off(qdev->ndev);
        ql_disable_interrupts(qdev);
+       /* Clear adapter up bit to signal the recovery
+        * process that it shouldn't kill the reset worker
+        * thread
+        */
+       clear_bit(QL_ADAPTER_UP, &qdev->flags);
        queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
  }
  
@@@ -1653,7 -1663,7 +1664,7 @@@ static int ql_napi_poll_msix(struct nap
                rx_ring->cq_id);
  
        if (work_done < budget) {
 -              __netif_rx_complete(napi);
 +              __napi_complete(napi);
                ql_enable_completion_interrupt(qdev, rx_ring->irq);
        }
        return work_done;
@@@ -1738,7 -1748,7 +1749,7 @@@ static irqreturn_t qlge_msix_tx_isr(in
  static irqreturn_t qlge_msix_rx_isr(int irq, void *dev_id)
  {
        struct rx_ring *rx_ring = dev_id;
 -      netif_rx_schedule(&rx_ring->napi);
 +      napi_schedule(&rx_ring->napi);
        return IRQ_HANDLED;
  }
  
@@@ -1824,7 -1834,7 +1835,7 @@@ static irqreturn_t qlge_isr(int irq, vo
                                                              &rx_ring->rx_work,
                                                              0);
                                else
 -                                      netif_rx_schedule(&rx_ring->napi);
 +                                      napi_schedule(&rx_ring->napi);
                                work_done++;
                        }
                }
@@@ -1928,10 -1938,6 +1939,6 @@@ static int qlge_send(struct sk_buff *sk
        tx_ring_desc = &tx_ring->q[tx_ring->prod_idx];
        mac_iocb_ptr = tx_ring_desc->queue_entry;
        memset((void *)mac_iocb_ptr, 0, sizeof(mac_iocb_ptr));
-       if (ql_map_send(qdev, mac_iocb_ptr, skb, tx_ring_desc) != NETDEV_TX_OK) {
-               QPRINTK(qdev, TX_QUEUED, ERR, "Could not map the segments.\n");
-               return NETDEV_TX_BUSY;
-       }
  
        mac_iocb_ptr->opcode = OPCODE_OB_MAC_IOCB;
        mac_iocb_ptr->tid = tx_ring_desc->index;
                ql_hw_csum_setup(skb,
                                 (struct ob_mac_tso_iocb_req *)mac_iocb_ptr);
        }
+       if (ql_map_send(qdev, mac_iocb_ptr, skb, tx_ring_desc) !=
+                       NETDEV_TX_OK) {
+               QPRINTK(qdev, TX_QUEUED, ERR,
+                               "Could not map the segments.\n");
+               return NETDEV_TX_BUSY;
+       }
        QL_DUMP_OB_MAC_IOCB(mac_iocb_ptr);
        tx_ring->prod_idx++;
        if (tx_ring->prod_idx == tx_ring->wq_len)
@@@ -2874,8 -2886,8 +2887,8 @@@ static int ql_start_rss(struct ql_adapt
        /*
         * Fill out the Indirection Table.
         */
-       for (i = 0; i < 32; i++)
-               hash_id[i] = i & 1;
+       for (i = 0; i < 256; i++)
+               hash_id[i] = i & (qdev->rss_ring_count - 1);
  
        /*
         * Random values for the IPv6 and IPv4 Hash Keys.
@@@ -3101,7 -3113,11 +3114,11 @@@ static int ql_adapter_down(struct ql_ad
        netif_stop_queue(ndev);
        netif_carrier_off(ndev);
  
-       cancel_delayed_work_sync(&qdev->asic_reset_work);
+       /* Don't kill the reset worker thread if we
+        * are in the process of recovery.
+        */
+       if (test_bit(QL_ADAPTER_UP, &qdev->flags))
+               cancel_delayed_work_sync(&qdev->asic_reset_work);
        cancel_delayed_work_sync(&qdev->mpi_reset_work);
        cancel_delayed_work_sync(&qdev->mpi_work);
  
@@@ -3502,7 -3518,7 +3519,7 @@@ static int qlge_set_mac_address(struct 
  static void qlge_tx_timeout(struct net_device *ndev)
  {
        struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
-       queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
+       ql_queue_asic_error(qdev);
  }
  
  static void ql_asic_reset_work(struct work_struct *work)
diff --combined drivers/net/tg3.c
index 5b3d60568d554196a1eb6549df1173b7aa7d9e1b,4595962fb8e1b0f74385fc25cc6d28d57846f878..479a37f75f3019c6c260804fb7263280669bc642
@@@ -852,7 -852,7 +852,7 @@@ static int tg3_bmcr_reset(struct tg3 *t
                }
                udelay(10);
        }
-       if (limit <= 0)
+       if (limit < 0)
                return -EBUSY;
  
        return 0;
  
  static int tg3_mdio_read(struct mii_bus *bp, int mii_id, int reg)
  {
 -      struct tg3 *tp = (struct tg3 *)bp->priv;
 +      struct tg3 *tp = bp->priv;
        u32 val;
  
        if (tp->tg3_flags3 & TG3_FLG3_MDIOBUS_PAUSED)
  
  static int tg3_mdio_write(struct mii_bus *bp, int mii_id, int reg, u16 val)
  {
 -      struct tg3 *tp = (struct tg3 *)bp->priv;
 +      struct tg3 *tp = bp->priv;
  
        if (tp->tg3_flags3 & TG3_FLG3_MDIOBUS_PAUSED)
                return -EAGAIN;
@@@ -1603,7 -1603,7 +1603,7 @@@ static int tg3_wait_macro_done(struct t
                                break;
                }
        }
-       if (limit <= 0)
+       if (limit < 0)
                return -EBUSY;
  
        return 0;
@@@ -4460,7 -4460,7 +4460,7 @@@ static int tg3_poll(struct napi_struct 
                        sblk->status &= ~SD_STATUS_UPDATED;
  
                if (likely(!tg3_has_work(tp))) {
 -                      netif_rx_complete(napi);
 +                      napi_complete(napi);
                        tg3_restart_ints(tp);
                        break;
                }
  
  tx_recovery:
        /* work_done is guaranteed to be less than budget. */
 -      netif_rx_complete(napi);
 +      napi_complete(napi);
        schedule_work(&tp->reset_task);
        return work_done;
  }
@@@ -4519,7 -4519,7 +4519,7 @@@ static irqreturn_t tg3_msi_1shot(int ir
        prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
  
        if (likely(!tg3_irq_sync(tp)))
 -              netif_rx_schedule(&tp->napi);
 +              napi_schedule(&tp->napi);
  
        return IRQ_HANDLED;
  }
@@@ -4544,7 -4544,7 +4544,7 @@@ static irqreturn_t tg3_msi(int irq, voi
         */
        tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
        if (likely(!tg3_irq_sync(tp)))
 -              netif_rx_schedule(&tp->napi);
 +              napi_schedule(&tp->napi);
  
        return IRQ_RETVAL(1);
  }
@@@ -4586,7 -4586,7 +4586,7 @@@ static irqreturn_t tg3_interrupt(int ir
        sblk->status &= ~SD_STATUS_UPDATED;
        if (likely(tg3_has_work(tp))) {
                prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
 -              netif_rx_schedule(&tp->napi);
 +              napi_schedule(&tp->napi);
        } else {
                /* No work, shared interrupt perhaps?  re-enable
                 * interrupts, and flush that PCI write
@@@ -4632,7 -4632,7 +4632,7 @@@ static irqreturn_t tg3_interrupt_tagged
        tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
        if (tg3_irq_sync(tp))
                goto out;
 -      if (netif_rx_schedule_prep(&tp->napi)) {
 +      if (napi_schedule_prep(&tp->napi)) {
                prefetch(&tp->rx_rcb[tp->rx_rcb_ptr]);
                /* Update last_tag to mark that this status has been
                 * seen. Because interrupt may be shared, we may be
                 * if tg3_poll() is not scheduled.
                 */
                tp->last_tag = sblk->status_tag;
 -              __netif_rx_schedule(&tp->napi);
 +              __napi_schedule(&tp->napi);
        }
  out:
        return IRQ_RETVAL(handled);
diff --combined fs/compat_ioctl.c
index c03c10d7fb6b2df896ce14d03cea7d1c5a044ab2,9c6d815dd1918b42640b4819393ac056b21da17f..64f406593c0e69569b234663c5da54c3f97f03e4
@@@ -785,7 -785,7 +785,7 @@@ static int sg_ioctl_trans(unsigned int 
  
        if (copy_in_user(&sgio->status, &sgio32->status,
                         (4 * sizeof(unsigned char)) +
-                        (2 * sizeof(unsigned (short))) +
+                        (2 * sizeof(unsigned short)) +
                         (3 * sizeof(int))))
                return -EFAULT;
  
@@@ -1988,8 -1988,6 +1988,8 @@@ COMPATIBLE_IOCTL(TUNSETGROUP
  COMPATIBLE_IOCTL(TUNGETFEATURES)
  COMPATIBLE_IOCTL(TUNSETOFFLOAD)
  COMPATIBLE_IOCTL(TUNSETTXFILTER)
 +COMPATIBLE_IOCTL(TUNGETSNDBUF)
 +COMPATIBLE_IOCTL(TUNSETSNDBUF)
  /* Big V */
  COMPATIBLE_IOCTL(VT_SETMODE)
  COMPATIBLE_IOCTL(VT_GETMODE)
diff --combined include/net/sock.h
index c047def9cf102c84bdd856fb5d2fd54a0b451331,ce3b5b6226838ca1d1595b519d02e6223efcb67b..ded6854e3e4a961cc9b4438810c4191804a0133c
@@@ -945,11 -945,6 +945,11 @@@ extern struct sk_buff            *sock_alloc_sen
                                                     unsigned long size,
                                                     int noblock,
                                                     int *errcode);
 +extern struct sk_buff                 *sock_alloc_send_pskb(struct sock *sk,
 +                                                    unsigned long header_len,
 +                                                    unsigned long data_len,
 +                                                    int noblock,
 +                                                    int *errcode);
  extern void *sock_kmalloc(struct sock *sk, int size,
                          gfp_t priority);
  extern void sock_kfree_s(struct sock *sk, void *mem, int size);
@@@ -1313,7 -1308,7 +1313,7 @@@ static inline int sock_writeable(const 
  
  static inline gfp_t gfp_any(void)
  {
-       return in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
+       return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
  }
  
  static inline long sock_rcvtimeo(const struct sock *sk, int noblock)
diff --combined net/core/sock.c
index c64996f8a27a3f3be06203269a004673056e9b78,6f2e1337975de8e09b079339f2c2819caddfa8ea..4c64be4f87659131dd52070aaaa506d16e6ed208
@@@ -696,6 -696,8 +696,8 @@@ int sock_getsockopt(struct socket *sock
        if (len < 0)
                return -EINVAL;
  
+       v.val = 0;
        switch(optname) {
        case SO_DEBUG:
                v.val = sock_flag(sk, SOCK_DBG);
@@@ -1254,9 -1256,10 +1256,9 @@@ static long sock_wait_for_wmem(struct s
   *    Generic send/receive buffer handlers
   */
  
 -static struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
 -                                          unsigned long header_len,
 -                                          unsigned long data_len,
 -                                          int noblock, int *errcode)
 +struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len,
 +                                   unsigned long data_len, int noblock,
 +                                   int *errcode)
  {
        struct sk_buff *skb;
        gfp_t gfp_mask;
@@@ -1336,7 -1339,6 +1338,7 @@@ failure
        *errcode = err;
        return NULL;
  }
 +EXPORT_SYMBOL(sock_alloc_send_pskb);
  
  struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size,
                                    int noblock, int *errcode)
diff --combined net/mac80211/tx.c
index bf73f6d561b726551aa0d2831c6efd072205b6f6,94de5033f0b6d331c796b0241a1a64d8827704e0..33926831c64889cc5836fafe065a6f9dd9d5cebd
@@@ -35,7 -35,6 +35,7 @@@
  #define IEEE80211_TX_OK               0
  #define IEEE80211_TX_AGAIN    1
  #define IEEE80211_TX_FRAG_AGAIN       2
 +#define IEEE80211_TX_PENDING  3
  
  /* misc utils */
  
@@@ -331,22 -330,6 +331,22 @@@ ieee80211_tx_h_multicast_ps_buf(struct 
        return TX_CONTINUE;
  }
  
 +static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta,
 +                           struct sk_buff *skb)
 +{
 +      if (!ieee80211_is_mgmt(fc))
 +              return 0;
 +
 +      if (sta == NULL || !test_sta_flags(sta, WLAN_STA_MFP))
 +              return 0;
 +
 +      if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *)
 +                                          skb->data))
 +              return 0;
 +
 +      return 1;
 +}
 +
  static ieee80211_tx_result
  ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
  {
@@@ -426,17 -409,11 +426,17 @@@ ieee80211_tx_h_select_key(struct ieee80
                tx->key = NULL;
        else if (tx->sta && (key = rcu_dereference(tx->sta->key)))
                tx->key = key;
 +      else if (ieee80211_is_mgmt(hdr->frame_control) &&
 +               (key = rcu_dereference(tx->sdata->default_mgmt_key)))
 +              tx->key = key;
        else if ((key = rcu_dereference(tx->sdata->default_key)))
                tx->key = key;
        else if (tx->sdata->drop_unencrypted &&
                 (tx->skb->protocol != cpu_to_be16(ETH_P_PAE)) &&
 -               !(info->flags & IEEE80211_TX_CTL_INJECTED)) {
 +               !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
 +               (!ieee80211_is_robust_mgmt_frame(hdr) ||
 +                (ieee80211_is_action(hdr->frame_control) &&
 +                 tx->sta && test_sta_flags(tx->sta, WLAN_STA_MFP)))) {
                I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
                return TX_DROP;
        } else
                        if (ieee80211_is_auth(hdr->frame_control))
                                break;
                case ALG_TKIP:
 -              case ALG_CCMP:
                        if (!ieee80211_is_data_present(hdr->frame_control))
                                tx->key = NULL;
                        break;
 +              case ALG_CCMP:
 +                      if (!ieee80211_is_data_present(hdr->frame_control) &&
 +                          !ieee80211_use_mfp(hdr->frame_control, tx->sta,
 +                                             tx->skb))
 +                              tx->key = NULL;
 +                      break;
 +              case ALG_AES_CMAC:
 +                      if (!ieee80211_is_mgmt(hdr->frame_control))
 +                              tx->key = NULL;
 +                      break;
                }
        }
  
@@@ -819,8 -787,6 +819,8 @@@ ieee80211_tx_h_encrypt(struct ieee80211
                return ieee80211_crypto_tkip_encrypt(tx);
        case ALG_CCMP:
                return ieee80211_crypto_ccmp_encrypt(tx);
 +      case ALG_AES_CMAC:
 +              return ieee80211_crypto_aes_cmac_encrypt(tx);
        }
  
        /* not reached */
@@@ -1086,7 -1052,8 +1086,7 @@@ static int __ieee80211_tx(struct ieee80
  
        if (skb) {
                if (netif_subqueue_stopped(local->mdev, skb))
 -                      return IEEE80211_TX_AGAIN;
 -              info =  IEEE80211_SKB_CB(skb);
 +                      return IEEE80211_TX_PENDING;
  
                ret = local->ops->tx(local_to_hw(local), skb);
                if (ret)
@@@ -1212,9 -1179,8 +1212,9 @@@ retry
                 * queues, there's no reason for a driver to reject
                 * a frame there, warn and drop it.
                 */
 -              if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
 -                      goto drop;
 +              if (ret != IEEE80211_TX_PENDING)
 +                      if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
 +                              goto drop;
  
                store = &local->pending_packet[queue];
  
@@@ -1330,19 -1296,6 +1330,19 @@@ int ieee80211_master_start_xmit(struct 
                return 0;
        }
  
 +      if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
 +          local->hw.conf.dynamic_ps_timeout > 0) {
 +              if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 +                      ieee80211_stop_queues_by_reason(&local->hw,
 +                                      IEEE80211_QUEUE_STOP_REASON_PS);
 +                      queue_work(local->hw.workqueue,
 +                                      &local->dynamic_ps_disable_work);
 +              }
 +
 +              mod_timer(&local->dynamic_ps_timer, jiffies +
 +                      msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
 +      }
 +
        memset(info, 0, sizeof(*info));
  
        info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
                                                list) {
                                if (!netif_running(sdata->dev))
                                        continue;
+                               if (sdata->vif.type != NL80211_IFTYPE_AP)
+                                       continue;
                                if (compare_ether_addr(sdata->dev->dev_addr,
                                                       hdr->addr2)) {
                                        dev_hold(sdata->dev);
@@@ -1435,31 -1390,10 +1437,31 @@@ int ieee80211_monitor_start_xmit(struc
                                 struct net_device *dev)
  {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 +      struct ieee80211_channel *chan = local->hw.conf.channel;
        struct ieee80211_radiotap_header *prthdr =
                (struct ieee80211_radiotap_header *)skb->data;
        u16 len_rthdr;
  
 +      /*
 +       * Frame injection is not allowed if beaconing is not allowed
 +       * or if we need radar detection. Beaconing is usually not allowed when
 +       * the mode or operation (Adhoc, AP, Mesh) does not support DFS.
 +       * Passive scan is also used in world regulatory domains where
 +       * your country is not known and as such it should be treated as
 +       * NO TX unless the channel is explicitly allowed in which case
 +       * your current regulatory domain would not have the passive scan
 +       * flag.
 +       *
 +       * Since AP mode uses monitor interfaces to inject/TX management
 +       * frames we can make AP mode the exception to this rule once it
 +       * supports radar detection as its implementation can deal with
 +       * radar detection by itself. We can do that later by adding a
 +       * monitor flag interfaces used for AP support.
 +       */
 +      if ((chan->flags & (IEEE80211_CHAN_NO_IBSS | IEEE80211_CHAN_RADAR |
 +           IEEE80211_CHAN_PASSIVE_SCAN)))
 +              goto fail;
 +
        /* check for not even having the fixed radiotap header part */
        if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
                goto fail; /* too short to be possibly valid */
@@@ -1543,6 -1477,19 +1545,6 @@@ int ieee80211_subif_start_xmit(struct s
                goto fail;
        }
  
 -      if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
 -          local->dynamic_ps_timeout > 0) {
 -              if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 -                      ieee80211_stop_queues_by_reason(&local->hw,
 -                                                      IEEE80211_QUEUE_STOP_REASON_PS);
 -                      queue_work(local->hw.workqueue,
 -                                 &local->dynamic_ps_disable_work);
 -              }
 -
 -              mod_timer(&local->dynamic_ps_timer, jiffies +
 -                        msecs_to_jiffies(local->dynamic_ps_timeout));
 -      }
 -
        nh_pos = skb_network_header(skb) - skb->data;
        h_pos = skb_transport_header(skb) - skb->data;