From mboxrd@z Thu Jan 1 00:00:00 1970 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=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 170FDC433DF for ; Thu, 30 Jul 2020 08:00:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E84F320672 for ; Thu, 30 Jul 2020 08:00:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rhl8tGJc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IBlNXKKF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbgG3IAy (ORCPT ); Thu, 30 Jul 2020 04:00:54 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48552 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbgG3IAx (ORCPT ); Thu, 30 Jul 2020 04:00:53 -0400 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596096052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cV4LtH8m4IjxWbH8oldUeuo8BRH7WOmNlWTPKqssdBE=; b=rhl8tGJcJGL95GNSycQtTre9hv+fFvzcG2LUK6tWgMczO1dtgNP8LM88BtKawkn2uIPin2 AAYU6NgkHArI/KeQHuKXMPzzG29CaGo6MiT0I9JKGJlv1iwO6FC796pj4ehmLoTnYpO2q7 zfCVzhyPc4utsp3o7uowSrsQzavSttAjGggKxoHm1cnVdETd5iSC+3G655Q2JOl3VfoBTT VS4OrirYBOweuyeqNllIunGAoH0T0fVTfcYuFn8utFTSgKysXzTHE8ZIPv1ZqNQOyZSYqe lbxGiZjj/usDiV8+Pe+DfiIVipPcylxJ2DmyaUHE4retT9O4oR1xHHXLge95jw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596096052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cV4LtH8m4IjxWbH8oldUeuo8BRH7WOmNlWTPKqssdBE=; b=IBlNXKKFUm+fuwSLkgN//oSudiGW0ed8tDsE9TI+sYdKd8VltJHjpQPd0jXMyGxgyE5UED zfjDQRZTGx3UWyBg== To: Richard Cochran Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Heiner Kallweit , Russell King , Grygorii Strashko , Ivan Khoronzhuk , Samuel Zou , netdev@vger.kernel.org, Petr Machata , Kurt Kanzenbach Subject: [PATCH v3 0/9] ptp: Add generic helper functions Date: Thu, 30 Jul 2020 10:00:39 +0200 Message-Id: <20200730080048.32553-1-kurt@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi! in order to reduce code duplication (and cut'n'paste errors) in the ptp code of DSA, Ethernet and Phy drivers, create helper functions and move them to ptp_classify. This way all drivers can share the same implementation. This is version three and contains bugfixes. Implemented as discussed [1] [2] [3] [4]. Previous versions can be found here: * https://lkml.kernel.org/netdev/20200723074946.14253-1-kurt@linutronix.de/ * https://lkml.kernel.org/netdev/20200727090601.6500-1-kurt@linutronix.de/ Thanks, Kurt Changes since v2: * Make ptp_parse_header() work in all scenarios (Russell King) * Fix msgtype offset for ptp v1 packets Changes since v1: * Fix Kconfig (Richard Cochran) * Include more drivers (Richard Cochran) [1] - https://lkml.kernel.org/netdev/20200713140112.GB27934@hoboy/ [2] - https://lkml.kernel.org/netdev/20200720142146.GB16001@hoboy/ [3] - https://lkml.kernel.org/netdev/20200723074946.14253-1-kurt@linutronix.de/ [4] - https://lkml.kernel.org/netdev/20200729100257.GX1551@shell.armlinux.org.uk/ Kurt Kanzenbach (9): ptp: Add generic ptp v2 header parsing function ptp: Add generic ptp message type function net: dsa: mv88e6xxx: Use generic helper function mlxsw: spectrum_ptp: Use generic helper function ethernet: ti: am65-cpts: Use generic helper function ethernet: ti: cpts: Use generic helper function net: phy: dp83640: Use generic helper function ptp: ptp_ines: Use generic helper function ptp: Remove unused macro drivers/net/dsa/mv88e6xxx/hwtstamp.c | 59 +++---------- .../ethernet/mellanox/mlxsw/spectrum_ptp.c | 32 ++----- drivers/net/ethernet/ti/am65-cpts.c | 37 ++------ drivers/net/ethernet/ti/cpts.c | 37 ++------ drivers/net/phy/dp83640.c | 69 ++++----------- drivers/ptp/ptp_ines.c | 88 ++++++------------- include/linux/ptp_classify.h | 63 ++++++++++++- net/core/ptp_classifier.c | 31 +++++++ 8 files changed, 172 insertions(+), 244 deletions(-) -- 2.20.1