diff options
author | David S. Miller <davem@davemloft.net> | 2014-07-30 16:25:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-30 16:25:49 -0400 |
commit | f139c74a8df071217dcd63f3ef06ae7be7071c4d (patch) | |
tree | 5711f695577a18a06dbcd0101956e97b388ffa1a /drivers/net | |
parent | bd695a5f0ccf7b38982c426d86055ff3591c9b5b (diff) | |
parent | 26bcd8b72563b4c54892c4c2a409f6656fb8ae8b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/c_can/c_can_platform.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-main.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/sun/sunvnet.c | 22 | ||||
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 1 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 15 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 16 | ||||
-rw-r--r-- | drivers/net/usb/r8152.c | 7 | ||||
-rw-r--r-- | drivers/net/vxlan.c | 2 |
13 files changed, 75 insertions, 14 deletions
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index e29b6d051103..5dede6e64376 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
@@ -278,7 +278,8 @@ static int c_can_plat_probe(struct platform_device *pdev) | |||
278 | break; | 278 | break; |
279 | } | 279 | } |
280 | 280 | ||
281 | priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res); | 281 | priv->raminit_ctrlreg = devm_ioremap(&pdev->dev, res->start, |
282 | resource_size(res)); | ||
282 | if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) | 283 | if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) |
283 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); | 284 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); |
284 | else | 285 | else |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c index d5a4f76e9474..e56c3d45b30e 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c | |||
@@ -349,7 +349,8 @@ static int xgbe_probe(struct platform_device *pdev) | |||
349 | /* Calculate the number of Tx and Rx rings to be created */ | 349 | /* Calculate the number of Tx and Rx rings to be created */ |
350 | pdata->tx_ring_count = min_t(unsigned int, num_online_cpus(), | 350 | pdata->tx_ring_count = min_t(unsigned int, num_online_cpus(), |
351 | pdata->hw_feat.tx_ch_cnt); | 351 | pdata->hw_feat.tx_ch_cnt); |
352 | if (netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count)) { | 352 | ret = netif_set_real_num_tx_queues(netdev, pdata->tx_ring_count); |
353 | if (ret) { | ||
353 | dev_err(dev, "error setting real tx queue count\n"); | 354 | dev_err(dev, "error setting real tx queue count\n"); |
354 | goto err_io; | 355 | goto err_io; |
355 | } | 356 | } |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index ce8f86966c11..d777fae86988 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -346,6 +346,7 @@ struct sw_tx_bd { | |||
346 | u8 flags; | 346 | u8 flags; |
347 | /* Set on the first BD descriptor when there is a split BD */ | 347 | /* Set on the first BD descriptor when there is a split BD */ |
348 | #define BNX2X_TSO_SPLIT_BD (1<<0) | 348 | #define BNX2X_TSO_SPLIT_BD (1<<0) |
349 | #define BNX2X_HAS_SECOND_PBD (1<<1) | ||
349 | }; | 350 | }; |
350 | 351 | ||
351 | struct sw_rx_page { | 352 | struct sw_rx_page { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index dca1236dd1cd..4e6c82e20224 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -227,6 +227,12 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, | |||
227 | --nbd; | 227 | --nbd; |
228 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | 228 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); |
229 | 229 | ||
230 | if (tx_buf->flags & BNX2X_HAS_SECOND_PBD) { | ||
231 | /* Skip second parse bd... */ | ||
232 | --nbd; | ||
233 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | ||
234 | } | ||
235 | |||
230 | /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ | 236 | /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ |
231 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { | 237 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { |
232 | tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd; | 238 | tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd; |
@@ -3902,6 +3908,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3902 | /* set encapsulation flag in start BD */ | 3908 | /* set encapsulation flag in start BD */ |
3903 | SET_FLAG(tx_start_bd->general_data, | 3909 | SET_FLAG(tx_start_bd->general_data, |
3904 | ETH_TX_START_BD_TUNNEL_EXIST, 1); | 3910 | ETH_TX_START_BD_TUNNEL_EXIST, 1); |
3911 | |||
3912 | tx_buf->flags |= BNX2X_HAS_SECOND_PBD; | ||
3913 | |||
3905 | nbd++; | 3914 | nbd++; |
3906 | } else if (xmit_type & XMIT_CSUM) { | 3915 | } else if (xmit_type & XMIT_CSUM) { |
3907 | /* Set PBD in checksum offload case w/o encapsulation */ | 3916 | /* Set PBD in checksum offload case w/o encapsulation */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 08ea91cab738..92fee842f954 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -416,6 +416,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
416 | break; | 416 | break; |
417 | case PORT_FIBRE: | 417 | case PORT_FIBRE: |
418 | case PORT_DA: | 418 | case PORT_DA: |
419 | case PORT_NONE: | ||
419 | if (!(bp->port.supported[0] & SUPPORTED_FIBRE || | 420 | if (!(bp->port.supported[0] & SUPPORTED_FIBRE || |
420 | bp->port.supported[1] & SUPPORTED_FIBRE)) { | 421 | bp->port.supported[1] & SUPPORTED_FIBRE)) { |
421 | DP(BNX2X_MSG_ETHTOOL, | 422 | DP(BNX2X_MSG_ETHTOOL, |
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 28c8111502cd..417ce68449a4 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
@@ -1147,6 +1147,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1147 | goto out; | 1147 | goto out; |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | if (skb_padto(skb, ETH_ZLEN)) { | ||
1151 | ret = NETDEV_TX_OK; | ||
1152 | goto out; | ||
1153 | } | ||
1154 | |||
1150 | /* set the SKB transmit checksum */ | 1155 | /* set the SKB transmit checksum */ |
1151 | if (priv->desc_64b_en) { | 1156 | if (priv->desc_64b_en) { |
1152 | ret = bcmgenet_put_tx_csum(dev, skb); | 1157 | ret = bcmgenet_put_tx_csum(dev, skb); |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index fd411d6e19a2..d813bfb1a847 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -610,6 +610,13 @@ static int __vnet_tx_trigger(struct vnet_port *port) | |||
610 | return err; | 610 | return err; |
611 | } | 611 | } |
612 | 612 | ||
613 | static inline bool port_is_up(struct vnet_port *vnet) | ||
614 | { | ||
615 | struct vio_driver_state *vio = &vnet->vio; | ||
616 | |||
617 | return !!(vio->hs_state & VIO_HS_COMPLETE); | ||
618 | } | ||
619 | |||
613 | struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) | 620 | struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) |
614 | { | 621 | { |
615 | unsigned int hash = vnet_hashfn(skb->data); | 622 | unsigned int hash = vnet_hashfn(skb->data); |
@@ -617,14 +624,19 @@ struct vnet_port *__tx_port_find(struct vnet *vp, struct sk_buff *skb) | |||
617 | struct vnet_port *port; | 624 | struct vnet_port *port; |
618 | 625 | ||
619 | hlist_for_each_entry(port, hp, hash) { | 626 | hlist_for_each_entry(port, hp, hash) { |
627 | if (!port_is_up(port)) | ||
628 | continue; | ||
620 | if (ether_addr_equal(port->raddr, skb->data)) | 629 | if (ether_addr_equal(port->raddr, skb->data)) |
621 | return port; | 630 | return port; |
622 | } | 631 | } |
623 | port = NULL; | 632 | list_for_each_entry(port, &vp->port_list, list) { |
624 | if (!list_empty(&vp->port_list)) | 633 | if (!port->switch_port) |
625 | port = list_entry(vp->port_list.next, struct vnet_port, list); | 634 | continue; |
626 | 635 | if (!port_is_up(port)) | |
627 | return port; | 636 | continue; |
637 | return port; | ||
638 | } | ||
639 | return NULL; | ||
628 | } | 640 | } |
629 | 641 | ||
630 | struct vnet_port *tx_port_find(struct vnet *vp, struct sk_buff *skb) | 642 | struct vnet_port *tx_port_find(struct vnet *vp, struct sk_buff *skb) |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index f13e0acc8a69..592977a6547c 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device) | |||
378 | 378 | ||
379 | net_device->send_section_map = | 379 | net_device->send_section_map = |
380 | kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL); | 380 | kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL); |
381 | if (net_device->send_section_map == NULL) | 381 | if (net_device->send_section_map == NULL) { |
382 | ret = -ENOMEM; | ||
382 | goto cleanup; | 383 | goto cleanup; |
384 | } | ||
383 | 385 | ||
384 | goto exit; | 386 | goto exit; |
385 | 387 | ||
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 4eaadcfcb0fe..203651ebccb0 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -255,6 +255,7 @@ int mdiobus_register(struct mii_bus *bus) | |||
255 | 255 | ||
256 | bus->dev.parent = bus->parent; | 256 | bus->dev.parent = bus->parent; |
257 | bus->dev.class = &mdio_bus_class; | 257 | bus->dev.class = &mdio_bus_class; |
258 | bus->dev.driver = bus->parent->driver; | ||
258 | bus->dev.groups = NULL; | 259 | bus->dev.groups = NULL; |
259 | dev_set_name(&bus->dev, "%s", bus->id); | 260 | dev_set_name(&bus->dev, "%s", bus->id); |
260 | 261 | ||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 4f4568ef124e..ca5ec3e18d36 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -355,7 +355,7 @@ int phy_device_register(struct phy_device *phydev) | |||
355 | phydev->bus->phy_map[phydev->addr] = phydev; | 355 | phydev->bus->phy_map[phydev->addr] = phydev; |
356 | 356 | ||
357 | /* Run all of the fixups for this PHY */ | 357 | /* Run all of the fixups for this PHY */ |
358 | err = phy_init_hw(phydev); | 358 | err = phy_scan_fixups(phydev); |
359 | if (err) { | 359 | if (err) { |
360 | pr_err("PHY %d failed to initialize\n", phydev->addr); | 360 | pr_err("PHY %d failed to initialize\n", phydev->addr); |
361 | goto out; | 361 | goto out; |
@@ -575,6 +575,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
575 | u32 flags, phy_interface_t interface) | 575 | u32 flags, phy_interface_t interface) |
576 | { | 576 | { |
577 | struct device *d = &phydev->dev; | 577 | struct device *d = &phydev->dev; |
578 | struct module *bus_module; | ||
578 | int err; | 579 | int err; |
579 | 580 | ||
580 | /* Assume that if there is no driver, that it doesn't | 581 | /* Assume that if there is no driver, that it doesn't |
@@ -599,6 +600,14 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
599 | return -EBUSY; | 600 | return -EBUSY; |
600 | } | 601 | } |
601 | 602 | ||
603 | /* Increment the bus module reference count */ | ||
604 | bus_module = phydev->bus->dev.driver ? | ||
605 | phydev->bus->dev.driver->owner : NULL; | ||
606 | if (!try_module_get(bus_module)) { | ||
607 | dev_err(&dev->dev, "failed to get the bus module\n"); | ||
608 | return -EIO; | ||
609 | } | ||
610 | |||
602 | phydev->attached_dev = dev; | 611 | phydev->attached_dev = dev; |
603 | dev->phydev = phydev; | 612 | dev->phydev = phydev; |
604 | 613 | ||
@@ -664,6 +673,10 @@ EXPORT_SYMBOL(phy_attach); | |||
664 | void phy_detach(struct phy_device *phydev) | 673 | void phy_detach(struct phy_device *phydev) |
665 | { | 674 | { |
666 | int i; | 675 | int i; |
676 | |||
677 | if (phydev->bus->dev.driver) | ||
678 | module_put(phydev->bus->dev.driver->owner); | ||
679 | |||
667 | phydev->attached_dev->phydev = NULL; | 680 | phydev->attached_dev->phydev = NULL; |
668 | phydev->attached_dev = NULL; | 681 | phydev->attached_dev = NULL; |
669 | phy_suspend(phydev); | 682 | phy_suspend(phydev); |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 9ea4bfe5d318..2a32d9167d3b 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -341,6 +341,22 @@ next_desc: | |||
341 | usb_driver_release_interface(driver, info->data); | 341 | usb_driver_release_interface(driver, info->data); |
342 | return -ENODEV; | 342 | return -ENODEV; |
343 | } | 343 | } |
344 | |||
345 | /* Some devices don't initialise properly. In particular | ||
346 | * the packet filter is not reset. There are devices that | ||
347 | * don't do reset all the way. So the packet filter should | ||
348 | * be set to a sane initial value. | ||
349 | */ | ||
350 | usb_control_msg(dev->udev, | ||
351 | usb_sndctrlpipe(dev->udev, 0), | ||
352 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
353 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
354 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST, | ||
355 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
356 | NULL, | ||
357 | 0, | ||
358 | USB_CTRL_SET_TIMEOUT | ||
359 | ); | ||
344 | return 0; | 360 | return 0; |
345 | 361 | ||
346 | bad_desc: | 362 | bad_desc: |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e1e430587868..87f710476217 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -287,7 +287,7 @@ | |||
287 | /* USB_DEV_STAT */ | 287 | /* USB_DEV_STAT */ |
288 | #define STAT_SPEED_MASK 0x0006 | 288 | #define STAT_SPEED_MASK 0x0006 |
289 | #define STAT_SPEED_HIGH 0x0000 | 289 | #define STAT_SPEED_HIGH 0x0000 |
290 | #define STAT_SPEED_FULL 0x0001 | 290 | #define STAT_SPEED_FULL 0x0002 |
291 | 291 | ||
292 | /* USB_TX_AGG */ | 292 | /* USB_TX_AGG */ |
293 | #define TX_AGG_MAX_THRESHOLD 0x03 | 293 | #define TX_AGG_MAX_THRESHOLD 0x03 |
@@ -2300,9 +2300,8 @@ static void r8152b_exit_oob(struct r8152 *tp) | |||
2300 | /* rx share fifo credit full threshold */ | 2300 | /* rx share fifo credit full threshold */ |
2301 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL); | 2301 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL); |
2302 | 2302 | ||
2303 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_DEV_STAT); | 2303 | if (tp->udev->speed == USB_SPEED_FULL || |
2304 | ocp_data &= STAT_SPEED_MASK; | 2304 | tp->udev->speed == USB_SPEED_LOW) { |
2305 | if (ocp_data == STAT_SPEED_FULL) { | ||
2306 | /* rx share fifo credit near full threshold */ | 2305 | /* rx share fifo credit near full threshold */ |
2307 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, | 2306 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, |
2308 | RXFIFO_THR2_FULL); | 2307 | RXFIFO_THR2_FULL); |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d3f3e5d21874..1fb7b37d1402 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -340,7 +340,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan, | |||
340 | ndm->ndm_state = fdb->state; | 340 | ndm->ndm_state = fdb->state; |
341 | ndm->ndm_ifindex = vxlan->dev->ifindex; | 341 | ndm->ndm_ifindex = vxlan->dev->ifindex; |
342 | ndm->ndm_flags = fdb->flags; | 342 | ndm->ndm_flags = fdb->flags; |
343 | ndm->ndm_type = NDA_DST; | 343 | ndm->ndm_type = RTN_UNICAST; |
344 | 344 | ||
345 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) | 345 | if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr)) |
346 | goto nla_put_failure; | 346 | goto nla_put_failure; |