From patchwork Fri Jul 29 15:17:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 12932509 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6820C19F2B for ; Fri, 29 Jul 2022 15:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237281AbiG2PS0 (ORCPT ); Fri, 29 Jul 2022 11:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237092AbiG2PSU (ORCPT ); Fri, 29 Jul 2022 11:18:20 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E83820E0; Fri, 29 Jul 2022 08:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659107898; x=1690643898; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v2vkp0VgcYELO7alefVTwDXvmUx4EHSuC1lz4h1SOaE=; b=CB0agdPzwkp+yiFN4w6Q67859dAkiStnNFTI8BHzsV7a3PbPaKAI6PKz Azhr0dTgHcJctYt5MwcV1KXHHd9QUxvgg7E9v6RU2TUAWW6Y8o7UlhWnI xbWCFLV/N45f+zjt+8dXx82vbk9Fs/d5mTNnKAkuQN5CXfGKe87d5oqDP fqR6LVeY452e2NNVT9YIzljYneD+Us70Szkv1Kl96ti+Nme6bA8zU39Vy m1V2pbYy73439TBg5SQZoiawyX0TV5q+yI4K5f0et9RdV+7uinXfNDLoK /Jo8eS1NdKuZAg3DfSuV1Jx5zgERX9SccY1EIDyRv1CzmuKRaKiWlaS/h A==; X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="174336074" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Jul 2022 08:18:17 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 29 Jul 2022 08:18:13 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 29 Jul 2022 08:18:03 -0700 From: Arun Ramadoss To: , CC: Woojung Huh , , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King" Subject: [Patch RFC net-next 1/4] net: dsa: microchip: modify vlan_add function prototype Date: Fri, 29 Jul 2022 20:47:30 +0530 Message-ID: <20220729151733.6032-2-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220729151733.6032-1-arun.ramadoss@microchip.com> References: <20220729151733.6032-1-arun.ramadoss@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC To use the vlan_add from the function other the .port_vlan_add dsa hook, changed the ksz8_vlan_add and ksz9477_vlan_del function prototype which uses only the vlan->vid and vlan->flags. Signed-off-by: Arun Ramadoss --- drivers/net/dsa/microchip/ksz8.h | 5 ++--- drivers/net/dsa/microchip/ksz8795.c | 19 +++++++++---------- drivers/net/dsa/microchip/ksz9477.c | 25 ++++++++++--------------- drivers/net/dsa/microchip/ksz9477.h | 4 +--- drivers/net/dsa/microchip/ksz_common.c | 2 +- drivers/net/dsa/microchip/ksz_common.h | 4 +--- 6 files changed, 24 insertions(+), 35 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8.h b/drivers/net/dsa/microchip/ksz8.h index 42c50cc4d853..6529f2e2426a 100644 --- a/drivers/net/dsa/microchip/ksz8.h +++ b/drivers/net/dsa/microchip/ksz8.h @@ -38,9 +38,8 @@ int ksz8_mdb_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_mdb *mdb, struct dsa_db db); int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, struct netlink_ext_ack *extack); -int ksz8_port_vlan_add(struct ksz_device *dev, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack); +int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, + u16 flags); int ksz8_port_vlan_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); int ksz8_port_mirror_add(struct ksz_device *dev, int port, diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index c79a5128235f..5dd73e994142 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -962,11 +962,10 @@ static void ksz8_port_enable_pvid(struct ksz_device *dev, int port, bool state) } } -int ksz8_port_vlan_add(struct ksz_device *dev, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack) +int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, + u16 flags) { - bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; + bool untagged = flags & BRIDGE_VLAN_INFO_UNTAGGED; struct ksz_port *p = &dev->ports[port]; u16 data, new_pvid = 0; u8 fid, member, valid; @@ -979,7 +978,7 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, * Ignore VID 0, which is always untagged. * Ignore CPU port, which will always be tagged. */ - if (untagged != p->remove_tag && vlan->vid != 0 && + if (untagged != p->remove_tag && vlan_vid != 0 && port != dev->cpu_port) { unsigned int vid; @@ -989,7 +988,7 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, */ for (vid = 1; vid < dev->info->num_vlans; ++vid) { /* Skip the VID we are going to add or reconfigure */ - if (vid == vlan->vid) + if (vid == vlan_vid) continue; ksz8_from_vlan(dev, dev->vlan_cache[vid].table[0], @@ -1002,7 +1001,7 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, p->remove_tag = untagged; } - ksz8_r_vlan_table(dev, vlan->vid, &data); + ksz8_r_vlan_table(dev, vlan_vid, &data); ksz8_from_vlan(dev, data, &fid, &member, &valid); /* First time to setup the VLAN entry. */ @@ -1014,11 +1013,11 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, member |= BIT(port); ksz8_to_vlan(dev, fid, member, valid, &data); - ksz8_w_vlan_table(dev, vlan->vid, data); + ksz8_w_vlan_table(dev, vlan_vid, data); /* change PVID */ - if (vlan->flags & BRIDGE_VLAN_INFO_PVID) - new_pvid = vlan->vid; + if (flags & BRIDGE_VLAN_INFO_PVID) + new_pvid = vlan_vid; if (new_pvid) { u16 vid; diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 4b14d80d27ed..81d24b89958b 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -370,21 +370,18 @@ int ksz9477_port_vlan_filtering(struct ksz_device *dev, int port, return 0; } -int ksz9477_port_vlan_add(struct ksz_device *dev, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack) +int ksz9477_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, + u16 flags) { u32 vlan_table[3]; - bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; + bool untagged = flags & BRIDGE_VLAN_INFO_UNTAGGED; int err; - err = ksz9477_get_vlan_table(dev, vlan->vid, vlan_table); - if (err) { - NL_SET_ERR_MSG_MOD(extack, "Failed to get vlan table"); + err = ksz9477_get_vlan_table(dev, vlan_vid, vlan_table); + if (err) return err; - } - vlan_table[0] = VLAN_VALID | (vlan->vid & VLAN_FID_M); + vlan_table[0] = VLAN_VALID | (vlan_vid & VLAN_FID_M); if (untagged) vlan_table[1] |= BIT(port); else @@ -393,15 +390,13 @@ int ksz9477_port_vlan_add(struct ksz_device *dev, int port, vlan_table[2] |= BIT(port) | BIT(dev->cpu_port); - err = ksz9477_set_vlan_table(dev, vlan->vid, vlan_table); - if (err) { - NL_SET_ERR_MSG_MOD(extack, "Failed to set vlan table"); + err = ksz9477_set_vlan_table(dev, vlan_vid, vlan_table); + if (err) return err; - } /* change PVID */ - if (vlan->flags & BRIDGE_VLAN_INFO_PVID) - ksz_pwrite16(dev, port, REG_PORT_DEFAULT_VID, vlan->vid); + if (flags & BRIDGE_VLAN_INFO_PVID) + ksz_pwrite16(dev, port, REG_PORT_DEFAULT_VID, vlan_vid); return 0; } diff --git a/drivers/net/dsa/microchip/ksz9477.h b/drivers/net/dsa/microchip/ksz9477.h index cd278b307b3c..30a1fff9b8ec 100644 --- a/drivers/net/dsa/microchip/ksz9477.h +++ b/drivers/net/dsa/microchip/ksz9477.h @@ -25,9 +25,7 @@ void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool freeze); void ksz9477_port_init_cnt(struct ksz_device *dev, int port); int ksz9477_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, struct netlink_ext_ack *extack); -int ksz9477_port_vlan_add(struct ksz_device *dev, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack); +int ksz9477_port_vlan_add(struct ksz_device *dev, int port, u16 vid, u16 flags); int ksz9477_port_vlan_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); int ksz9477_port_mirror_add(struct ksz_device *dev, int port, diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 02e58760cf7b..97dbccb065a9 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -1351,7 +1351,7 @@ static int ksz_port_vlan_add(struct dsa_switch *ds, int port, if (!dev->dev_ops->vlan_add) return -EOPNOTSUPP; - return dev->dev_ops->vlan_add(dev, port, vlan, extack); + return dev->dev_ops->vlan_add(dev, port, vlan->vid, vlan->flags); } static int ksz_port_vlan_del(struct dsa_switch *ds, int port, diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 764ada3a0f42..9bb378b79a94 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -267,9 +267,7 @@ struct ksz_dev_ops { void (*r_mib_stat64)(struct ksz_device *dev, int port); int (*vlan_filtering)(struct ksz_device *dev, int port, bool flag, struct netlink_ext_ack *extack); - int (*vlan_add)(struct ksz_device *dev, int port, - const struct switchdev_obj_port_vlan *vlan, - struct netlink_ext_ack *extack); + int (*vlan_add)(struct ksz_device *dev, int port, u16 vid, u16 flags); int (*vlan_del)(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); int (*mirror_add)(struct ksz_device *dev, int port, From patchwork Fri Jul 29 15:17:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 12932510 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0A9EC00144 for ; Fri, 29 Jul 2022 15:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237397AbiG2PSv (ORCPT ); Fri, 29 Jul 2022 11:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237326AbiG2PSj (ORCPT ); Fri, 29 Jul 2022 11:18:39 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BFBA8245A; Fri, 29 Jul 2022 08:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659107915; x=1690643915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RqIPaWspUXcggEiJPI0oGNwgnlO19dGMWZo/n/wJKQM=; b=o/29bpne0D1XpO4cHK9oYfbbRViTGlJwr4Nl7zqlzlcta1SeRW50EPpu qUbjYdob/Ex7aXZIgar0eUU/uOFGciHXpFlNWUB/UHwqmE+pm6vWEm5gy HETHpLfOlH5KZx9oNmTkvewlziL0Bfs/uoievquGxiYDWFCYUIn/bkb12 zwWvWf9l/eNZJTC+cvW2cv7rB7jKXTJ2HZA9CMkrY+noOKjvaoPCJnOyO mTGlzNoRW0lZo06J7aKo7YY3gExLiCcwVgZ1EAkhLN2iYqlfG45guTgkf 1CQvkzOY5ObRB+9fCjRBNGxsT5TBCHPJp1P3iqp8CdALCb7EFZXPWXQG/ g==; X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="166987979" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Jul 2022 08:18:34 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 29 Jul 2022 08:18:28 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 29 Jul 2022 08:18:17 -0700 From: Arun Ramadoss To: , CC: Woojung Huh , , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King" Subject: [Patch RFC net-next 2/4] net: dsa: microchip: lan937x: remove vlan_filtering_is_global flag Date: Fri, 29 Jul 2022 20:47:31 +0530 Message-ID: <20220729151733.6032-3-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220729151733.6032-1-arun.ramadoss@microchip.com> References: <20220729151733.6032-1-arun.ramadoss@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC To have the similar implementation among the ksz switches, removed the vlan_filtering_is_global flag which is only present in the lan937x. Signed-off-by: Arun Ramadoss --- drivers/net/dsa/microchip/lan937x_main.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index daedd2bf20c1..9c1fe38efd1a 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -401,11 +401,6 @@ int lan937x_setup(struct dsa_switch *ds) return ret; } - /* The VLAN aware is a global setting. Mixed vlan - * filterings are not supported. - */ - ds->vlan_filtering_is_global = true; - /* Enable aggressive back off for half duplex & UNH mode */ lan937x_cfg(dev, REG_SW_MAC_CTRL_0, (SW_PAUSE_UNH_MODE | SW_NEW_BACKOFF | SW_AGGR_BACKOFF), From patchwork Fri Jul 29 15:17:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 12932511 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BFB8C00144 for ; Fri, 29 Jul 2022 15:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237315AbiG2PTC (ORCPT ); Fri, 29 Jul 2022 11:19:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237371AbiG2PSu (ORCPT ); Fri, 29 Jul 2022 11:18:50 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567C08211C; Fri, 29 Jul 2022 08:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659107928; x=1690643928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B4irFJJNgvAIa3OfpYn8UbF+LRkjfTuoG1VFgflgbFU=; b=SyX1Qh+/M2hfufRgewy7NYHP5OQrs7s/j+hNDvEkLyMSITxDceNC6rW7 0mzJjJ5BXtCYC5zvLIF/Lp4pk3+OnjN0IRwx/MAlMFfd0HgGJ6F1i/uYd +ejbk0KRhVNOf2nWtMf+8LOVvjIAgUEMqiwK1k77BxhKonrIf4c6s4C82 wctn77+o4pquhN9KS2WUZLKq86BW3uNVAbL+tQT51pn/CWYeicull+oIN /AYqTOXVJpH5Z2UAE0+RurvjFJdf6o9Ehubw5q47nYZiBxqU51m5uD06Z 5C9yVOC8T7pCW6b2B9ZjsVYv7snOAP2ZVFUaW92ySouednXiV+tsVJP3B w==; X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="166988056" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Jul 2022 08:18:47 -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.2375.17; Fri, 29 Jul 2022 08:18:43 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 29 Jul 2022 08:18:32 -0700 From: Arun Ramadoss To: , CC: Woojung Huh , , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King" Subject: [Patch RFC net-next 3/4] net: dsa: microchip: common ksz pvid get and set function Date: Fri, 29 Jul 2022 20:47:32 +0530 Message-ID: <20220729151733.6032-4-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220729151733.6032-1-arun.ramadoss@microchip.com> References: <20220729151733.6032-1-arun.ramadoss@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Add the helper function for getting and setting the pvid which will be common for all ksz switches Signed-off-by: Arun Ramadoss Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- drivers/net/dsa/microchip/ksz8795.c | 8 ++------ drivers/net/dsa/microchip/ksz9477.c | 6 +++--- drivers/net/dsa/microchip/ksz_common.c | 21 +++++++++++++++++++++ drivers/net/dsa/microchip/ksz_common.h | 11 +++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index 5dd73e994142..b8843697c5a5 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1020,12 +1020,8 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, new_pvid = vlan_vid; if (new_pvid) { - u16 vid; - ksz_pread16(dev, port, REG_PORT_CTRL_VID, &vid); - vid &= ~VLAN_VID_MASK; - vid |= new_pvid; - ksz_pwrite16(dev, port, REG_PORT_CTRL_VID, vid); + ksz_set_pvid(dev, port, new_pvid); ksz8_port_enable_pvid(dev, port, true); } @@ -1042,7 +1038,7 @@ int ksz8_port_vlan_del(struct ksz_device *dev, int port, if (ksz_is_ksz88x3(dev)) return -ENOTSUPP; - ksz_pread16(dev, port, REG_PORT_CTRL_VID, &pvid); + ksz_get_pvid(dev, port, &pvid); pvid = pvid & 0xFFF; ksz8_r_vlan_table(dev, vlan->vid, &data); diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 81d24b89958b..a43a581520fb 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -396,7 +396,7 @@ int ksz9477_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, /* change PVID */ if (flags & BRIDGE_VLAN_INFO_PVID) - ksz_pwrite16(dev, port, REG_PORT_DEFAULT_VID, vlan_vid); + ksz_set_pvid(dev, port, vlan_vid); return 0; } @@ -408,7 +408,7 @@ int ksz9477_port_vlan_del(struct ksz_device *dev, int port, u32 vlan_table[3]; u16 pvid; - ksz_pread16(dev, port, REG_PORT_DEFAULT_VID, &pvid); + ksz_get_pvid(dev, port, &pvid); pvid = pvid & 0xFFF; if (ksz9477_get_vlan_table(dev, vlan->vid, vlan_table)) { @@ -429,7 +429,7 @@ int ksz9477_port_vlan_del(struct ksz_device *dev, int port, return -ETIMEDOUT; } - ksz_pwrite16(dev, port, REG_PORT_DEFAULT_VID, pvid); + ksz_set_pvid(dev, port, pvid); return 0; } diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 97dbccb065a9..516fb9d35c87 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -258,6 +259,7 @@ static const u16 ksz8795_regs[] = { [S_MULTICAST_CTRL] = 0x04, [P_XMII_CTRL_0] = 0x06, [P_XMII_CTRL_1] = 0x56, + [P_DEFAULT_PVID] = 0x03, }; static const u32 ksz8795_masks[] = { @@ -330,6 +332,7 @@ static const u16 ksz8863_regs[] = { [S_START_CTRL] = 0x01, [S_BROADCAST_CTRL] = 0x06, [S_MULTICAST_CTRL] = 0x04, + [P_DEFAULT_PVID] = 0x03, }; static const u32 ksz8863_masks[] = { @@ -372,6 +375,7 @@ static const u16 ksz9477_regs[] = { [S_MULTICAST_CTRL] = 0x0331, [P_XMII_CTRL_0] = 0x0300, [P_XMII_CTRL_1] = 0x0301, + [P_DEFAULT_PVID] = 0x0000, }; static const u32 ksz9477_masks[] = { @@ -1331,6 +1335,23 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds, return proto; } +void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid) +{ + const u16 *regs = dev->info->regs; + u16 val; + + ksz_pread16(dev, port, regs[P_DEFAULT_PVID], &val); + + *pvid = val & VLAN_VID_MASK; +} + +void ksz_set_pvid(struct ksz_device *dev, int port, u16 pvid) +{ + const u16 *regs = dev->info->regs; + + ksz_prmw16(dev, port, regs[P_DEFAULT_PVID], VLAN_VID_MASK, pvid); +} + static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, bool flag, struct netlink_ext_ack *extack) { diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 9bb378b79a94..3bcd4e20bfaa 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -175,6 +175,7 @@ enum ksz_regs { S_MULTICAST_CTRL, P_XMII_CTRL_0, P_XMII_CTRL_1, + P_DEFAULT_PVID, }; enum ksz_masks { @@ -319,6 +320,8 @@ void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state); bool ksz_get_gbit(struct ksz_device *dev, int port); phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit); extern const struct ksz_chip_data ksz_switch_chips[]; +void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid); +void ksz_set_pvid(struct ksz_device *dev, int port, u16 pvid); /* Common register access functions */ @@ -432,6 +435,14 @@ static inline void ksz_prmw8(struct ksz_device *dev, int port, int offset, mask, val); } +static inline void ksz_prmw16(struct ksz_device *dev, int port, int offset, + u16 mask, u16 val) +{ + regmap_update_bits(dev->regmap[1], + dev->dev_ops->get_port_addr(port, offset), + mask, val); +} + static inline void ksz_regmap_lock(void *__mtx) { struct mutex *mtx = __mtx; From patchwork Fri Jul 29 15:17:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramadoss X-Patchwork-Id: 12932512 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14B13C00144 for ; Fri, 29 Jul 2022 15:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237305AbiG2PTP (ORCPT ); Fri, 29 Jul 2022 11:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237308AbiG2PTB (ORCPT ); Fri, 29 Jul 2022 11:19:01 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE3B820D3; Fri, 29 Jul 2022 08:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1659107939; x=1690643939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Shuy9iGIy3e1bElJke/MLRaI0NEiRx4O4lziejrQgyI=; b=oWXkOezlsKgnrKk0EIfOFj/lj9QmCumGTEDDO13FfsHbuAl0YJZBDUp7 rAl8DNBFA/b9C+yS/rDBBZDtMjTquG0e7eByPAdTiZP2GQfKF0hF3Fzoq AzNjYUUYdeP9GcSt2J87R0abr5Y1Fwmg7/g6SpxD5LRlHgyJapAqW6rzV /zpk1kwKOXdaeYYN1ZMZ4eSFga+Lmh9+l3xhhDuglQ/aS15Jho3oa2FEk dPERj2r/UW4LERTRWh02x4TsTrXS7OltTcbuOc86K2TyXCLz5blt457o+ LhzRpSMorUMtz8mYRHXKo0zxfO4ph61a4DW3cSweA48poQFwViH8ZsYmp A==; X-IronPort-AV: E=Sophos;i="5.93,201,1654585200"; d="scan'208";a="174162834" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Jul 2022 08:18:59 -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.2375.17; Fri, 29 Jul 2022 08:18:57 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 29 Jul 2022 08:18:47 -0700 From: Arun Ramadoss To: , CC: Woojung Huh , , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Russell King" Subject: [Patch RFC net-next 4/4] net: dsa: microchip: use private pvid for bridge_vlan_unwaware Date: Fri, 29 Jul 2022 20:47:33 +0530 Message-ID: <20220729151733.6032-5-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220729151733.6032-1-arun.ramadoss@microchip.com> References: <20220729151733.6032-1-arun.ramadoss@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC To remove ds->configure_vlan_while_not_filtering, for the bridge vlan unaware the private pvid of 4095 is used. The bridged vlan pvid is stored in the ksz port structure and it is used only when vlan_filtering is enabled. If vlan_filtering is disabled then private pvid is used. Signed-off-by: Arun Ramadoss --- drivers/net/dsa/microchip/ksz8.h | 1 + drivers/net/dsa/microchip/ksz8795.c | 23 +------- drivers/net/dsa/microchip/ksz9477.c | 19 ++---- drivers/net/dsa/microchip/ksz9477.h | 1 + drivers/net/dsa/microchip/ksz_common.c | 81 ++++++++++++++++++++++++-- drivers/net/dsa/microchip/ksz_common.h | 10 +++- 6 files changed, 95 insertions(+), 40 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8.h b/drivers/net/dsa/microchip/ksz8.h index 6529f2e2426a..c5b0ab031427 100644 --- a/drivers/net/dsa/microchip/ksz8.h +++ b/drivers/net/dsa/microchip/ksz8.h @@ -42,6 +42,7 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, u16 flags); int ksz8_port_vlan_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); +void ksz8_port_enable_pvid(struct ksz_device *dev, int port, bool state); int ksz8_port_mirror_add(struct ksz_device *dev, int port, struct dsa_mall_mirror_tc_entry *mirror, bool ingress, struct netlink_ext_ack *extack); diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index b8843697c5a5..16709949d079 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -952,7 +952,7 @@ int ksz8_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, return 0; } -static void ksz8_port_enable_pvid(struct ksz_device *dev, int port, bool state) +void ksz8_port_enable_pvid(struct ksz_device *dev, int port, bool state) { if (ksz_is_ksz88x3(dev)) { ksz_cfg(dev, REG_SW_INSERT_SRC_PVID, @@ -967,8 +967,8 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, { bool untagged = flags & BRIDGE_VLAN_INFO_UNTAGGED; struct ksz_port *p = &dev->ports[port]; - u16 data, new_pvid = 0; u8 fid, member, valid; + u16 data; if (ksz_is_ksz88x3(dev)) return -ENOTSUPP; @@ -1015,32 +1015,18 @@ int ksz8_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, ksz8_to_vlan(dev, fid, member, valid, &data); ksz8_w_vlan_table(dev, vlan_vid, data); - /* change PVID */ - if (flags & BRIDGE_VLAN_INFO_PVID) - new_pvid = vlan_vid; - - if (new_pvid) { - - ksz_set_pvid(dev, port, new_pvid); - - ksz8_port_enable_pvid(dev, port, true); - } - return 0; } int ksz8_port_vlan_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan) { - u16 data, pvid; + u16 data; u8 fid, member, valid; if (ksz_is_ksz88x3(dev)) return -ENOTSUPP; - ksz_get_pvid(dev, port, &pvid); - pvid = pvid & 0xFFF; - ksz8_r_vlan_table(dev, vlan->vid, &data); ksz8_from_vlan(dev, data, &fid, &member, &valid); @@ -1055,9 +1041,6 @@ int ksz8_port_vlan_del(struct ksz_device *dev, int port, ksz8_to_vlan(dev, fid, member, valid, &data); ksz8_w_vlan_table(dev, vlan->vid, data); - if (pvid == vlan->vid) - ksz8_port_enable_pvid(dev, port, false); - return 0; } diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index a43a581520fb..b423aebe4473 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -354,6 +354,12 @@ void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port) } } +void ksz9477_port_drop_untagged(struct ksz_device *dev, int port, bool state) +{ + ksz_port_cfg(dev, port, REG_PORT_MRI_MAC_CTRL, PORT_DROP_NON_VLAN, + state); +} + int ksz9477_port_vlan_filtering(struct ksz_device *dev, int port, bool flag, struct netlink_ext_ack *extack) { @@ -394,10 +400,6 @@ int ksz9477_port_vlan_add(struct ksz_device *dev, int port, u16 vlan_vid, if (err) return err; - /* change PVID */ - if (flags & BRIDGE_VLAN_INFO_PVID) - ksz_set_pvid(dev, port, vlan_vid); - return 0; } @@ -406,10 +408,6 @@ int ksz9477_port_vlan_del(struct ksz_device *dev, int port, { bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; u32 vlan_table[3]; - u16 pvid; - - ksz_get_pvid(dev, port, &pvid); - pvid = pvid & 0xFFF; if (ksz9477_get_vlan_table(dev, vlan->vid, vlan_table)) { dev_dbg(dev->dev, "Failed to get vlan table\n"); @@ -418,9 +416,6 @@ int ksz9477_port_vlan_del(struct ksz_device *dev, int port, vlan_table[2] &= ~BIT(port); - if (pvid == vlan->vid) - pvid = 1; - if (untagged) vlan_table[1] &= ~BIT(port); @@ -429,8 +424,6 @@ int ksz9477_port_vlan_del(struct ksz_device *dev, int port, return -ETIMEDOUT; } - ksz_set_pvid(dev, port, pvid); - return 0; } diff --git a/drivers/net/dsa/microchip/ksz9477.h b/drivers/net/dsa/microchip/ksz9477.h index 30a1fff9b8ec..2bd88319a2c0 100644 --- a/drivers/net/dsa/microchip/ksz9477.h +++ b/drivers/net/dsa/microchip/ksz9477.h @@ -28,6 +28,7 @@ int ksz9477_port_vlan_filtering(struct ksz_device *dev, int port, int ksz9477_port_vlan_add(struct ksz_device *dev, int port, u16 vid, u16 flags); int ksz9477_port_vlan_del(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); +void ksz9477_port_drop_untagged(struct ksz_device *dev, int port, bool state); int ksz9477_port_mirror_add(struct ksz_device *dev, int port, struct dsa_mall_mirror_tc_entry *mirror, bool ingress, struct netlink_ext_ack *extack); diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 516fb9d35c87..8a5583b1f2f4 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -161,6 +161,7 @@ static const struct ksz_dev_ops ksz8_dev_ops = { .vlan_filtering = ksz8_port_vlan_filtering, .vlan_add = ksz8_port_vlan_add, .vlan_del = ksz8_port_vlan_del, + .drop_untagged = ksz8_port_enable_pvid, .mirror_add = ksz8_port_mirror_add, .mirror_del = ksz8_port_mirror_del, .get_caps = ksz8_get_caps, @@ -187,6 +188,7 @@ static const struct ksz_dev_ops ksz9477_dev_ops = { .vlan_filtering = ksz9477_port_vlan_filtering, .vlan_add = ksz9477_port_vlan_add, .vlan_del = ksz9477_port_vlan_del, + .drop_untagged = ksz9477_port_drop_untagged, .mirror_add = ksz9477_port_mirror_add, .mirror_del = ksz9477_port_mirror_del, .get_caps = ksz9477_get_caps, @@ -220,6 +222,7 @@ static const struct ksz_dev_ops lan937x_dev_ops = { .vlan_filtering = ksz9477_port_vlan_filtering, .vlan_add = ksz9477_port_vlan_add, .vlan_del = ksz9477_port_vlan_del, + .drop_untagged = ksz9477_port_drop_untagged, .mirror_add = ksz9477_port_mirror_add, .mirror_del = ksz9477_port_mirror_del, .get_caps = lan937x_phylink_get_caps, @@ -1254,6 +1257,9 @@ static int ksz_enable_port(struct dsa_switch *ds, int port, { struct ksz_device *dev = ds->priv; + dev->dev_ops->vlan_add(dev, port, KSZ_DEFAULT_VLAN, + BRIDGE_VLAN_INFO_UNTAGGED); + if (!dsa_is_user_port(ds, port)) return 0; @@ -1335,7 +1341,7 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds, return proto; } -void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid) +static void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid) { const u16 *regs = dev->info->regs; u16 val; @@ -1345,45 +1351,110 @@ void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid) *pvid = val & VLAN_VID_MASK; } -void ksz_set_pvid(struct ksz_device *dev, int port, u16 pvid) +static void ksz_set_pvid(struct ksz_device *dev, int port, u16 pvid) { const u16 *regs = dev->info->regs; ksz_prmw16(dev, port, regs[P_DEFAULT_PVID], VLAN_VID_MASK, pvid); } +static int ksz_commit_pvid(struct dsa_switch *ds, int port) +{ + struct dsa_port *dp = dsa_to_port(ds, port); + struct net_device *br = dsa_port_bridge_dev_get(dp); + struct ksz_device *dev = ds->priv; + u16 pvid = KSZ_DEFAULT_VLAN; + bool drop_untagged = false; + struct ksz_port *p; + + p = &dev->ports[port]; + + if (br && br_vlan_enabled(br)) { + pvid = p->bridge_pvid.vid; + drop_untagged = !p->bridge_pvid.valid; + } + + ksz_set_pvid(dev, port, pvid); + + if (dev->dev_ops->drop_untagged) + dev->dev_ops->drop_untagged(dev, port, drop_untagged); + + return 0; +} + static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, bool flag, struct netlink_ext_ack *extack) { struct ksz_device *dev = ds->priv; + int ret; if (!dev->dev_ops->vlan_filtering) return -EOPNOTSUPP; - return dev->dev_ops->vlan_filtering(dev, port, flag, extack); + ret = dev->dev_ops->vlan_filtering(dev, port, flag, extack); + if (ret) + return ret; + + return ksz_commit_pvid(ds, port); } static int ksz_port_vlan_add(struct dsa_switch *ds, int port, const struct switchdev_obj_port_vlan *vlan, struct netlink_ext_ack *extack) { + bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; struct ksz_device *dev = ds->priv; + struct ksz_port *p; + int ret; + + p = &dev->ports[port]; if (!dev->dev_ops->vlan_add) return -EOPNOTSUPP; - return dev->dev_ops->vlan_add(dev, port, vlan->vid, vlan->flags); + ret = dev->dev_ops->vlan_add(dev, port, vlan->vid, vlan->flags); + if (ret) + return ret; + + if (pvid) { + p->bridge_pvid.vid = vlan->vid; + p->bridge_pvid.valid = true; + } else if (vlan->vid && p->bridge_pvid.vid == vlan->vid) { + /* The old pvid was reinstalled as a non-pvid VLAN */ + p->bridge_pvid.valid = false; + } + + return ksz_commit_pvid(ds, port); } static int ksz_port_vlan_del(struct dsa_switch *ds, int port, const struct switchdev_obj_port_vlan *vlan) { struct ksz_device *dev = ds->priv; + struct ksz_port *p; + u16 pvid; + int ret; + + p = &dev->ports[port]; if (!dev->dev_ops->vlan_del) return -EOPNOTSUPP; - return dev->dev_ops->vlan_del(dev, port, vlan); + ksz_get_pvid(dev, port, &pvid); + + ret = dev->dev_ops->vlan_del(dev, port, vlan); + if (ret) + return ret; + + if (vlan->vid == pvid) { + p->bridge_pvid.valid = false; + + ret = ksz_commit_pvid(ds, port); + if (ret) + return ret; + } + + return 0; } static int ksz_port_mirror_add(struct dsa_switch *ds, int port, diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 3bcd4e20bfaa..3d7eb170e3ec 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -15,6 +15,7 @@ #include #define KSZ_MAX_NUM_PORTS 8 +#define KSZ_DEFAULT_VLAN (VLAN_N_VID - 1) struct vlan_table { u32 table[3]; @@ -63,6 +64,11 @@ struct ksz_chip_data { bool internal_phy[KSZ_MAX_NUM_PORTS]; }; +struct ksz_vlan { + u16 vid; + bool valid; +}; + struct ksz_port { bool remove_tag; /* Remove Tag flag set, for ksz8795 only */ int stp_state; @@ -81,6 +87,7 @@ struct ksz_port { u16 max_frame; u32 rgmii_tx_val; u32 rgmii_rx_val; + struct ksz_vlan bridge_pvid; }; struct ksz_device { @@ -271,6 +278,7 @@ struct ksz_dev_ops { int (*vlan_add)(struct ksz_device *dev, int port, u16 vid, u16 flags); int (*vlan_del)(struct ksz_device *dev, int port, const struct switchdev_obj_port_vlan *vlan); + void (*drop_untagged)(struct ksz_device *dev, int port, bool untagged); int (*mirror_add)(struct ksz_device *dev, int port, struct dsa_mall_mirror_tc_entry *mirror, bool ingress, struct netlink_ext_ack *extack); @@ -320,8 +328,6 @@ void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state); bool ksz_get_gbit(struct ksz_device *dev, int port); phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit); extern const struct ksz_chip_data ksz_switch_chips[]; -void ksz_get_pvid(struct ksz_device *dev, int port, u16 *pvid); -void ksz_set_pvid(struct ksz_device *dev, int port, u16 pvid); /* Common register access functions */