Commit df597efb5737063497f1a4f7c996cc9aec294230
Exists in
master
and in
39 other branches
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/iwlwifi/iwl-3945.h drivers/net/wireless/iwlwifi/iwl-tx.c drivers/net/wireless/iwlwifi/iwl3945-base.c
Showing 34 changed files Side-by-side Diff
- Documentation/DocBook/kernel-hacking.tmpl
- drivers/net/3c515.c
- drivers/net/at1700.c
- drivers/net/cnic.c
- drivers/net/eepro.c
- drivers/net/eexpress.c
- drivers/net/fealnx.c
- drivers/net/gianfar_ethtool.c
- drivers/net/ixgbe/ixgbe.h
- drivers/net/ixgbe/ixgbe_ethtool.c
- drivers/net/ixgbe/ixgbe_main.c
- drivers/net/netxen/netxen_nic_init.c
- drivers/net/pppoe.c
- drivers/net/r8169.c
- drivers/net/smc91x.h
- drivers/net/tokenring/ibmtr.c
- drivers/net/wireless/airo.c
- drivers/net/wireless/ath/ath9k/eeprom.c
- drivers/net/wireless/iwlwifi/iwl-tx.c
- drivers/net/wireless/iwmc3200wifi/netdev.c
- drivers/net/wireless/libertas/assoc.c
- drivers/net/wireless/libertas/scan.c
- drivers/scsi/scsi_transport_iscsi.c
- include/linux/inetdevice.h
- include/net/rose.h
- net/bridge/br_if.c
- net/ipv4/arp.c
- net/irda/irttp.c
- net/mac80211/mlme.c
- net/mac80211/pm.c
- net/mac80211/rx.c
- net/netlabel/netlabel_kapi.c
- net/rose/af_rose.c
- net/rose/rose_route.c
Documentation/DocBook/kernel-hacking.tmpl
drivers/net/3c515.c
... | ... | @@ -832,7 +832,9 @@ |
832 | 832 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
833 | 833 | vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); |
834 | 834 | } |
835 | - vp->rx_ring[i - 1].next = isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ | |
835 | + if (i != 0) | |
836 | + vp->rx_ring[i - 1].next = | |
837 | + isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ | |
836 | 838 | outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); |
837 | 839 | } |
838 | 840 | if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ |
drivers/net/at1700.c
... | ... | @@ -318,7 +318,7 @@ |
318 | 318 | pos3 = mca_read_stored_pos( slot, 3 ); |
319 | 319 | pos4 = mca_read_stored_pos( slot, 4 ); |
320 | 320 | |
321 | - for (l_i = 0; l_i < 0x09; l_i++) | |
321 | + for (l_i = 0; l_i < 8; l_i++) | |
322 | 322 | if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) |
323 | 323 | break; |
324 | 324 | ioaddr = at1700_mca_probe_list[l_i]; |
drivers/net/cnic.c
... | ... | @@ -227,7 +227,7 @@ |
227 | 227 | } |
228 | 228 | |
229 | 229 | rcu_read_lock(); |
230 | - ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); | |
230 | + ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); | |
231 | 231 | if (ulp_ops) |
232 | 232 | ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); |
233 | 233 | rcu_read_unlock(); |
... | ... | @@ -319,6 +319,20 @@ |
319 | 319 | return 0; |
320 | 320 | } |
321 | 321 | |
322 | +static void cnic_uio_stop(void) | |
323 | +{ | |
324 | + struct cnic_dev *dev; | |
325 | + | |
326 | + read_lock(&cnic_dev_lock); | |
327 | + list_for_each_entry(dev, &cnic_dev_list, list) { | |
328 | + struct cnic_local *cp = dev->cnic_priv; | |
329 | + | |
330 | + if (cp->cnic_uinfo) | |
331 | + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | |
332 | + } | |
333 | + read_unlock(&cnic_dev_lock); | |
334 | +} | |
335 | + | |
322 | 336 | int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) |
323 | 337 | { |
324 | 338 | struct cnic_dev *dev; |
... | ... | @@ -390,6 +404,9 @@ |
390 | 404 | } |
391 | 405 | read_unlock(&cnic_dev_lock); |
392 | 406 | |
407 | + if (ulp_type == CNIC_ULP_ISCSI) | |
408 | + cnic_uio_stop(); | |
409 | + | |
393 | 410 | rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); |
394 | 411 | |
395 | 412 | mutex_unlock(&cnic_lock); |
... | ... | @@ -632,7 +649,6 @@ |
632 | 649 | int i = 0; |
633 | 650 | |
634 | 651 | if (cp->cnic_uinfo) { |
635 | - cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | |
636 | 652 | while (cp->uio_dev != -1 && i < 15) { |
637 | 653 | msleep(100); |
638 | 654 | i++; |
... | ... | @@ -1056,6 +1072,9 @@ |
1056 | 1072 | { |
1057 | 1073 | struct cnic_local *cp = dev->cnic_priv; |
1058 | 1074 | int if_type; |
1075 | + | |
1076 | + if (cp->cnic_uinfo) | |
1077 | + cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | |
1059 | 1078 | |
1060 | 1079 | rcu_read_lock(); |
1061 | 1080 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { |
drivers/net/eepro.c
... | ... | @@ -1784,7 +1784,7 @@ |
1784 | 1784 | printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); |
1785 | 1785 | } |
1786 | 1786 | |
1787 | - for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { | |
1787 | + for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) { | |
1788 | 1788 | dev = alloc_etherdev(sizeof(struct eepro_local)); |
1789 | 1789 | if (!dev) |
1790 | 1790 | break; |
drivers/net/eexpress.c
... | ... | @@ -1474,13 +1474,13 @@ |
1474 | 1474 | outw(0x0000, ioaddr + 0x800c); |
1475 | 1475 | outw(0x0000, ioaddr + 0x800e); |
1476 | 1476 | |
1477 | - for (i = 0; i < (sizeof(start_code)); i+=32) { | |
1477 | + for (i = 0; i < ARRAY_SIZE(start_code) * 2; i+=32) { | |
1478 | 1478 | int j; |
1479 | 1479 | outw(i, ioaddr + SM_PTR); |
1480 | - for (j = 0; j < 16; j+=2) | |
1480 | + for (j = 0; j < 16 && (i+j)/2 < ARRAY_SIZE(start_code); j+=2) | |
1481 | 1481 | outw(start_code[(i+j)/2], |
1482 | 1482 | ioaddr+0x4000+j); |
1483 | - for (j = 0; j < 16; j+=2) | |
1483 | + for (j = 0; j < 16 && (i+j+16)/2 < ARRAY_SIZE(start_code); j+=2) | |
1484 | 1484 | outw(start_code[(i+j+16)/2], |
1485 | 1485 | ioaddr+0x8000+j); |
1486 | 1486 | } |
drivers/net/fealnx.c
... | ... | @@ -584,7 +584,8 @@ |
584 | 584 | if (np->flags == HAS_MII_XCVR) { |
585 | 585 | int phy, phy_idx = 0; |
586 | 586 | |
587 | - for (phy = 1; phy < 32 && phy_idx < 4; phy++) { | |
587 | + for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys); | |
588 | + phy++) { | |
588 | 589 | int mii_status = mdio_read(dev, phy, 1); |
589 | 590 | |
590 | 591 | if (mii_status != 0xffff && mii_status != 0x0000) { |
drivers/net/gianfar_ethtool.c
... | ... | @@ -366,9 +366,8 @@ |
366 | 366 | return -EINVAL; |
367 | 367 | } |
368 | 368 | |
369 | - priv->rxic = mk_ic_value( | |
370 | - gfar_usecs2ticks(priv, cvals->rx_coalesce_usecs), | |
371 | - cvals->rx_max_coalesced_frames); | |
369 | + priv->rxic = mk_ic_value(cvals->rx_max_coalesced_frames, | |
370 | + gfar_usecs2ticks(priv, cvals->rx_coalesce_usecs)); | |
372 | 371 | |
373 | 372 | /* Set up tx coalescing */ |
374 | 373 | if ((cvals->tx_coalesce_usecs == 0) || |
... | ... | @@ -390,9 +389,8 @@ |
390 | 389 | return -EINVAL; |
391 | 390 | } |
392 | 391 | |
393 | - priv->txic = mk_ic_value( | |
394 | - gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs), | |
395 | - cvals->tx_max_coalesced_frames); | |
392 | + priv->txic = mk_ic_value(cvals->tx_max_coalesced_frames, | |
393 | + gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs)); | |
396 | 394 | |
397 | 395 | gfar_write(&priv->regs->rxic, 0); |
398 | 396 | if (priv->rxcoalescing) |
drivers/net/ixgbe/ixgbe.h
... | ... | @@ -96,6 +96,8 @@ |
96 | 96 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 |
97 | 97 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 |
98 | 98 | |
99 | +#define IXGBE_MAX_RSC_INT_RATE 162760 | |
100 | + | |
99 | 101 | /* wrapper around a pointer to a socket buffer, |
100 | 102 | * so a DMA handle can be stored along with the buffer */ |
101 | 103 | struct ixgbe_tx_buffer { |
drivers/net/ixgbe/ixgbe_ethtool.c
... | ... | @@ -1980,7 +1980,10 @@ |
1980 | 1980 | * any other value means disable eitr, which is best |
1981 | 1981 | * served by setting the interrupt rate very high |
1982 | 1982 | */ |
1983 | - adapter->eitr_param = IXGBE_MAX_INT_RATE; | |
1983 | + if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) | |
1984 | + adapter->eitr_param = IXGBE_MAX_RSC_INT_RATE; | |
1985 | + else | |
1986 | + adapter->eitr_param = IXGBE_MAX_INT_RATE; | |
1984 | 1987 | adapter->itr_setting = 0; |
1985 | 1988 | } |
1986 | 1989 | |
1987 | 1990 | |
... | ... | @@ -2004,13 +2007,13 @@ |
2004 | 2007 | |
2005 | 2008 | ethtool_op_set_flags(netdev, data); |
2006 | 2009 | |
2007 | - if (!(adapter->flags & IXGBE_FLAG2_RSC_CAPABLE)) | |
2010 | + if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) | |
2008 | 2011 | return 0; |
2009 | 2012 | |
2010 | 2013 | /* if state changes we need to update adapter->flags and reset */ |
2011 | 2014 | if ((!!(data & ETH_FLAG_LRO)) != |
2012 | - (!!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED))) { | |
2013 | - adapter->flags ^= IXGBE_FLAG2_RSC_ENABLED; | |
2015 | + (!!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) { | |
2016 | + adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED; | |
2014 | 2017 | if (netif_running(netdev)) |
2015 | 2018 | ixgbe_reinit_locked(adapter); |
2016 | 2019 | else |
drivers/net/ixgbe/ixgbe_main.c
... | ... | @@ -513,8 +513,11 @@ |
513 | 513 | * @skb: skb currently being received and modified |
514 | 514 | **/ |
515 | 515 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, |
516 | - u32 status_err, struct sk_buff *skb) | |
516 | + union ixgbe_adv_rx_desc *rx_desc, | |
517 | + struct sk_buff *skb) | |
517 | 518 | { |
519 | + u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error); | |
520 | + | |
518 | 521 | skb->ip_summed = CHECKSUM_NONE; |
519 | 522 | |
520 | 523 | /* Rx csum disabled */ |
... | ... | @@ -532,6 +535,16 @@ |
532 | 535 | return; |
533 | 536 | |
534 | 537 | if (status_err & IXGBE_RXDADV_ERR_TCPE) { |
538 | + u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; | |
539 | + | |
540 | + /* | |
541 | + * 82599 errata, UDP frames with a 0 checksum can be marked as | |
542 | + * checksum errors. | |
543 | + */ | |
544 | + if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) && | |
545 | + (adapter->hw.mac.type == ixgbe_mac_82599EB)) | |
546 | + return; | |
547 | + | |
535 | 548 | adapter->hw_csum_rx_error++; |
536 | 549 | return; |
537 | 550 | } |
... | ... | @@ -769,7 +782,7 @@ |
769 | 782 | prefetch(next_rxd); |
770 | 783 | cleaned_count++; |
771 | 784 | |
772 | - if (adapter->flags & IXGBE_FLAG2_RSC_CAPABLE) | |
785 | + if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) | |
773 | 786 | rsc_count = ixgbe_get_rsc_count(rx_desc); |
774 | 787 | |
775 | 788 | if (rsc_count) { |
... | ... | @@ -805,7 +818,7 @@ |
805 | 818 | goto next_desc; |
806 | 819 | } |
807 | 820 | |
808 | - ixgbe_rx_checksum(adapter, staterr, skb); | |
821 | + ixgbe_rx_checksum(adapter, rx_desc, skb); | |
809 | 822 | |
810 | 823 | /* probably a little skewed due to removing CRC */ |
811 | 824 | total_rx_bytes += skb->len; |
... | ... | @@ -2025,7 +2038,7 @@ |
2025 | 2038 | IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); |
2026 | 2039 | } |
2027 | 2040 | } else { |
2028 | - if (!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED) && | |
2041 | + if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) && | |
2029 | 2042 | (netdev->mtu <= ETH_DATA_LEN)) |
2030 | 2043 | rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; |
2031 | 2044 | else |
... | ... | @@ -2154,7 +2167,7 @@ |
2154 | 2167 | IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); |
2155 | 2168 | } |
2156 | 2169 | |
2157 | - if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) { | |
2170 | + if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | |
2158 | 2171 | /* Enable 82599 HW-RSC */ |
2159 | 2172 | for (i = 0; i < adapter->num_rx_queues; i++) { |
2160 | 2173 | j = adapter->rx_ring[i].reg_idx; |
... | ... | @@ -3801,8 +3814,8 @@ |
3801 | 3814 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; |
3802 | 3815 | } else if (hw->mac.type == ixgbe_mac_82599EB) { |
3803 | 3816 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; |
3804 | - adapter->flags |= IXGBE_FLAG2_RSC_CAPABLE; | |
3805 | - adapter->flags |= IXGBE_FLAG2_RSC_ENABLED; | |
3817 | + adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE; | |
3818 | + adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; | |
3806 | 3819 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; |
3807 | 3820 | adapter->ring_feature[RING_F_FDIR].indices = |
3808 | 3821 | IXGBE_MAX_FDIR_INDICES; |
3809 | 3822 | |
3810 | 3823 | |
3811 | 3824 | |
... | ... | @@ -5349,12 +5362,19 @@ |
5349 | 5362 | static void ixgbe_netpoll(struct net_device *netdev) |
5350 | 5363 | { |
5351 | 5364 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5365 | + int i; | |
5352 | 5366 | |
5353 | - disable_irq(adapter->pdev->irq); | |
5354 | 5367 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
5355 | - ixgbe_intr(adapter->pdev->irq, netdev); | |
5368 | + if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | |
5369 | + int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | |
5370 | + for (i = 0; i < num_q_vectors; i++) { | |
5371 | + struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; | |
5372 | + ixgbe_msix_clean_many(0, q_vector); | |
5373 | + } | |
5374 | + } else { | |
5375 | + ixgbe_intr(adapter->pdev->irq, netdev); | |
5376 | + } | |
5356 | 5377 | adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; |
5357 | - enable_irq(adapter->pdev->irq); | |
5358 | 5378 | } |
5359 | 5379 | #endif |
5360 | 5380 | |
... | ... | @@ -5600,7 +5620,7 @@ |
5600 | 5620 | if (pci_using_dac) |
5601 | 5621 | netdev->features |= NETIF_F_HIGHDMA; |
5602 | 5622 | |
5603 | - if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) | |
5623 | + if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) | |
5604 | 5624 | netdev->features |= NETIF_F_LRO; |
5605 | 5625 | |
5606 | 5626 | /* make sure the EEPROM is good */ |
drivers/net/netxen/netxen_nic_init.c
... | ... | @@ -184,6 +184,13 @@ |
184 | 184 | kfree(recv_ctx->rds_rings); |
185 | 185 | |
186 | 186 | skip_rds: |
187 | + if (recv_ctx->sds_rings == NULL) | |
188 | + goto skip_sds; | |
189 | + | |
190 | + for(ring = 0; ring < adapter->max_sds_rings; ring++) | |
191 | + recv_ctx->sds_rings[ring].consumer = 0; | |
192 | + | |
193 | +skip_sds: | |
187 | 194 | if (adapter->tx_ring == NULL) |
188 | 195 | return; |
189 | 196 |
drivers/net/pppoe.c
drivers/net/r8169.c
... | ... | @@ -2060,8 +2060,6 @@ |
2060 | 2060 | } |
2061 | 2061 | } |
2062 | 2062 | |
2063 | - pci_set_master(pdev); | |
2064 | - | |
2065 | 2063 | /* ioremap MMIO region */ |
2066 | 2064 | ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); |
2067 | 2065 | if (!ioaddr) { |
... | ... | @@ -2089,6 +2087,8 @@ |
2089 | 2087 | |
2090 | 2088 | RTL_W16(IntrStatus, 0xffff); |
2091 | 2089 | |
2090 | + pci_set_master(pdev); | |
2091 | + | |
2092 | 2092 | /* Identify chip attached to board */ |
2093 | 2093 | rtl8169_get_mac_version(tp, ioaddr); |
2094 | 2094 | |
... | ... | @@ -3874,6 +3874,15 @@ |
3874 | 3874 | spin_unlock_irq(&tp->lock); |
3875 | 3875 | |
3876 | 3876 | if (system_state == SYSTEM_POWER_OFF) { |
3877 | + /* WoL fails with some 8168 when the receiver is disabled. */ | |
3878 | + if (tp->features & RTL_FEATURE_WOL) { | |
3879 | + pci_clear_master(pdev); | |
3880 | + | |
3881 | + RTL_W8(ChipCmd, CmdRxEnb); | |
3882 | + /* PCI commit */ | |
3883 | + RTL_R8(ChipCmd); | |
3884 | + } | |
3885 | + | |
3877 | 3886 | pci_wake_from_d3(pdev, true); |
3878 | 3887 | pci_set_power_state(pdev, PCI_D3hot); |
3879 | 3888 | } |
drivers/net/smc91x.h
... | ... | @@ -186,7 +186,8 @@ |
186 | 186 | #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) |
187 | 187 | #define SMC_IRQ_FLAGS (-1) /* from resource */ |
188 | 188 | |
189 | -#elif defined(CONFIG_MACH_LOGICPD_PXA270) | |
189 | +#elif defined(CONFIG_MACH_LOGICPD_PXA270) \ | |
190 | + || defined(CONFIG_MACH_NOMADIK_8815NHK) | |
190 | 191 | |
191 | 192 | #define SMC_CAN_USE_8BIT 0 |
192 | 193 | #define SMC_CAN_USE_16BIT 1 |
drivers/net/tokenring/ibmtr.c
drivers/net/wireless/airo.c
... | ... | @@ -5918,20 +5918,19 @@ |
5918 | 5918 | readSsidRid(local, &SSID_rid); |
5919 | 5919 | |
5920 | 5920 | /* Check if we asked for `any' */ |
5921 | - if(dwrq->flags == 0) { | |
5921 | + if (dwrq->flags == 0) { | |
5922 | 5922 | /* Just send an empty SSID list */ |
5923 | 5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); |
5924 | 5924 | } else { |
5925 | - int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | |
5925 | + unsigned index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | |
5926 | 5926 | |
5927 | 5927 | /* Check the size of the string */ |
5928 | - if(dwrq->length > IW_ESSID_MAX_SIZE) { | |
5928 | + if (dwrq->length > IW_ESSID_MAX_SIZE) | |
5929 | 5929 | return -E2BIG ; |
5930 | - } | |
5930 | + | |
5931 | 5931 | /* Check if index is valid */ |
5932 | - if((index < 0) || (index >= 4)) { | |
5932 | + if (index >= ARRAY_SIZE(SSID_rid.ssids)) | |
5933 | 5933 | return -EINVAL; |
5934 | - } | |
5935 | 5934 | |
5936 | 5935 | /* Set the SSID */ |
5937 | 5936 | memset(SSID_rid.ssids[index].ssid, 0, |
... | ... | @@ -6819,7 +6818,7 @@ |
6819 | 6818 | return -EINVAL; |
6820 | 6819 | } |
6821 | 6820 | clear_bit (FLAG_RADIO_OFF, &local->flags); |
6822 | - for (i = 0; cap_rid.txPowerLevels[i] && (i < 8); i++) | |
6821 | + for (i = 0; i < 8 && cap_rid.txPowerLevels[i]; i++) | |
6823 | 6822 | if (v == cap_rid.txPowerLevels[i]) { |
6824 | 6823 | readConfigRid(local, 1); |
6825 | 6824 | local->config.txPower = v; |
drivers/net/wireless/ath/ath9k/eeprom.c
... | ... | @@ -460,7 +460,7 @@ |
460 | 460 | integer = swab32(eep->modalHeader.antCtrlCommon); |
461 | 461 | eep->modalHeader.antCtrlCommon = integer; |
462 | 462 | |
463 | - for (i = 0; i < AR5416_MAX_CHAINS; i++) { | |
463 | + for (i = 0; i < AR5416_EEP4K_MAX_CHAINS; i++) { | |
464 | 464 | integer = swab32(eep->modalHeader.antCtrlChain[i]); |
465 | 465 | eep->modalHeader.antCtrlChain[i] = integer; |
466 | 466 | } |
... | ... | @@ -914,7 +914,7 @@ |
914 | 914 | ctlMode, numCtlModes, isHt40CtlMode, |
915 | 915 | (pCtlMode[ctlMode] & EXT_ADDITIVE)); |
916 | 916 | |
917 | - for (i = 0; (i < AR5416_NUM_CTLS) && | |
917 | + for (i = 0; (i < AR5416_EEP4K_NUM_CTLS) && | |
918 | 918 | pEepData->ctlIndex[i]; i++) { |
919 | 919 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, |
920 | 920 | " LOOP-Ctlidx %d: cfgCtl 0x%2.2x " |
drivers/net/wireless/iwlwifi/iwl-tx.c
... | ... | @@ -724,8 +724,6 @@ |
724 | 724 | goto drop_unlock; |
725 | 725 | } |
726 | 726 | |
727 | - spin_unlock_irqrestore(&priv->lock, flags); | |
728 | - | |
729 | 727 | hdr_len = ieee80211_hdrlen(fc); |
730 | 728 | |
731 | 729 | /* Find (or create) index into station table for destination station */ |
... | ... | @@ -733,7 +731,7 @@ |
733 | 731 | if (sta_id == IWL_INVALID_STATION) { |
734 | 732 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", |
735 | 733 | hdr->addr1); |
736 | - goto drop; | |
734 | + goto drop_unlock; | |
737 | 735 | } |
738 | 736 | |
739 | 737 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); |
740 | 738 | |
741 | 739 | |
... | ... | @@ -751,15 +749,18 @@ |
751 | 749 | /* aggregation is on for this <sta,tid> */ |
752 | 750 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
753 | 751 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; |
754 | - priv->stations[sta_id].tid[tid].tfds_in_queue++; | |
755 | 752 | } |
756 | 753 | |
757 | 754 | txq = &priv->txq[txq_id]; |
758 | 755 | swq_id = txq->swq_id; |
759 | 756 | q = &txq->q; |
760 | 757 | |
761 | - spin_lock_irqsave(&priv->lock, flags); | |
758 | + if (unlikely(iwl_queue_space(q) < q->high_mark)) | |
759 | + goto drop_unlock; | |
762 | 760 | |
761 | + if (ieee80211_is_data_qos(fc)) | |
762 | + priv->stations[sta_id].tid[tid].tfds_in_queue++; | |
763 | + | |
763 | 764 | /* Set up driver data for this TFD */ |
764 | 765 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); |
765 | 766 | txq->txb[q->write_ptr].skb[0] = skb; |
... | ... | @@ -903,7 +904,6 @@ |
903 | 904 | |
904 | 905 | drop_unlock: |
905 | 906 | spin_unlock_irqrestore(&priv->lock, flags); |
906 | -drop: | |
907 | 907 | return -1; |
908 | 908 | } |
909 | 909 | EXPORT_SYMBOL(iwl_tx_skb); |
... | ... | @@ -1172,6 +1172,8 @@ |
1172 | 1172 | IWL_ERR(priv, "Start AGG on invalid station\n"); |
1173 | 1173 | return -ENXIO; |
1174 | 1174 | } |
1175 | + if (unlikely(tid >= MAX_TID_COUNT)) | |
1176 | + return -EINVAL; | |
1175 | 1177 | |
1176 | 1178 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { |
1177 | 1179 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); |
drivers/net/wireless/iwmc3200wifi/netdev.c
... | ... | @@ -99,10 +99,8 @@ |
99 | 99 | int ret = 0; |
100 | 100 | |
101 | 101 | wdev = iwm_wdev_alloc(sizeof_bus, dev); |
102 | - if (!wdev) { | |
103 | - dev_err(dev, "no memory for wireless device instance\n"); | |
104 | - return ERR_PTR(-ENOMEM); | |
105 | - } | |
102 | + if (IS_ERR(wdev)) | |
103 | + return wdev; | |
106 | 104 | |
107 | 105 | iwm = wdev_to_iwm(wdev); |
108 | 106 | iwm->bus_ops = if_ops; |
drivers/net/wireless/libertas/assoc.c
1 | 1 | /* Copyright (C) 2006, Red Hat, Inc. */ |
2 | 2 | |
3 | 3 | #include <linux/types.h> |
4 | +#include <linux/kernel.h> | |
4 | 5 | #include <linux/etherdevice.h> |
5 | 6 | #include <linux/ieee80211.h> |
6 | 7 | #include <linux/if_arp.h> |
7 | 8 | |
8 | 9 | |
9 | 10 | |
... | ... | @@ -43,21 +44,21 @@ |
43 | 44 | u16 *rates_size) |
44 | 45 | { |
45 | 46 | u8 *card_rates = lbs_bg_rates; |
46 | - size_t num_card_rates = sizeof(lbs_bg_rates); | |
47 | 47 | int ret = 0, i, j; |
48 | - u8 tmp[30]; | |
48 | + u8 tmp[(ARRAY_SIZE(lbs_bg_rates) - 1) * (*rates_size - 1)]; | |
49 | 49 | size_t tmp_size = 0; |
50 | 50 | |
51 | 51 | /* For each rate in card_rates that exists in rate1, copy to tmp */ |
52 | - for (i = 0; card_rates[i] && (i < num_card_rates); i++) { | |
53 | - for (j = 0; rates[j] && (j < *rates_size); j++) { | |
52 | + for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) { | |
53 | + for (j = 0; j < *rates_size && rates[j]; j++) { | |
54 | 54 | if (rates[j] == card_rates[i]) |
55 | 55 | tmp[tmp_size++] = card_rates[i]; |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); |
60 | - lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates); | |
60 | + lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, | |
61 | + ARRAY_SIZE(lbs_bg_rates)); | |
61 | 62 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); |
62 | 63 | lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); |
63 | 64 | |
64 | 65 | |
... | ... | @@ -69,10 +70,7 @@ |
69 | 70 | lbs_pr_alert("Previously set fixed data rate %#x isn't " |
70 | 71 | "compatible with the network.\n", priv->cur_rate); |
71 | 72 | ret = -1; |
72 | - goto done; | |
73 | 73 | } |
74 | - ret = 0; | |
75 | - | |
76 | 74 | done: |
77 | 75 | memset(rates, 0, *rates_size); |
78 | 76 | *rates_size = min_t(int, tmp_size, *rates_size); |
... | ... | @@ -320,7 +318,7 @@ |
320 | 318 | rates = (struct mrvl_ie_rates_param_set *) pos; |
321 | 319 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); |
322 | 320 | memcpy(&rates->rates, &bss->rates, MAX_RATES); |
323 | - tmplen = MAX_RATES; | |
321 | + tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES); | |
324 | 322 | if (get_common_rates(priv, rates->rates, &tmplen)) { |
325 | 323 | ret = -1; |
326 | 324 | goto done; |
... | ... | @@ -594,7 +592,7 @@ |
594 | 592 | |
595 | 593 | /* Copy Data rates from the rates recorded in scan response */ |
596 | 594 | memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); |
597 | - ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES); | |
595 | + ratesize = min_t(u16, ARRAY_SIZE(cmd.bss.rates), MAX_RATES); | |
598 | 596 | memcpy(cmd.bss.rates, bss->rates, ratesize); |
599 | 597 | if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { |
600 | 598 | lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); |
drivers/net/wireless/libertas/scan.c
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | * for sending scan commands to the firmware. |
6 | 6 | */ |
7 | 7 | #include <linux/types.h> |
8 | +#include <linux/kernel.h> | |
8 | 9 | #include <linux/etherdevice.h> |
9 | 10 | #include <linux/if_arp.h> |
10 | 11 | #include <asm/unaligned.h> |
... | ... | @@ -876,7 +877,7 @@ |
876 | 877 | iwe.u.bitrate.disabled = 0; |
877 | 878 | iwe.u.bitrate.value = 0; |
878 | 879 | |
879 | - for (j = 0; bss->rates[j] && (j < sizeof(bss->rates)); j++) { | |
880 | + for (j = 0; j < ARRAY_SIZE(bss->rates) && bss->rates[j]; j++) { | |
880 | 881 | /* Bit rate given in 500 kb/s units */ |
881 | 882 | iwe.u.bitrate.value = bss->rates[j] * 500000; |
882 | 883 | current_val = iwe_stream_add_value(info, start, current_val, |
drivers/scsi/scsi_transport_iscsi.c
... | ... | @@ -990,7 +990,7 @@ |
990 | 990 | struct iscsi_uevent *ev; |
991 | 991 | int len = NLMSG_SPACE(sizeof(*ev) + data_size); |
992 | 992 | |
993 | - skb = alloc_skb(len, GFP_NOIO); | |
993 | + skb = alloc_skb(len, GFP_ATOMIC); | |
994 | 994 | if (!skb) { |
995 | 995 | printk(KERN_ERR "can not deliver iscsi offload message:OOM\n"); |
996 | 996 | return -ENOMEM; |
... | ... | @@ -1012,7 +1012,7 @@ |
1012 | 1012 | |
1013 | 1013 | memcpy((char *)ev + sizeof(*ev), data, data_size); |
1014 | 1014 | |
1015 | - return iscsi_multicast_skb(skb, ISCSI_NL_GRP_UIP, GFP_NOIO); | |
1015 | + return iscsi_multicast_skb(skb, ISCSI_NL_GRP_UIP, GFP_ATOMIC); | |
1016 | 1016 | } |
1017 | 1017 | EXPORT_SYMBOL_GPL(iscsi_offload_mesg); |
1018 | 1018 |
include/linux/inetdevice.h
... | ... | @@ -82,7 +82,7 @@ |
82 | 82 | |
83 | 83 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
84 | 84 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
85 | -#define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) | |
85 | +#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) | |
86 | 86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
87 | 87 | ACCEPT_SOURCE_ROUTE) |
88 | 88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) |
include/net/rose.h
... | ... | @@ -156,7 +156,7 @@ |
156 | 156 | extern int sysctl_rose_window_size; |
157 | 157 | extern int rosecmp(rose_address *, rose_address *); |
158 | 158 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); |
159 | -extern const char *rose2asc(const rose_address *); | |
159 | +extern char *rose2asc(char *buf, const rose_address *); | |
160 | 160 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); |
161 | 161 | extern void rose_kill_by_neigh(struct rose_neigh *); |
162 | 162 | extern unsigned int rose_new_lci(struct rose_neigh *); |
net/bridge/br_if.c
net/ipv4/arp.c
net/irda/irttp.c
net/mac80211/mlme.c
net/mac80211/pm.c
... | ... | @@ -55,15 +55,6 @@ |
55 | 55 | |
56 | 56 | rcu_read_unlock(); |
57 | 57 | |
58 | - /* flush again, in case driver queued work */ | |
59 | - flush_workqueue(local->hw.workqueue); | |
60 | - | |
61 | - /* stop hardware - this must stop RX */ | |
62 | - if (local->open_count) { | |
63 | - ieee80211_led_radio(local, false); | |
64 | - drv_stop(local); | |
65 | - } | |
66 | - | |
67 | 58 | /* remove STAs */ |
68 | 59 | spin_lock_irqsave(&local->sta_lock, flags); |
69 | 60 | list_for_each_entry(sta, &local->sta_list, list) { |
70 | 61 | |
... | ... | @@ -111,7 +102,22 @@ |
111 | 102 | drv_remove_interface(local, &conf); |
112 | 103 | } |
113 | 104 | |
105 | + /* stop hardware - this must stop RX */ | |
106 | + if (local->open_count) { | |
107 | + ieee80211_led_radio(local, false); | |
108 | + drv_stop(local); | |
109 | + } | |
110 | + | |
111 | + /* | |
112 | + * flush again, in case driver queued work -- it | |
113 | + * shouldn't be doing (or cancel everything in the | |
114 | + * stop callback) that but better safe than sorry. | |
115 | + */ | |
116 | + flush_workqueue(local->hw.workqueue); | |
117 | + | |
114 | 118 | local->suspended = true; |
119 | + /* need suspended to be visible before quiescing is false */ | |
120 | + barrier(); | |
115 | 121 | local->quiescing = false; |
116 | 122 | |
117 | 123 | return 0; |
net/mac80211/rx.c
... | ... | @@ -2439,6 +2439,18 @@ |
2439 | 2439 | return; |
2440 | 2440 | } |
2441 | 2441 | |
2442 | + /* | |
2443 | + * If we're suspending, it is possible although not too likely | |
2444 | + * that we'd be receiving frames after having already partially | |
2445 | + * quiesced the stack. We can't process such frames then since | |
2446 | + * that might, for example, cause stations to be added or other | |
2447 | + * driver callbacks be invoked. | |
2448 | + */ | |
2449 | + if (unlikely(local->quiescing || local->suspended)) { | |
2450 | + kfree_skb(skb); | |
2451 | + return; | |
2452 | + } | |
2453 | + | |
2442 | 2454 | if (status->flag & RX_FLAG_HT) { |
2443 | 2455 | /* rate_idx is MCS index */ |
2444 | 2456 | if (WARN_ON(status->rate_idx < 0 || |
net/netlabel/netlabel_kapi.c
... | ... | @@ -151,7 +151,7 @@ |
151 | 151 | addr6 = addr; |
152 | 152 | mask6 = mask; |
153 | 153 | map6 = kzalloc(sizeof(*map6), GFP_ATOMIC); |
154 | - if (map4 == NULL) | |
154 | + if (map6 == NULL) | |
155 | 155 | goto cfg_unlbl_map_add_failure; |
156 | 156 | map6->type = NETLBL_NLTYPE_UNLABELED; |
157 | 157 | ipv6_addr_copy(&map6->list.addr, addr6); |
net/rose/af_rose.c
... | ... | @@ -92,23 +92,21 @@ |
92 | 92 | /* |
93 | 93 | * Convert a ROSE address into text. |
94 | 94 | */ |
95 | -const char *rose2asc(const rose_address *addr) | |
95 | +char *rose2asc(char *buf, const rose_address *addr) | |
96 | 96 | { |
97 | - static char buffer[11]; | |
98 | - | |
99 | 97 | if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 && |
100 | 98 | addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 && |
101 | 99 | addr->rose_addr[4] == 0x00) { |
102 | - strcpy(buffer, "*"); | |
100 | + strcpy(buf, "*"); | |
103 | 101 | } else { |
104 | - sprintf(buffer, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, | |
102 | + sprintf(buf, "%02X%02X%02X%02X%02X", addr->rose_addr[0] & 0xFF, | |
105 | 103 | addr->rose_addr[1] & 0xFF, |
106 | 104 | addr->rose_addr[2] & 0xFF, |
107 | 105 | addr->rose_addr[3] & 0xFF, |
108 | 106 | addr->rose_addr[4] & 0xFF); |
109 | 107 | } |
110 | 108 | |
111 | - return buffer; | |
109 | + return buf; | |
112 | 110 | } |
113 | 111 | |
114 | 112 | /* |
... | ... | @@ -1437,7 +1435,7 @@ |
1437 | 1435 | |
1438 | 1436 | static int rose_info_show(struct seq_file *seq, void *v) |
1439 | 1437 | { |
1440 | - char buf[11]; | |
1438 | + char buf[11], rsbuf[11]; | |
1441 | 1439 | |
1442 | 1440 | if (v == SEQ_START_TOKEN) |
1443 | 1441 | seq_puts(seq, |
... | ... | @@ -1455,8 +1453,8 @@ |
1455 | 1453 | devname = dev->name; |
1456 | 1454 | |
1457 | 1455 | seq_printf(seq, "%-10s %-9s ", |
1458 | - rose2asc(&rose->dest_addr), | |
1459 | - ax2asc(buf, &rose->dest_call)); | |
1456 | + rose2asc(rsbuf, &rose->dest_addr), | |
1457 | + ax2asc(buf, &rose->dest_call)); | |
1460 | 1458 | |
1461 | 1459 | if (ax25cmp(&rose->source_call, &null_ax25_address) == 0) |
1462 | 1460 | callsign = "??????-?"; |
... | ... | @@ -1465,7 +1463,7 @@ |
1465 | 1463 | |
1466 | 1464 | seq_printf(seq, |
1467 | 1465 | "%-10s %-9s %-5s %3.3X %05d %d %d %d %d %3lu %3lu %3lu %3lu %3lu %3lu/%03lu %5d %5d %ld\n", |
1468 | - rose2asc(&rose->source_addr), | |
1466 | + rose2asc(rsbuf, &rose->source_addr), | |
1469 | 1467 | callsign, |
1470 | 1468 | devname, |
1471 | 1469 | rose->lci & 0x0FFF, |
net/rose/rose_route.c
... | ... | @@ -1104,6 +1104,7 @@ |
1104 | 1104 | |
1105 | 1105 | static int rose_node_show(struct seq_file *seq, void *v) |
1106 | 1106 | { |
1107 | + char rsbuf[11]; | |
1107 | 1108 | int i; |
1108 | 1109 | |
1109 | 1110 | if (v == SEQ_START_TOKEN) |
1110 | 1111 | |
... | ... | @@ -1112,13 +1113,13 @@ |
1112 | 1113 | const struct rose_node *rose_node = v; |
1113 | 1114 | /* if (rose_node->loopback) { |
1114 | 1115 | seq_printf(seq, "%-10s %04d 1 loopback\n", |
1115 | - rose2asc(&rose_node->address), | |
1116 | - rose_node->mask); | |
1116 | + rose2asc(rsbuf, &rose_node->address), | |
1117 | + rose_node->mask); | |
1117 | 1118 | } else { */ |
1118 | 1119 | seq_printf(seq, "%-10s %04d %d", |
1119 | - rose2asc(&rose_node->address), | |
1120 | - rose_node->mask, | |
1121 | - rose_node->count); | |
1120 | + rose2asc(rsbuf, &rose_node->address), | |
1121 | + rose_node->mask, | |
1122 | + rose_node->count); | |
1122 | 1123 | |
1123 | 1124 | for (i = 0; i < rose_node->count; i++) |
1124 | 1125 | seq_printf(seq, " %05d", |
... | ... | @@ -1267,7 +1268,7 @@ |
1267 | 1268 | |
1268 | 1269 | static int rose_route_show(struct seq_file *seq, void *v) |
1269 | 1270 | { |
1270 | - char buf[11]; | |
1271 | + char buf[11], rsbuf[11]; | |
1271 | 1272 | |
1272 | 1273 | if (v == SEQ_START_TOKEN) |
1273 | 1274 | seq_puts(seq, |
... | ... | @@ -1279,7 +1280,7 @@ |
1279 | 1280 | seq_printf(seq, |
1280 | 1281 | "%3.3X %-10s %-9s %05d ", |
1281 | 1282 | rose_route->lci1, |
1282 | - rose2asc(&rose_route->src_addr), | |
1283 | + rose2asc(rsbuf, &rose_route->src_addr), | |
1283 | 1284 | ax2asc(buf, &rose_route->src_call), |
1284 | 1285 | rose_route->neigh1->number); |
1285 | 1286 | else |
... | ... | @@ -1289,10 +1290,10 @@ |
1289 | 1290 | if (rose_route->neigh2) |
1290 | 1291 | seq_printf(seq, |
1291 | 1292 | "%3.3X %-10s %-9s %05d\n", |
1292 | - rose_route->lci2, | |
1293 | - rose2asc(&rose_route->dest_addr), | |
1294 | - ax2asc(buf, &rose_route->dest_call), | |
1295 | - rose_route->neigh2->number); | |
1293 | + rose_route->lci2, | |
1294 | + rose2asc(rsbuf, &rose_route->dest_addr), | |
1295 | + ax2asc(buf, &rose_route->dest_call), | |
1296 | + rose_route->neigh2->number); | |
1296 | 1297 | else |
1297 | 1298 | seq_puts(seq, |
1298 | 1299 | "000 * * 00000\n"); |