diff options
| author | Richard Cochran <richardcochran@gmail.com> | 2010-07-17 04:48:28 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-07-18 22:15:25 -0400 |
| commit | 4507a71507d4ff37e9a499c4241b7701ed1feab4 (patch) | |
| tree | 775ff8a11852f37ebc78363cf41729221cd92718 /include/linux/skbuff.h | |
| parent | ad1afb00393915a51c21b1ae8704562bf036855f (diff) | |
net: add driver hook for tx time stamping.
This patch adds a hook for transmit time stamps. The transmit hook
allows a software fallback for transmit time stamps, for MACs
lacking time stamping hardware. Using the hook will still require
adding an inline function call to each MAC driver.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ac74ee085d74..a1b0400c8d86 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1947,6 +1947,27 @@ static inline ktime_t net_invalid_timestamp(void) | |||
| 1947 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, | 1947 | extern void skb_tstamp_tx(struct sk_buff *orig_skb, |
| 1948 | struct skb_shared_hwtstamps *hwtstamps); | 1948 | struct skb_shared_hwtstamps *hwtstamps); |
| 1949 | 1949 | ||
| 1950 | static inline void sw_tx_timestamp(struct sk_buff *skb) | ||
| 1951 | { | ||
| 1952 | union skb_shared_tx *shtx = skb_tx(skb); | ||
| 1953 | if (shtx->software && !shtx->in_progress) | ||
| 1954 | skb_tstamp_tx(skb, NULL); | ||
| 1955 | } | ||
| 1956 | |||
| 1957 | /** | ||
| 1958 | * skb_tx_timestamp() - Driver hook for transmit timestamping | ||
| 1959 | * | ||
| 1960 | * Ethernet MAC Drivers should call this function in their hard_xmit() | ||
| 1961 | * function as soon as possible after giving the sk_buff to the MAC | ||
| 1962 | * hardware, but before freeing the sk_buff. | ||
| 1963 | * | ||
| 1964 | * @skb: A socket buffer. | ||
| 1965 | */ | ||
| 1966 | static inline void skb_tx_timestamp(struct sk_buff *skb) | ||
| 1967 | { | ||
| 1968 | sw_tx_timestamp(skb); | ||
| 1969 | } | ||
| 1970 | |||
| 1950 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 1971 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
| 1951 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 1972 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
| 1952 | 1973 | ||
