]> Pileus Git - ~andy/linux/blobdiff - include/linux/skbuff.h
net: add driver hook for tx time stamping.
[~andy/linux] / include / linux / skbuff.h
index ac74ee085d743139faddc1f36958a99c0f7f6a05..a1b0400c8d8648c41c47efba7e6f039b61f383f9 100644 (file)
@@ -1947,6 +1947,27 @@ static inline ktime_t net_invalid_timestamp(void)
 extern void skb_tstamp_tx(struct sk_buff *orig_skb,
                        struct skb_shared_hwtstamps *hwtstamps);
 
+static inline void sw_tx_timestamp(struct sk_buff *skb)
+{
+       union skb_shared_tx *shtx = skb_tx(skb);
+       if (shtx->software && !shtx->in_progress)
+               skb_tstamp_tx(skb, NULL);
+}
+
+/**
+ * skb_tx_timestamp() - Driver hook for transmit timestamping
+ *
+ * Ethernet MAC Drivers should call this function in their hard_xmit()
+ * function as soon as possible after giving the sk_buff to the MAC
+ * hardware, but before freeing the sk_buff.
+ *
+ * @skb: A socket buffer.
+ */
+static inline void skb_tx_timestamp(struct sk_buff *skb)
+{
+       sw_tx_timestamp(skb);
+}
+
 extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
 extern __sum16 __skb_checksum_complete(struct sk_buff *skb);