diff options
Diffstat (limited to 'drivers/net')
39 files changed, 244 insertions, 163 deletions
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 25197b698dd6..b8b4c7ba884f 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -89,16 +89,16 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
89 | BUGLVL(D_NORMAL) printk(VERSION); | 89 | BUGLVL(D_NORMAL) printk(VERSION); |
90 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); | 90 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); |
91 | 91 | ||
92 | BUGMSG(D_NORMAL, "Given: node %02Xh, shmem %lXh, irq %d\n", | 92 | BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n", |
93 | dev->dev_addr[0], dev->mem_start, dev->irq); | 93 | dev->dev_addr[0], dev->mem_start, dev->irq); |
94 | 94 | ||
95 | if (dev->mem_start <= 0 || dev->irq <= 0) { | 95 | if (dev->mem_start <= 0 || dev->irq <= 0) { |
96 | BUGMSG(D_NORMAL, "No autoprobe for RIM I; you " | 96 | BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you " |
97 | "must specify the shmem and irq!\n"); | 97 | "must specify the shmem and irq!\n"); |
98 | return -ENODEV; | 98 | return -ENODEV; |
99 | } | 99 | } |
100 | if (dev->dev_addr[0] == 0) { | 100 | if (dev->dev_addr[0] == 0) { |
101 | BUGMSG(D_NORMAL, "You need to specify your card's station " | 101 | BUGLVL(D_NORMAL) printk("You need to specify your card's station " |
102 | "ID!\n"); | 102 | "ID!\n"); |
103 | return -ENODEV; | 103 | return -ENODEV; |
104 | } | 104 | } |
@@ -109,7 +109,7 @@ static int __init arcrimi_probe(struct net_device *dev) | |||
109 | * will be taken. | 109 | * will be taken. |
110 | */ | 110 | */ |
111 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { | 111 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { |
112 | BUGMSG(D_NORMAL, "Card memory already allocated\n"); | 112 | BUGLVL(D_NORMAL) printk("Card memory already allocated\n"); |
113 | return -ENODEV; | 113 | return -ENODEV; |
114 | } | 114 | } |
115 | return arcrimi_found(dev); | 115 | return arcrimi_found(dev); |
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 9a66e2a910ae..9c1c8cd5223f 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c | |||
@@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work) | |||
744 | size_t fifo_occupancy = 0; | 744 | size_t fifo_occupancy = 0; |
745 | 745 | ||
746 | /* Wakeup timeout */ | 746 | /* Wakeup timeout */ |
747 | dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n", | 747 | dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n", |
748 | __func__); | 748 | __func__); |
749 | 749 | ||
750 | /* Check FIFO to check if modem has sent something. */ | 750 | /* Check FIFO to check if modem has sent something. */ |
751 | WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev, | 751 | WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev, |
752 | &fifo_occupancy)); | 752 | &fifo_occupancy)); |
753 | 753 | ||
754 | dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", | 754 | dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", |
755 | __func__, (unsigned) fifo_occupancy); | 755 | __func__, (unsigned) fifo_occupancy); |
756 | 756 | ||
757 | /* Check if we misssed the interrupt. */ | 757 | /* Check if we misssed the interrupt. */ |
@@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev) | |||
1210 | 1210 | ||
1211 | static void cfhsi_shutdown(struct cfhsi *cfhsi) | 1211 | static void cfhsi_shutdown(struct cfhsi *cfhsi) |
1212 | { | 1212 | { |
1213 | u8 *tx_buf, *rx_buf; | 1213 | u8 *tx_buf, *rx_buf, *flip_buf; |
1214 | 1214 | ||
1215 | /* Stop TXing */ | 1215 | /* Stop TXing */ |
1216 | netif_tx_stop_all_queues(cfhsi->ndev); | 1216 | netif_tx_stop_all_queues(cfhsi->ndev); |
@@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) | |||
1234 | /* Store bufferes: will be freed later. */ | 1234 | /* Store bufferes: will be freed later. */ |
1235 | tx_buf = cfhsi->tx_buf; | 1235 | tx_buf = cfhsi->tx_buf; |
1236 | rx_buf = cfhsi->rx_buf; | 1236 | rx_buf = cfhsi->rx_buf; |
1237 | 1237 | flip_buf = cfhsi->rx_flip_buf; | |
1238 | /* Flush transmit queues. */ | 1238 | /* Flush transmit queues. */ |
1239 | cfhsi_abort_tx(cfhsi); | 1239 | cfhsi_abort_tx(cfhsi); |
1240 | 1240 | ||
@@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) | |||
1247 | /* Free buffers. */ | 1247 | /* Free buffers. */ |
1248 | kfree(tx_buf); | 1248 | kfree(tx_buf); |
1249 | kfree(rx_buf); | 1249 | kfree(rx_buf); |
1250 | kfree(flip_buf); | ||
1250 | } | 1251 | } |
1251 | 1252 | ||
1252 | int cfhsi_remove(struct platform_device *pdev) | 1253 | int cfhsi_remove(struct platform_device *pdev) |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index 5234586dff15..629c4ba5d49d 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c | |||
@@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
875 | PCAN_USBPRO_INFO_FW, | 875 | PCAN_USBPRO_INFO_FW, |
876 | &fi, sizeof(fi)); | 876 | &fi, sizeof(fi)); |
877 | if (err) { | 877 | if (err) { |
878 | kfree(usb_if); | ||
878 | dev_err(dev->netdev->dev.parent, | 879 | dev_err(dev->netdev->dev.parent, |
879 | "unable to read %s firmware info (err %d)\n", | 880 | "unable to read %s firmware info (err %d)\n", |
880 | pcan_usb_pro.name, err); | 881 | pcan_usb_pro.name, err); |
@@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
885 | PCAN_USBPRO_INFO_BL, | 886 | PCAN_USBPRO_INFO_BL, |
886 | &bi, sizeof(bi)); | 887 | &bi, sizeof(bi)); |
887 | if (err) { | 888 | if (err) { |
889 | kfree(usb_if); | ||
888 | dev_err(dev->netdev->dev.parent, | 890 | dev_err(dev->netdev->dev.parent, |
889 | "unable to read %s bootloader info (err %d)\n", | 891 | "unable to read %s bootloader info (err %d)\n", |
890 | pcan_usb_pro.name, err); | 892 | pcan_usb_pro.name, err); |
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index d5c6d92f1ee7..442d91a2747b 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c | |||
@@ -107,14 +107,14 @@ static int dummy_dev_init(struct net_device *dev) | |||
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | static void dummy_dev_free(struct net_device *dev) | 110 | static void dummy_dev_uninit(struct net_device *dev) |
111 | { | 111 | { |
112 | free_percpu(dev->dstats); | 112 | free_percpu(dev->dstats); |
113 | free_netdev(dev); | ||
114 | } | 113 | } |
115 | 114 | ||
116 | static const struct net_device_ops dummy_netdev_ops = { | 115 | static const struct net_device_ops dummy_netdev_ops = { |
117 | .ndo_init = dummy_dev_init, | 116 | .ndo_init = dummy_dev_init, |
117 | .ndo_uninit = dummy_dev_uninit, | ||
118 | .ndo_start_xmit = dummy_xmit, | 118 | .ndo_start_xmit = dummy_xmit, |
119 | .ndo_validate_addr = eth_validate_addr, | 119 | .ndo_validate_addr = eth_validate_addr, |
120 | .ndo_set_rx_mode = set_multicast_list, | 120 | .ndo_set_rx_mode = set_multicast_list, |
@@ -128,7 +128,7 @@ static void dummy_setup(struct net_device *dev) | |||
128 | 128 | ||
129 | /* Initialize the device structure. */ | 129 | /* Initialize the device structure. */ |
130 | dev->netdev_ops = &dummy_netdev_ops; | 130 | dev->netdev_ops = &dummy_netdev_ops; |
131 | dev->destructor = dummy_dev_free; | 131 | dev->destructor = free_netdev; |
132 | 132 | ||
133 | /* Fill in device structure with ethernet-generic values. */ | 133 | /* Fill in device structure with ethernet-generic values. */ |
134 | dev->tx_queue_len = 0; | 134 | dev->tx_queue_len = 0; |
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c index 40ac41436549..c926857e8205 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.c +++ b/drivers/net/ethernet/atheros/atlx/atl1.c | |||
@@ -2476,7 +2476,7 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
2476 | "pcie phy link down %x\n", status); | 2476 | "pcie phy link down %x\n", status); |
2477 | if (netif_running(adapter->netdev)) { /* reset MAC */ | 2477 | if (netif_running(adapter->netdev)) { /* reset MAC */ |
2478 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 2478 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
2479 | schedule_work(&adapter->pcie_dma_to_rst_task); | 2479 | schedule_work(&adapter->reset_dev_task); |
2480 | return IRQ_HANDLED; | 2480 | return IRQ_HANDLED; |
2481 | } | 2481 | } |
2482 | } | 2482 | } |
@@ -2488,7 +2488,7 @@ static irqreturn_t atl1_intr(int irq, void *data) | |||
2488 | "pcie DMA r/w error (status = 0x%x)\n", | 2488 | "pcie DMA r/w error (status = 0x%x)\n", |
2489 | status); | 2489 | status); |
2490 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); | 2490 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
2491 | schedule_work(&adapter->pcie_dma_to_rst_task); | 2491 | schedule_work(&adapter->reset_dev_task); |
2492 | return IRQ_HANDLED; | 2492 | return IRQ_HANDLED; |
2493 | } | 2493 | } |
2494 | 2494 | ||
@@ -2633,10 +2633,10 @@ static void atl1_down(struct atl1_adapter *adapter) | |||
2633 | atl1_clean_rx_ring(adapter); | 2633 | atl1_clean_rx_ring(adapter); |
2634 | } | 2634 | } |
2635 | 2635 | ||
2636 | static void atl1_tx_timeout_task(struct work_struct *work) | 2636 | static void atl1_reset_dev_task(struct work_struct *work) |
2637 | { | 2637 | { |
2638 | struct atl1_adapter *adapter = | 2638 | struct atl1_adapter *adapter = |
2639 | container_of(work, struct atl1_adapter, tx_timeout_task); | 2639 | container_of(work, struct atl1_adapter, reset_dev_task); |
2640 | struct net_device *netdev = adapter->netdev; | 2640 | struct net_device *netdev = adapter->netdev; |
2641 | 2641 | ||
2642 | netif_device_detach(netdev); | 2642 | netif_device_detach(netdev); |
@@ -3038,12 +3038,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev, | |||
3038 | (unsigned long)adapter); | 3038 | (unsigned long)adapter); |
3039 | adapter->phy_timer_pending = false; | 3039 | adapter->phy_timer_pending = false; |
3040 | 3040 | ||
3041 | INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task); | 3041 | INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task); |
3042 | 3042 | ||
3043 | INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task); | 3043 | INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task); |
3044 | 3044 | ||
3045 | INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task); | ||
3046 | |||
3047 | err = register_netdev(netdev); | 3045 | err = register_netdev(netdev); |
3048 | if (err) | 3046 | if (err) |
3049 | goto err_common; | 3047 | goto err_common; |
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.h b/drivers/net/ethernet/atheros/atlx/atl1.h index 109d6da8be97..e04bf4d71e46 100644 --- a/drivers/net/ethernet/atheros/atlx/atl1.h +++ b/drivers/net/ethernet/atheros/atlx/atl1.h | |||
@@ -758,9 +758,8 @@ struct atl1_adapter { | |||
758 | u16 link_speed; | 758 | u16 link_speed; |
759 | u16 link_duplex; | 759 | u16 link_duplex; |
760 | spinlock_t lock; | 760 | spinlock_t lock; |
761 | struct work_struct tx_timeout_task; | 761 | struct work_struct reset_dev_task; |
762 | struct work_struct link_chg_task; | 762 | struct work_struct link_chg_task; |
763 | struct work_struct pcie_dma_to_rst_task; | ||
764 | 763 | ||
765 | struct timer_list phy_config_timer; | 764 | struct timer_list phy_config_timer; |
766 | bool phy_timer_pending; | 765 | bool phy_timer_pending; |
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c index 3cd8837236dc..c9e9dc57986c 100644 --- a/drivers/net/ethernet/atheros/atlx/atlx.c +++ b/drivers/net/ethernet/atheros/atlx/atlx.c | |||
@@ -194,7 +194,7 @@ static void atlx_tx_timeout(struct net_device *netdev) | |||
194 | { | 194 | { |
195 | struct atlx_adapter *adapter = netdev_priv(netdev); | 195 | struct atlx_adapter *adapter = netdev_priv(netdev); |
196 | /* Do the reset outside of interrupt context */ | 196 | /* Do the reset outside of interrupt context */ |
197 | schedule_work(&adapter->tx_timeout_task); | 197 | schedule_work(&adapter->reset_dev_task); |
198 | } | 198 | } |
199 | 199 | ||
200 | /* | 200 | /* |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index ad95324dc042..64392ec410a3 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -942,6 +942,12 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, | |||
942 | const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : | 942 | const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : |
943 | DCBX_E3B0_MAX_NUM_COS_PORT0; | 943 | DCBX_E3B0_MAX_NUM_COS_PORT0; |
944 | 944 | ||
945 | if (pri >= max_num_of_cos) { | ||
946 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | ||
947 | "parameter Illegal strict priority\n"); | ||
948 | return -EINVAL; | ||
949 | } | ||
950 | |||
945 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { | 951 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { |
946 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | 952 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " |
947 | "parameter There can't be two COS's with " | 953 | "parameter There can't be two COS's with " |
@@ -949,12 +955,6 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, | |||
949 | return -EINVAL; | 955 | return -EINVAL; |
950 | } | 956 | } |
951 | 957 | ||
952 | if (pri > max_num_of_cos) { | ||
953 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | ||
954 | "parameter Illegal strict priority\n"); | ||
955 | return -EINVAL; | ||
956 | } | ||
957 | |||
958 | sp_pri_to_cos[pri] = cos_entry; | 958 | sp_pri_to_cos[pri] = cos_entry; |
959 | return 0; | 959 | return 0; |
960 | 960 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 64c76443a7aa..b461c24945e3 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -1310,10 +1310,6 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1310 | 1310 | ||
1311 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) | 1311 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) |
1312 | oem_reg |= HV_OEM_BITS_LPLU; | 1312 | oem_reg |= HV_OEM_BITS_LPLU; |
1313 | |||
1314 | /* Set Restart auto-neg to activate the bits */ | ||
1315 | if (!hw->phy.ops.check_reset_block(hw)) | ||
1316 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1317 | } else { | 1313 | } else { |
1318 | if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | | 1314 | if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | |
1319 | E1000_PHY_CTRL_NOND0A_GBE_DISABLE)) | 1315 | E1000_PHY_CTRL_NOND0A_GBE_DISABLE)) |
@@ -1324,6 +1320,11 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1324 | oem_reg |= HV_OEM_BITS_LPLU; | 1320 | oem_reg |= HV_OEM_BITS_LPLU; |
1325 | } | 1321 | } |
1326 | 1322 | ||
1323 | /* Set Restart auto-neg to activate the bits */ | ||
1324 | if ((d0_state || (hw->mac.type != e1000_pchlan)) && | ||
1325 | !hw->phy.ops.check_reset_block(hw)) | ||
1326 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1327 | |||
1327 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); | 1328 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); |
1328 | 1329 | ||
1329 | release: | 1330 | release: |
@@ -3682,7 +3683,11 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) | |||
3682 | 3683 | ||
3683 | if (hw->mac.type >= e1000_pchlan) { | 3684 | if (hw->mac.type >= e1000_pchlan) { |
3684 | e1000_oem_bits_config_ich8lan(hw, false); | 3685 | e1000_oem_bits_config_ich8lan(hw, false); |
3685 | e1000_phy_hw_reset_ich8lan(hw); | 3686 | |
3687 | /* Reset PHY to activate OEM bits on 82577/8 */ | ||
3688 | if (hw->mac.type == e1000_pchlan) | ||
3689 | e1000e_phy_hw_reset_generic(hw); | ||
3690 | |||
3686 | ret_val = hw->phy.ops.acquire(hw); | 3691 | ret_val = hw->phy.ops.acquire(hw); |
3687 | if (ret_val) | 3692 | if (ret_val) |
3688 | return; | 3693 | return; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c index 027d7a75be39..ed1b47dc0834 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | |||
@@ -622,6 +622,16 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, int v_idx, | |||
622 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | 622 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) |
623 | set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); | 623 | set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); |
624 | 624 | ||
625 | #ifdef IXGBE_FCOE | ||
626 | if (adapter->netdev->features & NETIF_F_FCOE_MTU) { | ||
627 | struct ixgbe_ring_feature *f; | ||
628 | f = &adapter->ring_feature[RING_F_FCOE]; | ||
629 | if ((rxr_idx >= f->mask) && | ||
630 | (rxr_idx < f->mask + f->indices)) | ||
631 | set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); | ||
632 | } | ||
633 | |||
634 | #endif /* IXGBE_FCOE */ | ||
625 | /* apply Rx specific ring traits */ | 635 | /* apply Rx specific ring traits */ |
626 | ring->count = adapter->rx_ring_count; | 636 | ring->count = adapter->rx_ring_count; |
627 | ring->queue_index = rxr_idx; | 637 | ring->queue_index = rxr_idx; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 3e26b1f9ac75..a7f3cd872caf 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -3154,14 +3154,6 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter) | |||
3154 | set_ring_rsc_enabled(rx_ring); | 3154 | set_ring_rsc_enabled(rx_ring); |
3155 | else | 3155 | else |
3156 | clear_ring_rsc_enabled(rx_ring); | 3156 | clear_ring_rsc_enabled(rx_ring); |
3157 | #ifdef IXGBE_FCOE | ||
3158 | if (netdev->features & NETIF_F_FCOE_MTU) { | ||
3159 | struct ixgbe_ring_feature *f; | ||
3160 | f = &adapter->ring_feature[RING_F_FCOE]; | ||
3161 | if ((i >= f->mask) && (i < f->mask + f->indices)) | ||
3162 | set_bit(__IXGBE_RX_FCOE_BUFSZ, &rx_ring->state); | ||
3163 | } | ||
3164 | #endif /* IXGBE_FCOE */ | ||
3165 | } | 3157 | } |
3166 | } | 3158 | } |
3167 | 3159 | ||
@@ -4836,7 +4828,9 @@ static int ixgbe_resume(struct pci_dev *pdev) | |||
4836 | 4828 | ||
4837 | pci_wake_from_d3(pdev, false); | 4829 | pci_wake_from_d3(pdev, false); |
4838 | 4830 | ||
4831 | rtnl_lock(); | ||
4839 | err = ixgbe_init_interrupt_scheme(adapter); | 4832 | err = ixgbe_init_interrupt_scheme(adapter); |
4833 | rtnl_unlock(); | ||
4840 | if (err) { | 4834 | if (err) { |
4841 | e_dev_err("Cannot initialize interrupts for device\n"); | 4835 | e_dev_err("Cannot initialize interrupts for device\n"); |
4842 | return err; | 4836 | return err; |
@@ -4893,6 +4887,16 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4893 | if (wufc) { | 4887 | if (wufc) { |
4894 | ixgbe_set_rx_mode(netdev); | 4888 | ixgbe_set_rx_mode(netdev); |
4895 | 4889 | ||
4890 | /* | ||
4891 | * enable the optics for both mult-speed fiber and | ||
4892 | * 82599 SFP+ fiber as we can WoL. | ||
4893 | */ | ||
4894 | if (hw->mac.ops.enable_tx_laser && | ||
4895 | (hw->phy.multispeed_fiber || | ||
4896 | (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber && | ||
4897 | hw->mac.type == ixgbe_mac_82599EB))) | ||
4898 | hw->mac.ops.enable_tx_laser(hw); | ||
4899 | |||
4896 | /* turn on all-multi mode if wake on multicast is enabled */ | 4900 | /* turn on all-multi mode if wake on multicast is enabled */ |
4897 | if (wufc & IXGBE_WUFC_MC) { | 4901 | if (wufc & IXGBE_WUFC_MC) { |
4898 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); | 4902 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index c722aa607d07..f8dda009d3c0 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -889,16 +889,17 @@ static int ks8851_net_stop(struct net_device *dev) | |||
889 | netif_stop_queue(dev); | 889 | netif_stop_queue(dev); |
890 | 890 | ||
891 | mutex_lock(&ks->lock); | 891 | mutex_lock(&ks->lock); |
892 | /* turn off the IRQs and ack any outstanding */ | ||
893 | ks8851_wrreg16(ks, KS_IER, 0x0000); | ||
894 | ks8851_wrreg16(ks, KS_ISR, 0xffff); | ||
895 | mutex_unlock(&ks->lock); | ||
892 | 896 | ||
893 | /* stop any outstanding work */ | 897 | /* stop any outstanding work */ |
894 | flush_work(&ks->irq_work); | 898 | flush_work(&ks->irq_work); |
895 | flush_work(&ks->tx_work); | 899 | flush_work(&ks->tx_work); |
896 | flush_work(&ks->rxctrl_work); | 900 | flush_work(&ks->rxctrl_work); |
897 | 901 | ||
898 | /* turn off the IRQs and ack any outstanding */ | 902 | mutex_lock(&ks->lock); |
899 | ks8851_wrreg16(ks, KS_IER, 0x0000); | ||
900 | ks8851_wrreg16(ks, KS_ISR, 0xffff); | ||
901 | |||
902 | /* shutdown RX process */ | 903 | /* shutdown RX process */ |
903 | ks8851_wrreg16(ks, KS_RXCR1, 0x0000); | 904 | ks8851_wrreg16(ks, KS_RXCR1, 0x0000); |
904 | 905 | ||
@@ -907,6 +908,7 @@ static int ks8851_net_stop(struct net_device *dev) | |||
907 | 908 | ||
908 | /* set powermode to soft power down to save power */ | 909 | /* set powermode to soft power down to save power */ |
909 | ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN); | 910 | ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN); |
911 | mutex_unlock(&ks->lock); | ||
910 | 912 | ||
911 | /* ensure any queued tx buffers are dumped */ | 913 | /* ensure any queued tx buffers are dumped */ |
912 | while (!skb_queue_empty(&ks->txq)) { | 914 | while (!skb_queue_empty(&ks->txq)) { |
@@ -918,7 +920,6 @@ static int ks8851_net_stop(struct net_device *dev) | |||
918 | dev_kfree_skb(txb); | 920 | dev_kfree_skb(txb); |
919 | } | 921 | } |
920 | 922 | ||
921 | mutex_unlock(&ks->lock); | ||
922 | return 0; | 923 | return 0; |
923 | } | 924 | } |
924 | 925 | ||
@@ -1418,6 +1419,7 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1418 | struct net_device *ndev; | 1419 | struct net_device *ndev; |
1419 | struct ks8851_net *ks; | 1420 | struct ks8851_net *ks; |
1420 | int ret; | 1421 | int ret; |
1422 | unsigned cider; | ||
1421 | 1423 | ||
1422 | ndev = alloc_etherdev(sizeof(struct ks8851_net)); | 1424 | ndev = alloc_etherdev(sizeof(struct ks8851_net)); |
1423 | if (!ndev) | 1425 | if (!ndev) |
@@ -1484,8 +1486,8 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1484 | ks8851_soft_reset(ks, GRR_GSR); | 1486 | ks8851_soft_reset(ks, GRR_GSR); |
1485 | 1487 | ||
1486 | /* simple check for a valid chip being connected to the bus */ | 1488 | /* simple check for a valid chip being connected to the bus */ |
1487 | 1489 | cider = ks8851_rdreg16(ks, KS_CIDER); | |
1488 | if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { | 1490 | if ((cider & ~CIDER_REV_MASK) != CIDER_ID) { |
1489 | dev_err(&spi->dev, "failed to read device ID\n"); | 1491 | dev_err(&spi->dev, "failed to read device ID\n"); |
1490 | ret = -ENODEV; | 1492 | ret = -ENODEV; |
1491 | goto err_id; | 1493 | goto err_id; |
@@ -1516,15 +1518,14 @@ static int __devinit ks8851_probe(struct spi_device *spi) | |||
1516 | } | 1518 | } |
1517 | 1519 | ||
1518 | netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", | 1520 | netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", |
1519 | CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)), | 1521 | CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq, |
1520 | ndev->dev_addr, ndev->irq, | ||
1521 | ks->rc_ccr & CCR_EEPROM ? "has" : "no"); | 1522 | ks->rc_ccr & CCR_EEPROM ? "has" : "no"); |
1522 | 1523 | ||
1523 | return 0; | 1524 | return 0; |
1524 | 1525 | ||
1525 | 1526 | ||
1526 | err_netdev: | 1527 | err_netdev: |
1527 | free_irq(ndev->irq, ndev); | 1528 | free_irq(ndev->irq, ks); |
1528 | 1529 | ||
1529 | err_id: | 1530 | err_id: |
1530 | err_irq: | 1531 | err_irq: |
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c index b8104d9f4081..5ffde23ac8fb 100644 --- a/drivers/net/ethernet/micrel/ks8851_mll.c +++ b/drivers/net/ethernet/micrel/ks8851_mll.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define DRV_NAME "ks8851_mll" | 40 | #define DRV_NAME "ks8851_mll" |
41 | 41 | ||
42 | static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 }; | 42 | static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 }; |
43 | #define MAX_RECV_FRAMES 32 | 43 | #define MAX_RECV_FRAMES 255 |
44 | #define MAX_BUF_SIZE 2048 | 44 | #define MAX_BUF_SIZE 2048 |
45 | #define TX_BUF_SIZE 2000 | 45 | #define TX_BUF_SIZE 2000 |
46 | #define RX_BUF_SIZE 2000 | 46 | #define RX_BUF_SIZE 2000 |
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index ef723b185d85..eaf9ff0262a9 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c | |||
@@ -5675,7 +5675,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr) | |||
5675 | memcpy(hw->override_addr, mac->sa_data, ETH_ALEN); | 5675 | memcpy(hw->override_addr, mac->sa_data, ETH_ALEN); |
5676 | } | 5676 | } |
5677 | 5677 | ||
5678 | memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN); | 5678 | memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN); |
5679 | 5679 | ||
5680 | interrupt = hw_block_intr(hw); | 5680 | interrupt = hw_block_intr(hw); |
5681 | 5681 | ||
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c index abc79076f867..b3287c0fe279 100644 --- a/drivers/net/ethernet/realtek/8139cp.c +++ b/drivers/net/ethernet/realtek/8139cp.c | |||
@@ -958,6 +958,11 @@ static inline void cp_start_hw (struct cp_private *cp) | |||
958 | cpw8(Cmd, RxOn | TxOn); | 958 | cpw8(Cmd, RxOn | TxOn); |
959 | } | 959 | } |
960 | 960 | ||
961 | static void cp_enable_irq(struct cp_private *cp) | ||
962 | { | ||
963 | cpw16_f(IntrMask, cp_intr_mask); | ||
964 | } | ||
965 | |||
961 | static void cp_init_hw (struct cp_private *cp) | 966 | static void cp_init_hw (struct cp_private *cp) |
962 | { | 967 | { |
963 | struct net_device *dev = cp->dev; | 968 | struct net_device *dev = cp->dev; |
@@ -997,8 +1002,6 @@ static void cp_init_hw (struct cp_private *cp) | |||
997 | 1002 | ||
998 | cpw16(MultiIntr, 0); | 1003 | cpw16(MultiIntr, 0); |
999 | 1004 | ||
1000 | cpw16_f(IntrMask, cp_intr_mask); | ||
1001 | |||
1002 | cpw8_f(Cfg9346, Cfg9346_Lock); | 1005 | cpw8_f(Cfg9346, Cfg9346_Lock); |
1003 | } | 1006 | } |
1004 | 1007 | ||
@@ -1130,6 +1133,8 @@ static int cp_open (struct net_device *dev) | |||
1130 | if (rc) | 1133 | if (rc) |
1131 | goto err_out_hw; | 1134 | goto err_out_hw; |
1132 | 1135 | ||
1136 | cp_enable_irq(cp); | ||
1137 | |||
1133 | netif_carrier_off(dev); | 1138 | netif_carrier_off(dev); |
1134 | mii_check_media(&cp->mii_if, netif_msg_link(cp), true); | 1139 | mii_check_media(&cp->mii_if, netif_msg_link(cp), true); |
1135 | netif_start_queue(dev); | 1140 | netif_start_queue(dev); |
@@ -2031,6 +2036,7 @@ static int cp_resume (struct pci_dev *pdev) | |||
2031 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ | 2036 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ |
2032 | cp_init_rings_index (cp); | 2037 | cp_init_rings_index (cp); |
2033 | cp_init_hw (cp); | 2038 | cp_init_hw (cp); |
2039 | cp_enable_irq(cp); | ||
2034 | netif_start_queue (dev); | 2040 | netif_start_queue (dev); |
2035 | 2041 | ||
2036 | spin_lock_irqsave (&cp->lock, flags); | 2042 | spin_lock_irqsave (&cp->lock, flags); |
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 4a6971027076..cd3defb11ffb 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat) | |||
1166 | 1166 | ||
1167 | /* Quickly dumps bad packets */ | 1167 | /* Quickly dumps bad packets */ |
1168 | static void | 1168 | static void |
1169 | smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes) | 1169 | smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords) |
1170 | { | 1170 | { |
1171 | unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2; | ||
1172 | |||
1173 | if (likely(pktwords >= 4)) { | 1171 | if (likely(pktwords >= 4)) { |
1174 | unsigned int timeout = 500; | 1172 | unsigned int timeout = 500; |
1175 | unsigned int val; | 1173 | unsigned int val; |
@@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) | |||
1233 | continue; | 1231 | continue; |
1234 | } | 1232 | } |
1235 | 1233 | ||
1236 | skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN); | 1234 | skb = netdev_alloc_skb(dev, pktwords << 2); |
1237 | if (unlikely(!skb)) { | 1235 | if (unlikely(!skb)) { |
1238 | SMSC_WARN(pdata, rx_err, | 1236 | SMSC_WARN(pdata, rx_err, |
1239 | "Unable to allocate skb for rx packet"); | 1237 | "Unable to allocate skb for rx packet"); |
@@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) | |||
1243 | break; | 1241 | break; |
1244 | } | 1242 | } |
1245 | 1243 | ||
1246 | skb->data = skb->head; | 1244 | pdata->ops->rx_readfifo(pdata, |
1247 | skb_reset_tail_pointer(skb); | 1245 | (unsigned int *)skb->data, pktwords); |
1248 | 1246 | ||
1249 | /* Align IP on 16B boundary */ | 1247 | /* Align IP on 16B boundary */ |
1250 | skb_reserve(skb, NET_IP_ALIGN); | 1248 | skb_reserve(skb, NET_IP_ALIGN); |
1251 | skb_put(skb, pktlength - 4); | 1249 | skb_put(skb, pktlength - 4); |
1252 | pdata->ops->rx_readfifo(pdata, | ||
1253 | (unsigned int *)skb->head, pktwords); | ||
1254 | skb->protocol = eth_type_trans(skb, dev); | 1250 | skb->protocol = eth_type_trans(skb, dev); |
1255 | skb_checksum_none_assert(skb); | 1251 | skb_checksum_none_assert(skb); |
1256 | netif_receive_skb(skb); | 1252 | netif_receive_skb(skb); |
@@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev) | |||
1565 | smsc911x_reg_write(pdata, FIFO_INT, temp); | 1561 | smsc911x_reg_write(pdata, FIFO_INT, temp); |
1566 | 1562 | ||
1567 | /* set RX Data offset to 2 bytes for alignment */ | 1563 | /* set RX Data offset to 2 bytes for alignment */ |
1568 | smsc911x_reg_write(pdata, RX_CFG, (2 << 8)); | 1564 | smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8)); |
1569 | 1565 | ||
1570 | /* enable NAPI polling before enabling RX interrupts */ | 1566 | /* enable NAPI polling before enabling RX interrupts */ |
1571 | napi_enable(&pdata->napi); | 1567 | napi_enable(&pdata->napi); |
@@ -2382,7 +2378,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
2382 | SET_NETDEV_DEV(dev, &pdev->dev); | 2378 | SET_NETDEV_DEV(dev, &pdev->dev); |
2383 | 2379 | ||
2384 | pdata = netdev_priv(dev); | 2380 | pdata = netdev_priv(dev); |
2385 | |||
2386 | dev->irq = irq_res->start; | 2381 | dev->irq = irq_res->start; |
2387 | irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; | 2382 | irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; |
2388 | pdata->ioaddr = ioremap_nocache(res->start, res_size); | 2383 | pdata->ioaddr = ioremap_nocache(res->start, res_size); |
@@ -2446,7 +2441,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
2446 | if (retval) { | 2441 | if (retval) { |
2447 | SMSC_WARN(pdata, probe, | 2442 | SMSC_WARN(pdata, probe, |
2448 | "Unable to claim requested irq: %d", dev->irq); | 2443 | "Unable to claim requested irq: %d", dev->irq); |
2449 | goto out_free_irq; | 2444 | goto out_disable_resources; |
2450 | } | 2445 | } |
2451 | 2446 | ||
2452 | retval = register_netdev(dev); | 2447 | retval = register_netdev(dev); |
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c index 2757c7d6e633..e4e47088e26b 100644 --- a/drivers/net/ethernet/ti/davinci_mdio.c +++ b/drivers/net/ethernet/ti/davinci_mdio.c | |||
@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) | |||
181 | __davinci_mdio_reset(data); | 181 | __davinci_mdio_reset(data); |
182 | return -EAGAIN; | 182 | return -EAGAIN; |
183 | } | 183 | } |
184 | |||
185 | reg = __raw_readl(®s->user[0].access); | ||
186 | if ((reg & USERACCESS_GO) == 0) | ||
187 | return 0; | ||
188 | |||
184 | dev_err(data->dev, "timed out waiting for user access\n"); | 189 | dev_err(data->dev, "timed out waiting for user access\n"); |
185 | return -ETIMEDOUT; | 190 | return -ETIMEDOUT; |
186 | } | 191 | } |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index cc83af083fd7..44b8d2bad8c3 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h | |||
@@ -2,9 +2,7 @@ | |||
2 | * Definitions for Xilinx Axi Ethernet device driver. | 2 | * Definitions for Xilinx Axi Ethernet device driver. |
3 | * | 3 | * |
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
5 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 5 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
6 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | ||
7 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | ||
8 | */ | 6 | */ |
9 | 7 | ||
10 | #ifndef XILINX_AXIENET_H | 8 | #ifndef XILINX_AXIENET_H |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 2fcbeba6814b..9c365e192a31 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c | |||
@@ -4,9 +4,9 @@ | |||
4 | * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi | 4 | * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi |
5 | * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net> | 5 | * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net> |
6 | * Copyright (c) 2008-2009 Secret Lab Technologies Ltd. | 6 | * Copyright (c) 2008-2009 Secret Lab Technologies Ltd. |
7 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 7 | * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> |
8 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | 8 | * Copyright (c) 2010 - 2011 PetaLogix |
9 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | 9 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
10 | * | 10 | * |
11 | * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6 | 11 | * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6 |
12 | * and Spartan6. | 12 | * and Spartan6. |
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c index d70b6e79f6c0..e90e1f46121e 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | |||
@@ -2,9 +2,9 @@ | |||
2 | * MDIO bus driver for the Xilinx Axi Ethernet device | 2 | * MDIO bus driver for the Xilinx Axi Ethernet device |
3 | * | 3 | * |
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
5 | * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | 5 | * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> |
6 | * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | 6 | * Copyright (c) 2010 - 2011 PetaLogix |
7 | * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | 7 | * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/of_address.h> | 10 | #include <linux/of_address.h> |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index dd294783b5c5..2d59138db7f3 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -44,6 +44,7 @@ struct net_device_context { | |||
44 | /* point back to our device context */ | 44 | /* point back to our device context */ |
45 | struct hv_device *device_ctx; | 45 | struct hv_device *device_ctx; |
46 | struct delayed_work dwork; | 46 | struct delayed_work dwork; |
47 | struct work_struct work; | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | 50 | ||
@@ -51,30 +52,22 @@ static int ring_size = 128; | |||
51 | module_param(ring_size, int, S_IRUGO); | 52 | module_param(ring_size, int, S_IRUGO); |
52 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); | 53 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); |
53 | 54 | ||
54 | struct set_multicast_work { | ||
55 | struct work_struct work; | ||
56 | struct net_device *net; | ||
57 | }; | ||
58 | |||
59 | static void do_set_multicast(struct work_struct *w) | 55 | static void do_set_multicast(struct work_struct *w) |
60 | { | 56 | { |
61 | struct set_multicast_work *swk = | 57 | struct net_device_context *ndevctx = |
62 | container_of(w, struct set_multicast_work, work); | 58 | container_of(w, struct net_device_context, work); |
63 | struct net_device *net = swk->net; | ||
64 | |||
65 | struct net_device_context *ndevctx = netdev_priv(net); | ||
66 | struct netvsc_device *nvdev; | 59 | struct netvsc_device *nvdev; |
67 | struct rndis_device *rdev; | 60 | struct rndis_device *rdev; |
68 | 61 | ||
69 | nvdev = hv_get_drvdata(ndevctx->device_ctx); | 62 | nvdev = hv_get_drvdata(ndevctx->device_ctx); |
70 | if (nvdev == NULL) | 63 | if (nvdev == NULL || nvdev->ndev == NULL) |
71 | goto out; | 64 | return; |
72 | 65 | ||
73 | rdev = nvdev->extension; | 66 | rdev = nvdev->extension; |
74 | if (rdev == NULL) | 67 | if (rdev == NULL) |
75 | goto out; | 68 | return; |
76 | 69 | ||
77 | if (net->flags & IFF_PROMISC) | 70 | if (nvdev->ndev->flags & IFF_PROMISC) |
78 | rndis_filter_set_packet_filter(rdev, | 71 | rndis_filter_set_packet_filter(rdev, |
79 | NDIS_PACKET_TYPE_PROMISCUOUS); | 72 | NDIS_PACKET_TYPE_PROMISCUOUS); |
80 | else | 73 | else |
@@ -82,21 +75,13 @@ static void do_set_multicast(struct work_struct *w) | |||
82 | NDIS_PACKET_TYPE_BROADCAST | | 75 | NDIS_PACKET_TYPE_BROADCAST | |
83 | NDIS_PACKET_TYPE_ALL_MULTICAST | | 76 | NDIS_PACKET_TYPE_ALL_MULTICAST | |
84 | NDIS_PACKET_TYPE_DIRECTED); | 77 | NDIS_PACKET_TYPE_DIRECTED); |
85 | |||
86 | out: | ||
87 | kfree(w); | ||
88 | } | 78 | } |
89 | 79 | ||
90 | static void netvsc_set_multicast_list(struct net_device *net) | 80 | static void netvsc_set_multicast_list(struct net_device *net) |
91 | { | 81 | { |
92 | struct set_multicast_work *swk = | 82 | struct net_device_context *net_device_ctx = netdev_priv(net); |
93 | kmalloc(sizeof(struct set_multicast_work), GFP_ATOMIC); | ||
94 | if (swk == NULL) | ||
95 | return; | ||
96 | 83 | ||
97 | swk->net = net; | 84 | schedule_work(&net_device_ctx->work); |
98 | INIT_WORK(&swk->work, do_set_multicast); | ||
99 | schedule_work(&swk->work); | ||
100 | } | 85 | } |
101 | 86 | ||
102 | static int netvsc_open(struct net_device *net) | 87 | static int netvsc_open(struct net_device *net) |
@@ -125,6 +110,8 @@ static int netvsc_close(struct net_device *net) | |||
125 | 110 | ||
126 | netif_tx_disable(net); | 111 | netif_tx_disable(net); |
127 | 112 | ||
113 | /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */ | ||
114 | cancel_work_sync(&net_device_ctx->work); | ||
128 | ret = rndis_filter_close(device_obj); | 115 | ret = rndis_filter_close(device_obj); |
129 | if (ret != 0) | 116 | if (ret != 0) |
130 | netdev_err(net, "unable to close device (ret %d).\n", ret); | 117 | netdev_err(net, "unable to close device (ret %d).\n", ret); |
@@ -335,6 +322,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) | |||
335 | 322 | ||
336 | nvdev->start_remove = true; | 323 | nvdev->start_remove = true; |
337 | cancel_delayed_work_sync(&ndevctx->dwork); | 324 | cancel_delayed_work_sync(&ndevctx->dwork); |
325 | cancel_work_sync(&ndevctx->work); | ||
338 | netif_tx_disable(ndev); | 326 | netif_tx_disable(ndev); |
339 | rndis_filter_device_remove(hdev); | 327 | rndis_filter_device_remove(hdev); |
340 | 328 | ||
@@ -403,6 +391,7 @@ static int netvsc_probe(struct hv_device *dev, | |||
403 | net_device_ctx->device_ctx = dev; | 391 | net_device_ctx->device_ctx = dev; |
404 | hv_set_drvdata(dev, net); | 392 | hv_set_drvdata(dev, net); |
405 | INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp); | 393 | INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp); |
394 | INIT_WORK(&net_device_ctx->work, do_set_multicast); | ||
406 | 395 | ||
407 | net->netdev_ops = &device_ops; | 396 | net->netdev_ops = &device_ops; |
408 | 397 | ||
@@ -456,6 +445,7 @@ static int netvsc_remove(struct hv_device *dev) | |||
456 | 445 | ||
457 | ndev_ctx = netdev_priv(net); | 446 | ndev_ctx = netdev_priv(net); |
458 | cancel_delayed_work_sync(&ndev_ctx->dwork); | 447 | cancel_delayed_work_sync(&ndev_ctx->dwork); |
448 | cancel_work_sync(&ndev_ctx->work); | ||
459 | 449 | ||
460 | /* Stop outbound asap */ | 450 | /* Stop outbound asap */ |
461 | netif_tx_disable(net); | 451 | netif_tx_disable(net); |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index f08c85acf761..5ac46f5226f3 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
@@ -40,6 +40,7 @@ MODULE_LICENSE("GPL"); | |||
40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ | 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ |
41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
43 | #define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ | ||
43 | 44 | ||
44 | static int ip175c_config_init(struct phy_device *phydev) | 45 | static int ip175c_config_init(struct phy_device *phydev) |
45 | { | 46 | { |
@@ -185,6 +186,15 @@ static int ip175c_config_aneg(struct phy_device *phydev) | |||
185 | return 0; | 186 | return 0; |
186 | } | 187 | } |
187 | 188 | ||
189 | static int ip101a_g_ack_interrupt(struct phy_device *phydev) | ||
190 | { | ||
191 | int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS); | ||
192 | if (err < 0) | ||
193 | return err; | ||
194 | |||
195 | return 0; | ||
196 | } | ||
197 | |||
188 | static struct phy_driver ip175c_driver = { | 198 | static struct phy_driver ip175c_driver = { |
189 | .phy_id = 0x02430d80, | 199 | .phy_id = 0x02430d80, |
190 | .name = "ICPlus IP175C", | 200 | .name = "ICPlus IP175C", |
@@ -204,7 +214,6 @@ static struct phy_driver ip1001_driver = { | |||
204 | .phy_id_mask = 0x0ffffff0, | 214 | .phy_id_mask = 0x0ffffff0, |
205 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | 215 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | |
206 | SUPPORTED_Asym_Pause, | 216 | SUPPORTED_Asym_Pause, |
207 | .flags = PHY_HAS_INTERRUPT, | ||
208 | .config_init = &ip1001_config_init, | 217 | .config_init = &ip1001_config_init, |
209 | .config_aneg = &genphy_config_aneg, | 218 | .config_aneg = &genphy_config_aneg, |
210 | .read_status = &genphy_read_status, | 219 | .read_status = &genphy_read_status, |
@@ -220,6 +229,7 @@ static struct phy_driver ip101a_g_driver = { | |||
220 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | | 229 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | |
221 | SUPPORTED_Asym_Pause, | 230 | SUPPORTED_Asym_Pause, |
222 | .flags = PHY_HAS_INTERRUPT, | 231 | .flags = PHY_HAS_INTERRUPT, |
232 | .ack_interrupt = ip101a_g_ack_interrupt, | ||
223 | .config_init = &ip101a_g_config_init, | 233 | .config_init = &ip101a_g_config_init, |
224 | .config_aneg = &genphy_config_aneg, | 234 | .config_aneg = &genphy_config_aneg, |
225 | .read_status = &genphy_read_status, | 235 | .read_status = &genphy_read_status, |
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c index 33f8c51968b6..21d7151fb0ab 100644 --- a/drivers/net/ppp/ppp_generic.c +++ b/drivers/net/ppp/ppp_generic.c | |||
@@ -235,7 +235,7 @@ struct ppp_net { | |||
235 | /* Prototypes. */ | 235 | /* Prototypes. */ |
236 | static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, | 236 | static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, |
237 | struct file *file, unsigned int cmd, unsigned long arg); | 237 | struct file *file, unsigned int cmd, unsigned long arg); |
238 | static int ppp_xmit_process(struct ppp *ppp); | 238 | static void ppp_xmit_process(struct ppp *ppp); |
239 | static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb); | 239 | static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb); |
240 | static void ppp_push(struct ppp *ppp); | 240 | static void ppp_push(struct ppp *ppp); |
241 | static void ppp_channel_push(struct channel *pch); | 241 | static void ppp_channel_push(struct channel *pch); |
@@ -969,8 +969,7 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
969 | put_unaligned_be16(proto, pp); | 969 | put_unaligned_be16(proto, pp); |
970 | 970 | ||
971 | skb_queue_tail(&ppp->file.xq, skb); | 971 | skb_queue_tail(&ppp->file.xq, skb); |
972 | if (!ppp_xmit_process(ppp)) | 972 | ppp_xmit_process(ppp); |
973 | netif_stop_queue(dev); | ||
974 | return NETDEV_TX_OK; | 973 | return NETDEV_TX_OK; |
975 | 974 | ||
976 | outf: | 975 | outf: |
@@ -1048,11 +1047,10 @@ static void ppp_setup(struct net_device *dev) | |||
1048 | * Called to do any work queued up on the transmit side | 1047 | * Called to do any work queued up on the transmit side |
1049 | * that can now be done. | 1048 | * that can now be done. |
1050 | */ | 1049 | */ |
1051 | static int | 1050 | static void |
1052 | ppp_xmit_process(struct ppp *ppp) | 1051 | ppp_xmit_process(struct ppp *ppp) |
1053 | { | 1052 | { |
1054 | struct sk_buff *skb; | 1053 | struct sk_buff *skb; |
1055 | int ret = 0; | ||
1056 | 1054 | ||
1057 | ppp_xmit_lock(ppp); | 1055 | ppp_xmit_lock(ppp); |
1058 | if (!ppp->closing) { | 1056 | if (!ppp->closing) { |
@@ -1062,13 +1060,12 @@ ppp_xmit_process(struct ppp *ppp) | |||
1062 | ppp_send_frame(ppp, skb); | 1060 | ppp_send_frame(ppp, skb); |
1063 | /* If there's no work left to do, tell the core net | 1061 | /* If there's no work left to do, tell the core net |
1064 | code that we can accept some more. */ | 1062 | code that we can accept some more. */ |
1065 | if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) { | 1063 | if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) |
1066 | netif_wake_queue(ppp->dev); | 1064 | netif_wake_queue(ppp->dev); |
1067 | ret = 1; | 1065 | else |
1068 | } | 1066 | netif_stop_queue(ppp->dev); |
1069 | } | 1067 | } |
1070 | ppp_xmit_unlock(ppp); | 1068 | ppp_xmit_unlock(ppp); |
1071 | return ret; | ||
1072 | } | 1069 | } |
1073 | 1070 | ||
1074 | static inline struct sk_buff * | 1071 | static inline struct sk_buff * |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 552d24bf862e..d316503b35d4 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -365,6 +365,27 @@ static const struct driver_info qmi_wwan_force_int4 = { | |||
365 | .data = BIT(4), /* interface whitelist bitmap */ | 365 | .data = BIT(4), /* interface whitelist bitmap */ |
366 | }; | 366 | }; |
367 | 367 | ||
368 | /* Sierra Wireless provide equally useless interface descriptors | ||
369 | * Devices in QMI mode can be switched between two different | ||
370 | * configurations: | ||
371 | * a) USB interface #8 is QMI/wwan | ||
372 | * b) USB interfaces #8, #19 and #20 are QMI/wwan | ||
373 | * | ||
374 | * Both configurations provide a number of other interfaces (serial++), | ||
375 | * some of which have the same endpoint configuration as we expect, so | ||
376 | * a whitelist or blacklist is necessary. | ||
377 | * | ||
378 | * FIXME: The below whitelist should include BIT(20). It does not | ||
379 | * because I cannot get it to work... | ||
380 | */ | ||
381 | static const struct driver_info qmi_wwan_sierra = { | ||
382 | .description = "Sierra Wireless wwan/QMI device", | ||
383 | .flags = FLAG_WWAN, | ||
384 | .bind = qmi_wwan_bind_gobi, | ||
385 | .unbind = qmi_wwan_unbind_shared, | ||
386 | .manage_power = qmi_wwan_manage_power, | ||
387 | .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | ||
388 | }; | ||
368 | 389 | ||
369 | #define HUAWEI_VENDOR_ID 0x12D1 | 390 | #define HUAWEI_VENDOR_ID 0x12D1 |
370 | #define QMI_GOBI_DEVICE(vend, prod) \ | 391 | #define QMI_GOBI_DEVICE(vend, prod) \ |
@@ -445,6 +466,15 @@ static const struct usb_device_id products[] = { | |||
445 | .bInterfaceProtocol = 0xff, | 466 | .bInterfaceProtocol = 0xff, |
446 | .driver_info = (unsigned long)&qmi_wwan_force_int4, | 467 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
447 | }, | 468 | }, |
469 | { /* Sierra Wireless MC77xx in QMI mode */ | ||
470 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | ||
471 | .idVendor = 0x1199, | ||
472 | .idProduct = 0x68a2, | ||
473 | .bInterfaceClass = 0xff, | ||
474 | .bInterfaceSubClass = 0xff, | ||
475 | .bInterfaceProtocol = 0xff, | ||
476 | .driver_info = (unsigned long)&qmi_wwan_sierra, | ||
477 | }, | ||
448 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 478 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
449 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 479 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
450 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ | 480 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 187d01ccb973..a2349483cd2a 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -1051,6 +1051,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1051 | dev->net->ethtool_ops = &smsc75xx_ethtool_ops; | 1051 | dev->net->ethtool_ops = &smsc75xx_ethtool_ops; |
1052 | dev->net->flags |= IFF_MULTICAST; | 1052 | dev->net->flags |= IFF_MULTICAST; |
1053 | dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD; | 1053 | dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD; |
1054 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | ||
1054 | return 0; | 1055 | return 0; |
1055 | } | 1056 | } |
1056 | 1057 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 4de2760c5937..af8acc85f4bb 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -626,16 +626,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
626 | /* This can happen with OOM and indirect buffers. */ | 626 | /* This can happen with OOM and indirect buffers. */ |
627 | if (unlikely(capacity < 0)) { | 627 | if (unlikely(capacity < 0)) { |
628 | if (likely(capacity == -ENOMEM)) { | 628 | if (likely(capacity == -ENOMEM)) { |
629 | if (net_ratelimit()) { | 629 | if (net_ratelimit()) |
630 | dev_warn(&dev->dev, | 630 | dev_warn(&dev->dev, |
631 | "TX queue failure: out of memory\n"); | 631 | "TX queue failure: out of memory\n"); |
632 | } else { | 632 | } else { |
633 | dev->stats.tx_fifo_errors++; | 633 | dev->stats.tx_fifo_errors++; |
634 | if (net_ratelimit()) | 634 | if (net_ratelimit()) |
635 | dev_warn(&dev->dev, | 635 | dev_warn(&dev->dev, |
636 | "Unexpected TX queue failure: %d\n", | 636 | "Unexpected TX queue failure: %d\n", |
637 | capacity); | 637 | capacity); |
638 | } | ||
639 | } | 638 | } |
640 | dev->stats.tx_dropped++; | 639 | dev->stats.tx_dropped++; |
641 | kfree_skb(skb); | 640 | kfree_skb(skb); |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index ebb9f24eefb5..1a623183cbe5 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -2483,6 +2483,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2483 | pr_err("Control memory remap failed\n"); | 2483 | pr_err("Control memory remap failed\n"); |
2484 | pci_release_regions(pdev); | 2484 | pci_release_regions(pdev); |
2485 | pci_disable_device(pdev); | 2485 | pci_disable_device(pdev); |
2486 | iounmap(card->mem); | ||
2486 | kfree(card); | 2487 | kfree(card); |
2487 | return -ENODEV; | 2488 | return -ENODEV; |
2488 | } | 2489 | } |
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index 8faa129da5a0..8c50d9d19d78 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/nl80211.h> | 19 | #include <linux/nl80211.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/etherdevice.h> | 21 | #include <linux/etherdevice.h> |
22 | #include <linux/export.h> | ||
22 | #include <ar231x_platform.h> | 23 | #include <ar231x_platform.h> |
23 | #include "ath5k.h" | 24 | #include "ath5k.h" |
24 | #include "debug.h" | 25 | #include "debug.h" |
@@ -119,7 +120,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
119 | if (res == NULL) { | 120 | if (res == NULL) { |
120 | dev_err(&pdev->dev, "no IRQ resource found\n"); | 121 | dev_err(&pdev->dev, "no IRQ resource found\n"); |
121 | ret = -ENXIO; | 122 | ret = -ENXIO; |
122 | goto err_out; | 123 | goto err_iounmap; |
123 | } | 124 | } |
124 | 125 | ||
125 | irq = res->start; | 126 | irq = res->start; |
@@ -128,7 +129,7 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
128 | if (hw == NULL) { | 129 | if (hw == NULL) { |
129 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); | 130 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); |
130 | ret = -ENOMEM; | 131 | ret = -ENOMEM; |
131 | goto err_out; | 132 | goto err_iounmap; |
132 | } | 133 | } |
133 | 134 | ||
134 | ah = hw->priv; | 135 | ah = hw->priv; |
@@ -185,6 +186,8 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
185 | err_free_hw: | 186 | err_free_hw: |
186 | ieee80211_free_hw(hw); | 187 | ieee80211_free_hw(hw); |
187 | platform_set_drvdata(pdev, NULL); | 188 | platform_set_drvdata(pdev, NULL); |
189 | err_iounmap: | ||
190 | iounmap(mem); | ||
188 | err_out: | 191 | err_out: |
189 | return ret; | 192 | return ret; |
190 | } | 193 | } |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 215eb2536b1e..798ea57252b4 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -118,15 +118,13 @@ void ath9k_ps_restore(struct ath_softc *sc) | |||
118 | if (--sc->ps_usecount != 0) | 118 | if (--sc->ps_usecount != 0) |
119 | goto unlock; | 119 | goto unlock; |
120 | 120 | ||
121 | if (sc->ps_flags & PS_WAIT_FOR_TX_ACK) | 121 | if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK)) |
122 | goto unlock; | ||
123 | |||
124 | if (sc->ps_idle) | ||
125 | mode = ATH9K_PM_FULL_SLEEP; | 122 | mode = ATH9K_PM_FULL_SLEEP; |
126 | else if (sc->ps_enabled && | 123 | else if (sc->ps_enabled && |
127 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | 124 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | |
128 | PS_WAIT_FOR_CAB | | 125 | PS_WAIT_FOR_CAB | |
129 | PS_WAIT_FOR_PSPOLL_DATA))) | 126 | PS_WAIT_FOR_PSPOLL_DATA | |
127 | PS_WAIT_FOR_TX_ACK))) | ||
130 | mode = ATH9K_PM_NETWORK_SLEEP; | 128 | mode = ATH9K_PM_NETWORK_SLEEP; |
131 | else | 129 | else |
132 | goto unlock; | 130 | goto unlock; |
@@ -1550,6 +1548,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1550 | struct ath_hw *ah = sc->sc_ah; | 1548 | struct ath_hw *ah = sc->sc_ah; |
1551 | struct ath_common *common = ath9k_hw_common(ah); | 1549 | struct ath_common *common = ath9k_hw_common(ah); |
1552 | struct ieee80211_conf *conf = &hw->conf; | 1550 | struct ieee80211_conf *conf = &hw->conf; |
1551 | bool reset_channel = false; | ||
1553 | 1552 | ||
1554 | ath9k_ps_wakeup(sc); | 1553 | ath9k_ps_wakeup(sc); |
1555 | mutex_lock(&sc->mutex); | 1554 | mutex_lock(&sc->mutex); |
@@ -1558,6 +1557,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1558 | sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); | 1557 | sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); |
1559 | if (sc->ps_idle) | 1558 | if (sc->ps_idle) |
1560 | ath_cancel_work(sc); | 1559 | ath_cancel_work(sc); |
1560 | else | ||
1561 | /* | ||
1562 | * The chip needs a reset to properly wake up from | ||
1563 | * full sleep | ||
1564 | */ | ||
1565 | reset_channel = ah->chip_fullsleep; | ||
1561 | } | 1566 | } |
1562 | 1567 | ||
1563 | /* | 1568 | /* |
@@ -1586,7 +1591,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1586 | } | 1591 | } |
1587 | } | 1592 | } |
1588 | 1593 | ||
1589 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | 1594 | if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { |
1590 | struct ieee80211_channel *curchan = hw->conf.channel; | 1595 | struct ieee80211_channel *curchan = hw->conf.channel; |
1591 | int pos = curchan->hw_value; | 1596 | int pos = curchan->hw_value; |
1592 | int old_pos = -1; | 1597 | int old_pos = -1; |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 834e6bc45e8b..23eaa1b26ebe 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1820,6 +1820,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | |||
1820 | struct ath_frame_info *fi = get_frame_info(skb); | 1820 | struct ath_frame_info *fi = get_frame_info(skb); |
1821 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1821 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1822 | struct ath_buf *bf; | 1822 | struct ath_buf *bf; |
1823 | int fragno; | ||
1823 | u16 seqno; | 1824 | u16 seqno; |
1824 | 1825 | ||
1825 | bf = ath_tx_get_buffer(sc); | 1826 | bf = ath_tx_get_buffer(sc); |
@@ -1831,9 +1832,16 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, | |||
1831 | ATH_TXBUF_RESET(bf); | 1832 | ATH_TXBUF_RESET(bf); |
1832 | 1833 | ||
1833 | if (tid) { | 1834 | if (tid) { |
1835 | fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; | ||
1834 | seqno = tid->seq_next; | 1836 | seqno = tid->seq_next; |
1835 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); | 1837 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); |
1836 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | 1838 | |
1839 | if (fragno) | ||
1840 | hdr->seq_ctrl |= cpu_to_le16(fragno); | ||
1841 | |||
1842 | if (!ieee80211_has_morefrags(hdr->frame_control)) | ||
1843 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | ||
1844 | |||
1837 | bf->bf_state.seqno = seqno; | 1845 | bf->bf_state.seqno = seqno; |
1838 | } | 1846 | } |
1839 | 1847 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 231ddf4a674f..7083db75b00c 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -7614,6 +7614,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, | |||
7614 | { | 7614 | { |
7615 | int len_mpdu; | 7615 | int len_mpdu; |
7616 | struct ieee80211_rx_status rx_status; | 7616 | struct ieee80211_rx_status rx_status; |
7617 | struct ieee80211_hdr *hdr; | ||
7617 | 7618 | ||
7618 | memset(&rx_status, 0, sizeof(rx_status)); | 7619 | memset(&rx_status, 0, sizeof(rx_status)); |
7619 | prep_mac80211_status(wlc, rxh, p, &rx_status); | 7620 | prep_mac80211_status(wlc, rxh, p, &rx_status); |
@@ -7623,6 +7624,13 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, | |||
7623 | skb_pull(p, D11_PHY_HDR_LEN); | 7624 | skb_pull(p, D11_PHY_HDR_LEN); |
7624 | __skb_trim(p, len_mpdu); | 7625 | __skb_trim(p, len_mpdu); |
7625 | 7626 | ||
7627 | /* unmute transmit */ | ||
7628 | if (wlc->hw->suspended_fifos) { | ||
7629 | hdr = (struct ieee80211_hdr *)p->data; | ||
7630 | if (ieee80211_is_beacon(hdr->frame_control)) | ||
7631 | brcms_b_mute(wlc->hw, false); | ||
7632 | } | ||
7633 | |||
7626 | memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status)); | 7634 | memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status)); |
7627 | ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); | 7635 | ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); |
7628 | } | 7636 | } |
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 3fa1ecebadfd..2fa879b015b6 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -103,7 +103,7 @@ static const u32 cipher_suites[] = { | |||
103 | * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 | 103 | * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 |
104 | * in the firmware spec | 104 | * in the firmware spec |
105 | */ | 105 | */ |
106 | static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type) | 106 | static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type) |
107 | { | 107 | { |
108 | int ret = -ENOTSUPP; | 108 | int ret = -ENOTSUPP; |
109 | 109 | ||
@@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1411 | goto done; | 1411 | goto done; |
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | lbs_set_authtype(priv, sme); | 1414 | ret = lbs_set_authtype(priv, sme); |
1415 | if (ret == -ENOTSUPP) { | ||
1416 | wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type); | ||
1417 | goto done; | ||
1418 | } | ||
1419 | |||
1415 | lbs_set_radio(priv, preamble, 1); | 1420 | lbs_set_radio(priv, preamble, 1); |
1416 | 1421 | ||
1417 | /* Do the actual association */ | 1422 | /* Do the actual association */ |
diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h index 445ff21772e2..2f218f9a3fd3 100644 --- a/drivers/net/wireless/mwifiex/pcie.h +++ b/drivers/net/wireless/mwifiex/pcie.h | |||
@@ -48,15 +48,15 @@ | |||
48 | #define PCIE_HOST_INT_STATUS_MASK 0xC3C | 48 | #define PCIE_HOST_INT_STATUS_MASK 0xC3C |
49 | #define PCIE_SCRATCH_2_REG 0xC40 | 49 | #define PCIE_SCRATCH_2_REG 0xC40 |
50 | #define PCIE_SCRATCH_3_REG 0xC44 | 50 | #define PCIE_SCRATCH_3_REG 0xC44 |
51 | #define PCIE_SCRATCH_4_REG 0xCC0 | 51 | #define PCIE_SCRATCH_4_REG 0xCD0 |
52 | #define PCIE_SCRATCH_5_REG 0xCC4 | 52 | #define PCIE_SCRATCH_5_REG 0xCD4 |
53 | #define PCIE_SCRATCH_6_REG 0xCC8 | 53 | #define PCIE_SCRATCH_6_REG 0xCD8 |
54 | #define PCIE_SCRATCH_7_REG 0xCCC | 54 | #define PCIE_SCRATCH_7_REG 0xCDC |
55 | #define PCIE_SCRATCH_8_REG 0xCD0 | 55 | #define PCIE_SCRATCH_8_REG 0xCE0 |
56 | #define PCIE_SCRATCH_9_REG 0xCD4 | 56 | #define PCIE_SCRATCH_9_REG 0xCE4 |
57 | #define PCIE_SCRATCH_10_REG 0xCD8 | 57 | #define PCIE_SCRATCH_10_REG 0xCE8 |
58 | #define PCIE_SCRATCH_11_REG 0xCDC | 58 | #define PCIE_SCRATCH_11_REG 0xCEC |
59 | #define PCIE_SCRATCH_12_REG 0xCE0 | 59 | #define PCIE_SCRATCH_12_REG 0xCF0 |
60 | 60 | ||
61 | #define CPU_INTR_DNLD_RDY BIT(0) | 61 | #define CPU_INTR_DNLD_RDY BIT(0) |
62 | #define CPU_INTR_DOOR_BELL BIT(1) | 62 | #define CPU_INTR_DOOR_BELL BIT(1) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index fc9901e027c1..90cc5e772650 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1062,11 +1062,6 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) | |||
1062 | 1062 | ||
1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); | 1063 | set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); |
1064 | 1064 | ||
1065 | /* | ||
1066 | * Register the extra components. | ||
1067 | */ | ||
1068 | rt2x00rfkill_register(rt2x00dev); | ||
1069 | |||
1070 | return 0; | 1065 | return 0; |
1071 | } | 1066 | } |
1072 | 1067 | ||
@@ -1210,6 +1205,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) | |||
1210 | rt2x00link_register(rt2x00dev); | 1205 | rt2x00link_register(rt2x00dev); |
1211 | rt2x00leds_register(rt2x00dev); | 1206 | rt2x00leds_register(rt2x00dev); |
1212 | rt2x00debug_register(rt2x00dev); | 1207 | rt2x00debug_register(rt2x00dev); |
1208 | rt2x00rfkill_register(rt2x00dev); | ||
1213 | 1209 | ||
1214 | return 0; | 1210 | return 0; |
1215 | 1211 | ||
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 510023554e5f..e54488db0e10 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -838,7 +838,10 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw, | |||
838 | __le16 fc = hdr->frame_control; | 838 | __le16 fc = hdr->frame_control; |
839 | 839 | ||
840 | txrate = ieee80211_get_tx_rate(hw, info); | 840 | txrate = ieee80211_get_tx_rate(hw, info); |
841 | tcb_desc->hw_rate = txrate->hw_value; | 841 | if (txrate) |
842 | tcb_desc->hw_rate = txrate->hw_value; | ||
843 | else | ||
844 | tcb_desc->hw_rate = 0; | ||
842 | 845 | ||
843 | if (ieee80211_is_data(fc)) { | 846 | if (ieee80211_is_data(fc)) { |
844 | /* | 847 | /* |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 07dd38efe62a..288b035a3579 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -912,8 +912,13 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); | 912 | memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); |
913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 913 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
914 | pskb = __skb_dequeue(&ring->queue); | 914 | pskb = __skb_dequeue(&ring->queue); |
915 | if (pskb) | 915 | if (pskb) { |
916 | struct rtl_tx_desc *entry = &ring->desc[ring->idx]; | ||
917 | pci_unmap_single(rtlpci->pdev, rtlpriv->cfg->ops->get_desc( | ||
918 | (u8 *) entry, true, HW_DESC_TXBUFF_ADDR), | ||
919 | pskb->len, PCI_DMA_TODEVICE); | ||
916 | kfree_skb(pskb); | 920 | kfree_skb(pskb); |
921 | } | ||
917 | 922 | ||
918 | /*NB: the beacon data buffer must be 32-bit aligned. */ | 923 | /*NB: the beacon data buffer must be 32-bit aligned. */ |
919 | pskb = ieee80211_beacon_get(hw, mac->vif); | 924 | pskb = ieee80211_beacon_get(hw, mac->vif); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 4898c502974d..480862c07f92 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -91,7 +91,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
91 | u8 tid; | 91 | u8 tid; |
92 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 92 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
94 | static int header_print; | ||
95 | 94 | ||
96 | rtlpriv->dm.dm_initialgain_enable = true; | 95 | rtlpriv->dm.dm_initialgain_enable = true; |
97 | rtlpriv->dm.dm_flag = 0; | 96 | rtlpriv->dm.dm_flag = 0; |
@@ -171,10 +170,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
171 | for (tid = 0; tid < 8; tid++) | 170 | for (tid = 0; tid < 8; tid++) |
172 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); | 171 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); |
173 | 172 | ||
174 | /* Only load firmware for first MAC */ | ||
175 | if (header_print) | ||
176 | return 0; | ||
177 | |||
178 | /* for firmware buf */ | 173 | /* for firmware buf */ |
179 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); | 174 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); |
180 | if (!rtlpriv->rtlhal.pfirmware) { | 175 | if (!rtlpriv->rtlhal.pfirmware) { |
@@ -186,7 +181,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
186 | rtlpriv->max_fw_size = 0x8000; | 181 | rtlpriv->max_fw_size = 0x8000; |
187 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); | 182 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); |
188 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); | 183 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); |
189 | header_print++; | ||
190 | 184 | ||
191 | /* request fw */ | 185 | /* request fw */ |
192 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, | 186 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 2e1e352864bb..d04dbda13f5a 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -124,46 +124,38 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, | |||
124 | return status; | 124 | return status; |
125 | } | 125 | } |
126 | 126 | ||
127 | static u32 _usb_read_sync(struct usb_device *udev, u32 addr, u16 len) | 127 | static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len) |
128 | { | 128 | { |
129 | struct device *dev = rtlpriv->io.dev; | ||
130 | struct usb_device *udev = to_usb_device(dev); | ||
129 | u8 request; | 131 | u8 request; |
130 | u16 wvalue; | 132 | u16 wvalue; |
131 | u16 index; | 133 | u16 index; |
132 | u32 *data; | 134 | __le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index]; |
133 | u32 ret; | ||
134 | 135 | ||
135 | data = kmalloc(sizeof(u32), GFP_KERNEL); | ||
136 | if (!data) | ||
137 | return -ENOMEM; | ||
138 | request = REALTEK_USB_VENQT_CMD_REQ; | 136 | request = REALTEK_USB_VENQT_CMD_REQ; |
139 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ | 137 | index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */ |
140 | 138 | ||
141 | wvalue = (u16)addr; | 139 | wvalue = (u16)addr; |
142 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); | 140 | _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len); |
143 | ret = le32_to_cpu(*data); | 141 | if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT) |
144 | kfree(data); | 142 | rtlpriv->usb_data_index = 0; |
145 | return ret; | 143 | return le32_to_cpu(*data); |
146 | } | 144 | } |
147 | 145 | ||
148 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) | 146 | static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) |
149 | { | 147 | { |
150 | struct device *dev = rtlpriv->io.dev; | 148 | return (u8)_usb_read_sync(rtlpriv, addr, 1); |
151 | |||
152 | return (u8)_usb_read_sync(to_usb_device(dev), addr, 1); | ||
153 | } | 149 | } |
154 | 150 | ||
155 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) | 151 | static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) |
156 | { | 152 | { |
157 | struct device *dev = rtlpriv->io.dev; | 153 | return (u16)_usb_read_sync(rtlpriv, addr, 2); |
158 | |||
159 | return (u16)_usb_read_sync(to_usb_device(dev), addr, 2); | ||
160 | } | 154 | } |
161 | 155 | ||
162 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) | 156 | static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) |
163 | { | 157 | { |
164 | struct device *dev = rtlpriv->io.dev; | 158 | return _usb_read_sync(rtlpriv, addr, 4); |
165 | |||
166 | return _usb_read_sync(to_usb_device(dev), addr, 4); | ||
167 | } | 159 | } |
168 | 160 | ||
169 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, | 161 | static void _usb_write_async(struct usb_device *udev, u32 addr, u32 val, |
@@ -955,6 +947,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
955 | return -ENOMEM; | 947 | return -ENOMEM; |
956 | } | 948 | } |
957 | rtlpriv = hw->priv; | 949 | rtlpriv = hw->priv; |
950 | rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32), | ||
951 | GFP_KERNEL); | ||
952 | if (!rtlpriv->usb_data) | ||
953 | return -ENOMEM; | ||
954 | rtlpriv->usb_data_index = 0; | ||
958 | init_completion(&rtlpriv->firmware_loading_complete); | 955 | init_completion(&rtlpriv->firmware_loading_complete); |
959 | SET_IEEE80211_DEV(hw, &intf->dev); | 956 | SET_IEEE80211_DEV(hw, &intf->dev); |
960 | udev = interface_to_usbdev(intf); | 957 | udev = interface_to_usbdev(intf); |
@@ -1025,6 +1022,7 @@ void rtl_usb_disconnect(struct usb_interface *intf) | |||
1025 | /* rtl_deinit_rfkill(hw); */ | 1022 | /* rtl_deinit_rfkill(hw); */ |
1026 | rtl_usb_deinit(hw); | 1023 | rtl_usb_deinit(hw); |
1027 | rtl_deinit_core(hw); | 1024 | rtl_deinit_core(hw); |
1025 | kfree(rtlpriv->usb_data); | ||
1028 | rtlpriv->cfg->ops->deinit_sw_leds(hw); | 1026 | rtlpriv->cfg->ops->deinit_sw_leds(hw); |
1029 | rtlpriv->cfg->ops->deinit_sw_vars(hw); | 1027 | rtlpriv->cfg->ops->deinit_sw_vars(hw); |
1030 | _rtl_usb_io_handler_release(hw); | 1028 | _rtl_usb_io_handler_release(hw); |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index b591614c3b9b..28ebc69218a3 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -67,7 +67,7 @@ | |||
67 | #define QOS_QUEUE_NUM 4 | 67 | #define QOS_QUEUE_NUM 4 |
68 | #define RTL_MAC80211_NUM_QUEUE 5 | 68 | #define RTL_MAC80211_NUM_QUEUE 5 |
69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 | 69 | #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 |
70 | 70 | #define RTL_USB_MAX_RX_COUNT 100 | |
71 | #define QBSS_LOAD_SIZE 5 | 71 | #define QBSS_LOAD_SIZE 5 |
72 | #define MAX_WMMELE_LENGTH 64 | 72 | #define MAX_WMMELE_LENGTH 64 |
73 | 73 | ||
@@ -1629,6 +1629,10 @@ struct rtl_priv { | |||
1629 | interface or hardware */ | 1629 | interface or hardware */ |
1630 | unsigned long status; | 1630 | unsigned long status; |
1631 | 1631 | ||
1632 | /* data buffer pointer for USB reads */ | ||
1633 | __le32 *usb_data; | ||
1634 | int usb_data_index; | ||
1635 | |||
1632 | /*This must be the last item so | 1636 | /*This must be the last item so |
1633 | that it points to the data allocated | 1637 | that it points to the data allocated |
1634 | beyond this structure like: | 1638 | beyond this structure like: |