Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3275182imm; Mon, 4 Jun 2018 00:12:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLubC5LSD6xoCQK3GjLvt5PvUCp8GTBcpNhb7B7O+RwEaog+Gb6qZlXI80dFqGezoc2X1IS X-Received: by 2002:a65:468e:: with SMTP id h14-v6mr9935195pgr.89.1528096374034; Mon, 04 Jun 2018 00:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528096374; cv=none; d=google.com; s=arc-20160816; b=Ivh+pOsEw5FIm4JSIMn7pUo8SsJTO1IYYqENHifdeZ9yMRCkbfH3u/RgUpK/HkFyRu 0JgYbBuND0I5c8A2J7wyx52ixMIPA+T9SYaXA5ep9etGUqWE3ldh8LgBw5RM1z6DNujr b1tLUeTRrYNcQpWJyo0Pi1kdpc1UpzcJyzcDuWzvgjuXpO4+iPdnrm8qT+ePzbw/0ET6 YuPve+hBFhZTdpmEbnczeROP94caTMl74MX9tCynsF50GK2sRzR/Ykq9k2aND4YkRgI7 rjBd9/cJicTPdyA1ZL03EPwilceUIunCuV+TC5i9NP69ST8SH+HjjNVysgaZTMSqrQ/C r57w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nZJaNQDJlr8+3bSS8hskVngM5mYDNDi6MzD/PAOT9kI=; b=A/gCPYRMnKHKAPLDYnYuXpHPF1Y8xw0hwNESUynm5ytz48MVU4WE19+hVg22aGMx47 iJXVHzbG1eLRNG33HCT2nYCWIaj7raGcDlXwJ5Un/GgbVkD4gY8hSRVhzsOMiME/tt+h lWL9vjpA45QA2Eb3J+UioiVw9XxaWp/Tg+ufxm2hTnm/sQUIxeJREAUepulXeIin5OPJ 36TfTZYJbT+S/r9XAGHrBBTKzCR5347vV8Z4AbPCTYQjGtyO0+Px3Bbl/XgAkYuaYf+c 6g009Fp+LUf1/rgEzMcuw2pNW4yRNe2NRREfPjkDx4jK8syW3jU2lDaWmhbxgnZZf/6x 6XWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12-v6si19864892plp.123.2018.06.04.00.12.39; Mon, 04 Jun 2018 00:12:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756AbeFDHMS (ORCPT + 99 others); Mon, 4 Jun 2018 03:12:18 -0400 Received: from inva021.nxp.com ([92.121.34.21]:34810 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753086AbeFDHKl (ORCPT ); Mon, 4 Jun 2018 03:10:41 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0FCDE2000F5; Mon, 4 Jun 2018 09:10:40 +0200 (CEST) Received: from smtp.na-rdc02.nxp.com (inv1260.us-phx01.nxp.com [134.27.49.11]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C612E20008C; Mon, 4 Jun 2018 09:10:39 +0200 (CEST) Received: from az84smr01.freescale.net (az84smr01.freescale.net [10.64.34.197]) by inv1260.na-rdc02.nxp.com (Postfix) with ESMTP id 3776240A59; Mon, 4 Jun 2018 00:10:39 -0700 (MST) Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w547ADCx029072; Mon, 4 Jun 2018 00:10:36 -0700 From: Yangbo Lu To: netdev@vger.kernel.org, madalin.bucur@nxp.com, Richard Cochran , Rob Herring , Shawn Guo , "David S . Miller" Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yangbo Lu Subject: [PATCH 07/10] fsl/fman_port: support getting timestamp field Date: Mon, 4 Jun 2018 15:08:34 +0800 Message-Id: <20180604070837.19265-8-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180604070837.19265-1-yangbo.lu@nxp.com> References: <20180604070837.19265-1-yangbo.lu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is to add fman_port_get_tstamp_field() interface to get timestamp field data. Signed-off-by: Yangbo Lu --- 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