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=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 C1895C35244 for ; Fri, 24 Jan 2020 16:19:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1E1F2070A for ; Fri, 24 Jan 2020 16:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389819AbgAXQTj (ORCPT ); Fri, 24 Jan 2020 11:19:39 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:25554 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387404AbgAXQTh (ORCPT ); Fri, 24 Jan 2020 11:19:37 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Horatiu.Vultur@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="Horatiu.Vultur@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Horatiu.Vultur@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: NFw6fDRdCq8D8EK/GYJ92Dw3Am1HEqUoO7GhZRh6Nw8fWp8FyZEhZYXDxIp6w1OKXk7z+tHIrt ENBU0eEvVk7TJTk8WK49vAvRVUb2iknIGy4re5fszM3DB0H9Mb6MFFfqtXH2mhmtsrZVChB9O4 yHB04AOmZ8loV2aLpIelsSTiLOrKCzhRePcLivuTdkbe8jCJfn6gomQt92dMzKNiISGh9f5lXl 4Gagj2aAZz6JgyfaG8O4mS+jSGM0jFXnVZTHozqaZLye/6YKwEEBdMh6OsxiRJC/QbaNcWTkf7 IJo= X-IronPort-AV: E=Sophos;i="5.70,358,1574146800"; d="scan'208";a="19349" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 24 Jan 2020 09:19:36 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 24 Jan 2020 09:19:34 -0700 Received: from soft-dev3.microsemi.net (10.10.85.251) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 24 Jan 2020 09:19:32 -0700 From: Horatiu Vultur To: , , , , , , , , , , , , CC: Horatiu Vultur Subject: [RFC net-next v3 02/10] net: bridge: mrp: Expose function br_mrp_port_open Date: Fri, 24 Jan 2020 17:18:20 +0100 Message-ID: <20200124161828.12206-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200124161828.12206-1-horatiu.vultur@microchip.com> References: <20200124161828.12206-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case the HW is capable to detect when the MRP ring is open or closed. It is expected that the network driver will notify the bridge that the ring is open or closed. The function br_mrp_port_open is used to notify the kernel that one of the ports stopped receiving MRP_Test frames. The argument 'loc' has a value of '1' when the port stopped receiving MRP_Test and '0' when it started to receive MRP_Test. This notification will eventually reach the userspace via netlink interface and the userspace application will process this information. Signed-off-by: Horatiu Vultur --- include/linux/mrp_bridge.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/linux/mrp_bridge.h diff --git a/include/linux/mrp_bridge.h b/include/linux/mrp_bridge.h new file mode 100644 index 000000000000..0508bbe6ecdb --- /dev/null +++ b/include/linux/mrp_bridge.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _LINUX_MRP_BRIDGE_H +#define _LINUX_MRO_BRIDGE_H + +#include + +/* The drivers are responsible to call this function when it detects that the + * MRP port stopped receiving MRP_Test frames or it started to receive MRP_Test. + * The argument dev represents the port and loc(Lost of Continuity) has a value + * of 1 when it stopped receiving MRP_Test frames and a value of 0 when it + * started to receive frames. + * + * This eventually eventually notify the userspace which is required to react on + * thise changes. + */ + +#ifdef CONFIG_BRIDGE_MRP +void br_mrp_port_open(struct net_device *dev, u8 loc); +#else +inline void br_mrp_port_open(struct net_device *dev, u8 loc) {} +#endif + +#endif + -- 2.17.1