Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2665936rwb; Sat, 8 Oct 2022 11:54:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RvH3QIbrIvJci1gBJu+0jHxKPPZ32d+PPUSNtJl3+9Mydj8pNbnMEbrhQOi1Cmtyhq4Uv X-Received: by 2002:a05:6402:298e:b0:451:129e:1b35 with SMTP id eq14-20020a056402298e00b00451129e1b35mr10030273edb.79.1665255286032; Sat, 08 Oct 2022 11:54:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665255286; cv=pass; d=google.com; s=arc-20160816; b=r9mCRHtO2uscpDmBF/GG12PKYHF/36z3F0Cct7HzhMxcaqHdCzXgzazds8VOoITKF5 lS7J7iai4hlrrvsJkkKNwsY8pno2Qg4FiH5SpdRAnPIHpfXk4/Csv11VdxZnOjx1Lsj4 mGSQerhUyhRrx6iUnqycH72kv+0mkmo7xen7NNCjUi6yF8k9BQmVi1Ef8lmyHHMw3pUz tr8O7SizzF/qmDWb85ubrtFnK3b4PjA5n1y3Yf5/WakcYvRUh6nd2HG1RpQfXPlwjLJd hedOeR44rrM9imj1VaSJjhkmfIiqmuNJF5+XZ2ngedy/jWvMWTIcoXdCWOV2oPioNQuX zC5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OAo2yqRtU2ZEFfuhn1TmTcFTpyicruheyh3pV/alJbI=; b=tD0mdeme5RqLsCD/hSkD5Q71zVeEt1bLqdZ5pTbj1Uo1T6ZE6xjIfNA76DPZblEPBf FRMmPP5Mch7eqIlkxJh7Crnp6sEhsvsCjZCNcnFGKXoiHsmpSuQU5gQ4KVgdssiLMBG+ ISkHb/iyp0bQFMsEdKl47502xJvYT4vS9samzPHy0sIyLPZNOCBwr+OmobwxVsw5pgv8 Gl77Wqj0nqPmVlzoZFsV6YPiX003Wz9iK0ynwFrySOs84XAcU2XnnoiDEWwhhWI5UR4S 0C6qiBwYCE6xjSNihwduqnvYtQ7lPrABSz0rdUMFdaCwEfwJ40eEVw14qvp4dQojmnxX CGwg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=CWElgqX6; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ch16-20020a0564021bd000b00458ee128628si2528411edb.470.2022.10.08.11.54.20; Sat, 08 Oct 2022 11:54:46 -0700 (PDT) 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=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=CWElgqX6; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbiJHSwQ (ORCPT + 99 others); Sat, 8 Oct 2022 14:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiJHSwK (ORCPT ); Sat, 8 Oct 2022 14:52:10 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2118.outbound.protection.outlook.com [40.107.94.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D423F1DA; Sat, 8 Oct 2022 11:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a45BY3daUdmjLhJLS7z9d3z4UOX8IL5rT9TlvrmPt3h6i/IlP3xRZLVPNStrGRpRHGbWWLaxzNc8J/ncDwJwiBdtD7gu+80z9vc8wYAmO6vcCRsPyNVNPrT873ZlA0pdSPEQl+TjdY3RjVJ647yMcxFKL+cow+wjiqEybP8VIXMUfStiUMZBjiqzxYz8Bgm9jT8oqRdYqeRkWxeJab+4jhfQ6KIpMRQbJUE1PZwWZd/nr3D/X+r425JV3zeJbxqU5Idyfu9JgkgXnF+lAILov3BloNR311VFsohURRN99Qg8+YIXL4UU2GsAAKIn+zfQ1ZKB+GWG3yUjMcCAkxu9xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OAo2yqRtU2ZEFfuhn1TmTcFTpyicruheyh3pV/alJbI=; b=kLGaFw66LC+Z0rReg98YRSZDvNI9usqDYODj8UC6ohntmlHg7XgIfEI9YCJHgJr/yGzg/f3DwYNr3ervxO6Gk4muq0SYS/gubzbfSBmsh90dR3J/NaIwNO0Fr9A/nGR7T8bIiW9WmIptyU7yrmBcTY0BSFaM5y3+Y/exeqiovY74AEamS/nxx3qvZo3jXnLQl/RXZIxqEgyR1eCOompZee9+dMWkU5sOK9PCT1MI4TIjPz/jeyP9GYuQAMMgxm27mc2HrIAoE8XGahjYs0ETlabBgRPnzchIfUjaTjz5h4Mrs7hM7aS1WR2WlVgxmIVxY22DBbkMCy/vwruyjW76kg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OAo2yqRtU2ZEFfuhn1TmTcFTpyicruheyh3pV/alJbI=; b=CWElgqX69p9XJSjLfpOfdSd+yKtgA6UJ2IVwODH3R/2IHGT4k5Drn2tx8AnKPcb/GsRPyLN+NvahKvSEIJpLgfk+MuccceRbcROiretNSJdtB49TFxSd8qY8YNXkjHEUbb3NhgsV1Lu8Ztd9kfAe70rxlfHuSzMwfNgjFbW8jaI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by PH7PR10MB6129.namprd10.prod.outlook.com (2603:10b6:510:1f7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Sat, 8 Oct 2022 18:52:05 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::ee5e:cbf9:e304:942f%7]) with mapi id 15.20.5676.028; Sat, 8 Oct 2022 18:52:05 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Russell King , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Vivien Didelot , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones Subject: [RFC v4 net-next 03/17] net: mscc: ocelot: expose stats layout definition to be used by other drivers Date: Sat, 8 Oct 2022 11:51:38 -0700 Message-Id: <20221008185152.2411007-4-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221008185152.2411007-1-colin.foster@in-advantage.com> References: <20221008185152.2411007-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0304.namprd03.prod.outlook.com (2603:10b6:303:dd::9) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2351:EE_|PH7PR10MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a140f7d-ba5d-4ee0-1290-08daa95e31a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1EsWjjbLvnzfQmlyGFIGHWhRGbvGUi1PugvzVHVOwteKzVy2GqfpO0HQEGBIRXOTIKUCRSHPmkXFc6n6VMGBZ7cMq+CocnVXJq/4ymy7e6nWkSD1W2sPFszQUcjs9toz/q0gA/r4902tCvaztKGQwtvr8/V9E1Cy/ThHCA+gI3VI56FxaFNi+HGxgQozidaoAZnEpr/HxZFEtDFbso2d7EBMoGh+x+Qf+0Krg9sVWoNRucO0wS4rRCLYQNAD/p6fbAlYJlmRXPQ3ZM8uA+8QSPtGn85ZLyh8FfgeLtgZIbebjLOeHXL21Tmlm1yejgi+eRMWveFWuWDi3TNdqLyTZX4wf2/OCVDDWrMsWoel4T4KT4xk8iRzkGyz/A14IPm1VSQ9tKB7STKyCvONh/aBED3UM2DRUy9r3vKI5RrsCM9gjJs7xMluxSHB6pbUJFhpnwTVGUhX53YdWOj04YOHGcqtzSlCgUQPKYD2SpPhXPZa9j2I0gFGJMhz4AWZ0CWNOAMwzBks6fU8QNeBw2eQ/8BFHMXkGz4leO9Q9Ke09uk+hK11ZEIva5NZfPAl1x9NyU1gR+3jZqOGzCmTcOHvrO9sc+FNE1hy185rWNH9N91DWhJ242AL974yozqgq0196cNCctZiW1kI6TIkNZcMRrfEkYZVBVzK7zo59VCS4Xgr1Nmro5AAtscAUOAnqgK+X6ojXvE+jLgRLiPzYJByjSL0pYl/+AHxQrbDLyF7sUu9z4c8oAjoQcu5GcnCRPGTO7yhJk3e1yvTxbObphAnGw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(39830400003)(376002)(366004)(136003)(396003)(451199015)(44832011)(186003)(6512007)(6666004)(26005)(6486002)(6506007)(2616005)(316002)(54906003)(38100700002)(38350700002)(52116002)(4326008)(86362001)(83380400001)(1076003)(478600001)(36756003)(7416002)(2906002)(41300700001)(8676002)(66476007)(8936002)(5660300002)(66946007)(66556008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?FTxLwquaytkF1TiFsdmUvOFJJSUdDbHCYYqiSRbCwIKaTbgIzHWNvTgNs0EP?= =?us-ascii?Q?ym5TOI5RE5ZB80YYWCAANfPlyEchpeEqsIO+WCDxCVZ6/V+hA8JpBxLuJE87?= =?us-ascii?Q?4lXMzxXSw4CpxoGSAkg3IFFQMYBaGdwu/RoiprkwaOw5cUNGWpwPW6O2XJQT?= =?us-ascii?Q?IomiYONnTgJocELVsHYWBgkxm76INYPdPG0fqzoqX9wF83g683dtYvtXM8nc?= =?us-ascii?Q?60vWD1XbLvemRLYntHiqjbo5bj4CaEqIVk+9dKFETQFjZH56cpIPqkB/+/CJ?= =?us-ascii?Q?Q+9Qgw5hF2O4ZUwYiOyiHo85SS9F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?= =?us-ascii?Q?o21tFgyA/wCrDs9ojYBIQPYnIKrmkmXuu1mmmRJkr3zjrPnENuUtPg6paWE1?= =?us-ascii?Q?l4HjHAGoWKOjA7n/xatdKSokoQeKKgQKJoQqoZCueKURGeRGrWci9MyDyAhD?= =?us-ascii?Q?Dm3+7/cai8JNbwINLowvF1EeHZVMi2xmnOs13rmvmwPsFQbVExJ2KIRztDBA?= =?us-ascii?Q?k93l+W9u0QXjBjpeG7WtPdsDD9XUWg9s/+K6yD7blZrjxQsG2B+/L/Gy6/Kf?= =?us-ascii?Q?4a6qIh2kisVEHpQbyPHugi7cotPPozsd8RhuNyc/OsCVGwCLVnZamtM4xG4T?= =?us-ascii?Q?e5KtHkENhDUghE/NPiT7gbv5FDhXr5zDvdgAdNsycUQxTiQBrjSuUntyYivt?= =?us-ascii?Q?Vj+N7PmEwW+uA7Hk9tvQIdX4j/VdZUYCubFlCYAa08udgNdOK7+HmkCM8Hqb?= =?us-ascii?Q?iw=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a140f7d-ba5d-4ee0-1290-08daa95e31a1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2022 18:52:05.2568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Kbuotqx5cWXaq45pA7HaVPk1DAsptSQA2BwWypiBEykDddhEdQiCZ/LiimOo9Y4lulK7bHbpKI8j2FB2hBFRq8G55Xg4x2dkYO+M9O7p5dM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6129 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 The ocelot_stats_layout array is common between several different chips, some of which can only be controlled externally. Export this structure so it doesn't have to be duplicated in these other drivers. Rename the structure as well, to follow the conventions of other shared resources. Signed-off-by: Colin Foster --- v2-v4 * No change v1 from previous RFC: * Utilize OCELOT_COMMON_STATS --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 6 +----- drivers/net/ethernet/mscc/vsc7514_regs.c | 5 +++++ include/soc/mscc/vsc7514_regs.h | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 6d695375b14b..4fb525f071ac 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -42,10 +42,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = { [DEV_GMII] = vsc7514_dev_gmii_regmap, }; -static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = { - OCELOT_COMMON_STATS, -}; - static void ocelot_pll5_init(struct ocelot *ocelot) { /* Configure PLL5. This will need a proper CCF driver @@ -80,7 +76,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) int ret; ocelot->map = ocelot_regmap; - ocelot->stats_layout = ocelot_stats_layout; + ocelot->stats_layout = vsc7514_stats_layout; ocelot->num_mact_rows = 1024; ocelot->ops = ops; diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index 123175618251..d665522e18c6 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -9,6 +9,11 @@ #include #include "ocelot.h" +const struct ocelot_stat_layout vsc7514_stats_layout[OCELOT_NUM_STATS] = { + OCELOT_COMMON_STATS, +}; +EXPORT_SYMBOL(vsc7514_stats_layout); + const struct reg_field vsc7514_regfields[REGFIELD_MAX] = { [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11), [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10), diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index 9b40e7d00ec5..d2b5b6b86aff 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -8,8 +8,11 @@ #ifndef VSC7514_REGS_H #define VSC7514_REGS_H +#include #include +extern const struct ocelot_stat_layout vsc7514_stats_layout[]; + extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; extern const u32 vsc7514_ana_regmap[]; -- 2.25.1