From patchwork Mon Jun 4 07:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 10446055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92DE7600CA for ; Mon, 4 Jun 2018 07:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 844FC28B5B for ; Mon, 4 Jun 2018 07:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 762A228B5D; Mon, 4 Jun 2018 07:40:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F379028B5B for ; Mon, 4 Jun 2018 07:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tFkgu9+Lq1hf3WzQpb81v8NQLtemn0z1KB6136CqSr8=; b=bY/eWIq9VA9RKZJQ0EbpOfASNu JKIjPSzIvOvaUqHD1PcTTouLs1yo6Lz8MQBrg2UoDm1Fm0lnzS6yRU03grclgwpU4/ENWsSUNLz+o HlTblpYTwHBiJ0i89i/rG+8+ridS0icqifylG5qp4mjDfJ/grV6btLNQbhs6ShSf9bApspRJmCTsT ZVEFNJ3xHXEn7DRzP/VNHJEwdLOwxr4DMDwFrs0W6rGYO7kCG/zMVcFCKy4YUmw/M4jVO15CiJfZM hMcGemWupK8onocUQdYAa4li4NthOnCgfO5mh/jwObdS4pG8gDSEKCjUgZ5a1ZnSAR92swIzoSQOo rz9nHcNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPk6Q-000313-4b; Mon, 04 Jun 2018 07:40:30 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPjdg-0005Pb-D5 for linux-arm-kernel@lists.infradead.org; Mon, 04 Jun 2018 07:10:55 +0000 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" 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180604_001048_616856_8B330855 X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Yangbo Lu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */