From patchwork Thu Nov 24 10:14:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 25427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3304828wrr; Thu, 24 Nov 2022 02:21:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Xr5rBE398VXj5sdjKEWO0yn2mTHQO6gsHHPq8V4DiNwwWD3r5jN4J4NbmBkJnj3DW2MnK X-Received: by 2002:a17:90b:2d85:b0:213:258d:68ef with SMTP id sj5-20020a17090b2d8500b00213258d68efmr34846851pjb.235.1669285289956; Thu, 24 Nov 2022 02:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669285289; cv=none; d=google.com; s=arc-20160816; b=DS2pjcvcZC12Z/VvyUQu3w8nFo7xKqeqkGFi2C6jkCTriZmHW2zP5eiWQjiggfA2Ws aUO17/dwe47v4N8bqFIW9SJ2S46UoqS2JgmQIB9DypBO/Bo/xJIL0aTf7S9aV4jY+hEB jYY19zLYtHEu1X1/AnJ63ol587sw5tYhTs04qoUvaN66p/NcYsoH+27HL7IU5J/NO9uZ ECaEb0fr6GJ+/hLqs82kVssOgsT2PeSLurTKaXjZzzWAkvX3/m/Y6Gpxkr1M+RzQlXAC m4QQC3Y2ak+qylT8OiStOzQyoAzpN+ax/3S1uE/8JbdP+ekSntQ5RxekGbMaOvnFUxlX MrTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=nYWnU/sgWtnKBZ/o1lua4l/lyv5Xq4bsc90Ry4+125s=; b=lDFoQS1js2Evf56Vm2qM2uBuYbHz/fyAbQM9doDP2BJFEezCTh7J8cz9Ur/KnOs71J Ylr89AefC7AOXXv5Vka06pmMIhTQTU54VjkRAuy54Ph1bXRFrzPA+ucFevvYYxick6+I oOu3NFwJJVMWl3KgzHM2pO7Zm1+pAaddFuWwHSe/PdEOvo7T6hq4X0N8JxMiyM91P2Ng H2EUi6uhnXU7a8cHp0ZWjkKaJZFhh95Id8ELfyyVFBKeIFJMDiYi/JjH0svhu8w2fKp4 P9kedUrK7fXFEZ+ofMpr12NSetcaWyq8xTFgbsd0YcIjpI/95Ze0D3MEiBlzZnoCbeH8 eQoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a62d40d000000b005725d4d6fcdsi644877pfh.205.2022.11.24.02.21.16; Thu, 24 Nov 2022 02:21:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiKXKPU (ORCPT + 99 others); Thu, 24 Nov 2022 05:15:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiKXKPO (ORCPT ); Thu, 24 Nov 2022 05:15:14 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2F2C2873 for ; Thu, 24 Nov 2022 02:15:13 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oy9G4-0004Ig-1z; Thu, 24 Nov 2022 11:15:04 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oy9G0-0000ja-Fi; Thu, 24 Nov 2022 11:15:01 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oy9Fz-00E4X7-Nb; Thu, 24 Nov 2022 11:14:59 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com Subject: [PATCH net-next v6 6/6] net: dsa: microchip: ksz8: move all DSA configurations to one location Date: Thu, 24 Nov 2022 11:14:58 +0100 Message-Id: <20221124101458.3353902-7-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221124101458.3353902-1-o.rempel@pengutronix.de> References: <20221124101458.3353902-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750372492020290955?= X-GMAIL-MSGID: =?utf-8?q?1750372492020290955?= To make the code more comparable to KSZ9477 code, move DSA configurations to the same location. Signed-off-by: Oleksij Rempel Acked-by: Arun Ramadoss Reviewed-by: Vladimir Oltean --- drivers/net/dsa/microchip/ksz8795.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index 060e41b9b6ef..003b0ac2854c 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1359,6 +1359,16 @@ int ksz8_setup(struct dsa_switch *ds) ds->mtu_enforcement_ingress = true; + /* We rely on software untagging on the CPU port, so that we + * can support both tagged and untagged VLANs + */ + ds->untag_bridge_pvid = true; + + /* VLAN filtering is partly controlled by the global VLAN + * Enable flag + */ + ds->vlan_filtering_is_global = true; + ksz_cfg(dev, S_REPLACE_VID_CTRL, SW_FLOW_CTRL, true); /* Enable automatic fast aging when link changed detected. */ @@ -1418,16 +1428,6 @@ int ksz8_switch_init(struct ksz_device *dev) dev->phy_port_cnt = dev->info->port_cnt - 1; dev->port_mask = (BIT(dev->phy_port_cnt) - 1) | dev->info->cpu_ports; - /* We rely on software untagging on the CPU port, so that we - * can support both tagged and untagged VLANs - */ - dev->ds->untag_bridge_pvid = true; - - /* VLAN filtering is partly controlled by the global VLAN - * Enable flag - */ - dev->ds->vlan_filtering_is_global = true; - return 0; }