From patchwork Thu Feb 2 12:59:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Sankaranarayanan X-Patchwork-Id: 51912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp221735wrn; Thu, 2 Feb 2023 05:01:00 -0800 (PST) X-Google-Smtp-Source: AK7set+RpcRP7uskWMsi9PBhV05I5WvvF4rzf4Bkh9ycOE5DmPYGQi8Czckf7VxN1FQAZx7PSXee X-Received: by 2002:a17:906:407:b0:887:3c7e:5df with SMTP id d7-20020a170906040700b008873c7e05dfmr6418164eja.73.1675342860138; Thu, 02 Feb 2023 05:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675342860; cv=none; d=google.com; s=arc-20160816; b=egurEW9M6ihFAZKegq4llhIKIe6VkFWUXEk7fs99FywHwblmYJrRzTRhAay7G+es+n j1ng4iy9kqxBNyonRivp5qWag8japBcMavxsjs5gpW2xvCAH63zqE/R5R86yPkVvQpGo awMG0CZhpijffHBWBJQiuUBtdFoPOvdSqiWyJvFoxnd0153DwAC75lI1TUXKNsMvfWUF X8+iNJSxUT2hf2Z1Y3+L+EbWMgWexPYFORAr7HHqBuBXMsTbvHl0kXwYKYBtPXwIWcsz WBGU/qI3f88OvTqRvvzWwK/tK13UxjGhuPssC/tDlm6XN2d97HRCBxfAXaAK+p9t3pN2 wb8g== 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 :dkim-signature; bh=lVBdfDYx63XdgSjjLPZsLSN0Wdd0qjfOcuPnlz6uuKA=; b=Jv379ajQmDJL8ZBUXypRQxE9MMF7BAZQwaDiAVn/z+sGrwStAQbiO3wG0BEEdIOtxx LLwgkAc6NmaKtjD7c0VJFpb3QdJVAwFsl44tLSuSlkaqArX/fDqSAVroTIjYO4YjEVPL FEsI0uxHniAtpDhiJYDFwI5k67WISkgmsiLFi2BzyyV1pS10eEJRICflNYo5Qof9DZS2 QdfxdJ1fYQyZ0kMLGUx3Z7bixv+DrTY2dezhI0qYhbTkjVQsFBwa0andfcfIMd28JK1D GDdJLpCsDH9o7ow7rtSfRPGDn+5pxL0xk6t2NouOPoduz2vW55/vuJrhyvn0W9ehG4kx 2Fig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=St3z3Em+; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a170906000c00b0087766403eccsi28382389eja.819.2023.02.02.05.00.34; Thu, 02 Feb 2023 05:01:00 -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; dkim=pass header.i=@microchip.com header.s=mchp header.b=St3z3Em+; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232506AbjBBM7U (ORCPT + 99 others); Thu, 2 Feb 2023 07:59:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232372AbjBBM7D (ORCPT ); Thu, 2 Feb 2023 07:59:03 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FCD689FAC; Thu, 2 Feb 2023 04:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1675342741; x=1706878741; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=32H2oJWTk/bY+4r4IuXy3k5EXeQhNmioppl2l7N7A2E=; b=St3z3Em+sFB1Naes9cIk9mdM0mhZF1hfBRVP3q/xy+VbJ+VddBeYDacW PQibYf/GYKF2iAeXDuPaFac3Vs495+kyLmh2wy3U+wX4yxoqxHd6bDkU1 ujWQuIMZoGoMStOiNhAlllhz/IcQbRd5KzHCK39TR7z0Z7W9tu9X4MG2L mBlVN51k5TfT/ctOGKCv4V8rjUdI4Cq7IWFkbWhh1myzMN6OH6+qgnUts a4fXeJXdOeIRWNKH2V2ptQokPEfhcDoh6XZgM5opXGFU3zZOPhw086a3n sA5QO8aO0hGmOwIVbTQEvZcUbJx5Pm0qMmp1x++/Y7UCJWcfoJd3FpVIO g==; X-IronPort-AV: E=Sophos;i="5.97,267,1669100400"; d="scan'208";a="135251838" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2023 05:59:00 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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.2507.16; Thu, 2 Feb 2023 05:59:00 -0700 Received: from che-lt-i67786lx.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Feb 2023 05:58:55 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , Subject: [RFC PATCH net-next 06/11] net: dsa: microchip: lan937x: get cascade tag protocol Date: Thu, 2 Feb 2023 18:29:25 +0530 Message-ID: <20230202125930.271740-7-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> References: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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?1756724314711836926?= X-GMAIL-MSGID: =?utf-8?q?1756724314711836926?= Update ksz_get_tag_protocol to return separate tag protocol if switch is connected in cascade mode. Variable ds->dst->last_switch will contain total number of switches registered. For cascaded connection alone, this will be more than zero. Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/ksz_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index adf8391dd29f..2160a3e61a5a 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -2567,9 +2567,13 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds, dev->chip_id == KSZ9567_CHIP_ID) proto = DSA_TAG_PROTO_KSZ9477; - if (is_lan937x(dev)) + if (is_lan937x(dev)) { proto = DSA_TAG_PROTO_LAN937X_VALUE; + if (ds->dst->last_switch) + proto = DSA_TAG_PROTO_LAN937X_CASCADE_VALUE; + } + return proto; }