Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266214
b: refs/heads/master
c: 3869f80
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 29, 2011
1 parent 099eaaf commit 892e26c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ccb974df5ac5f721491c1f07154450168b6fd0a
refs/heads/master: 3869f80605847b2235b9be01e59606d9b5606d96
34 changes: 31 additions & 3 deletions trunk/drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
Expand All @@ -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
};

/*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1586,7 +1614,7 @@ fec_probe(struct platform_device *pdev)
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);
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 892e26c

Please sign in to comment.