lkml.org 
[lkml]   [2018]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[v2, 07/10] fsl/fman_port: support getting timestamp field
    Date
    This patch is to add fman_port_get_tstamp_field() interface
    to get timestamp field data.

    Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
    ---
    Changes for v2:
    - None.
    ---
    drivers/net/ethernet/freescale/fman/fman_port.c | 12 ++++++++++++
    drivers/net/ethernet/freescale/fman/fman_port.h | 3 +++
    2 files changed, 15 insertions(+), 0 deletions(-)

    diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
    index ce6e24c..86f0094 100644
    --- a/drivers/net/ethernet/freescale/fman/fman_port.c
    +++ b/drivers/net/ethernet/freescale/fman/fman_port.c
    @@ -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);

    +int fman_port_get_tstamp_field(struct fman_port *port, const void *data,
    + u64 *tstamp)
    +{
    + if (port->buffer_offsets.time_stamp_offset == ILLEGAL_BASE)
    + return -EINVAL;
    +
    + *tstamp = *(u64 *)(data + port->buffer_offsets.time_stamp_offset);
    +
    + return 0;
    +}
    +EXPORT_SYMBOL(fman_port_get_tstamp_field);
    +
    static int fman_port_probe(struct platform_device *of_dev)
    {
    struct fman_port *port;
    diff --git a/drivers/net/ethernet/freescale/fman/fman_port.h b/drivers/net/ethernet/freescale/fman/fman_port.h
    index e86ca6a..d10e48d 100644
    --- a/drivers/net/ethernet/freescale/fman/fman_port.h
    +++ b/drivers/net/ethernet/freescale/fman/fman_port.h
    @@ -153,6 +153,9 @@ int fman_port_cfg_buf_prefix_content(struct fman_port *port,

    int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset);

    +int fman_port_get_tstamp_field(struct fman_port *port, const void *data,
    + u64 *tstamp);
    +
    struct fman_port *fman_port_bind(struct device *dev);

    #endif /* __FMAN_PORT_H */
    --
    1.7.1
    \
     
     \ /
      Last update: 2018-06-07 05:26    [W:2.317 / U:0.336 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site