From patchwork Sun Nov 22 08:26:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 11923807 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F9A7C63798 for ; Sun, 22 Nov 2020 08:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33A9A20721 for ; Sun, 22 Nov 2020 08:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727378AbgKVI20 (ORCPT ); Sun, 22 Nov 2020 03:28:26 -0500 Received: from mailout07.rmx.de ([94.199.90.95]:34401 "EHLO mailout07.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgKVI20 (ORCPT ); Sun, 22 Nov 2020 03:28:26 -0500 Received: from kdin02.retarus.com (kdin02.dmz1.retloc [172.19.17.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout07.rmx.de (Postfix) with ESMTPS id 4Cf3MT3QH7zBwKq; Sun, 22 Nov 2020 09:28:21 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin02.retarus.com (Postfix) with ESMTPS id 4Cf3MB42HBz2TS5B; Sun, 22 Nov 2020 09:28:06 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.14) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Sun, 22 Nov 2020 09:27:27 +0100 From: Christian Eggers To: Richard Cochran , Andrew Lunn , Heiner Kallweit , Jakub Kicinski CC: Vladimir Oltean , Russell King , "David S . Miller" , , , Christian Eggers , "Christian Eggers" , Kurt Kanzenbach Subject: [PATCH net-next 1/3] net: phy: dp83640: use new PTP_MSGTYPE_SYNC define Date: Sun, 22 Nov 2020 09:26:34 +0100 Message-ID: <20201122082636.12451-2-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201122082636.12451-1-ceggers@arri.de> References: <20201122082636.12451-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.14] X-RMX-ID: 20201122-092812-4Cf3MB42HBz2TS5B-0@kdin02 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Replace use of magic number with recently introduced define. Signed-off-by: Christian Eggers Cc: Kurt Kanzenbach --- drivers/net/phy/dp83640.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c index f2caccaf4408..9757ca0d9633 100644 --- a/drivers/net/phy/dp83640.c +++ b/drivers/net/phy/dp83640.c @@ -964,15 +964,12 @@ static void decode_status_frame(struct dp83640_private *dp83640, static int is_sync(struct sk_buff *skb, int type) { struct ptp_header *hdr; - u8 msgtype; hdr = ptp_parse_header(skb, type); if (!hdr) return 0; - msgtype = ptp_get_msgtype(hdr, type); - - return (msgtype & 0xf) == 0; + return ptp_get_msgtype(hdr, type) == PTP_MSGTYPE_SYNC; } static void dp83640_free_clocks(void) From patchwork Sun Nov 22 08:26:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 11923809 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC64EC5519F for ; Sun, 22 Nov 2020 08:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 795A32075A for ; Sun, 22 Nov 2020 08:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727408AbgKVI3V (ORCPT ); Sun, 22 Nov 2020 03:29:21 -0500 Received: from mailout09.rmx.de ([94.199.88.74]:41541 "EHLO mailout09.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgKVI3V (ORCPT ); Sun, 22 Nov 2020 03:29:21 -0500 Received: from kdin02.retarus.com (kdin02.dmz1.retloc [172.19.17.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout09.rmx.de (Postfix) with ESMTPS id 4Cf3NY00lZzbkvY; Sun, 22 Nov 2020 09:29:17 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin02.retarus.com (Postfix) with ESMTPS id 4Cf3NJ21VFz2TRjV; Sun, 22 Nov 2020 09:29:04 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.14) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Sun, 22 Nov 2020 09:28:02 +0100 From: Christian Eggers To: Richard Cochran , Andrew Lunn , Heiner Kallweit , Jakub Kicinski CC: Vladimir Oltean , Russell King , "David S . Miller" , , , Christian Eggers , "Christian Eggers" , Petr Machata , Jiri Pirko , Ido Schimmel Subject: [PATCH net-next 2/3] mlxsw: spectrum_ptp: use PTP wide message type definitions Date: Sun, 22 Nov 2020 09:26:35 +0100 Message-ID: <20201122082636.12451-3-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201122082636.12451-1-ceggers@arri.de> References: <20201122082636.12451-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.14] X-RMX-ID: 20201122-092906-4Cf3NJ21VFz2TRjV-0@kdin02 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use recently introduced PTP wide defines instead of a driver internal enumeration. Signed-off-by: Christian Eggers Cc: Petr Machata Cc: Jiri Pirko Cc: Ido Schimmel Reviewed-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 8 ++++---- drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c index ca8090a28dec..d6e9ecb14681 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c @@ -828,10 +828,10 @@ struct mlxsw_sp_ptp_state *mlxsw_sp1_ptp_init(struct mlxsw_sp *mlxsw_sp) goto err_hashtable_init; /* Delive these message types as PTP0. */ - message_type = BIT(MLXSW_SP_PTP_MESSAGE_TYPE_SYNC) | - BIT(MLXSW_SP_PTP_MESSAGE_TYPE_DELAY_REQ) | - BIT(MLXSW_SP_PTP_MESSAGE_TYPE_PDELAY_REQ) | - BIT(MLXSW_SP_PTP_MESSAGE_TYPE_PDELAY_RESP); + message_type = BIT(PTP_MSGTYPE_SYNC) | + BIT(PTP_MSGTYPE_DELAY_REQ) | + BIT(PTP_MSGTYPE_PDELAY_REQ) | + BIT(PTP_MSGTYPE_PDELAY_RESP); err = mlxsw_sp_ptp_mtptpt_set(mlxsw_sp, MLXSW_REG_MTPTPT_TRAP_ID_PTP0, message_type); if (err) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h index 8c386571afce..1d43a3755285 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h @@ -11,13 +11,6 @@ struct mlxsw_sp; struct mlxsw_sp_port; struct mlxsw_sp_ptp_clock; -enum { - MLXSW_SP_PTP_MESSAGE_TYPE_SYNC, - MLXSW_SP_PTP_MESSAGE_TYPE_DELAY_REQ, - MLXSW_SP_PTP_MESSAGE_TYPE_PDELAY_REQ, - MLXSW_SP_PTP_MESSAGE_TYPE_PDELAY_RESP, -}; - static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct ethtool_ts_info *info) { info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | From patchwork Sun Nov 22 08:26:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Eggers X-Patchwork-Id: 11923811 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF2DFC63798 for ; Sun, 22 Nov 2020 08:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF2F220795 for ; Sun, 22 Nov 2020 08:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbgKVIaP (ORCPT ); Sun, 22 Nov 2020 03:30:15 -0500 Received: from mailout07.rmx.de ([94.199.90.95]:35195 "EHLO mailout07.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgKVIaO (ORCPT ); Sun, 22 Nov 2020 03:30:14 -0500 Received: from kdin02.retarus.com (kdin02.dmz1.retloc [172.19.17.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout07.rmx.de (Postfix) with ESMTPS id 4Cf3PZ3JD3zBwKk; Sun, 22 Nov 2020 09:30:10 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin02.retarus.com (Postfix) with ESMTPS id 4Cf3PR5dlNz2TRjV; Sun, 22 Nov 2020 09:30:03 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.14) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Sun, 22 Nov 2020 09:28:32 +0100 From: Christian Eggers To: Richard Cochran , Andrew Lunn , Heiner Kallweit , Jakub Kicinski CC: Vladimir Oltean , Russell King , "David S . Miller" , , , Christian Eggers , "Christian Eggers" , Quentin Schulz , "Antoine Tenart" , Antoine Tenart Subject: [PATCH net-next 3/3] net: phy: mscc: use new PTP_MSGTYPE_* defines Date: Sun, 22 Nov 2020 09:26:36 +0100 Message-ID: <20201122082636.12451-4-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201122082636.12451-1-ceggers@arri.de> References: <20201122082636.12451-1-ceggers@arri.de> MIME-Version: 1.0 X-Originating-IP: [192.168.54.14] X-RMX-ID: 20201122-093003-4Cf3PR5dlNz2TRjV-0@kdin02 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use recently introduced PTP_MSGTYPE_SYNC and PTP_MSGTYPE_DELAY_REQ defines instead of a driver internal enumeration. Signed-off-by: Christian Eggers Cc: Quentin Schulz Cc: Antoine Tenart Cc: Antoine Tenart Reported-by: kernel test robot Reviewed-by: Antoine Tenart --- drivers/net/phy/mscc/mscc_ptp.c | 14 +++++++------- drivers/net/phy/mscc/mscc_ptp.h | 5 ----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/net/phy/mscc/mscc_ptp.c b/drivers/net/phy/mscc/mscc_ptp.c index d8a61456d1ce..924ed5b034a4 100644 --- a/drivers/net/phy/mscc/mscc_ptp.c +++ b/drivers/net/phy/mscc/mscc_ptp.c @@ -506,9 +506,9 @@ static int vsc85xx_ptp_cmp_init(struct phy_device *phydev, enum ts_blk blk) { struct vsc8531_private *vsc8531 = phydev->priv; bool base = phydev->mdio.addr == vsc8531->ts_base_addr; - enum vsc85xx_ptp_msg_type msgs[] = { - PTP_MSG_TYPE_SYNC, - PTP_MSG_TYPE_DELAY_REQ + u8 msgs[] = { + PTP_MSGTYPE_SYNC, + PTP_MSGTYPE_DELAY_REQ }; u32 val; u8 i; @@ -847,9 +847,9 @@ static int vsc85xx_ts_ptp_action_flow(struct phy_device *phydev, enum ts_blk blk static int vsc85xx_ptp_conf(struct phy_device *phydev, enum ts_blk blk, bool one_step, bool enable) { - enum vsc85xx_ptp_msg_type msgs[] = { - PTP_MSG_TYPE_SYNC, - PTP_MSG_TYPE_DELAY_REQ + u8 msgs[] = { + PTP_MSGTYPE_SYNC, + PTP_MSGTYPE_DELAY_REQ }; u32 val; u8 i; @@ -858,7 +858,7 @@ static int vsc85xx_ptp_conf(struct phy_device *phydev, enum ts_blk blk, if (blk == INGRESS) vsc85xx_ts_ptp_action_flow(phydev, blk, msgs[i], PTP_WRITE_NS); - else if (msgs[i] == PTP_MSG_TYPE_SYNC && one_step) + else if (msgs[i] == PTP_MSGTYPE_SYNC && one_step) /* no need to know Sync t when sending in one_step */ vsc85xx_ts_ptp_action_flow(phydev, blk, msgs[i], PTP_WRITE_1588); diff --git a/drivers/net/phy/mscc/mscc_ptp.h b/drivers/net/phy/mscc/mscc_ptp.h index 3ea163af0f4f..da3465360e90 100644 --- a/drivers/net/phy/mscc/mscc_ptp.h +++ b/drivers/net/phy/mscc/mscc_ptp.h @@ -436,11 +436,6 @@ enum ptp_cmd { PTP_SAVE_IN_TS_FIFO = 11, /* invalid when writing in reg */ }; -enum vsc85xx_ptp_msg_type { - PTP_MSG_TYPE_SYNC, - PTP_MSG_TYPE_DELAY_REQ, -}; - struct vsc85xx_ptphdr { u8 tsmt; /* transportSpecific | messageType */ u8 ver; /* reserved0 | versionPTP */