Commit 2a2529ef authored by Matthew Whitehead's avatar Matthew Whitehead Committed by David S. Miller

3c59x: Add software timestamping

Added software timestamping ability. Tested with linuxptp and synchronized
clocks to an average of less than 200 microseconds on 10 megabit ethernet.

Tested on both Vortex and Boomerang models.
Signed-off-by: default avatarMatthew Whitehead <tedheadster@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23721754
...@@ -2079,10 +2079,12 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2079,10 +2079,12 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
iowrite16(len, ioaddr + Wn7_MasterLen); iowrite16(len, ioaddr + Wn7_MasterLen);
spin_unlock_irq(&vp->window_lock); spin_unlock_irq(&vp->window_lock);
vp->tx_skb = skb; vp->tx_skb = skb;
skb_tx_timestamp(skb);
iowrite16(StartDMADown, ioaddr + EL3_CMD); iowrite16(StartDMADown, ioaddr + EL3_CMD);
/* netif_wake_queue() will be called at the DMADone interrupt. */ /* netif_wake_queue() will be called at the DMADone interrupt. */
} else { } else {
/* ... and the packet rounded to a doubleword. */ /* ... and the packet rounded to a doubleword. */
skb_tx_timestamp(skb);
iowrite32_rep(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); iowrite32_rep(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
dev_kfree_skb (skb); dev_kfree_skb (skb);
if (ioread16(ioaddr + TxFree) > 1536) { if (ioread16(ioaddr + TxFree) > 1536) {
...@@ -2212,6 +2214,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2212,6 +2214,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
prev_entry->status &= cpu_to_le32(~TxIntrUploaded); prev_entry->status &= cpu_to_le32(~TxIntrUploaded);
#endif #endif
} }
skb_tx_timestamp(skb);
iowrite16(DownUnstall, ioaddr + EL3_CMD); iowrite16(DownUnstall, ioaddr + EL3_CMD);
spin_unlock_irqrestore(&vp->lock, flags); spin_unlock_irqrestore(&vp->lock, flags);
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -2986,6 +2989,7 @@ static const struct ethtool_ops vortex_ethtool_ops = { ...@@ -2986,6 +2989,7 @@ static const struct ethtool_ops vortex_ethtool_ops = {
.nway_reset = vortex_nway_reset, .nway_reset = vortex_nway_reset,
.get_wol = vortex_get_wol, .get_wol = vortex_get_wol,
.set_wol = vortex_set_wol, .set_wol = vortex_set_wol,
.get_ts_info = ethtool_op_get_ts_info,
}; };
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment