diff options
48 files changed, 498 insertions, 263 deletions
diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig index 7ffc756131a2..547098086773 100644 --- a/drivers/net/caif/Kconfig +++ b/drivers/net/caif/Kconfig | |||
@@ -43,7 +43,7 @@ config CAIF_HSI | |||
43 | 43 | ||
44 | config CAIF_VIRTIO | 44 | config CAIF_VIRTIO |
45 | tristate "CAIF virtio transport driver" | 45 | tristate "CAIF virtio transport driver" |
46 | depends on CAIF | 46 | depends on CAIF && HAS_DMA |
47 | select VHOST_RING | 47 | select VHOST_RING |
48 | select VIRTIO | 48 | select VIRTIO |
49 | select GENERIC_ALLOCATOR | 49 | select GENERIC_ALLOCATOR |
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index de570a8f8967..072c6f14e8fc 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c | |||
@@ -632,7 +632,6 @@ struct vortex_private { | |||
632 | pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */ | 632 | pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */ |
633 | open:1, | 633 | open:1, |
634 | medialock:1, | 634 | medialock:1, |
635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ | ||
636 | large_frames:1, /* accept large frames */ | 635 | large_frames:1, /* accept large frames */ |
637 | handling_irq:1; /* private in_irq indicator */ | 636 | handling_irq:1; /* private in_irq indicator */ |
638 | /* {get|set}_wol operations are already serialized by rtnl. | 637 | /* {get|set}_wol operations are already serialized by rtnl. |
@@ -1012,6 +1011,12 @@ static int vortex_init_one(struct pci_dev *pdev, | |||
1012 | if (rc < 0) | 1011 | if (rc < 0) |
1013 | goto out; | 1012 | goto out; |
1014 | 1013 | ||
1014 | rc = pci_request_regions(pdev, DRV_NAME); | ||
1015 | if (rc < 0) { | ||
1016 | pci_disable_device(pdev); | ||
1017 | goto out; | ||
1018 | } | ||
1019 | |||
1015 | unit = vortex_cards_found; | 1020 | unit = vortex_cards_found; |
1016 | 1021 | ||
1017 | if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) { | 1022 | if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) { |
@@ -1027,6 +1032,7 @@ static int vortex_init_one(struct pci_dev *pdev, | |||
1027 | if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ | 1032 | if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ |
1028 | ioaddr = pci_iomap(pdev, 0, 0); | 1033 | ioaddr = pci_iomap(pdev, 0, 0); |
1029 | if (!ioaddr) { | 1034 | if (!ioaddr) { |
1035 | pci_release_regions(pdev); | ||
1030 | pci_disable_device(pdev); | 1036 | pci_disable_device(pdev); |
1031 | rc = -ENOMEM; | 1037 | rc = -ENOMEM; |
1032 | goto out; | 1038 | goto out; |
@@ -1036,6 +1042,7 @@ static int vortex_init_one(struct pci_dev *pdev, | |||
1036 | ent->driver_data, unit); | 1042 | ent->driver_data, unit); |
1037 | if (rc < 0) { | 1043 | if (rc < 0) { |
1038 | pci_iounmap(pdev, ioaddr); | 1044 | pci_iounmap(pdev, ioaddr); |
1045 | pci_release_regions(pdev); | ||
1039 | pci_disable_device(pdev); | 1046 | pci_disable_device(pdev); |
1040 | goto out; | 1047 | goto out; |
1041 | } | 1048 | } |
@@ -1178,11 +1185,6 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq, | |||
1178 | 1185 | ||
1179 | /* PCI-only startup logic */ | 1186 | /* PCI-only startup logic */ |
1180 | if (pdev) { | 1187 | if (pdev) { |
1181 | /* EISA resources already marked, so only PCI needs to do this here */ | ||
1182 | /* Ignore return value, because Cardbus drivers already allocate for us */ | ||
1183 | if (request_region(dev->base_addr, vci->io_size, print_name) != NULL) | ||
1184 | vp->must_free_region = 1; | ||
1185 | |||
1186 | /* enable bus-mastering if necessary */ | 1188 | /* enable bus-mastering if necessary */ |
1187 | if (vci->flags & PCI_USES_MASTER) | 1189 | if (vci->flags & PCI_USES_MASTER) |
1188 | pci_set_master(pdev); | 1190 | pci_set_master(pdev); |
@@ -1220,7 +1222,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq, | |||
1220 | &vp->rx_ring_dma); | 1222 | &vp->rx_ring_dma); |
1221 | retval = -ENOMEM; | 1223 | retval = -ENOMEM; |
1222 | if (!vp->rx_ring) | 1224 | if (!vp->rx_ring) |
1223 | goto free_region; | 1225 | goto free_device; |
1224 | 1226 | ||
1225 | vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE); | 1227 | vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE); |
1226 | vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE; | 1228 | vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE; |
@@ -1484,9 +1486,7 @@ free_ring: | |||
1484 | + sizeof(struct boom_tx_desc) * TX_RING_SIZE, | 1486 | + sizeof(struct boom_tx_desc) * TX_RING_SIZE, |
1485 | vp->rx_ring, | 1487 | vp->rx_ring, |
1486 | vp->rx_ring_dma); | 1488 | vp->rx_ring_dma); |
1487 | free_region: | 1489 | free_device: |
1488 | if (vp->must_free_region) | ||
1489 | release_region(dev->base_addr, vci->io_size); | ||
1490 | free_netdev(dev); | 1490 | free_netdev(dev); |
1491 | pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval); | 1491 | pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval); |
1492 | out: | 1492 | out: |
@@ -3254,8 +3254,9 @@ static void vortex_remove_one(struct pci_dev *pdev) | |||
3254 | + sizeof(struct boom_tx_desc) * TX_RING_SIZE, | 3254 | + sizeof(struct boom_tx_desc) * TX_RING_SIZE, |
3255 | vp->rx_ring, | 3255 | vp->rx_ring, |
3256 | vp->rx_ring_dma); | 3256 | vp->rx_ring_dma); |
3257 | if (vp->must_free_region) | 3257 | |
3258 | release_region(dev->base_addr, vp->io_size); | 3258 | pci_release_regions(pdev); |
3259 | |||
3259 | free_netdev(dev); | 3260 | free_netdev(dev); |
3260 | } | 3261 | } |
3261 | 3262 | ||
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index ce4a030d3d0c..07f7ef05c3f2 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c | |||
@@ -3236,9 +3236,10 @@ bnad_init(struct bnad *bnad, | |||
3236 | 3236 | ||
3237 | sprintf(bnad->wq_name, "%s_wq_%d", BNAD_NAME, bnad->id); | 3237 | sprintf(bnad->wq_name, "%s_wq_%d", BNAD_NAME, bnad->id); |
3238 | bnad->work_q = create_singlethread_workqueue(bnad->wq_name); | 3238 | bnad->work_q = create_singlethread_workqueue(bnad->wq_name); |
3239 | 3239 | if (!bnad->work_q) { | |
3240 | if (!bnad->work_q) | 3240 | iounmap(bnad->bar0); |
3241 | return -ENOMEM; | 3241 | return -ENOMEM; |
3242 | } | ||
3242 | 3243 | ||
3243 | return 0; | 3244 | return 0; |
3244 | } | 3245 | } |
diff --git a/drivers/net/ethernet/cadence/Kconfig b/drivers/net/ethernet/cadence/Kconfig index 1194446f859a..768285ec10f4 100644 --- a/drivers/net/ethernet/cadence/Kconfig +++ b/drivers/net/ethernet/cadence/Kconfig | |||
@@ -22,7 +22,7 @@ if NET_CADENCE | |||
22 | 22 | ||
23 | config ARM_AT91_ETHER | 23 | config ARM_AT91_ETHER |
24 | tristate "AT91RM9200 Ethernet support" | 24 | tristate "AT91RM9200 Ethernet support" |
25 | depends on GENERIC_HARDIRQS | 25 | depends on GENERIC_HARDIRQS && HAS_DMA |
26 | select NET_CORE | 26 | select NET_CORE |
27 | select MACB | 27 | select MACB |
28 | ---help--- | 28 | ---help--- |
@@ -31,6 +31,7 @@ config ARM_AT91_ETHER | |||
31 | 31 | ||
32 | config MACB | 32 | config MACB |
33 | tristate "Cadence MACB/GEM support" | 33 | tristate "Cadence MACB/GEM support" |
34 | depends on HAS_DMA | ||
34 | select PHYLIB | 35 | select PHYLIB |
35 | ---help--- | 36 | ---help--- |
36 | The Cadence MACB ethernet interface is found on many Atmel AT32 and | 37 | The Cadence MACB ethernet interface is found on many Atmel AT32 and |
diff --git a/drivers/net/ethernet/calxeda/Kconfig b/drivers/net/ethernet/calxeda/Kconfig index aba435c3d4ae..184a063bed5f 100644 --- a/drivers/net/ethernet/calxeda/Kconfig +++ b/drivers/net/ethernet/calxeda/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config NET_CALXEDA_XGMAC | 1 | config NET_CALXEDA_XGMAC |
2 | tristate "Calxeda 1G/10G XGMAC Ethernet driver" | 2 | tristate "Calxeda 1G/10G XGMAC Ethernet driver" |
3 | depends on HAS_IOMEM | 3 | depends on HAS_IOMEM && HAS_DMA |
4 | select CRC32 | 4 | select CRC32 |
5 | help | 5 | help |
6 | This is the driver for the XGMAC Ethernet IP block found on Calxeda | 6 | This is the driver for the XGMAC Ethernet IP block found on Calxeda |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index aff0310a778b..ca9825ca88c9 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -87,6 +87,8 @@ | |||
87 | #define FEC_QUIRK_HAS_GBIT (1 << 3) | 87 | #define FEC_QUIRK_HAS_GBIT (1 << 3) |
88 | /* Controller has extend desc buffer */ | 88 | /* Controller has extend desc buffer */ |
89 | #define FEC_QUIRK_HAS_BUFDESC_EX (1 << 4) | 89 | #define FEC_QUIRK_HAS_BUFDESC_EX (1 << 4) |
90 | /* Controller has hardware checksum support */ | ||
91 | #define FEC_QUIRK_HAS_CSUM (1 << 5) | ||
90 | 92 | ||
91 | static struct platform_device_id fec_devtype[] = { | 93 | static struct platform_device_id fec_devtype[] = { |
92 | { | 94 | { |
@@ -105,7 +107,7 @@ static struct platform_device_id fec_devtype[] = { | |||
105 | }, { | 107 | }, { |
106 | .name = "imx6q-fec", | 108 | .name = "imx6q-fec", |
107 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | | 109 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | |
108 | FEC_QUIRK_HAS_BUFDESC_EX, | 110 | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM, |
109 | }, { | 111 | }, { |
110 | .name = "mvf-fec", | 112 | .name = "mvf-fec", |
111 | .driver_data = FEC_QUIRK_ENET_MAC, | 113 | .driver_data = FEC_QUIRK_ENET_MAC, |
@@ -1744,6 +1746,8 @@ static const struct net_device_ops fec_netdev_ops = { | |||
1744 | static int fec_enet_init(struct net_device *ndev) | 1746 | static int fec_enet_init(struct net_device *ndev) |
1745 | { | 1747 | { |
1746 | struct fec_enet_private *fep = netdev_priv(ndev); | 1748 | struct fec_enet_private *fep = netdev_priv(ndev); |
1749 | const struct platform_device_id *id_entry = | ||
1750 | platform_get_device_id(fep->pdev); | ||
1747 | struct bufdesc *cbd_base; | 1751 | struct bufdesc *cbd_base; |
1748 | 1752 | ||
1749 | /* Allocate memory for buffer descriptors. */ | 1753 | /* Allocate memory for buffer descriptors. */ |
@@ -1775,12 +1779,14 @@ static int fec_enet_init(struct net_device *ndev) | |||
1775 | writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); | 1779 | writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); |
1776 | netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT); | 1780 | netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT); |
1777 | 1781 | ||
1778 | /* enable hw accelerator */ | 1782 | if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) { |
1779 | ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1783 | /* enable hw accelerator */ |
1780 | | NETIF_F_RXCSUM); | 1784 | ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1781 | ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1785 | | NETIF_F_RXCSUM); |
1782 | | NETIF_F_RXCSUM); | 1786 | ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1783 | fep->csum_flags |= FLAG_RX_CSUM_ENABLED; | 1787 | | NETIF_F_RXCSUM); |
1788 | fep->csum_flags |= FLAG_RX_CSUM_ENABLED; | ||
1789 | } | ||
1784 | 1790 | ||
1785 | fec_restart(ndev, 0); | 1791 | fec_restart(ndev, 0); |
1786 | 1792 | ||
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 4989481c19f0..d300a0c0eafc 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c | |||
@@ -359,10 +359,26 @@ static int emac_reset(struct emac_instance *dev) | |||
359 | } | 359 | } |
360 | 360 | ||
361 | #ifdef CONFIG_PPC_DCR_NATIVE | 361 | #ifdef CONFIG_PPC_DCR_NATIVE |
362 | /* Enable internal clock source */ | 362 | /* |
363 | if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) | 363 | * PPC460EX/GT Embedded Processor Advanced User's Manual |
364 | dcri_clrset(SDR0, SDR0_ETH_CFG, | 364 | * section 28.10.1 Mode Register 0 (EMACx_MR0) states: |
365 | 0, SDR0_ETH_CFG_ECS << dev->cell_index); | 365 | * Note: The PHY must provide a TX Clk in order to perform a soft reset |
366 | * of the EMAC. If none is present, select the internal clock | ||
367 | * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1). | ||
368 | * After a soft reset, select the external clock. | ||
369 | */ | ||
370 | if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { | ||
371 | if (dev->phy_address == 0xffffffff && | ||
372 | dev->phy_map == 0xffffffff) { | ||
373 | /* No PHY: select internal loop clock before reset */ | ||
374 | dcri_clrset(SDR0, SDR0_ETH_CFG, | ||
375 | 0, SDR0_ETH_CFG_ECS << dev->cell_index); | ||
376 | } else { | ||
377 | /* PHY present: select external clock before reset */ | ||
378 | dcri_clrset(SDR0, SDR0_ETH_CFG, | ||
379 | SDR0_ETH_CFG_ECS << dev->cell_index, 0); | ||
380 | } | ||
381 | } | ||
366 | #endif | 382 | #endif |
367 | 383 | ||
368 | out_be32(&p->mr0, EMAC_MR0_SRST); | 384 | out_be32(&p->mr0, EMAC_MR0_SRST); |
@@ -370,10 +386,14 @@ static int emac_reset(struct emac_instance *dev) | |||
370 | --n; | 386 | --n; |
371 | 387 | ||
372 | #ifdef CONFIG_PPC_DCR_NATIVE | 388 | #ifdef CONFIG_PPC_DCR_NATIVE |
373 | /* Enable external clock source */ | 389 | if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { |
374 | if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) | 390 | if (dev->phy_address == 0xffffffff && |
375 | dcri_clrset(SDR0, SDR0_ETH_CFG, | 391 | dev->phy_map == 0xffffffff) { |
376 | SDR0_ETH_CFG_ECS << dev->cell_index, 0); | 392 | /* No PHY: restore external clock source after reset */ |
393 | dcri_clrset(SDR0, SDR0_ETH_CFG, | ||
394 | SDR0_ETH_CFG_ECS << dev->cell_index, 0); | ||
395 | } | ||
396 | } | ||
377 | #endif | 397 | #endif |
378 | 398 | ||
379 | if (n) { | 399 | if (n) { |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_resources.c b/drivers/net/ethernet/mellanox/mlx4/en_resources.c index 91f2b2c43c12..d3f508697a3d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_resources.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_resources.c | |||
@@ -60,7 +60,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride, | |||
60 | context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6; | 60 | context->pri_path.sched_queue = 0x83 | (priv->port - 1) << 6; |
61 | if (user_prio >= 0) { | 61 | if (user_prio >= 0) { |
62 | context->pri_path.sched_queue |= user_prio << 3; | 62 | context->pri_path.sched_queue |= user_prio << 3; |
63 | context->pri_path.feup = 1 << 6; | 63 | context->pri_path.feup = MLX4_FEUP_FORCE_ETH_UP; |
64 | } | 64 | } |
65 | context->pri_path.counter_index = 0xff; | 65 | context->pri_path.counter_index = 0xff; |
66 | context->cqn_send = cpu_to_be32(cqn); | 66 | context->cqn_send = cpu_to_be32(cqn); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index b147bdd40768..58a8e535d698 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -131,7 +131,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags) | |||
131 | [2] = "RSS XOR Hash Function support", | 131 | [2] = "RSS XOR Hash Function support", |
132 | [3] = "Device manage flow steering support", | 132 | [3] = "Device manage flow steering support", |
133 | [4] = "Automatic MAC reassignment support", | 133 | [4] = "Automatic MAC reassignment support", |
134 | [5] = "Time stamping support" | 134 | [5] = "Time stamping support", |
135 | [6] = "VST (control vlan insertion/stripping) support", | ||
136 | [7] = "FSM (MAC anti-spoofing) support" | ||
135 | }; | 137 | }; |
136 | int i; | 138 | int i; |
137 | 139 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index e12e0d2e0ee0..1157f028a90f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | |||
@@ -372,24 +372,29 @@ static int update_vport_qp_param(struct mlx4_dev *dev, | |||
372 | if (MLX4_QP_ST_RC == qp_type) | 372 | if (MLX4_QP_ST_RC == qp_type) |
373 | return -EINVAL; | 373 | return -EINVAL; |
374 | 374 | ||
375 | /* force strip vlan by clear vsd */ | ||
376 | qpc->param3 &= ~cpu_to_be32(MLX4_STRIP_VLAN); | ||
377 | if (0 != vp_oper->state.default_vlan) { | ||
378 | qpc->pri_path.vlan_control = | ||
379 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | | ||
380 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED | | ||
381 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED; | ||
382 | } else { /* priority tagged */ | ||
383 | qpc->pri_path.vlan_control = | ||
384 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED | | ||
385 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED; | ||
386 | } | ||
387 | |||
388 | qpc->pri_path.fvl_rx |= MLX4_FVL_RX_FORCE_ETH_VLAN; | ||
375 | qpc->pri_path.vlan_index = vp_oper->vlan_idx; | 389 | qpc->pri_path.vlan_index = vp_oper->vlan_idx; |
376 | qpc->pri_path.fl = (1 << 6) | (1 << 2); /* set cv bit and hide_cqe_vlan bit*/ | 390 | qpc->pri_path.fl |= MLX4_FL_CV | MLX4_FL_ETH_HIDE_CQE_VLAN; |
377 | qpc->pri_path.feup |= 1 << 3; /* set fvl bit */ | 391 | qpc->pri_path.feup |= MLX4_FEUP_FORCE_ETH_UP | MLX4_FVL_FORCE_ETH_VLAN; |
378 | qpc->pri_path.sched_queue &= 0xC7; | 392 | qpc->pri_path.sched_queue &= 0xC7; |
379 | qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3; | 393 | qpc->pri_path.sched_queue |= (vp_oper->state.default_qos) << 3; |
380 | mlx4_dbg(dev, "qp %d port %d Q 0x%x set vlan to %d vidx %d feup %x fl %x\n", | ||
381 | be32_to_cpu(qpc->local_qpn) & 0xffffff, port, | ||
382 | (int)(qpc->pri_path.sched_queue), vp_oper->state.default_vlan, | ||
383 | vp_oper->vlan_idx, (int)(qpc->pri_path.feup), | ||
384 | (int)(qpc->pri_path.fl)); | ||
385 | } | 394 | } |
386 | if (vp_oper->state.spoofchk) { | 395 | if (vp_oper->state.spoofchk) { |
387 | qpc->pri_path.feup |= 1 << 5; /* set fsm bit */; | 396 | qpc->pri_path.feup |= MLX4_FSM_FORCE_ETH_SRC_MAC; |
388 | qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx; | 397 | qpc->pri_path.grh_mylmc = (0x80 & qpc->pri_path.grh_mylmc) + vp_oper->mac_idx; |
389 | mlx4_dbg(dev, "spoof qp %d port %d feup 0x%x, myLmc 0x%x mindx %d\n", | ||
390 | be32_to_cpu(qpc->local_qpn) & 0xffffff, port, | ||
391 | (int)qpc->pri_path.feup, (int)qpc->pri_path.grh_mylmc, | ||
392 | vp_oper->mac_idx); | ||
393 | } | 398 | } |
394 | return 0; | 399 | return 0; |
395 | } | 400 | } |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 90c253b145ef..019c5f78732e 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -429,6 +429,7 @@ struct qlcnic_hardware_context { | |||
429 | 429 | ||
430 | u16 port_type; | 430 | u16 port_type; |
431 | u16 board_type; | 431 | u16 board_type; |
432 | u16 supported_type; | ||
432 | 433 | ||
433 | u16 link_speed; | 434 | u16 link_speed; |
434 | u16 link_duplex; | 435 | u16 link_duplex; |
@@ -1514,6 +1515,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter); | |||
1514 | void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter); | 1515 | void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter); |
1515 | void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter); | 1516 | void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter); |
1516 | void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter); | 1517 | void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter); |
1518 | int qlcnic_82xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *); | ||
1517 | 1519 | ||
1518 | int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32); | 1520 | int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32); |
1519 | int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); | 1521 | int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index ea790a93ee7c..b4ff1e35a11d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -696,15 +696,14 @@ u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *adapter) | |||
696 | return 1; | 696 | return 1; |
697 | } | 697 | } |
698 | 698 | ||
699 | u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *adapter) | 699 | u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *adapter, u32 *wait_time) |
700 | { | 700 | { |
701 | u32 data; | 701 | u32 data; |
702 | unsigned long wait_time = 0; | ||
703 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 702 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
704 | /* wait for mailbox completion */ | 703 | /* wait for mailbox completion */ |
705 | do { | 704 | do { |
706 | data = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); | 705 | data = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); |
707 | if (++wait_time > QLCNIC_MBX_TIMEOUT) { | 706 | if (++(*wait_time) > QLCNIC_MBX_TIMEOUT) { |
708 | data = QLCNIC_RCODE_TIMEOUT; | 707 | data = QLCNIC_RCODE_TIMEOUT; |
709 | break; | 708 | break; |
710 | } | 709 | } |
@@ -720,8 +719,8 @@ int qlcnic_83xx_mbx_op(struct qlcnic_adapter *adapter, | |||
720 | u16 opcode; | 719 | u16 opcode; |
721 | u8 mbx_err_code; | 720 | u8 mbx_err_code; |
722 | unsigned long flags; | 721 | unsigned long flags; |
723 | u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd; | ||
724 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 722 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
723 | u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, wait_time = 0; | ||
725 | 724 | ||
726 | opcode = LSW(cmd->req.arg[0]); | 725 | opcode = LSW(cmd->req.arg[0]); |
727 | if (!test_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status)) { | 726 | if (!test_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status)) { |
@@ -754,15 +753,13 @@ int qlcnic_83xx_mbx_op(struct qlcnic_adapter *adapter, | |||
754 | /* Signal FW about the impending command */ | 753 | /* Signal FW about the impending command */ |
755 | QLCWRX(ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); | 754 | QLCWRX(ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); |
756 | poll: | 755 | poll: |
757 | rsp = qlcnic_83xx_mbx_poll(adapter); | 756 | rsp = qlcnic_83xx_mbx_poll(adapter, &wait_time); |
758 | if (rsp != QLCNIC_RCODE_TIMEOUT) { | 757 | if (rsp != QLCNIC_RCODE_TIMEOUT) { |
759 | /* Get the FW response data */ | 758 | /* Get the FW response data */ |
760 | fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); | 759 | fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); |
761 | if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { | 760 | if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { |
762 | __qlcnic_83xx_process_aen(adapter); | 761 | __qlcnic_83xx_process_aen(adapter); |
763 | mbx_val = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); | 762 | goto poll; |
764 | if (mbx_val) | ||
765 | goto poll; | ||
766 | } | 763 | } |
767 | mbx_err_code = QLCNIC_MBX_STATUS(fw_data); | 764 | mbx_err_code = QLCNIC_MBX_STATUS(fw_data); |
768 | rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); | 765 | rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); |
@@ -1276,11 +1273,13 @@ out: | |||
1276 | return err; | 1273 | return err; |
1277 | } | 1274 | } |
1278 | 1275 | ||
1279 | static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test) | 1276 | static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test, |
1277 | int num_sds_ring) | ||
1280 | { | 1278 | { |
1281 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1279 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1282 | struct qlcnic_host_sds_ring *sds_ring; | 1280 | struct qlcnic_host_sds_ring *sds_ring; |
1283 | struct qlcnic_host_rds_ring *rds_ring; | 1281 | struct qlcnic_host_rds_ring *rds_ring; |
1282 | u16 adapter_state = adapter->is_up; | ||
1284 | u8 ring; | 1283 | u8 ring; |
1285 | int ret; | 1284 | int ret; |
1286 | 1285 | ||
@@ -1304,6 +1303,10 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test) | |||
1304 | ret = qlcnic_fw_create_ctx(adapter); | 1303 | ret = qlcnic_fw_create_ctx(adapter); |
1305 | if (ret) { | 1304 | if (ret) { |
1306 | qlcnic_detach(adapter); | 1305 | qlcnic_detach(adapter); |
1306 | if (adapter_state == QLCNIC_ADAPTER_UP_MAGIC) { | ||
1307 | adapter->max_sds_rings = num_sds_ring; | ||
1308 | qlcnic_attach(adapter); | ||
1309 | } | ||
1307 | netif_device_attach(netdev); | 1310 | netif_device_attach(netdev); |
1308 | return ret; | 1311 | return ret; |
1309 | } | 1312 | } |
@@ -1596,7 +1599,8 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode) | |||
1596 | if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) | 1599 | if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) |
1597 | return -EBUSY; | 1600 | return -EBUSY; |
1598 | 1601 | ||
1599 | ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST); | 1602 | ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST, |
1603 | max_sds_rings); | ||
1600 | if (ret) | 1604 | if (ret) |
1601 | goto fail_diag_alloc; | 1605 | goto fail_diag_alloc; |
1602 | 1606 | ||
@@ -2830,6 +2834,23 @@ int qlcnic_83xx_test_link(struct qlcnic_adapter *adapter) | |||
2830 | break; | 2834 | break; |
2831 | } | 2835 | } |
2832 | config = cmd.rsp.arg[3]; | 2836 | config = cmd.rsp.arg[3]; |
2837 | if (QLC_83XX_SFP_PRESENT(config)) { | ||
2838 | switch (ahw->module_type) { | ||
2839 | case LINKEVENT_MODULE_OPTICAL_UNKNOWN: | ||
2840 | case LINKEVENT_MODULE_OPTICAL_SRLR: | ||
2841 | case LINKEVENT_MODULE_OPTICAL_LRM: | ||
2842 | case LINKEVENT_MODULE_OPTICAL_SFP_1G: | ||
2843 | ahw->supported_type = PORT_FIBRE; | ||
2844 | break; | ||
2845 | case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLE: | ||
2846 | case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLELEN: | ||
2847 | case LINKEVENT_MODULE_TWINAX: | ||
2848 | ahw->supported_type = PORT_TP; | ||
2849 | break; | ||
2850 | default: | ||
2851 | ahw->supported_type = PORT_OTHER; | ||
2852 | } | ||
2853 | } | ||
2833 | if (config & 1) | 2854 | if (config & 1) |
2834 | err = 1; | 2855 | err = 1; |
2835 | } | 2856 | } |
@@ -2838,7 +2859,8 @@ out: | |||
2838 | return config; | 2859 | return config; |
2839 | } | 2860 | } |
2840 | 2861 | ||
2841 | int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter) | 2862 | int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter, |
2863 | struct ethtool_cmd *ecmd) | ||
2842 | { | 2864 | { |
2843 | u32 config = 0; | 2865 | u32 config = 0; |
2844 | int status = 0; | 2866 | int status = 0; |
@@ -2851,6 +2873,54 @@ int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter) | |||
2851 | ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); | 2873 | ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); |
2852 | /* hard code until there is a way to get it from flash */ | 2874 | /* hard code until there is a way to get it from flash */ |
2853 | ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; | 2875 | ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; |
2876 | |||
2877 | if (netif_running(adapter->netdev) && ahw->has_link_events) { | ||
2878 | ethtool_cmd_speed_set(ecmd, ahw->link_speed); | ||
2879 | ecmd->duplex = ahw->link_duplex; | ||
2880 | ecmd->autoneg = ahw->link_autoneg; | ||
2881 | } else { | ||
2882 | ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN); | ||
2883 | ecmd->duplex = DUPLEX_UNKNOWN; | ||
2884 | ecmd->autoneg = AUTONEG_DISABLE; | ||
2885 | } | ||
2886 | |||
2887 | if (ahw->port_type == QLCNIC_XGBE) { | ||
2888 | ecmd->supported = SUPPORTED_1000baseT_Full; | ||
2889 | ecmd->advertising = ADVERTISED_1000baseT_Full; | ||
2890 | } else { | ||
2891 | ecmd->supported = (SUPPORTED_10baseT_Half | | ||
2892 | SUPPORTED_10baseT_Full | | ||
2893 | SUPPORTED_100baseT_Half | | ||
2894 | SUPPORTED_100baseT_Full | | ||
2895 | SUPPORTED_1000baseT_Half | | ||
2896 | SUPPORTED_1000baseT_Full); | ||
2897 | ecmd->advertising = (ADVERTISED_100baseT_Half | | ||
2898 | ADVERTISED_100baseT_Full | | ||
2899 | ADVERTISED_1000baseT_Half | | ||
2900 | ADVERTISED_1000baseT_Full); | ||
2901 | } | ||
2902 | |||
2903 | switch (ahw->supported_type) { | ||
2904 | case PORT_FIBRE: | ||
2905 | ecmd->supported |= SUPPORTED_FIBRE; | ||
2906 | ecmd->advertising |= ADVERTISED_FIBRE; | ||
2907 | ecmd->port = PORT_FIBRE; | ||
2908 | ecmd->transceiver = XCVR_EXTERNAL; | ||
2909 | break; | ||
2910 | case PORT_TP: | ||
2911 | ecmd->supported |= SUPPORTED_TP; | ||
2912 | ecmd->advertising |= ADVERTISED_TP; | ||
2913 | ecmd->port = PORT_TP; | ||
2914 | ecmd->transceiver = XCVR_INTERNAL; | ||
2915 | break; | ||
2916 | default: | ||
2917 | ecmd->supported |= SUPPORTED_FIBRE; | ||
2918 | ecmd->advertising |= ADVERTISED_FIBRE; | ||
2919 | ecmd->port = PORT_OTHER; | ||
2920 | ecmd->transceiver = XCVR_EXTERNAL; | ||
2921 | break; | ||
2922 | } | ||
2923 | ecmd->phy_address = ahw->physical_port; | ||
2854 | return status; | 2924 | return status; |
2855 | } | 2925 | } |
2856 | 2926 | ||
@@ -3046,7 +3116,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev) | |||
3046 | if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) | 3116 | if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) |
3047 | return -EIO; | 3117 | return -EIO; |
3048 | 3118 | ||
3049 | ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST); | 3119 | ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST, |
3120 | max_sds_rings); | ||
3050 | if (ret) | 3121 | if (ret) |
3051 | goto fail_diag_irq; | 3122 | goto fail_diag_irq; |
3052 | 3123 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h index 1f1d85e6f2af..f5db67fc9f55 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | |||
@@ -603,7 +603,7 @@ int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *); | |||
603 | 603 | ||
604 | void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *); | 604 | void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *); |
605 | void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data); | 605 | void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data); |
606 | int qlcnic_83xx_get_settings(struct qlcnic_adapter *); | 606 | int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *); |
607 | int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *); | 607 | int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *); |
608 | void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *, | 608 | void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *, |
609 | struct ethtool_pauseparam *); | 609 | struct ethtool_pauseparam *); |
@@ -620,7 +620,7 @@ int qlcnic_83xx_flash_test(struct qlcnic_adapter *); | |||
620 | int qlcnic_83xx_enable_flash_write(struct qlcnic_adapter *); | 620 | int qlcnic_83xx_enable_flash_write(struct qlcnic_adapter *); |
621 | int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *); | 621 | int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *); |
622 | u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *); | 622 | u32 qlcnic_83xx_mac_rcode(struct qlcnic_adapter *); |
623 | u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *); | 623 | u32 qlcnic_83xx_mbx_poll(struct qlcnic_adapter *, u32 *); |
624 | void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *); | 624 | void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *); |
625 | void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *); | 625 | void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *); |
626 | #endif | 626 | #endif |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index ab1d8d99cbd5..c67d1eb35e8f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -435,10 +435,6 @@ static void qlcnic_83xx_idc_attach_driver(struct qlcnic_adapter *adapter) | |||
435 | } | 435 | } |
436 | done: | 436 | done: |
437 | netif_device_attach(netdev); | 437 | netif_device_attach(netdev); |
438 | if (netif_running(netdev)) { | ||
439 | netif_carrier_on(netdev); | ||
440 | netif_wake_queue(netdev); | ||
441 | } | ||
442 | } | 438 | } |
443 | 439 | ||
444 | static int qlcnic_83xx_idc_enter_failed_state(struct qlcnic_adapter *adapter, | 440 | static int qlcnic_83xx_idc_enter_failed_state(struct qlcnic_adapter *adapter, |
@@ -642,15 +638,21 @@ static int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *adapter) | |||
642 | 638 | ||
643 | static void qlcnic_83xx_idc_update_idc_params(struct qlcnic_adapter *adapter) | 639 | static void qlcnic_83xx_idc_update_idc_params(struct qlcnic_adapter *adapter) |
644 | { | 640 | { |
641 | struct qlcnic_hardware_context *ahw = adapter->ahw; | ||
642 | |||
645 | qlcnic_83xx_idc_update_drv_presence_reg(adapter, 1, 1); | 643 | qlcnic_83xx_idc_update_drv_presence_reg(adapter, 1, 1); |
646 | clear_bit(__QLCNIC_RESETTING, &adapter->state); | ||
647 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); | 644 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); |
648 | qlcnic_83xx_idc_update_audit_reg(adapter, 0, 1); | 645 | qlcnic_83xx_idc_update_audit_reg(adapter, 0, 1); |
649 | set_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status); | 646 | set_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status); |
650 | adapter->ahw->idc.quiesce_req = 0; | 647 | |
651 | adapter->ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY; | 648 | ahw->idc.quiesce_req = 0; |
652 | adapter->ahw->idc.err_code = 0; | 649 | ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY; |
653 | adapter->ahw->idc.collect_dump = 0; | 650 | ahw->idc.err_code = 0; |
651 | ahw->idc.collect_dump = 0; | ||
652 | ahw->reset_context = 0; | ||
653 | adapter->tx_timeo_cnt = 0; | ||
654 | |||
655 | clear_bit(__QLCNIC_RESETTING, &adapter->state); | ||
654 | } | 656 | } |
655 | 657 | ||
656 | /** | 658 | /** |
@@ -851,6 +853,7 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter) | |||
851 | /* Check for soft reset request */ | 853 | /* Check for soft reset request */ |
852 | if (ahw->reset_context && | 854 | if (ahw->reset_context && |
853 | !(val & QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY)) { | 855 | !(val & QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY)) { |
856 | adapter->ahw->reset_context = 0; | ||
854 | qlcnic_83xx_idc_tx_soft_reset(adapter); | 857 | qlcnic_83xx_idc_tx_soft_reset(adapter); |
855 | return ret; | 858 | return ret; |
856 | } | 859 | } |
@@ -914,6 +917,7 @@ static int qlcnic_83xx_idc_need_quiesce_state(struct qlcnic_adapter *adapter) | |||
914 | static int qlcnic_83xx_idc_failed_state(struct qlcnic_adapter *adapter) | 917 | static int qlcnic_83xx_idc_failed_state(struct qlcnic_adapter *adapter) |
915 | { | 918 | { |
916 | dev_err(&adapter->pdev->dev, "%s: please restart!!\n", __func__); | 919 | dev_err(&adapter->pdev->dev, "%s: please restart!!\n", __func__); |
920 | clear_bit(__QLCNIC_RESETTING, &adapter->state); | ||
917 | adapter->ahw->idc.err_code = -EIO; | 921 | adapter->ahw->idc.err_code = -EIO; |
918 | 922 | ||
919 | return 0; | 923 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 08efb4635007..f67652de5a63 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -131,12 +131,13 @@ static const char qlcnic_83xx_rx_stats_strings[][ETH_GSTRING_LEN] = { | |||
131 | "ctx_lro_pkt_cnt", | 131 | "ctx_lro_pkt_cnt", |
132 | "ctx_ip_csum_error", | 132 | "ctx_ip_csum_error", |
133 | "ctx_rx_pkts_wo_ctx", | 133 | "ctx_rx_pkts_wo_ctx", |
134 | "ctx_rx_pkts_dropped_wo_sts", | 134 | "ctx_rx_pkts_drop_wo_sds_on_card", |
135 | "ctx_rx_pkts_drop_wo_sds_on_host", | ||
135 | "ctx_rx_osized_pkts", | 136 | "ctx_rx_osized_pkts", |
136 | "ctx_rx_pkts_dropped_wo_rds", | 137 | "ctx_rx_pkts_dropped_wo_rds", |
137 | "ctx_rx_unexpected_mcast_pkts", | 138 | "ctx_rx_unexpected_mcast_pkts", |
138 | "ctx_invalid_mac_address", | 139 | "ctx_invalid_mac_address", |
139 | "ctx_rx_rds_ring_prim_attemoted", | 140 | "ctx_rx_rds_ring_prim_attempted", |
140 | "ctx_rx_rds_ring_prim_success", | 141 | "ctx_rx_rds_ring_prim_success", |
141 | "ctx_num_lro_flows_added", | 142 | "ctx_num_lro_flows_added", |
142 | "ctx_num_lro_flows_removed", | 143 | "ctx_num_lro_flows_removed", |
@@ -251,6 +252,18 @@ static int | |||
251 | qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | 252 | qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
252 | { | 253 | { |
253 | struct qlcnic_adapter *adapter = netdev_priv(dev); | 254 | struct qlcnic_adapter *adapter = netdev_priv(dev); |
255 | |||
256 | if (qlcnic_82xx_check(adapter)) | ||
257 | return qlcnic_82xx_get_settings(adapter, ecmd); | ||
258 | else if (qlcnic_83xx_check(adapter)) | ||
259 | return qlcnic_83xx_get_settings(adapter, ecmd); | ||
260 | |||
261 | return -EIO; | ||
262 | } | ||
263 | |||
264 | int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter, | ||
265 | struct ethtool_cmd *ecmd) | ||
266 | { | ||
254 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 267 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
255 | u32 speed, reg; | 268 | u32 speed, reg; |
256 | int check_sfp_module = 0; | 269 | int check_sfp_module = 0; |
@@ -276,10 +289,7 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
276 | 289 | ||
277 | } else if (adapter->ahw->port_type == QLCNIC_XGBE) { | 290 | } else if (adapter->ahw->port_type == QLCNIC_XGBE) { |
278 | u32 val = 0; | 291 | u32 val = 0; |
279 | if (qlcnic_83xx_check(adapter)) | 292 | val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR); |
280 | qlcnic_83xx_get_settings(adapter); | ||
281 | else | ||
282 | val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR); | ||
283 | 293 | ||
284 | if (val == QLCNIC_PORT_MODE_802_3_AP) { | 294 | if (val == QLCNIC_PORT_MODE_802_3_AP) { |
285 | ecmd->supported = SUPPORTED_1000baseT_Full; | 295 | ecmd->supported = SUPPORTED_1000baseT_Full; |
@@ -289,16 +299,13 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
289 | ecmd->advertising = ADVERTISED_10000baseT_Full; | 299 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
290 | } | 300 | } |
291 | 301 | ||
292 | if (netif_running(dev) && adapter->ahw->has_link_events) { | 302 | if (netif_running(adapter->netdev) && ahw->has_link_events) { |
293 | if (qlcnic_82xx_check(adapter)) { | 303 | reg = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn)); |
294 | reg = QLCRD32(adapter, | 304 | speed = P3P_LINK_SPEED_VAL(pcifn, reg); |
295 | P3P_LINK_SPEED_REG(pcifn)); | 305 | ahw->link_speed = speed * P3P_LINK_SPEED_MHZ; |
296 | speed = P3P_LINK_SPEED_VAL(pcifn, reg); | 306 | ethtool_cmd_speed_set(ecmd, ahw->link_speed); |
297 | ahw->link_speed = speed * P3P_LINK_SPEED_MHZ; | 307 | ecmd->autoneg = ahw->link_autoneg; |
298 | } | 308 | ecmd->duplex = ahw->link_duplex; |
299 | ethtool_cmd_speed_set(ecmd, adapter->ahw->link_speed); | ||
300 | ecmd->autoneg = adapter->ahw->link_autoneg; | ||
301 | ecmd->duplex = adapter->ahw->link_duplex; | ||
302 | goto skip; | 309 | goto skip; |
303 | } | 310 | } |
304 | 311 | ||
@@ -340,8 +347,8 @@ skip: | |||
340 | case QLCNIC_BRDTYPE_P3P_10G_SFP_QT: | 347 | case QLCNIC_BRDTYPE_P3P_10G_SFP_QT: |
341 | ecmd->advertising |= ADVERTISED_TP; | 348 | ecmd->advertising |= ADVERTISED_TP; |
342 | ecmd->supported |= SUPPORTED_TP; | 349 | ecmd->supported |= SUPPORTED_TP; |
343 | check_sfp_module = netif_running(dev) && | 350 | check_sfp_module = netif_running(adapter->netdev) && |
344 | adapter->ahw->has_link_events; | 351 | ahw->has_link_events; |
345 | case QLCNIC_BRDTYPE_P3P_10G_XFP: | 352 | case QLCNIC_BRDTYPE_P3P_10G_XFP: |
346 | ecmd->supported |= SUPPORTED_FIBRE; | 353 | ecmd->supported |= SUPPORTED_FIBRE; |
347 | ecmd->advertising |= ADVERTISED_FIBRE; | 354 | ecmd->advertising |= ADVERTISED_FIBRE; |
@@ -355,8 +362,8 @@ skip: | |||
355 | ecmd->advertising |= | 362 | ecmd->advertising |= |
356 | (ADVERTISED_FIBRE | ADVERTISED_TP); | 363 | (ADVERTISED_FIBRE | ADVERTISED_TP); |
357 | ecmd->port = PORT_FIBRE; | 364 | ecmd->port = PORT_FIBRE; |
358 | check_sfp_module = netif_running(dev) && | 365 | check_sfp_module = netif_running(adapter->netdev) && |
359 | adapter->ahw->has_link_events; | 366 | ahw->has_link_events; |
360 | } else { | 367 | } else { |
361 | ecmd->autoneg = AUTONEG_ENABLE; | 368 | ecmd->autoneg = AUTONEG_ENABLE; |
362 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); | 369 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); |
@@ -365,13 +372,6 @@ skip: | |||
365 | ecmd->port = PORT_TP; | 372 | ecmd->port = PORT_TP; |
366 | } | 373 | } |
367 | break; | 374 | break; |
368 | case QLCNIC_BRDTYPE_83XX_10G: | ||
369 | ecmd->autoneg = AUTONEG_DISABLE; | ||
370 | ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP); | ||
371 | ecmd->advertising |= (ADVERTISED_FIBRE | ADVERTISED_TP); | ||
372 | ecmd->port = PORT_FIBRE; | ||
373 | check_sfp_module = netif_running(dev) && ahw->has_link_events; | ||
374 | break; | ||
375 | default: | 375 | default: |
376 | dev_err(&adapter->pdev->dev, "Unsupported board model %d\n", | 376 | dev_err(&adapter->pdev->dev, "Unsupported board model %d\n", |
377 | adapter->ahw->board_type); | 377 | adapter->ahw->board_type); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h index 95b1b5732838..b6818f4356b9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | |||
@@ -134,7 +134,7 @@ struct qlcnic_mailbox_metadata { | |||
134 | 134 | ||
135 | #define QLCNIC_SET_OWNER 1 | 135 | #define QLCNIC_SET_OWNER 1 |
136 | #define QLCNIC_CLR_OWNER 0 | 136 | #define QLCNIC_CLR_OWNER 0 |
137 | #define QLCNIC_MBX_TIMEOUT 10000 | 137 | #define QLCNIC_MBX_TIMEOUT 5000 |
138 | 138 | ||
139 | #define QLCNIC_MBX_RSP_OK 1 | 139 | #define QLCNIC_MBX_RSP_OK 1 |
140 | #define QLCNIC_MBX_PORT_RSP_OK 0x1a | 140 | #define QLCNIC_MBX_PORT_RSP_OK 0x1a |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 264d5a4f8153..8fb836d4129f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -37,24 +37,24 @@ MODULE_PARM_DESC(qlcnic_mac_learn, | |||
37 | "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)"); | 37 | "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)"); |
38 | 38 | ||
39 | int qlcnic_use_msi = 1; | 39 | int qlcnic_use_msi = 1; |
40 | MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled"); | 40 | MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled)"); |
41 | module_param_named(use_msi, qlcnic_use_msi, int, 0444); | 41 | module_param_named(use_msi, qlcnic_use_msi, int, 0444); |
42 | 42 | ||
43 | int qlcnic_use_msi_x = 1; | 43 | int qlcnic_use_msi_x = 1; |
44 | MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled"); | 44 | MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled)"); |
45 | module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444); | 45 | module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444); |
46 | 46 | ||
47 | int qlcnic_auto_fw_reset = 1; | 47 | int qlcnic_auto_fw_reset = 1; |
48 | MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled"); | 48 | MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled)"); |
49 | module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644); | 49 | module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644); |
50 | 50 | ||
51 | int qlcnic_load_fw_file; | 51 | int qlcnic_load_fw_file; |
52 | MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file"); | 52 | MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file)"); |
53 | module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444); | 53 | module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444); |
54 | 54 | ||
55 | int qlcnic_config_npars; | 55 | int qlcnic_config_npars; |
56 | module_param(qlcnic_config_npars, int, 0444); | 56 | module_param(qlcnic_config_npars, int, 0444); |
57 | MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled"); | 57 | MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled)"); |
58 | 58 | ||
59 | static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); | 59 | static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent); |
60 | static void qlcnic_remove(struct pci_dev *pdev); | 60 | static void qlcnic_remove(struct pci_dev *pdev); |
@@ -308,6 +308,23 @@ int qlcnic_read_mac_addr(struct qlcnic_adapter *adapter) | |||
308 | return 0; | 308 | return 0; |
309 | } | 309 | } |
310 | 310 | ||
311 | static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter) | ||
312 | { | ||
313 | struct qlcnic_mac_list_s *cur; | ||
314 | struct list_head *head; | ||
315 | |||
316 | list_for_each(head, &adapter->mac_list) { | ||
317 | cur = list_entry(head, struct qlcnic_mac_list_s, list); | ||
318 | if (!memcmp(adapter->mac_addr, cur->mac_addr, ETH_ALEN)) { | ||
319 | qlcnic_sre_macaddr_change(adapter, cur->mac_addr, | ||
320 | 0, QLCNIC_MAC_DEL); | ||
321 | list_del(&cur->list); | ||
322 | kfree(cur); | ||
323 | return; | ||
324 | } | ||
325 | } | ||
326 | } | ||
327 | |||
311 | static int qlcnic_set_mac(struct net_device *netdev, void *p) | 328 | static int qlcnic_set_mac(struct net_device *netdev, void *p) |
312 | { | 329 | { |
313 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 330 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
@@ -322,11 +339,15 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p) | |||
322 | if (!is_valid_ether_addr(addr->sa_data)) | 339 | if (!is_valid_ether_addr(addr->sa_data)) |
323 | return -EINVAL; | 340 | return -EINVAL; |
324 | 341 | ||
342 | if (!memcmp(adapter->mac_addr, addr->sa_data, ETH_ALEN)) | ||
343 | return 0; | ||
344 | |||
325 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { | 345 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { |
326 | netif_device_detach(netdev); | 346 | netif_device_detach(netdev); |
327 | qlcnic_napi_disable(adapter); | 347 | qlcnic_napi_disable(adapter); |
328 | } | 348 | } |
329 | 349 | ||
350 | qlcnic_delete_adapter_mac(adapter); | ||
330 | memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len); | 351 | memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len); |
331 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 352 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
332 | qlcnic_set_multi(adapter->netdev); | 353 | qlcnic_set_multi(adapter->netdev); |
@@ -2481,12 +2502,17 @@ static void qlcnic_tx_timeout(struct net_device *netdev) | |||
2481 | if (test_bit(__QLCNIC_RESETTING, &adapter->state)) | 2502 | if (test_bit(__QLCNIC_RESETTING, &adapter->state)) |
2482 | return; | 2503 | return; |
2483 | 2504 | ||
2484 | dev_err(&netdev->dev, "transmit timeout, resetting.\n"); | 2505 | if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) { |
2485 | 2506 | netdev_info(netdev, "Tx timeout, reset the adapter.\n"); | |
2486 | if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) | 2507 | if (qlcnic_82xx_check(adapter)) |
2487 | adapter->need_fw_reset = 1; | 2508 | adapter->need_fw_reset = 1; |
2488 | else | 2509 | else if (qlcnic_83xx_check(adapter)) |
2510 | qlcnic_83xx_idc_request_reset(adapter, | ||
2511 | QLCNIC_FORCE_FW_DUMP_KEY); | ||
2512 | } else { | ||
2513 | netdev_info(netdev, "Tx timeout, reset adapter context.\n"); | ||
2489 | adapter->ahw->reset_context = 1; | 2514 | adapter->ahw->reset_context = 1; |
2515 | } | ||
2490 | } | 2516 | } |
2491 | 2517 | ||
2492 | static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev) | 2518 | static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 44d547d78b84..3869c3864deb 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | |||
@@ -280,9 +280,9 @@ void qlcnic_sriov_cleanup(struct qlcnic_adapter *adapter) | |||
280 | static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr, | 280 | static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr, |
281 | u32 *pay, u8 pci_func, u8 size) | 281 | u32 *pay, u8 pci_func, u8 size) |
282 | { | 282 | { |
283 | u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, val, wait_time = 0; | ||
283 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 284 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
284 | unsigned long flags; | 285 | unsigned long flags; |
285 | u32 rsp, mbx_val, fw_data, rsp_num, mbx_cmd, val; | ||
286 | u16 opcode; | 286 | u16 opcode; |
287 | u8 mbx_err_code; | 287 | u8 mbx_err_code; |
288 | int i, j; | 288 | int i, j; |
@@ -330,15 +330,13 @@ static int qlcnic_sriov_post_bc_msg(struct qlcnic_adapter *adapter, u32 *hdr, | |||
330 | * assume something is wrong. | 330 | * assume something is wrong. |
331 | */ | 331 | */ |
332 | poll: | 332 | poll: |
333 | rsp = qlcnic_83xx_mbx_poll(adapter); | 333 | rsp = qlcnic_83xx_mbx_poll(adapter, &wait_time); |
334 | if (rsp != QLCNIC_RCODE_TIMEOUT) { | 334 | if (rsp != QLCNIC_RCODE_TIMEOUT) { |
335 | /* Get the FW response data */ | 335 | /* Get the FW response data */ |
336 | fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); | 336 | fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); |
337 | if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { | 337 | if (fw_data & QLCNIC_MBX_ASYNC_EVENT) { |
338 | __qlcnic_83xx_process_aen(adapter); | 338 | __qlcnic_83xx_process_aen(adapter); |
339 | mbx_val = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); | 339 | goto poll; |
340 | if (mbx_val) | ||
341 | goto poll; | ||
342 | } | 340 | } |
343 | mbx_err_code = QLCNIC_MBX_STATUS(fw_data); | 341 | mbx_err_code = QLCNIC_MBX_STATUS(fw_data); |
344 | rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); | 342 | rsp_num = QLCNIC_MBX_NUM_REGS(fw_data); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index c81be2da119b..1a66ccded235 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | |||
@@ -1133,9 +1133,6 @@ static int qlcnic_sriov_validate_linkevent(struct qlcnic_vf_info *vf, | |||
1133 | if ((cmd->req.arg[1] >> 16) != vf->rx_ctx_id) | 1133 | if ((cmd->req.arg[1] >> 16) != vf->rx_ctx_id) |
1134 | return -EINVAL; | 1134 | return -EINVAL; |
1135 | 1135 | ||
1136 | if (!(cmd->req.arg[1] & BIT_8)) | ||
1137 | return -EINVAL; | ||
1138 | |||
1139 | return 0; | 1136 | return 0; |
1140 | } | 1137 | } |
1141 | 1138 | ||
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 87463bc701a6..50235d201592 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -1106,6 +1106,7 @@ static int ql_get_next_chunk(struct ql_adapter *qdev, struct rx_ring *rx_ring, | |||
1106 | if (pci_dma_mapping_error(qdev->pdev, map)) { | 1106 | if (pci_dma_mapping_error(qdev->pdev, map)) { |
1107 | __free_pages(rx_ring->pg_chunk.page, | 1107 | __free_pages(rx_ring->pg_chunk.page, |
1108 | qdev->lbq_buf_order); | 1108 | qdev->lbq_buf_order); |
1109 | rx_ring->pg_chunk.page = NULL; | ||
1109 | netif_err(qdev, drv, qdev->ndev, | 1110 | netif_err(qdev, drv, qdev->ndev, |
1110 | "PCI mapping failed.\n"); | 1111 | "PCI mapping failed.\n"); |
1111 | return -ENOMEM; | 1112 | return -ENOMEM; |
@@ -2777,6 +2778,12 @@ static void ql_free_lbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring | |||
2777 | curr_idx = 0; | 2778 | curr_idx = 0; |
2778 | 2779 | ||
2779 | } | 2780 | } |
2781 | if (rx_ring->pg_chunk.page) { | ||
2782 | pci_unmap_page(qdev->pdev, rx_ring->pg_chunk.map, | ||
2783 | ql_lbq_block_size(qdev), PCI_DMA_FROMDEVICE); | ||
2784 | put_page(rx_ring->pg_chunk.page); | ||
2785 | rx_ring->pg_chunk.page = NULL; | ||
2786 | } | ||
2780 | } | 2787 | } |
2781 | 2788 | ||
2782 | static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring) | 2789 | static void ql_free_sbq_buffers(struct ql_adapter *qdev, struct rx_ring *rx_ring) |
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index f695a50bac47..43c1f3223322 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config STMMAC_ETH | 1 | config STMMAC_ETH |
2 | tristate "STMicroelectronics 10/100/1000 Ethernet driver" | 2 | tristate "STMicroelectronics 10/100/1000 Ethernet driver" |
3 | depends on HAS_IOMEM | 3 | depends on HAS_IOMEM && HAS_DMA |
4 | select NET_CORE | 4 | select NET_CORE |
5 | select MII | 5 | select MII |
6 | select PHYLIB | 6 | select PHYLIB |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d5a141c7c4e7..1c502bb0c916 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -229,7 +229,8 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) | |||
229 | } | 229 | } |
230 | 230 | ||
231 | if (port->passthru) | 231 | if (port->passthru) |
232 | vlan = list_first_entry(&port->vlans, struct macvlan_dev, list); | 232 | vlan = list_first_or_null_rcu(&port->vlans, |
233 | struct macvlan_dev, list); | ||
233 | else | 234 | else |
234 | vlan = macvlan_hash_lookup(port, eth->h_dest); | 235 | vlan = macvlan_hash_lookup(port, eth->h_dest); |
235 | if (vlan == NULL) | 236 | if (vlan == NULL) |
@@ -814,7 +815,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | |||
814 | if (err < 0) | 815 | if (err < 0) |
815 | goto upper_dev_unlink; | 816 | goto upper_dev_unlink; |
816 | 817 | ||
817 | list_add_tail(&vlan->list, &port->vlans); | 818 | list_add_tail_rcu(&vlan->list, &port->vlans); |
818 | netif_stacked_transfer_operstate(lowerdev, dev); | 819 | netif_stacked_transfer_operstate(lowerdev, dev); |
819 | 820 | ||
820 | return 0; | 821 | return 0; |
@@ -842,7 +843,7 @@ void macvlan_dellink(struct net_device *dev, struct list_head *head) | |||
842 | { | 843 | { |
843 | struct macvlan_dev *vlan = netdev_priv(dev); | 844 | struct macvlan_dev *vlan = netdev_priv(dev); |
844 | 845 | ||
845 | list_del(&vlan->list); | 846 | list_del_rcu(&vlan->list); |
846 | unregister_netdevice_queue(dev, head); | 847 | unregister_netdevice_queue(dev, head); |
847 | netdev_upper_dev_unlink(vlan->lowerdev, dev); | 848 | netdev_upper_dev_unlink(vlan->lowerdev, dev); |
848 | } | 849 | } |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 3c23fdc27bf0..655bb25eed2b 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/cpu.h> | 29 | #include <linux/cpu.h> |
30 | 30 | ||
31 | static int napi_weight = 128; | 31 | static int napi_weight = NAPI_POLL_WEIGHT; |
32 | module_param(napi_weight, int, 0444); | 32 | module_param(napi_weight, int, 0444); |
33 | 33 | ||
34 | static bool csum = true, gso = true; | 34 | static bool csum = true, gso = true; |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 9b20d9ee2719..7f702fe3ecc2 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2369,6 +2369,9 @@ ath5k_tx_complete_poll_work(struct work_struct *work) | |||
2369 | int i; | 2369 | int i; |
2370 | bool needreset = false; | 2370 | bool needreset = false; |
2371 | 2371 | ||
2372 | if (!test_bit(ATH_STAT_STARTED, ah->status)) | ||
2373 | return; | ||
2374 | |||
2372 | mutex_lock(&ah->lock); | 2375 | mutex_lock(&ah->lock); |
2373 | 2376 | ||
2374 | for (i = 0; i < ARRAY_SIZE(ah->txqs); i++) { | 2377 | for (i = 0; i < ARRAY_SIZE(ah->txqs); i++) { |
@@ -2676,6 +2679,7 @@ done: | |||
2676 | mmiowb(); | 2679 | mmiowb(); |
2677 | mutex_unlock(&ah->lock); | 2680 | mutex_unlock(&ah->lock); |
2678 | 2681 | ||
2682 | set_bit(ATH_STAT_STARTED, ah->status); | ||
2679 | ieee80211_queue_delayed_work(ah->hw, &ah->tx_complete_work, | 2683 | ieee80211_queue_delayed_work(ah->hw, &ah->tx_complete_work, |
2680 | msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT)); | 2684 | msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT)); |
2681 | 2685 | ||
@@ -2737,6 +2741,7 @@ void ath5k_stop(struct ieee80211_hw *hw) | |||
2737 | 2741 | ||
2738 | ath5k_stop_tasklets(ah); | 2742 | ath5k_stop_tasklets(ah); |
2739 | 2743 | ||
2744 | clear_bit(ATH_STAT_STARTED, ah->status); | ||
2740 | cancel_delayed_work_sync(&ah->tx_complete_work); | 2745 | cancel_delayed_work_sync(&ah->tx_complete_work); |
2741 | 2746 | ||
2742 | if (!ath5k_modparam_no_hw_rfkill_switch) | 2747 | if (!ath5k_modparam_no_hw_rfkill_switch) |
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 17507dc8a1e7..f3dc124c60c7 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig | |||
@@ -17,7 +17,7 @@ config ATH9K_BTCOEX_SUPPORT | |||
17 | 17 | ||
18 | config ATH9K | 18 | config ATH9K |
19 | tristate "Atheros 802.11n wireless cards support" | 19 | tristate "Atheros 802.11n wireless cards support" |
20 | depends on MAC80211 | 20 | depends on MAC80211 && HAS_DMA |
21 | select ATH9K_HW | 21 | select ATH9K_HW |
22 | select MAC80211_LEDS | 22 | select MAC80211_LEDS |
23 | select LEDS_CLASS | 23 | select LEDS_CLASS |
diff --git a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h index 0c2ac0c6dc89..e85a8b076c22 100644 --- a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h | |||
@@ -233,9 +233,9 @@ static const u32 ar9565_1p0_baseband_core[][2] = { | |||
233 | {0x00009d10, 0x01834061}, | 233 | {0x00009d10, 0x01834061}, |
234 | {0x00009d14, 0x00c00400}, | 234 | {0x00009d14, 0x00c00400}, |
235 | {0x00009d18, 0x00000000}, | 235 | {0x00009d18, 0x00000000}, |
236 | {0x00009e08, 0x0078230c}, | 236 | {0x00009e08, 0x0038230c}, |
237 | {0x00009e24, 0x990bb515}, | 237 | {0x00009e24, 0x9907b515}, |
238 | {0x00009e28, 0x126f0000}, | 238 | {0x00009e28, 0x126f0600}, |
239 | {0x00009e30, 0x06336f77}, | 239 | {0x00009e30, 0x06336f77}, |
240 | {0x00009e34, 0x6af6532f}, | 240 | {0x00009e34, 0x6af6532f}, |
241 | {0x00009e38, 0x0cc80c00}, | 241 | {0x00009e38, 0x0cc80c00}, |
@@ -337,7 +337,7 @@ static const u32 ar9565_1p0_baseband_core[][2] = { | |||
337 | 337 | ||
338 | static const u32 ar9565_1p0_baseband_postamble[][5] = { | 338 | static const u32 ar9565_1p0_baseband_postamble[][5] = { |
339 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | 339 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ |
340 | {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a800d}, | 340 | {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8009}, |
341 | {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae}, | 341 | {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae}, |
342 | {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x63c640da}, | 342 | {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x63c640da}, |
343 | {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x09143c81}, | 343 | {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x09143c81}, |
@@ -345,9 +345,9 @@ static const u32 ar9565_1p0_baseband_postamble[][5] = { | |||
345 | {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, | 345 | {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, |
346 | {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4}, | 346 | {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4}, |
347 | {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0}, | 347 | {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0}, |
348 | {0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, | 348 | {0x00009e04, 0x00802020, 0x00802020, 0x00142020, 0x00142020}, |
349 | {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000d8}, | 349 | {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2}, |
350 | {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec86d2e}, | 350 | {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e}, |
351 | {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e}, | 351 | {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e}, |
352 | {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 352 | {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
353 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, | 353 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, |
@@ -450,6 +450,8 @@ static const u32 ar9565_1p0_soc_postamble[][5] = { | |||
450 | 450 | ||
451 | static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { | 451 | static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { |
452 | /* Addr allmodes */ | 452 | /* Addr allmodes */ |
453 | {0x00004050, 0x00300300}, | ||
454 | {0x0000406c, 0x00100000}, | ||
453 | {0x0000a000, 0x00010000}, | 455 | {0x0000a000, 0x00010000}, |
454 | {0x0000a004, 0x00030002}, | 456 | {0x0000a004, 0x00030002}, |
455 | {0x0000a008, 0x00050004}, | 457 | {0x0000a008, 0x00050004}, |
@@ -498,27 +500,27 @@ static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { | |||
498 | {0x0000a0b4, 0x00000000}, | 500 | {0x0000a0b4, 0x00000000}, |
499 | {0x0000a0b8, 0x00000000}, | 501 | {0x0000a0b8, 0x00000000}, |
500 | {0x0000a0bc, 0x00000000}, | 502 | {0x0000a0bc, 0x00000000}, |
501 | {0x0000a0c0, 0x001f0000}, | 503 | {0x0000a0c0, 0x00bf00a0}, |
502 | {0x0000a0c4, 0x01000101}, | 504 | {0x0000a0c4, 0x11a011a1}, |
503 | {0x0000a0c8, 0x011e011f}, | 505 | {0x0000a0c8, 0x11be11bf}, |
504 | {0x0000a0cc, 0x011c011d}, | 506 | {0x0000a0cc, 0x11bc11bd}, |
505 | {0x0000a0d0, 0x02030204}, | 507 | {0x0000a0d0, 0x22632264}, |
506 | {0x0000a0d4, 0x02010202}, | 508 | {0x0000a0d4, 0x22612262}, |
507 | {0x0000a0d8, 0x021f0200}, | 509 | {0x0000a0d8, 0x227f2260}, |
508 | {0x0000a0dc, 0x0302021e}, | 510 | {0x0000a0dc, 0x4322227e}, |
509 | {0x0000a0e0, 0x03000301}, | 511 | {0x0000a0e0, 0x43204321}, |
510 | {0x0000a0e4, 0x031e031f}, | 512 | {0x0000a0e4, 0x433e433f}, |
511 | {0x0000a0e8, 0x0402031d}, | 513 | {0x0000a0e8, 0x4462433d}, |
512 | {0x0000a0ec, 0x04000401}, | 514 | {0x0000a0ec, 0x44604461}, |
513 | {0x0000a0f0, 0x041e041f}, | 515 | {0x0000a0f0, 0x447e447f}, |
514 | {0x0000a0f4, 0x0502041d}, | 516 | {0x0000a0f4, 0x5582447d}, |
515 | {0x0000a0f8, 0x05000501}, | 517 | {0x0000a0f8, 0x55805581}, |
516 | {0x0000a0fc, 0x051e051f}, | 518 | {0x0000a0fc, 0x559e559f}, |
517 | {0x0000a100, 0x06010602}, | 519 | {0x0000a100, 0x66816682}, |
518 | {0x0000a104, 0x061f0600}, | 520 | {0x0000a104, 0x669f6680}, |
519 | {0x0000a108, 0x061d061e}, | 521 | {0x0000a108, 0x669d669e}, |
520 | {0x0000a10c, 0x07020703}, | 522 | {0x0000a10c, 0x77627763}, |
521 | {0x0000a110, 0x07000701}, | 523 | {0x0000a110, 0x77607761}, |
522 | {0x0000a114, 0x00000000}, | 524 | {0x0000a114, 0x00000000}, |
523 | {0x0000a118, 0x00000000}, | 525 | {0x0000a118, 0x00000000}, |
524 | {0x0000a11c, 0x00000000}, | 526 | {0x0000a11c, 0x00000000}, |
@@ -530,27 +532,27 @@ static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { | |||
530 | {0x0000a134, 0x00000000}, | 532 | {0x0000a134, 0x00000000}, |
531 | {0x0000a138, 0x00000000}, | 533 | {0x0000a138, 0x00000000}, |
532 | {0x0000a13c, 0x00000000}, | 534 | {0x0000a13c, 0x00000000}, |
533 | {0x0000a140, 0x001f0000}, | 535 | {0x0000a140, 0x00bf00a0}, |
534 | {0x0000a144, 0x01000101}, | 536 | {0x0000a144, 0x11a011a1}, |
535 | {0x0000a148, 0x011e011f}, | 537 | {0x0000a148, 0x11be11bf}, |
536 | {0x0000a14c, 0x011c011d}, | 538 | {0x0000a14c, 0x11bc11bd}, |
537 | {0x0000a150, 0x02030204}, | 539 | {0x0000a150, 0x22632264}, |
538 | {0x0000a154, 0x02010202}, | 540 | {0x0000a154, 0x22612262}, |
539 | {0x0000a158, 0x021f0200}, | 541 | {0x0000a158, 0x227f2260}, |
540 | {0x0000a15c, 0x0302021e}, | 542 | {0x0000a15c, 0x4322227e}, |
541 | {0x0000a160, 0x03000301}, | 543 | {0x0000a160, 0x43204321}, |
542 | {0x0000a164, 0x031e031f}, | 544 | {0x0000a164, 0x433e433f}, |
543 | {0x0000a168, 0x0402031d}, | 545 | {0x0000a168, 0x4462433d}, |
544 | {0x0000a16c, 0x04000401}, | 546 | {0x0000a16c, 0x44604461}, |
545 | {0x0000a170, 0x041e041f}, | 547 | {0x0000a170, 0x447e447f}, |
546 | {0x0000a174, 0x0502041d}, | 548 | {0x0000a174, 0x5582447d}, |
547 | {0x0000a178, 0x05000501}, | 549 | {0x0000a178, 0x55805581}, |
548 | {0x0000a17c, 0x051e051f}, | 550 | {0x0000a17c, 0x559e559f}, |
549 | {0x0000a180, 0x06010602}, | 551 | {0x0000a180, 0x66816682}, |
550 | {0x0000a184, 0x061f0600}, | 552 | {0x0000a184, 0x669f6680}, |
551 | {0x0000a188, 0x061d061e}, | 553 | {0x0000a188, 0x669d669e}, |
552 | {0x0000a18c, 0x07020703}, | 554 | {0x0000a18c, 0x77e677e7}, |
553 | {0x0000a190, 0x07000701}, | 555 | {0x0000a190, 0x77e477e5}, |
554 | {0x0000a194, 0x00000000}, | 556 | {0x0000a194, 0x00000000}, |
555 | {0x0000a198, 0x00000000}, | 557 | {0x0000a198, 0x00000000}, |
556 | {0x0000a19c, 0x00000000}, | 558 | {0x0000a19c, 0x00000000}, |
@@ -770,7 +772,7 @@ static const u32 ar9565_1p0_Modes_lowest_ob_db_tx_gain_table[][5] = { | |||
770 | 772 | ||
771 | static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = { | 773 | static const u32 ar9565_1p0_pciephy_clkreq_disable_L1[][2] = { |
772 | /* Addr allmodes */ | 774 | /* Addr allmodes */ |
773 | {0x00018c00, 0x18213ede}, | 775 | {0x00018c00, 0x18212ede}, |
774 | {0x00018c04, 0x000801d8}, | 776 | {0x00018c04, 0x000801d8}, |
775 | {0x00018c08, 0x0003780c}, | 777 | {0x00018c08, 0x0003780c}, |
776 | }; | 778 | }; |
@@ -889,8 +891,8 @@ static const u32 ar9565_1p0_common_wo_xlna_rx_gain_table[][2] = { | |||
889 | {0x0000a180, 0x66816682}, | 891 | {0x0000a180, 0x66816682}, |
890 | {0x0000a184, 0x669f6680}, | 892 | {0x0000a184, 0x669f6680}, |
891 | {0x0000a188, 0x669d669e}, | 893 | {0x0000a188, 0x669d669e}, |
892 | {0x0000a18c, 0x77627763}, | 894 | {0x0000a18c, 0x77e677e7}, |
893 | {0x0000a190, 0x77607761}, | 895 | {0x0000a190, 0x77e477e5}, |
894 | {0x0000a194, 0x00000000}, | 896 | {0x0000a194, 0x00000000}, |
895 | {0x0000a198, 0x00000000}, | 897 | {0x0000a198, 0x00000000}, |
896 | {0x0000a19c, 0x00000000}, | 898 | {0x0000a19c, 0x00000000}, |
@@ -1114,7 +1116,7 @@ static const u32 ar9565_1p0_modes_high_ob_db_tx_gain_table[][5] = { | |||
1114 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | 1116 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, |
1115 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | 1117 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, |
1116 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | 1118 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, |
1117 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | 1119 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050df, 0x000050df}, |
1118 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, | 1120 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, |
1119 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, | 1121 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, |
1120 | {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, | 1122 | {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, |
@@ -1140,13 +1142,13 @@ static const u32 ar9565_1p0_modes_high_ob_db_tx_gain_table[][5] = { | |||
1140 | {0x0000a558, 0x69027f56, 0x69027f56, 0x53001ce5, 0x53001ce5}, | 1142 | {0x0000a558, 0x69027f56, 0x69027f56, 0x53001ce5, 0x53001ce5}, |
1141 | {0x0000a55c, 0x6d029f56, 0x6d029f56, 0x57001ce9, 0x57001ce9}, | 1143 | {0x0000a55c, 0x6d029f56, 0x6d029f56, 0x57001ce9, 0x57001ce9}, |
1142 | {0x0000a560, 0x73049f56, 0x73049f56, 0x5b001ceb, 0x5b001ceb}, | 1144 | {0x0000a560, 0x73049f56, 0x73049f56, 0x5b001ceb, 0x5b001ceb}, |
1143 | {0x0000a564, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1145 | {0x0000a564, 0x7804ff56, 0x7804ff56, 0x60001cf0, 0x60001cf0}, |
1144 | {0x0000a568, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1146 | {0x0000a568, 0x7804ff56, 0x7804ff56, 0x61001cf1, 0x61001cf1}, |
1145 | {0x0000a56c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1147 | {0x0000a56c, 0x7804ff56, 0x7804ff56, 0x62001cf2, 0x62001cf2}, |
1146 | {0x0000a570, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1148 | {0x0000a570, 0x7804ff56, 0x7804ff56, 0x63001cf3, 0x63001cf3}, |
1147 | {0x0000a574, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1149 | {0x0000a574, 0x7804ff56, 0x7804ff56, 0x64001cf4, 0x64001cf4}, |
1148 | {0x0000a578, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1150 | {0x0000a578, 0x7804ff56, 0x7804ff56, 0x66001ff6, 0x66001ff6}, |
1149 | {0x0000a57c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | 1151 | {0x0000a57c, 0x7804ff56, 0x7804ff56, 0x66001ff6, 0x66001ff6}, |
1150 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1152 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1151 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1153 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1152 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1154 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
@@ -1174,7 +1176,7 @@ static const u32 ar9565_1p0_modes_high_power_tx_gain_table[][5] = { | |||
1174 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | 1176 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, |
1175 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | 1177 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, |
1176 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | 1178 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, |
1177 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | 1179 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050df, 0x000050df}, |
1178 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, | 1180 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, |
1179 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, | 1181 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, |
1180 | {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, | 1182 | {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, |
@@ -1200,13 +1202,13 @@ static const u32 ar9565_1p0_modes_high_power_tx_gain_table[][5] = { | |||
1200 | {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, | 1202 | {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, |
1201 | {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, | 1203 | {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, |
1202 | {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, | 1204 | {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, |
1203 | {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1205 | {0x0000a564, 0x7504ff56, 0x7504ff56, 0x59001cf0, 0x59001cf0}, |
1204 | {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1206 | {0x0000a568, 0x7504ff56, 0x7504ff56, 0x5a001cf1, 0x5a001cf1}, |
1205 | {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1207 | {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x5b001cf2, 0x5b001cf2}, |
1206 | {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1208 | {0x0000a570, 0x7504ff56, 0x7504ff56, 0x5c001cf3, 0x5c001cf3}, |
1207 | {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1209 | {0x0000a574, 0x7504ff56, 0x7504ff56, 0x5d001cf4, 0x5d001cf4}, |
1208 | {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1210 | {0x0000a578, 0x7504ff56, 0x7504ff56, 0x5f001ff6, 0x5f001ff6}, |
1209 | {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | 1211 | {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x5f001ff6, 0x5f001ff6}, |
1210 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1212 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1211 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1213 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
1212 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | 1214 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6963862a1872..a18414b5948b 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -227,13 +227,13 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||
227 | if (!test_bit(SC_OP_BEACONS, &sc->sc_flags)) | 227 | if (!test_bit(SC_OP_BEACONS, &sc->sc_flags)) |
228 | goto work; | 228 | goto work; |
229 | 229 | ||
230 | ath9k_set_beacon(sc); | ||
231 | |||
232 | if (ah->opmode == NL80211_IFTYPE_STATION && | 230 | if (ah->opmode == NL80211_IFTYPE_STATION && |
233 | test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { | 231 | test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) { |
234 | spin_lock_irqsave(&sc->sc_pm_lock, flags); | 232 | spin_lock_irqsave(&sc->sc_pm_lock, flags); |
235 | sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; | 233 | sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON; |
236 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | 234 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |
235 | } else { | ||
236 | ath9k_set_beacon(sc); | ||
237 | } | 237 | } |
238 | work: | 238 | work: |
239 | ath_restart_work(sc); | 239 | ath_restart_work(sc); |
@@ -1332,6 +1332,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw, | |||
1332 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1332 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1333 | struct ath_node *an = (struct ath_node *) sta->drv_priv; | 1333 | struct ath_node *an = (struct ath_node *) sta->drv_priv; |
1334 | struct ieee80211_key_conf ps_key = { }; | 1334 | struct ieee80211_key_conf ps_key = { }; |
1335 | int key; | ||
1335 | 1336 | ||
1336 | ath_node_attach(sc, sta, vif); | 1337 | ath_node_attach(sc, sta, vif); |
1337 | 1338 | ||
@@ -1339,7 +1340,9 @@ static int ath9k_sta_add(struct ieee80211_hw *hw, | |||
1339 | vif->type != NL80211_IFTYPE_AP_VLAN) | 1340 | vif->type != NL80211_IFTYPE_AP_VLAN) |
1340 | return 0; | 1341 | return 0; |
1341 | 1342 | ||
1342 | an->ps_key = ath_key_config(common, vif, sta, &ps_key); | 1343 | key = ath_key_config(common, vif, sta, &ps_key); |
1344 | if (key > 0) | ||
1345 | an->ps_key = key; | ||
1343 | 1346 | ||
1344 | return 0; | 1347 | return 0; |
1345 | } | 1348 | } |
@@ -1356,6 +1359,7 @@ static void ath9k_del_ps_key(struct ath_softc *sc, | |||
1356 | return; | 1359 | return; |
1357 | 1360 | ||
1358 | ath_key_delete(common, &ps_key); | 1361 | ath_key_delete(common, &ps_key); |
1362 | an->ps_key = 0; | ||
1359 | } | 1363 | } |
1360 | 1364 | ||
1361 | static int ath9k_sta_remove(struct ieee80211_hw *hw, | 1365 | static int ath9k_sta_remove(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 523355b87659..f7c70b3a6ea9 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -1728,6 +1728,25 @@ drop_recycle_buffer: | |||
1728 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); | 1728 | sync_descbuffer_for_device(ring, dmaaddr, ring->rx_buffersize); |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | void b43_dma_handle_rx_overflow(struct b43_dmaring *ring) | ||
1732 | { | ||
1733 | int current_slot, previous_slot; | ||
1734 | |||
1735 | B43_WARN_ON(ring->tx); | ||
1736 | |||
1737 | /* Device has filled all buffers, drop all packets and let TCP | ||
1738 | * decrease speed. | ||
1739 | * Decrement RX index by one will let the device to see all slots | ||
1740 | * as free again | ||
1741 | */ | ||
1742 | /* | ||
1743 | *TODO: How to increase rx_drop in mac80211? | ||
1744 | */ | ||
1745 | current_slot = ring->ops->get_current_rxslot(ring); | ||
1746 | previous_slot = prev_slot(ring, current_slot); | ||
1747 | ring->ops->set_current_rxslot(ring, previous_slot); | ||
1748 | } | ||
1749 | |||
1731 | void b43_dma_rx(struct b43_dmaring *ring) | 1750 | void b43_dma_rx(struct b43_dmaring *ring) |
1732 | { | 1751 | { |
1733 | const struct b43_dma_ops *ops = ring->ops; | 1752 | const struct b43_dma_ops *ops = ring->ops; |
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h index 9fdd1983079c..df8c8cdcbdb5 100644 --- a/drivers/net/wireless/b43/dma.h +++ b/drivers/net/wireless/b43/dma.h | |||
@@ -9,7 +9,7 @@ | |||
9 | /* DMA-Interrupt reasons. */ | 9 | /* DMA-Interrupt reasons. */ |
10 | #define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \ | 10 | #define B43_DMAIRQ_FATALMASK ((1 << 10) | (1 << 11) | (1 << 12) \ |
11 | | (1 << 14) | (1 << 15)) | 11 | | (1 << 14) | (1 << 15)) |
12 | #define B43_DMAIRQ_NONFATALMASK (1 << 13) | 12 | #define B43_DMAIRQ_RDESC_UFLOW (1 << 13) |
13 | #define B43_DMAIRQ_RX_DONE (1 << 16) | 13 | #define B43_DMAIRQ_RX_DONE (1 << 16) |
14 | 14 | ||
15 | /*** 32-bit DMA Engine. ***/ | 15 | /*** 32-bit DMA Engine. ***/ |
@@ -295,6 +295,8 @@ int b43_dma_tx(struct b43_wldev *dev, | |||
295 | void b43_dma_handle_txstatus(struct b43_wldev *dev, | 295 | void b43_dma_handle_txstatus(struct b43_wldev *dev, |
296 | const struct b43_txstatus *status); | 296 | const struct b43_txstatus *status); |
297 | 297 | ||
298 | void b43_dma_handle_rx_overflow(struct b43_dmaring *ring); | ||
299 | |||
298 | void b43_dma_rx(struct b43_dmaring *ring); | 300 | void b43_dma_rx(struct b43_dmaring *ring); |
299 | 301 | ||
300 | void b43_dma_direct_fifo_rx(struct b43_wldev *dev, | 302 | void b43_dma_direct_fifo_rx(struct b43_wldev *dev, |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d377f77d30b5..6dd07e2ec595 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1902,30 +1902,18 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev) | |||
1902 | } | 1902 | } |
1903 | } | 1903 | } |
1904 | 1904 | ||
1905 | if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK | | 1905 | if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK))) { |
1906 | B43_DMAIRQ_NONFATALMASK))) { | 1906 | b43err(dev->wl, |
1907 | if (merged_dma_reason & B43_DMAIRQ_FATALMASK) { | 1907 | "Fatal DMA error: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X\n", |
1908 | b43err(dev->wl, "Fatal DMA error: " | 1908 | dma_reason[0], dma_reason[1], |
1909 | "0x%08X, 0x%08X, 0x%08X, " | 1909 | dma_reason[2], dma_reason[3], |
1910 | "0x%08X, 0x%08X, 0x%08X\n", | 1910 | dma_reason[4], dma_reason[5]); |
1911 | dma_reason[0], dma_reason[1], | 1911 | b43err(dev->wl, "This device does not support DMA " |
1912 | dma_reason[2], dma_reason[3], | ||
1913 | dma_reason[4], dma_reason[5]); | ||
1914 | b43err(dev->wl, "This device does not support DMA " | ||
1915 | "on your system. It will now be switched to PIO.\n"); | 1912 | "on your system. It will now be switched to PIO.\n"); |
1916 | /* Fall back to PIO transfers if we get fatal DMA errors! */ | 1913 | /* Fall back to PIO transfers if we get fatal DMA errors! */ |
1917 | dev->use_pio = true; | 1914 | dev->use_pio = true; |
1918 | b43_controller_restart(dev, "DMA error"); | 1915 | b43_controller_restart(dev, "DMA error"); |
1919 | return; | 1916 | return; |
1920 | } | ||
1921 | if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) { | ||
1922 | b43err(dev->wl, "DMA error: " | ||
1923 | "0x%08X, 0x%08X, 0x%08X, " | ||
1924 | "0x%08X, 0x%08X, 0x%08X\n", | ||
1925 | dma_reason[0], dma_reason[1], | ||
1926 | dma_reason[2], dma_reason[3], | ||
1927 | dma_reason[4], dma_reason[5]); | ||
1928 | } | ||
1929 | } | 1917 | } |
1930 | 1918 | ||
1931 | if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) | 1919 | if (unlikely(reason & B43_IRQ_UCODE_DEBUG)) |
@@ -1944,6 +1932,11 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev) | |||
1944 | handle_irq_noise(dev); | 1932 | handle_irq_noise(dev); |
1945 | 1933 | ||
1946 | /* Check the DMA reason registers for received data. */ | 1934 | /* Check the DMA reason registers for received data. */ |
1935 | if (dma_reason[0] & B43_DMAIRQ_RDESC_UFLOW) { | ||
1936 | if (B43_DEBUG) | ||
1937 | b43warn(dev->wl, "RX descriptor underrun\n"); | ||
1938 | b43_dma_handle_rx_overflow(dev->dma.rx_ring); | ||
1939 | } | ||
1947 | if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { | 1940 | if (dma_reason[0] & B43_DMAIRQ_RX_DONE) { |
1948 | if (b43_using_pio_transfers(dev)) | 1941 | if (b43_using_pio_transfers(dev)) |
1949 | b43_pio_rx(dev->pio.rx_queue); | 1942 | b43_pio_rx(dev->pio.rx_queue); |
@@ -2001,7 +1994,7 @@ static irqreturn_t b43_do_interrupt(struct b43_wldev *dev) | |||
2001 | return IRQ_NONE; | 1994 | return IRQ_NONE; |
2002 | 1995 | ||
2003 | dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) | 1996 | dev->dma_reason[0] = b43_read32(dev, B43_MMIO_DMA0_REASON) |
2004 | & 0x0001DC00; | 1997 | & 0x0001FC00; |
2005 | dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) | 1998 | dev->dma_reason[1] = b43_read32(dev, B43_MMIO_DMA1_REASON) |
2006 | & 0x0000DC00; | 1999 | & 0x0000DC00; |
2007 | dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) | 2000 | dev->dma_reason[2] = b43_read32(dev, B43_MMIO_DMA2_REASON) |
@@ -3130,7 +3123,7 @@ static int b43_chip_init(struct b43_wldev *dev) | |||
3130 | b43_write32(dev, 0x018C, 0x02000000); | 3123 | b43_write32(dev, 0x018C, 0x02000000); |
3131 | } | 3124 | } |
3132 | b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); | 3125 | b43_write32(dev, B43_MMIO_GEN_IRQ_REASON, 0x00004000); |
3133 | b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001DC00); | 3126 | b43_write32(dev, B43_MMIO_DMA0_IRQ_MASK, 0x0001FC00); |
3134 | b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); | 3127 | b43_write32(dev, B43_MMIO_DMA1_IRQ_MASK, 0x0000DC00); |
3135 | b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); | 3128 | b43_write32(dev, B43_MMIO_DMA2_IRQ_MASK, 0x0000DC00); |
3136 | b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); | 3129 | b43_write32(dev, B43_MMIO_DMA3_IRQ_MASK, 0x0001DC00); |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index b8f82e688c72..9a95045c97b6 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -5741,8 +5741,7 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length) | |||
5741 | hw->flags = | 5741 | hw->flags = |
5742 | IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_AMPDU_AGGREGATION | | 5742 | IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_AMPDU_AGGREGATION | |
5743 | IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC | IEEE80211_HW_SPECTRUM_MGMT | | 5743 | IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC | IEEE80211_HW_SPECTRUM_MGMT | |
5744 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | IEEE80211_HW_SUPPORTS_PS | | 5744 | IEEE80211_HW_SUPPORTS_PS | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; |
5745 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; | ||
5746 | if (il->cfg->sku & IL_SKU_N) | 5745 | if (il->cfg->sku & IL_SKU_N) |
5747 | hw->flags |= | 5746 | hw->flags |= |
5748 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | | 5747 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index d3c8ece980d8..e42b266a023a 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2234,9 +2234,6 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
2234 | if (wdev->netdev->reg_state == NETREG_REGISTERED) | 2234 | if (wdev->netdev->reg_state == NETREG_REGISTERED) |
2235 | unregister_netdevice(wdev->netdev); | 2235 | unregister_netdevice(wdev->netdev); |
2236 | 2236 | ||
2237 | if (wdev->netdev->reg_state == NETREG_UNREGISTERED) | ||
2238 | free_netdev(wdev->netdev); | ||
2239 | |||
2240 | /* Clear the priv in adapter */ | 2237 | /* Clear the priv in adapter */ |
2241 | priv->netdev = NULL; | 2238 | priv->netdev = NULL; |
2242 | 2239 | ||
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 74db0d24a579..26755d9acb55 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -1191,6 +1191,7 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter) | |||
1191 | adapter->if_ops.wakeup(adapter); | 1191 | adapter->if_ops.wakeup(adapter); |
1192 | adapter->hs_activated = false; | 1192 | adapter->hs_activated = false; |
1193 | adapter->is_hs_configured = false; | 1193 | adapter->is_hs_configured = false; |
1194 | adapter->is_suspended = false; | ||
1194 | mwifiex_hs_activated_event(mwifiex_get_priv(adapter, | 1195 | mwifiex_hs_activated_event(mwifiex_get_priv(adapter, |
1195 | MWIFIEX_BSS_ROLE_ANY), | 1196 | MWIFIEX_BSS_ROLE_ANY), |
1196 | false); | 1197 | false); |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 121443a0f2a1..2eb88ea9acf7 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -655,6 +655,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv, | |||
655 | struct net_device *dev) | 655 | struct net_device *dev) |
656 | { | 656 | { |
657 | dev->netdev_ops = &mwifiex_netdev_ops; | 657 | dev->netdev_ops = &mwifiex_netdev_ops; |
658 | dev->destructor = free_netdev; | ||
658 | /* Initialize private structure */ | 659 | /* Initialize private structure */ |
659 | priv->current_key_index = 0; | 660 | priv->current_key_index = 0; |
660 | priv->media_connected = false; | 661 | priv->media_connected = false; |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 311d0b26b81c..1a8a19dbd635 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -96,7 +96,7 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, | |||
96 | } else { | 96 | } else { |
97 | /* Multicast */ | 97 | /* Multicast */ |
98 | priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; | 98 | priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; |
99 | if (mcast_list->mode == MWIFIEX_MULTICAST_MODE) { | 99 | if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) { |
100 | dev_dbg(priv->adapter->dev, | 100 | dev_dbg(priv->adapter->dev, |
101 | "info: Enabling All Multicast!\n"); | 101 | "info: Enabling All Multicast!\n"); |
102 | priv->curr_pkt_filter |= | 102 | priv->curr_pkt_filter |= |
@@ -108,20 +108,11 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, | |||
108 | dev_dbg(priv->adapter->dev, | 108 | dev_dbg(priv->adapter->dev, |
109 | "info: Set multicast list=%d\n", | 109 | "info: Set multicast list=%d\n", |
110 | mcast_list->num_multicast_addr); | 110 | mcast_list->num_multicast_addr); |
111 | /* Set multicast addresses to firmware */ | 111 | /* Send multicast addresses to firmware */ |
112 | if (old_pkt_filter == priv->curr_pkt_filter) { | 112 | ret = mwifiex_send_cmd_async(priv, |
113 | /* Send request to firmware */ | 113 | HostCmd_CMD_MAC_MULTICAST_ADR, |
114 | ret = mwifiex_send_cmd_async(priv, | 114 | HostCmd_ACT_GEN_SET, 0, |
115 | HostCmd_CMD_MAC_MULTICAST_ADR, | 115 | mcast_list); |
116 | HostCmd_ACT_GEN_SET, 0, | ||
117 | mcast_list); | ||
118 | } else { | ||
119 | /* Send request to firmware */ | ||
120 | ret = mwifiex_send_cmd_async(priv, | ||
121 | HostCmd_CMD_MAC_MULTICAST_ADR, | ||
122 | HostCmd_ACT_GEN_SET, 0, | ||
123 | mcast_list); | ||
124 | } | ||
125 | } | 116 | } |
126 | } | 117 | } |
127 | } | 118 | } |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 67f46ad6920a..352eec9df1b8 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -126,7 +126,7 @@ struct mlx4_rss_context { | |||
126 | 126 | ||
127 | struct mlx4_qp_path { | 127 | struct mlx4_qp_path { |
128 | u8 fl; | 128 | u8 fl; |
129 | u8 reserved1[1]; | 129 | u8 vlan_control; |
130 | u8 disable_pkey_check; | 130 | u8 disable_pkey_check; |
131 | u8 pkey_index; | 131 | u8 pkey_index; |
132 | u8 counter_index; | 132 | u8 counter_index; |
@@ -141,11 +141,32 @@ struct mlx4_qp_path { | |||
141 | u8 sched_queue; | 141 | u8 sched_queue; |
142 | u8 vlan_index; | 142 | u8 vlan_index; |
143 | u8 feup; | 143 | u8 feup; |
144 | u8 reserved3; | 144 | u8 fvl_rx; |
145 | u8 reserved4[2]; | 145 | u8 reserved4[2]; |
146 | u8 dmac[6]; | 146 | u8 dmac[6]; |
147 | }; | 147 | }; |
148 | 148 | ||
149 | enum { /* fl */ | ||
150 | MLX4_FL_CV = 1 << 6, | ||
151 | MLX4_FL_ETH_HIDE_CQE_VLAN = 1 << 2 | ||
152 | }; | ||
153 | enum { /* vlan_control */ | ||
154 | MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6, | ||
155 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2, | ||
156 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */ | ||
157 | MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0 | ||
158 | }; | ||
159 | |||
160 | enum { /* feup */ | ||
161 | MLX4_FEUP_FORCE_ETH_UP = 1 << 6, /* force Eth UP */ | ||
162 | MLX4_FSM_FORCE_ETH_SRC_MAC = 1 << 5, /* force Source MAC */ | ||
163 | MLX4_FVL_FORCE_ETH_VLAN = 1 << 3 /* force Eth vlan */ | ||
164 | }; | ||
165 | |||
166 | enum { /* fvl_rx */ | ||
167 | MLX4_FVL_RX_FORCE_ETH_VLAN = 1 << 0 /* enforce Eth rx vlan */ | ||
168 | }; | ||
169 | |||
149 | struct mlx4_qp_context { | 170 | struct mlx4_qp_context { |
150 | __be32 flags; | 171 | __be32 flags; |
151 | __be32 pd; | 172 | __be32 pd; |
@@ -185,6 +206,10 @@ struct mlx4_qp_context { | |||
185 | u32 reserved5[10]; | 206 | u32 reserved5[10]; |
186 | }; | 207 | }; |
187 | 208 | ||
209 | enum { /* param3 */ | ||
210 | MLX4_STRIP_VLAN = 1 << 30 | ||
211 | }; | ||
212 | |||
188 | /* Which firmware version adds support for NEC (NoErrorCompletion) bit */ | 213 | /* Which firmware version adds support for NEC (NoErrorCompletion) bit */ |
189 | #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) | 214 | #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) |
190 | 215 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 5c97b0fc5623..66772cf8c3c5 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -866,6 +866,18 @@ struct inet_hashinfo; | |||
866 | struct raw_hashinfo; | 866 | struct raw_hashinfo; |
867 | struct module; | 867 | struct module; |
868 | 868 | ||
869 | /* | ||
870 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
871 | * un-modified. Special care is taken when initializing object to zero. | ||
872 | */ | ||
873 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
874 | { | ||
875 | if (offsetof(struct sock, sk_node.next) != 0) | ||
876 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
877 | memset(&sk->sk_node.pprev, 0, | ||
878 | size - offsetof(struct sock, sk_node.pprev)); | ||
879 | } | ||
880 | |||
869 | /* Networking protocol blocks we attach to sockets. | 881 | /* Networking protocol blocks we attach to sockets. |
870 | * socket layer -> transport layer interface | 882 | * socket layer -> transport layer interface |
871 | * transport -> network interface is defined by struct inet_proto | 883 | * transport -> network interface is defined by struct inet_proto |
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 8e15d966d9b0..239992021b1d 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c | |||
@@ -837,6 +837,19 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, | |||
837 | 837 | ||
838 | dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst); | 838 | dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst); |
839 | if (dat_entry) { | 839 | if (dat_entry) { |
840 | /* If the ARP request is destined for a local client the local | ||
841 | * client will answer itself. DAT would only generate a | ||
842 | * duplicate packet. | ||
843 | * | ||
844 | * Moreover, if the soft-interface is enslaved into a bridge, an | ||
845 | * additional DAT answer may trigger kernel warnings about | ||
846 | * a packet coming from the wrong port. | ||
847 | */ | ||
848 | if (batadv_is_my_client(bat_priv, dat_entry->mac_addr)) { | ||
849 | ret = true; | ||
850 | goto out; | ||
851 | } | ||
852 | |||
840 | skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src, | 853 | skb_new = arp_create(ARPOP_REPLY, ETH_P_ARP, ip_src, |
841 | bat_priv->soft_iface, ip_dst, hw_src, | 854 | bat_priv->soft_iface, ip_dst, hw_src, |
842 | dat_entry->mac_addr, hw_src); | 855 | dat_entry->mac_addr, hw_src); |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 3e30a0f1b908..1240f07ad31d 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -163,14 +163,22 @@ void batadv_mesh_free(struct net_device *soft_iface) | |||
163 | batadv_vis_quit(bat_priv); | 163 | batadv_vis_quit(bat_priv); |
164 | 164 | ||
165 | batadv_gw_node_purge(bat_priv); | 165 | batadv_gw_node_purge(bat_priv); |
166 | batadv_originator_free(bat_priv); | ||
167 | batadv_nc_free(bat_priv); | 166 | batadv_nc_free(bat_priv); |
167 | batadv_dat_free(bat_priv); | ||
168 | batadv_bla_free(bat_priv); | ||
168 | 169 | ||
170 | /* Free the TT and the originator tables only after having terminated | ||
171 | * all the other depending components which may use these structures for | ||
172 | * their purposes. | ||
173 | */ | ||
169 | batadv_tt_free(bat_priv); | 174 | batadv_tt_free(bat_priv); |
170 | 175 | ||
171 | batadv_bla_free(bat_priv); | 176 | /* Since the originator table clean up routine is accessing the TT |
172 | 177 | * tables as well, it has to be invoked after the TT tables have been | |
173 | batadv_dat_free(bat_priv); | 178 | * freed and marked as empty. This ensures that no cleanup RCU callbacks |
179 | * accessing the TT data are scheduled for later execution. | ||
180 | */ | ||
181 | batadv_originator_free(bat_priv); | ||
174 | 182 | ||
175 | free_percpu(bat_priv->bat_counters); | 183 | free_percpu(bat_priv->bat_counters); |
176 | 184 | ||
@@ -475,7 +483,7 @@ static int batadv_param_set_ra(const char *val, const struct kernel_param *kp) | |||
475 | char *algo_name = (char *)val; | 483 | char *algo_name = (char *)val; |
476 | size_t name_len = strlen(algo_name); | 484 | size_t name_len = strlen(algo_name); |
477 | 485 | ||
478 | if (algo_name[name_len - 1] == '\n') | 486 | if (name_len > 0 && algo_name[name_len - 1] == '\n') |
479 | algo_name[name_len - 1] = '\0'; | 487 | algo_name[name_len - 1] = '\0'; |
480 | 488 | ||
481 | bat_algo_ops = batadv_algo_get(algo_name); | 489 | bat_algo_ops = batadv_algo_get(algo_name); |
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index f7c54305a918..e84629ece9b7 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c | |||
@@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1514 | struct ethhdr *ethhdr, ethhdr_tmp; | 1514 | struct ethhdr *ethhdr, ethhdr_tmp; |
1515 | uint8_t *orig_dest, ttl, ttvn; | 1515 | uint8_t *orig_dest, ttl, ttvn; |
1516 | unsigned int coding_len; | 1516 | unsigned int coding_len; |
1517 | int err; | ||
1517 | 1518 | ||
1518 | /* Save headers temporarily */ | 1519 | /* Save headers temporarily */ |
1519 | memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp)); | 1520 | memcpy(&coded_packet_tmp, skb->data, sizeof(coded_packet_tmp)); |
@@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, | |||
1568 | coding_len); | 1569 | coding_len); |
1569 | 1570 | ||
1570 | /* Resize decoded skb if decoded with larger packet */ | 1571 | /* Resize decoded skb if decoded with larger packet */ |
1571 | if (nc_packet->skb->len > coding_len + h_size) | 1572 | if (nc_packet->skb->len > coding_len + h_size) { |
1572 | pskb_trim_rcsum(skb, coding_len + h_size); | 1573 | err = pskb_trim_rcsum(skb, coding_len + h_size); |
1574 | if (err) | ||
1575 | return NULL; | ||
1576 | } | ||
1573 | 1577 | ||
1574 | /* Create decoded unicast packet */ | 1578 | /* Create decoded unicast packet */ |
1575 | unicast_packet = (struct batadv_unicast_packet *)skb->data; | 1579 | unicast_packet = (struct batadv_unicast_packet *)skb->data; |
diff --git a/net/core/sock.c b/net/core/sock.c index d4f4cea726e7..6ba327da79e1 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1217,18 +1217,6 @@ static void sock_copy(struct sock *nsk, const struct sock *osk) | |||
1217 | #endif | 1217 | #endif |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | /* | ||
1221 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
1222 | * un-modified. Special care is taken when initializing object to zero. | ||
1223 | */ | ||
1224 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
1225 | { | ||
1226 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1227 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1228 | memset(&sk->sk_node.pprev, 0, | ||
1229 | size - offsetof(struct sock, sk_node.pprev)); | ||
1230 | } | ||
1231 | |||
1232 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) | 1220 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) |
1233 | { | 1221 | { |
1234 | unsigned long nulls1, nulls2; | 1222 | unsigned long nulls1, nulls2; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 147abf5275aa..4bcabf3ab4ca 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -84,7 +84,7 @@ int sysctl_ip_default_ttl __read_mostly = IPDEFTTL; | |||
84 | EXPORT_SYMBOL(sysctl_ip_default_ttl); | 84 | EXPORT_SYMBOL(sysctl_ip_default_ttl); |
85 | 85 | ||
86 | /* Generate a checksum for an outgoing IP datagram. */ | 86 | /* Generate a checksum for an outgoing IP datagram. */ |
87 | __inline__ void ip_send_check(struct iphdr *iph) | 87 | void ip_send_check(struct iphdr *iph) |
88 | { | 88 | { |
89 | iph->check = 0; | 89 | iph->check = 0; |
90 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 90 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index d3ddd8400354..ecd60733e5e2 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -1081,6 +1081,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev, | |||
1081 | } | 1081 | } |
1082 | if (t == NULL) | 1082 | if (t == NULL) |
1083 | t = netdev_priv(dev); | 1083 | t = netdev_priv(dev); |
1084 | memset(&p, 0, sizeof(p)); | ||
1084 | ip6gre_tnl_parm_to_user(&p, &t->parms); | 1085 | ip6gre_tnl_parm_to_user(&p, &t->parms); |
1085 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) | 1086 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) |
1086 | err = -EFAULT; | 1087 | err = -EFAULT; |
@@ -1128,6 +1129,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev, | |||
1128 | if (t) { | 1129 | if (t) { |
1129 | err = 0; | 1130 | err = 0; |
1130 | 1131 | ||
1132 | memset(&p, 0, sizeof(p)); | ||
1131 | ip6gre_tnl_parm_to_user(&p, &t->parms); | 1133 | ip6gre_tnl_parm_to_user(&p, &t->parms); |
1132 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) | 1134 | if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) |
1133 | err = -EFAULT; | 1135 | err = -EFAULT; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 71167069b394..0a17ed9eaf39 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1890,6 +1890,17 @@ void tcp6_proc_exit(struct net *net) | |||
1890 | } | 1890 | } |
1891 | #endif | 1891 | #endif |
1892 | 1892 | ||
1893 | static void tcp_v6_clear_sk(struct sock *sk, int size) | ||
1894 | { | ||
1895 | struct inet_sock *inet = inet_sk(sk); | ||
1896 | |||
1897 | /* we do not want to clear pinet6 field, because of RCU lookups */ | ||
1898 | sk_prot_clear_nulls(sk, offsetof(struct inet_sock, pinet6)); | ||
1899 | |||
1900 | size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); | ||
1901 | memset(&inet->pinet6 + 1, 0, size); | ||
1902 | } | ||
1903 | |||
1893 | struct proto tcpv6_prot = { | 1904 | struct proto tcpv6_prot = { |
1894 | .name = "TCPv6", | 1905 | .name = "TCPv6", |
1895 | .owner = THIS_MODULE, | 1906 | .owner = THIS_MODULE, |
@@ -1933,6 +1944,7 @@ struct proto tcpv6_prot = { | |||
1933 | #ifdef CONFIG_MEMCG_KMEM | 1944 | #ifdef CONFIG_MEMCG_KMEM |
1934 | .proto_cgroup = tcp_proto_cgroup, | 1945 | .proto_cgroup = tcp_proto_cgroup, |
1935 | #endif | 1946 | #endif |
1947 | .clear_sk = tcp_v6_clear_sk, | ||
1936 | }; | 1948 | }; |
1937 | 1949 | ||
1938 | static const struct inet6_protocol tcpv6_protocol = { | 1950 | static const struct inet6_protocol tcpv6_protocol = { |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index d4defdd44937..42923b14dfa6 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1432,6 +1432,17 @@ void udp6_proc_exit(struct net *net) { | |||
1432 | } | 1432 | } |
1433 | #endif /* CONFIG_PROC_FS */ | 1433 | #endif /* CONFIG_PROC_FS */ |
1434 | 1434 | ||
1435 | void udp_v6_clear_sk(struct sock *sk, int size) | ||
1436 | { | ||
1437 | struct inet_sock *inet = inet_sk(sk); | ||
1438 | |||
1439 | /* we do not want to clear pinet6 field, because of RCU lookups */ | ||
1440 | sk_prot_clear_portaddr_nulls(sk, offsetof(struct inet_sock, pinet6)); | ||
1441 | |||
1442 | size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); | ||
1443 | memset(&inet->pinet6 + 1, 0, size); | ||
1444 | } | ||
1445 | |||
1435 | /* ------------------------------------------------------------------------ */ | 1446 | /* ------------------------------------------------------------------------ */ |
1436 | 1447 | ||
1437 | struct proto udpv6_prot = { | 1448 | struct proto udpv6_prot = { |
@@ -1462,7 +1473,7 @@ struct proto udpv6_prot = { | |||
1462 | .compat_setsockopt = compat_udpv6_setsockopt, | 1473 | .compat_setsockopt = compat_udpv6_setsockopt, |
1463 | .compat_getsockopt = compat_udpv6_getsockopt, | 1474 | .compat_getsockopt = compat_udpv6_getsockopt, |
1464 | #endif | 1475 | #endif |
1465 | .clear_sk = sk_prot_clear_portaddr_nulls, | 1476 | .clear_sk = udp_v6_clear_sk, |
1466 | }; | 1477 | }; |
1467 | 1478 | ||
1468 | static struct inet_protosw udpv6_protosw = { | 1479 | static struct inet_protosw udpv6_protosw = { |
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h index d7571046bfc4..4691ed50a928 100644 --- a/net/ipv6/udp_impl.h +++ b/net/ipv6/udp_impl.h | |||
@@ -31,6 +31,8 @@ extern int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
31 | extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); | 31 | extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); |
32 | extern void udpv6_destroy_sock(struct sock *sk); | 32 | extern void udpv6_destroy_sock(struct sock *sk); |
33 | 33 | ||
34 | extern void udp_v6_clear_sk(struct sock *sk, int size); | ||
35 | |||
34 | #ifdef CONFIG_PROC_FS | 36 | #ifdef CONFIG_PROC_FS |
35 | extern int udp6_seq_show(struct seq_file *seq, void *v); | 37 | extern int udp6_seq_show(struct seq_file *seq, void *v); |
36 | #endif | 38 | #endif |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 1d08e21d9f69..dfcc4be46898 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -56,7 +56,7 @@ struct proto udplitev6_prot = { | |||
56 | .compat_setsockopt = compat_udpv6_setsockopt, | 56 | .compat_setsockopt = compat_udpv6_setsockopt, |
57 | .compat_getsockopt = compat_udpv6_getsockopt, | 57 | .compat_getsockopt = compat_udpv6_getsockopt, |
58 | #endif | 58 | #endif |
59 | .clear_sk = sk_prot_clear_portaddr_nulls, | 59 | .clear_sk = udp_v6_clear_sk, |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static struct inet_protosw udplite6_protosw = { | 62 | static struct inet_protosw udplite6_protosw = { |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 4ef7bdb65440..23ed03d786c8 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -103,8 +103,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, | |||
103 | dev_hold(dev); | 103 | dev_hold(dev); |
104 | 104 | ||
105 | xdst->u.rt6.rt6i_idev = in6_dev_get(dev); | 105 | xdst->u.rt6.rt6i_idev = in6_dev_get(dev); |
106 | if (!xdst->u.rt6.rt6i_idev) | 106 | if (!xdst->u.rt6.rt6i_idev) { |
107 | dev_put(dev); | ||
107 | return -ENODEV; | 108 | return -ENODEV; |
109 | } | ||
108 | 110 | ||
109 | rt6_transfer_peer(&xdst->u.rt6, rt); | 111 | rt6_transfer_peer(&xdst->u.rt6, rt); |
110 | 112 | ||