diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/3c515.c | 4 | ||||
-rw-r--r-- | drivers/net/at1700.c | 2 | ||||
-rw-r--r-- | drivers/net/cnic.c | 23 | ||||
-rw-r--r-- | drivers/net/eepro.c | 2 | ||||
-rw-r--r-- | drivers/net/eexpress.c | 6 | ||||
-rw-r--r-- | drivers/net/fealnx.c | 3 | ||||
-rw-r--r-- | drivers/net/gianfar_ethtool.c | 10 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 11 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 42 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 7 | ||||
-rw-r--r-- | drivers/net/pppoe.c | 1 | ||||
-rw-r--r-- | drivers/net/r8169.c | 13 | ||||
-rw-r--r-- | drivers/net/smc91x.h | 3 | ||||
-rw-r--r-- | drivers/net/tokenring/ibmtr.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/airo.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/netdev.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/scan.c | 3 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 4 |
22 files changed, 127 insertions, 66 deletions
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c index 85ffd132bada..3116410b3499 100644 --- a/drivers/net/3c515.c +++ b/drivers/net/3c515.c | |||
@@ -832,7 +832,9 @@ static int corkscrew_open(struct net_device *dev) | |||
832 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 832 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
833 | vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); | 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 | outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); | 838 | outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); |
837 | } | 839 | } |
838 | if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ | 840 | if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ |
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c index c2227d79673a..5349c58d1fae 100644 --- a/drivers/net/at1700.c +++ b/drivers/net/at1700.c | |||
@@ -318,7 +318,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr) | |||
318 | pos3 = mca_read_stored_pos( slot, 3 ); | 318 | pos3 = mca_read_stored_pos( slot, 3 ); |
319 | pos4 = mca_read_stored_pos( slot, 4 ); | 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 | if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) | 322 | if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i]) |
323 | break; | 323 | break; |
324 | ioaddr = at1700_mca_probe_list[l_i]; | 324 | ioaddr = at1700_mca_probe_list[l_i]; |
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 4d1515f45ba2..4869d77cbe91 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -227,7 +227,7 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type, | |||
227 | } | 227 | } |
228 | 228 | ||
229 | rcu_read_lock(); | 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 | if (ulp_ops) | 231 | if (ulp_ops) |
232 | ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); | 232 | ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len); |
233 | rcu_read_unlock(); | 233 | rcu_read_unlock(); |
@@ -319,6 +319,20 @@ static int cnic_abort_prep(struct cnic_sock *csk) | |||
319 | return 0; | 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 | int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) | 336 | int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) |
323 | { | 337 | { |
324 | struct cnic_dev *dev; | 338 | struct cnic_dev *dev; |
@@ -390,6 +404,9 @@ int cnic_unregister_driver(int ulp_type) | |||
390 | } | 404 | } |
391 | read_unlock(&cnic_dev_lock); | 405 | read_unlock(&cnic_dev_lock); |
392 | 406 | ||
407 | if (ulp_type == CNIC_ULP_ISCSI) | ||
408 | cnic_uio_stop(); | ||
409 | |||
393 | rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); | 410 | rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL); |
394 | 411 | ||
395 | mutex_unlock(&cnic_lock); | 412 | mutex_unlock(&cnic_lock); |
@@ -632,7 +649,6 @@ static void cnic_free_resc(struct cnic_dev *dev) | |||
632 | int i = 0; | 649 | int i = 0; |
633 | 650 | ||
634 | if (cp->cnic_uinfo) { | 651 | if (cp->cnic_uinfo) { |
635 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | ||
636 | while (cp->uio_dev != -1 && i < 15) { | 652 | while (cp->uio_dev != -1 && i < 15) { |
637 | msleep(100); | 653 | msleep(100); |
638 | i++; | 654 | i++; |
@@ -1057,6 +1073,9 @@ static void cnic_ulp_stop(struct cnic_dev *dev) | |||
1057 | struct cnic_local *cp = dev->cnic_priv; | 1073 | struct cnic_local *cp = dev->cnic_priv; |
1058 | int if_type; | 1074 | int if_type; |
1059 | 1075 | ||
1076 | if (cp->cnic_uinfo) | ||
1077 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | ||
1078 | |||
1060 | rcu_read_lock(); | 1079 | rcu_read_lock(); |
1061 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { | 1080 | for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) { |
1062 | struct cnic_ulp_ops *ulp_ops; | 1081 | struct cnic_ulp_ops *ulp_ops; |
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index 71605d63708c..53317a83857a 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c | |||
@@ -1784,7 +1784,7 @@ int __init init_module(void) | |||
1784 | printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); | 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 | dev = alloc_etherdev(sizeof(struct eepro_local)); | 1788 | dev = alloc_etherdev(sizeof(struct eepro_local)); |
1789 | if (!dev) | 1789 | if (!dev) |
1790 | break; | 1790 | break; |
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index 8c44ef4ba357..d1b6368faacd 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c | |||
@@ -1474,13 +1474,13 @@ static void eexp_hw_init586(struct net_device *dev) | |||
1474 | outw(0x0000, ioaddr + 0x800c); | 1474 | outw(0x0000, ioaddr + 0x800c); |
1475 | outw(0x0000, ioaddr + 0x800e); | 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 | int j; | 1478 | int j; |
1479 | outw(i, ioaddr + SM_PTR); | 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 | outw(start_code[(i+j)/2], | 1481 | outw(start_code[(i+j)/2], |
1482 | ioaddr+0x4000+j); | 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 | outw(start_code[(i+j+16)/2], | 1484 | outw(start_code[(i+j+16)/2], |
1485 | ioaddr+0x8000+j); | 1485 | ioaddr+0x8000+j); |
1486 | } | 1486 | } |
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index 75e5fe5153d9..b2d617206bd9 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
@@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev, | |||
584 | if (np->flags == HAS_MII_XCVR) { | 584 | if (np->flags == HAS_MII_XCVR) { |
585 | int phy, phy_idx = 0; | 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 | int mii_status = mdio_read(dev, phy, 1); | 589 | int mii_status = mdio_read(dev, phy, 1); |
589 | 590 | ||
590 | if (mii_status != 0xffff && mii_status != 0x0000) { | 591 | if (mii_status != 0xffff && mii_status != 0x0000) { |
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index dbf06e9313cc..2234118eedbb 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -366,9 +366,8 @@ static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals | |||
366 | return -EINVAL; | 366 | return -EINVAL; |
367 | } | 367 | } |
368 | 368 | ||
369 | priv->rxic = mk_ic_value( | 369 | priv->rxic = mk_ic_value(cvals->rx_max_coalesced_frames, |
370 | gfar_usecs2ticks(priv, cvals->rx_coalesce_usecs), | 370 | gfar_usecs2ticks(priv, cvals->rx_coalesce_usecs)); |
371 | cvals->rx_max_coalesced_frames); | ||
372 | 371 | ||
373 | /* Set up tx coalescing */ | 372 | /* Set up tx coalescing */ |
374 | if ((cvals->tx_coalesce_usecs == 0) || | 373 | if ((cvals->tx_coalesce_usecs == 0) || |
@@ -390,9 +389,8 @@ static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals | |||
390 | return -EINVAL; | 389 | return -EINVAL; |
391 | } | 390 | } |
392 | 391 | ||
393 | priv->txic = mk_ic_value( | 392 | priv->txic = mk_ic_value(cvals->tx_max_coalesced_frames, |
394 | gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs), | 393 | gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs)); |
395 | cvals->tx_max_coalesced_frames); | ||
396 | 394 | ||
397 | gfar_write(&priv->regs->rxic, 0); | 395 | gfar_write(&priv->regs->rxic, 0); |
398 | if (priv->rxcoalescing) | 396 | if (priv->rxcoalescing) |
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index dc3cc4348d1d..62b6c028ae81 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -96,6 +96,8 @@ | |||
96 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 | 96 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 |
97 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 | 97 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 |
98 | 98 | ||
99 | #define IXGBE_MAX_RSC_INT_RATE 162760 | ||
100 | |||
99 | /* wrapper around a pointer to a socket buffer, | 101 | /* wrapper around a pointer to a socket buffer, |
100 | * so a DMA handle can be stored along with the buffer */ | 102 | * so a DMA handle can be stored along with the buffer */ |
101 | struct ixgbe_tx_buffer { | 103 | struct ixgbe_tx_buffer { |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 1464b33f1b8e..c6db9a04187d 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1980,7 +1980,10 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
1980 | * any other value means disable eitr, which is best | 1980 | * any other value means disable eitr, which is best |
1981 | * served by setting the interrupt rate very high | 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 | adapter->itr_setting = 0; | 1987 | adapter->itr_setting = 0; |
1985 | } | 1988 | } |
1986 | 1989 | ||
@@ -2004,13 +2007,13 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
2004 | 2007 | ||
2005 | ethtool_op_set_flags(netdev, data); | 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 | return 0; | 2011 | return 0; |
2009 | 2012 | ||
2010 | /* if state changes we need to update adapter->flags and reset */ | 2013 | /* if state changes we need to update adapter->flags and reset */ |
2011 | if ((!!(data & ETH_FLAG_LRO)) != | 2014 | if ((!!(data & ETH_FLAG_LRO)) != |
2012 | (!!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED))) { | 2015 | (!!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) { |
2013 | adapter->flags ^= IXGBE_FLAG2_RSC_ENABLED; | 2016 | adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED; |
2014 | if (netif_running(netdev)) | 2017 | if (netif_running(netdev)) |
2015 | ixgbe_reinit_locked(adapter); | 2018 | ixgbe_reinit_locked(adapter); |
2016 | else | 2019 | else |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 50709da922c7..44adc9862826 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -513,8 +513,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector, | |||
513 | * @skb: skb currently being received and modified | 513 | * @skb: skb currently being received and modified |
514 | **/ | 514 | **/ |
515 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, | 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 | skb->ip_summed = CHECKSUM_NONE; | 521 | skb->ip_summed = CHECKSUM_NONE; |
519 | 522 | ||
520 | /* Rx csum disabled */ | 523 | /* Rx csum disabled */ |
@@ -532,6 +535,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, | |||
532 | return; | 535 | return; |
533 | 536 | ||
534 | if (status_err & IXGBE_RXDADV_ERR_TCPE) { | 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 | adapter->hw_csum_rx_error++; | 548 | adapter->hw_csum_rx_error++; |
536 | return; | 549 | return; |
537 | } | 550 | } |
@@ -769,7 +782,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
769 | prefetch(next_rxd); | 782 | prefetch(next_rxd); |
770 | cleaned_count++; | 783 | cleaned_count++; |
771 | 784 | ||
772 | if (adapter->flags & IXGBE_FLAG2_RSC_CAPABLE) | 785 | if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) |
773 | rsc_count = ixgbe_get_rsc_count(rx_desc); | 786 | rsc_count = ixgbe_get_rsc_count(rx_desc); |
774 | 787 | ||
775 | if (rsc_count) { | 788 | if (rsc_count) { |
@@ -805,7 +818,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
805 | goto next_desc; | 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 | /* probably a little skewed due to removing CRC */ | 823 | /* probably a little skewed due to removing CRC */ |
811 | total_rx_bytes += skb->len; | 824 | total_rx_bytes += skb->len; |
@@ -2025,7 +2038,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
2025 | IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); | 2038 | IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); |
2026 | } | 2039 | } |
2027 | } else { | 2040 | } else { |
2028 | if (!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED) && | 2041 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) && |
2029 | (netdev->mtu <= ETH_DATA_LEN)) | 2042 | (netdev->mtu <= ETH_DATA_LEN)) |
2030 | rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; | 2043 | rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; |
2031 | else | 2044 | else |
@@ -2154,7 +2167,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
2154 | IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); | 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 | /* Enable 82599 HW-RSC */ | 2171 | /* Enable 82599 HW-RSC */ |
2159 | for (i = 0; i < adapter->num_rx_queues; i++) { | 2172 | for (i = 0; i < adapter->num_rx_queues; i++) { |
2160 | j = adapter->rx_ring[i].reg_idx; | 2173 | j = adapter->rx_ring[i].reg_idx; |
@@ -3801,8 +3814,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
3801 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; | 3814 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; |
3802 | } else if (hw->mac.type == ixgbe_mac_82599EB) { | 3815 | } else if (hw->mac.type == ixgbe_mac_82599EB) { |
3803 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; | 3816 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; |
3804 | adapter->flags |= IXGBE_FLAG2_RSC_CAPABLE; | 3817 | adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE; |
3805 | adapter->flags |= IXGBE_FLAG2_RSC_ENABLED; | 3818 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; |
3806 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | 3819 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; |
3807 | adapter->ring_feature[RING_F_FDIR].indices = | 3820 | adapter->ring_feature[RING_F_FDIR].indices = |
3808 | IXGBE_MAX_FDIR_INDICES; | 3821 | IXGBE_MAX_FDIR_INDICES; |
@@ -5349,12 +5362,19 @@ static int ixgbe_del_sanmac_netdev(struct net_device *dev) | |||
5349 | static void ixgbe_netpoll(struct net_device *netdev) | 5362 | static void ixgbe_netpoll(struct net_device *netdev) |
5350 | { | 5363 | { |
5351 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5364 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5365 | int i; | ||
5352 | 5366 | ||
5353 | disable_irq(adapter->pdev->irq); | ||
5354 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 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 | adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; | 5377 | adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; |
5357 | enable_irq(adapter->pdev->irq); | ||
5358 | } | 5378 | } |
5359 | #endif | 5379 | #endif |
5360 | 5380 | ||
@@ -5600,7 +5620,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5600 | if (pci_using_dac) | 5620 | if (pci_using_dac) |
5601 | netdev->features |= NETIF_F_HIGHDMA; | 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 | netdev->features |= NETIF_F_LRO; | 5624 | netdev->features |= NETIF_F_LRO; |
5605 | 5625 | ||
5606 | /* make sure the EEPROM is good */ | 5626 | /* make sure the EEPROM is good */ |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index a6b244a9f4a1..81253abbfa34 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -184,6 +184,13 @@ void netxen_free_sw_resources(struct netxen_adapter *adapter) | |||
184 | kfree(recv_ctx->rds_rings); | 184 | kfree(recv_ctx->rds_rings); |
185 | 185 | ||
186 | skip_rds: | 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 | if (adapter->tx_ring == NULL) | 194 | if (adapter->tx_ring == NULL) |
188 | return; | 195 | return; |
189 | 196 | ||
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index f0031f1f97e5..5f2090233d7b 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -1063,6 +1063,7 @@ static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1063 | else { | 1063 | else { |
1064 | int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote); | 1064 | int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote); |
1065 | 1065 | ||
1066 | po = NULL; | ||
1066 | while (++hash < PPPOE_HASH_SIZE) { | 1067 | while (++hash < PPPOE_HASH_SIZE) { |
1067 | po = pn->hash_table[hash]; | 1068 | po = pn->hash_table[hash]; |
1068 | if (po) | 1069 | if (po) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 4b53b58d75fc..b82780d805f5 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2060,8 +2060,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2060 | } | 2060 | } |
2061 | } | 2061 | } |
2062 | 2062 | ||
2063 | pci_set_master(pdev); | ||
2064 | |||
2065 | /* ioremap MMIO region */ | 2063 | /* ioremap MMIO region */ |
2066 | ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); | 2064 | ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE); |
2067 | if (!ioaddr) { | 2065 | if (!ioaddr) { |
@@ -2089,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2089 | 2087 | ||
2090 | RTL_W16(IntrStatus, 0xffff); | 2088 | RTL_W16(IntrStatus, 0xffff); |
2091 | 2089 | ||
2090 | pci_set_master(pdev); | ||
2091 | |||
2092 | /* Identify chip attached to board */ | 2092 | /* Identify chip attached to board */ |
2093 | rtl8169_get_mac_version(tp, ioaddr); | 2093 | rtl8169_get_mac_version(tp, ioaddr); |
2094 | 2094 | ||
@@ -3874,6 +3874,15 @@ static void rtl_shutdown(struct pci_dev *pdev) | |||
3874 | spin_unlock_irq(&tp->lock); | 3874 | spin_unlock_irq(&tp->lock); |
3875 | 3875 | ||
3876 | if (system_state == SYSTEM_POWER_OFF) { | 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 | pci_wake_from_d3(pdev, true); | 3886 | pci_wake_from_d3(pdev, true); |
3878 | pci_set_power_state(pdev, PCI_D3hot); | 3887 | pci_set_power_state(pdev, PCI_D3hot); |
3879 | } | 3888 | } |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index f1f773b17fe1..57a159fac99f 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -186,7 +186,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
186 | #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) | 186 | #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) |
187 | #define SMC_IRQ_FLAGS (-1) /* from resource */ | 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 | #define SMC_CAN_USE_8BIT 0 | 192 | #define SMC_CAN_USE_8BIT 0 |
192 | #define SMC_CAN_USE_16BIT 1 | 193 | #define SMC_CAN_USE_16BIT 1 |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 6472ba5cfc5e..96d00c8f8d3e 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -1912,7 +1912,7 @@ static int __init ibmtr_init(void) | |||
1912 | 1912 | ||
1913 | find_turbo_adapters(io); | 1913 | find_turbo_adapters(io); |
1914 | 1914 | ||
1915 | for (i = 0; io[i] && (i < IBMTR_MAX_ADAPTERS); i++) { | 1915 | for (i = 0; i < IBMTR_MAX_ADAPTERS && io[i]; i++) { |
1916 | struct net_device *dev; | 1916 | struct net_device *dev; |
1917 | irq[i] = 0; | 1917 | irq[i] = 0; |
1918 | mem[i] = 0; | 1918 | mem[i] = 0; |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 49f3139a3fe7..c150c4858576 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -5918,20 +5918,19 @@ static int airo_set_essid(struct net_device *dev, | |||
5918 | readSsidRid(local, &SSID_rid); | 5918 | readSsidRid(local, &SSID_rid); |
5919 | 5919 | ||
5920 | /* Check if we asked for `any' */ | 5920 | /* Check if we asked for `any' */ |
5921 | if(dwrq->flags == 0) { | 5921 | if (dwrq->flags == 0) { |
5922 | /* Just send an empty SSID list */ | 5922 | /* Just send an empty SSID list */ |
5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); | 5923 | memset(&SSID_rid, 0, sizeof(SSID_rid)); |
5924 | } else { | 5924 | } else { |
5925 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | 5925 | unsigned index = (dwrq->flags & IW_ENCODE_INDEX) - 1; |
5926 | 5926 | ||
5927 | /* Check the size of the string */ | 5927 | /* Check the size of the string */ |
5928 | if(dwrq->length > IW_ESSID_MAX_SIZE) { | 5928 | if (dwrq->length > IW_ESSID_MAX_SIZE) |
5929 | return -E2BIG ; | 5929 | return -E2BIG ; |
5930 | } | 5930 | |
5931 | /* Check if index is valid */ | 5931 | /* Check if index is valid */ |
5932 | if((index < 0) || (index >= 4)) { | 5932 | if (index >= ARRAY_SIZE(SSID_rid.ssids)) |
5933 | return -EINVAL; | 5933 | return -EINVAL; |
5934 | } | ||
5935 | 5934 | ||
5936 | /* Set the SSID */ | 5935 | /* Set the SSID */ |
5937 | memset(SSID_rid.ssids[index].ssid, 0, | 5936 | memset(SSID_rid.ssids[index].ssid, 0, |
@@ -6819,7 +6818,7 @@ static int airo_set_txpow(struct net_device *dev, | |||
6819 | return -EINVAL; | 6818 | return -EINVAL; |
6820 | } | 6819 | } |
6821 | clear_bit (FLAG_RADIO_OFF, &local->flags); | 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 | if (v == cap_rid.txPowerLevels[i]) { | 6822 | if (v == cap_rid.txPowerLevels[i]) { |
6824 | readConfigRid(local, 1); | 6823 | readConfigRid(local, 1); |
6825 | local->config.txPower = v; | 6824 | local->config.txPower = v; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index df41ed5fd7c4..93e8ce0598a4 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
@@ -460,7 +460,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah) | |||
460 | integer = swab32(eep->modalHeader.antCtrlCommon); | 460 | integer = swab32(eep->modalHeader.antCtrlCommon); |
461 | eep->modalHeader.antCtrlCommon = integer; | 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 | integer = swab32(eep->modalHeader.antCtrlChain[i]); | 464 | integer = swab32(eep->modalHeader.antCtrlChain[i]); |
465 | eep->modalHeader.antCtrlChain[i] = integer; | 465 | eep->modalHeader.antCtrlChain[i] = integer; |
466 | } | 466 | } |
@@ -914,7 +914,7 @@ static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah, | |||
914 | ctlMode, numCtlModes, isHt40CtlMode, | 914 | ctlMode, numCtlModes, isHt40CtlMode, |
915 | (pCtlMode[ctlMode] & EXT_ADDITIVE)); | 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 | pEepData->ctlIndex[i]; i++) { | 918 | pEepData->ctlIndex[i]; i++) { |
919 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, | 919 | DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, |
920 | " LOOP-Ctlidx %d: cfgCtl 0x%2.2x " | 920 | " LOOP-Ctlidx %d: cfgCtl 0x%2.2x " |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 0912987af603..c7100b9dcede 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -724,8 +724,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
724 | goto drop_unlock; | 724 | goto drop_unlock; |
725 | } | 725 | } |
726 | 726 | ||
727 | spin_unlock_irqrestore(&priv->lock, flags); | ||
728 | |||
729 | hdr_len = ieee80211_hdrlen(fc); | 727 | hdr_len = ieee80211_hdrlen(fc); |
730 | 728 | ||
731 | /* Find (or create) index into station table for destination station */ | 729 | /* Find (or create) index into station table for destination station */ |
@@ -733,7 +731,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
733 | if (sta_id == IWL_INVALID_STATION) { | 731 | if (sta_id == IWL_INVALID_STATION) { |
734 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", | 732 | IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", |
735 | hdr->addr1); | 733 | hdr->addr1); |
736 | goto drop; | 734 | goto drop_unlock; |
737 | } | 735 | } |
738 | 736 | ||
739 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); | 737 | IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); |
@@ -751,14 +749,17 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
751 | /* aggregation is on for this <sta,tid> */ | 749 | /* aggregation is on for this <sta,tid> */ |
752 | if (info->flags & IEEE80211_TX_CTL_AMPDU) | 750 | if (info->flags & IEEE80211_TX_CTL_AMPDU) |
753 | txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; | 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 | txq = &priv->txq[txq_id]; | 754 | txq = &priv->txq[txq_id]; |
758 | swq_id = txq->swq_id; | 755 | swq_id = txq->swq_id; |
759 | q = &txq->q; | 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; | ||
760 | |||
761 | if (ieee80211_is_data_qos(fc)) | ||
762 | priv->stations[sta_id].tid[tid].tfds_in_queue++; | ||
762 | 763 | ||
763 | /* Set up driver data for this TFD */ | 764 | /* Set up driver data for this TFD */ |
764 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); | 765 | memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); |
@@ -903,7 +904,6 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) | |||
903 | 904 | ||
904 | drop_unlock: | 905 | drop_unlock: |
905 | spin_unlock_irqrestore(&priv->lock, flags); | 906 | spin_unlock_irqrestore(&priv->lock, flags); |
906 | drop: | ||
907 | return -1; | 907 | return -1; |
908 | } | 908 | } |
909 | EXPORT_SYMBOL(iwl_tx_skb); | 909 | EXPORT_SYMBOL(iwl_tx_skb); |
@@ -1172,6 +1172,8 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn) | |||
1172 | IWL_ERR(priv, "Start AGG on invalid station\n"); | 1172 | IWL_ERR(priv, "Start AGG on invalid station\n"); |
1173 | return -ENXIO; | 1173 | return -ENXIO; |
1174 | } | 1174 | } |
1175 | if (unlikely(tid >= MAX_TID_COUNT)) | ||
1176 | return -EINVAL; | ||
1175 | 1177 | ||
1176 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { | 1178 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_OFF) { |
1177 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); | 1179 | IWL_ERR(priv, "Start AGG when state is not IWL_AGG_OFF !\n"); |
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c index 092d28ae56a0..93cc1b3e7f48 100644 --- a/drivers/net/wireless/iwmc3200wifi/netdev.c +++ b/drivers/net/wireless/iwmc3200wifi/netdev.c | |||
@@ -99,10 +99,8 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev, | |||
99 | int ret = 0; | 99 | int ret = 0; |
100 | 100 | ||
101 | wdev = iwm_wdev_alloc(sizeof_bus, dev); | 101 | wdev = iwm_wdev_alloc(sizeof_bus, dev); |
102 | if (!wdev) { | 102 | if (IS_ERR(wdev)) |
103 | dev_err(dev, "no memory for wireless device instance\n"); | 103 | return wdev; |
104 | return ERR_PTR(-ENOMEM); | ||
105 | } | ||
106 | 104 | ||
107 | iwm = wdev_to_iwm(wdev); | 105 | iwm = wdev_to_iwm(wdev); |
108 | iwm->bus_ops = if_ops; | 106 | iwm->bus_ops = if_ops; |
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 385b50f4b105..1902b6f0b78c 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* Copyright (C) 2006, Red Hat, Inc. */ | 1 | /* Copyright (C) 2006, Red Hat, Inc. */ |
2 | 2 | ||
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/kernel.h> | ||
4 | #include <linux/etherdevice.h> | 5 | #include <linux/etherdevice.h> |
5 | #include <linux/ieee80211.h> | 6 | #include <linux/ieee80211.h> |
6 | #include <linux/if_arp.h> | 7 | #include <linux/if_arp.h> |
@@ -43,21 +44,21 @@ static int get_common_rates(struct lbs_private *priv, | |||
43 | u16 *rates_size) | 44 | u16 *rates_size) |
44 | { | 45 | { |
45 | u8 *card_rates = lbs_bg_rates; | 46 | u8 *card_rates = lbs_bg_rates; |
46 | size_t num_card_rates = sizeof(lbs_bg_rates); | ||
47 | int ret = 0, i, j; | 47 | int ret = 0, i, j; |
48 | u8 tmp[30]; | 48 | u8 tmp[(ARRAY_SIZE(lbs_bg_rates) - 1) * (*rates_size - 1)]; |
49 | size_t tmp_size = 0; | 49 | size_t tmp_size = 0; |
50 | 50 | ||
51 | /* For each rate in card_rates that exists in rate1, copy to tmp */ | 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++) { | 52 | for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) { |
53 | for (j = 0; rates[j] && (j < *rates_size); j++) { | 53 | for (j = 0; j < *rates_size && rates[j]; j++) { |
54 | if (rates[j] == card_rates[i]) | 54 | if (rates[j] == card_rates[i]) |
55 | tmp[tmp_size++] = card_rates[i]; | 55 | tmp[tmp_size++] = card_rates[i]; |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); | 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 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); | 62 | lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); |
62 | lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); | 63 | lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); |
63 | 64 | ||
@@ -69,10 +70,7 @@ static int get_common_rates(struct lbs_private *priv, | |||
69 | lbs_pr_alert("Previously set fixed data rate %#x isn't " | 70 | lbs_pr_alert("Previously set fixed data rate %#x isn't " |
70 | "compatible with the network.\n", priv->cur_rate); | 71 | "compatible with the network.\n", priv->cur_rate); |
71 | ret = -1; | 72 | ret = -1; |
72 | goto done; | ||
73 | } | 73 | } |
74 | ret = 0; | ||
75 | |||
76 | done: | 74 | done: |
77 | memset(rates, 0, *rates_size); | 75 | memset(rates, 0, *rates_size); |
78 | *rates_size = min_t(int, tmp_size, *rates_size); | 76 | *rates_size = min_t(int, tmp_size, *rates_size); |
@@ -320,7 +318,7 @@ static int lbs_associate(struct lbs_private *priv, | |||
320 | rates = (struct mrvl_ie_rates_param_set *) pos; | 318 | rates = (struct mrvl_ie_rates_param_set *) pos; |
321 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); | 319 | rates->header.type = cpu_to_le16(TLV_TYPE_RATES); |
322 | memcpy(&rates->rates, &bss->rates, MAX_RATES); | 320 | memcpy(&rates->rates, &bss->rates, MAX_RATES); |
323 | tmplen = MAX_RATES; | 321 | tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES); |
324 | if (get_common_rates(priv, rates->rates, &tmplen)) { | 322 | if (get_common_rates(priv, rates->rates, &tmplen)) { |
325 | ret = -1; | 323 | ret = -1; |
326 | goto done; | 324 | goto done; |
@@ -594,7 +592,7 @@ static int lbs_adhoc_join(struct lbs_private *priv, | |||
594 | 592 | ||
595 | /* Copy Data rates from the rates recorded in scan response */ | 593 | /* Copy Data rates from the rates recorded in scan response */ |
596 | memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); | 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 | memcpy(cmd.bss.rates, bss->rates, ratesize); | 596 | memcpy(cmd.bss.rates, bss->rates, ratesize); |
599 | if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { | 597 | if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { |
600 | lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); | 598 | lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 601b54249677..6c95af3023cc 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * for sending scan commands to the firmware. | 5 | * for sending scan commands to the firmware. |
6 | */ | 6 | */ |
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/kernel.h> | ||
8 | #include <linux/etherdevice.h> | 9 | #include <linux/etherdevice.h> |
9 | #include <linux/if_arp.h> | 10 | #include <linux/if_arp.h> |
10 | #include <asm/unaligned.h> | 11 | #include <asm/unaligned.h> |
@@ -876,7 +877,7 @@ static inline char *lbs_translate_scan(struct lbs_private *priv, | |||
876 | iwe.u.bitrate.disabled = 0; | 877 | iwe.u.bitrate.disabled = 0; |
877 | iwe.u.bitrate.value = 0; | 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 | /* Bit rate given in 500 kb/s units */ | 881 | /* Bit rate given in 500 kb/s units */ |
881 | iwe.u.bitrate.value = bss->rates[j] * 500000; | 882 | iwe.u.bitrate.value = bss->rates[j] * 500000; |
882 | current_val = iwe_stream_add_value(info, start, current_val, | 883 | current_val = iwe_stream_add_value(info, start, current_val, |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 783e33c65eb7..b47240ca4b19 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -990,7 +990,7 @@ int iscsi_offload_mesg(struct Scsi_Host *shost, | |||
990 | struct iscsi_uevent *ev; | 990 | struct iscsi_uevent *ev; |
991 | int len = NLMSG_SPACE(sizeof(*ev) + data_size); | 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 | if (!skb) { | 994 | if (!skb) { |
995 | printk(KERN_ERR "can not deliver iscsi offload message:OOM\n"); | 995 | printk(KERN_ERR "can not deliver iscsi offload message:OOM\n"); |
996 | return -ENOMEM; | 996 | return -ENOMEM; |
@@ -1012,7 +1012,7 @@ int iscsi_offload_mesg(struct Scsi_Host *shost, | |||
1012 | 1012 | ||
1013 | memcpy((char *)ev + sizeof(*ev), data, data_size); | 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 | EXPORT_SYMBOL_GPL(iscsi_offload_mesg); | 1017 | EXPORT_SYMBOL_GPL(iscsi_offload_mesg); |
1018 | 1018 | ||