diff options
-rw-r--r-- | drivers/net/ethernet/freescale/fec.c | 34 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 6 |
2 files changed, 37 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index cce78ceb63e..1124ce0a159 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -177,6 +177,8 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define PKT_MINBUF_SIZE 64 #define PKT_MAXBLR_SIZE 1520 +/* This device has up to three irqs on some platforms */ +#define FEC_IRQ_NUM 3 /* * The 5270/5271/5280/5282/532x RX control register also contains maximum frame @@ -240,6 +242,7 @@ struct fec_enet_private { int link; int full_duplex; struct completion mdio_done; + int irq[FEC_IRQ_NUM]; }; /* FEC MII MMFR bits definition */ @@ -1361,6 +1364,29 @@ fec_set_mac_address(struct net_device *ndev, void *p) return 0; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * fec_poll_controller: FEC Poll controller function + * @dev: The FEC network adapter + * + * Polled functionality used by netconsole and others in non interrupt mode + * + */ +void fec_poll_controller(struct net_device *dev) +{ + int i; + struct fec_enet_private *fep = netdev_priv(dev); + + for (i = 0; i < FEC_IRQ_NUM; i++) { + if (fep->irq[i] > 0) { + disable_irq(fep->irq[i]); + fec_enet_interrupt(fep->irq[i], dev); + enable_irq(fep->irq[i]); + } + } +} +#endif + static const struct net_device_ops fec_netdev_ops = { .ndo_open = fec_enet_open, .ndo_stop = fec_enet_close, @@ -1371,6 +1397,9 @@ static const struct net_device_ops fec_netdev_ops = { .ndo_tx_timeout = fec_timeout, .ndo_set_mac_address = fec_set_mac_address, .ndo_do_ioctl = fec_enet_ioctl, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = fec_poll_controller, +#endif }; /* @@ -1540,8 +1569,7 @@ fec_probe(struct platform_device *pdev) fec_reset_phy(pdev); - /* This device has up to three irqs on some platforms */ - for (i = 0; i < 3; i++) { + for (i = 0; i < FEC_IRQ_NUM; i++) { irq = platform_get_irq(pdev, i); if (i && irq < 0) break; @@ -1586,7 +1614,7 @@ failed_init: clk_disable(fep->clk); clk_put(fep->clk); failed_clk: - for (i = 0; i < 3; i++) { + for (i = 0; i < FEC_IRQ_NUM; i++) { irq = platform_get_irq(pdev, i); if (irq > 0) free_irq(irq, ndev); diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ce395fe5de2..cdb958875ba 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -238,6 +238,10 @@ void usbnet_skb_return (struct usbnet *dev, struct sk_buff *skb) netif_dbg(dev, rx_status, dev->net, "< rx, len %zu, type 0x%x\n", skb->len + sizeof (struct ethhdr), skb->protocol); memset (skb->cb, 0, sizeof (struct skb_data)); + + if (skb_defer_rx_timestamp(skb)) + return; + status = netif_rx (skb); if (status != NET_RX_SUCCESS) netif_dbg(dev, rx_err, dev->net, @@ -1053,6 +1057,8 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, unsigned long flags; int retval; + skb_tx_timestamp(skb); + // some devices want funky USB-level framing, for // win32 driver (usually) and/or hardware quirks if (info->tx_fixup) { |