Commit 880f874c authored by Yangbo Lu's avatar Yangbo Lu Committed by David S. Miller

fsl/fman_port: support getting timestamp

This patch is to add fman_port_get_tstamp() interface
to get timestamp.
Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Acked-by: default avatarMadalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0fab782a
...@@ -1731,6 +1731,18 @@ int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset) ...@@ -1731,6 +1731,18 @@ int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
} }
EXPORT_SYMBOL(fman_port_get_hash_result_offset); EXPORT_SYMBOL(fman_port_get_hash_result_offset);
int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp)
{
if (port->buffer_offsets.time_stamp_offset == ILLEGAL_BASE)
return -EINVAL;
*tstamp = be64_to_cpu(*(__be64 *)(data +
port->buffer_offsets.time_stamp_offset));
return 0;
}
EXPORT_SYMBOL(fman_port_get_tstamp);
static int fman_port_probe(struct platform_device *of_dev) static int fman_port_probe(struct platform_device *of_dev)
{ {
struct fman_port *port; struct fman_port *port;
......
...@@ -153,6 +153,8 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port); ...@@ -153,6 +153,8 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port);
int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset); int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset);
int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp);
struct fman_port *fman_port_bind(struct device *dev); struct fman_port *fman_port_bind(struct device *dev);
#endif /* __FMAN_PORT_H */ #endif /* __FMAN_PORT_H */
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