Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp968969ybl; Fri, 24 Jan 2020 12:55:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwbtnTL5anoADs9CrxaOlqHClDqsuIqPJbqWPesgq6/rQVLOaVV3ohqdOPGc2Wdn/T1nfqp X-Received: by 2002:a54:4507:: with SMTP id l7mr495099oil.164.1579899312112; Fri, 24 Jan 2020 12:55:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579899312; cv=none; d=google.com; s=arc-20160816; b=OZFP6TR32JQIEX5KWBjLXKWETjjkUufRHF+AE2Ogi7j3q+NDvNQ1z6yy+CT9HOX7CN mIz+2KYsVzCIOkwKbOiG/Tc0Y3ilhE7ADQliJ/yo5Fqf04JaL1oREEZeybcll2TMFxyT w4XyweFCBWVVqAg6o07HO2knuuMk76Bt3EVkCUTVW78dUy3hLtDf443ZghWZJzHSy7J0 rAO+N/gfMrlK7njckt8PYOE090arFIgqYeONpM4k7TTjXC/2sJO2DqgFwbk0FnTqzQx4 UTjV0h92UpyGbee0sKog87PsYgDJIjqXrToo5UNyjl+c3LF11C1JTr3402a7Ky2YKi4f UMzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr; bh=AFUOsLpm1JeqmmosL1xpLVdUNYYKw9eeqf828zrqfqM=; b=HRIZNVYJlJAEyaNNM6+ztv7FnKpA4WC4WBd414js5q+JIO5082rbhYNewIQz75VqFV NUvuKmYo38v9Pg8OKlho9P0pDsoKIqaMNEgvMmtJ1OXKM90BiWTNZjDnMk92Teu6gibN h2Tvb+Ff6fc9rNDc2rxhMWwG/KITVm0QSUWnScZo2wAx5oax9ciuD3Ma4aJek1lybnjk KqbMeKFG4aTx29HfzjIOYk5Ni5f46LjD4FihvT1NBoNwuoEiVyTQGH2igXT+ZCoK6jp0 JkLVpJNMD9t+FJDZ2MxosEbfgTysmjjZ6+4JXw8YVTDvjwlsVCysPz5pmaMj19CE73PX y3pQ== 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=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si1213270otq.201.2020.01.24.12.55.00; Fri, 24 Jan 2020 12:55:12 -0800 (PST) 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=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389802AbgAXQTj (ORCPT + 99 others); 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