Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4486864rwn; Sun, 11 Sep 2022 13:20:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR7jbYOaJLqyPRgZwVd3tZo2+DO5t9bwL3JNUj/M/FgBC1glvlogdvGlHEIwuE4KOOPPYesP X-Received: by 2002:a17:907:31c1:b0:742:28a3:5d08 with SMTP id xf1-20020a17090731c100b0074228a35d08mr16268839ejb.112.1662927630103; Sun, 11 Sep 2022 13:20:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662927630; cv=pass; d=google.com; s=arc-20160816; b=R1waw1jSf+nNRMNoMG/dbD0ipGlpFaDAK27L1+0TFl5QnwtoNPMxd4JtByQcvAFxSv 1bnUgZKDUi4lKfDkk+R5pQx1wZDPt0W8nqbSzW5bSn4Vi4xyp0Q8/dMcbx6TGJPKN4M3 kYvCB6FhbMdlYoAC/z8wYCco2cyYAIQo4MZv3/1LWWBcneoqmRQGgtORewMOrbip1+Ni 0thh3P9WptsKU2B8jEsbVXmXmDTicfnmsnkBl2uXaRqMsUapqEkzvdIc62JZrsTfHU6c Z6YUFG8I7o9MM6RKaonGSiNO929CWiYkiXbzPhPc5nAvmBRyfPH+2DSOTtICnR6QcdWd RSRg== 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=ZHIvTKO+UXoZEB1hgivgMMnofiDHu8X9nTf9H8NPZ4U=; b=w4CpdK+36mNV3M5NDqj1vBGeG7sq6+uWv+mYPUPYNHPaaWfqjTtmH2lf0ppFuas4UM 9fm9zHo2F8Mdn84RxbquEBgnpSweokWFZW2Frr3Ki58BFZC6kMBfO+h8hYfGp1O4RM0g ShnD4xbf3SccOTrZR5W8PmEc3t9/KzxZ9pMjGPAbxSdhM0XXgyrZQSyLT6tvnXIiPwHB +irwpi0Y+nioX6qDNO7lPbymb+ryhuXyUVqNWpGWcFWheiFEGfZlYiIYfGtYpRobnWpB RwqL833bIjqRsQsaGCpfK3bk2Vgg7v47VFYBVRUSkW60mykGm1gZscKBsPh9r2CGPDfe scqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=ToY4KI5U; 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 hb14-20020a170907160e00b0077b2e822b53si4412590ejc.672.2022.09.11.13.20.04; Sun, 11 Sep 2022 13:20:30 -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=ToY4KI5U; 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 S229766AbiIKUDN (ORCPT + 99 others); Sun, 11 Sep 2022 16:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbiIKUDE (ORCPT ); Sun, 11 Sep 2022 16:03:04 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2095.outbound.protection.outlook.com [40.107.96.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4523327DF8; Sun, 11 Sep 2022 13:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFoE75818edk952CGRcViPSowmpQbjoBt7XdC/ZOFr1jBNK51OngrDdKo95dcWh/J1OKZR7JUmtWH3zHXlS5UiQKgUYqZXjW1mDxc3GtTPdqbeYr+NNtgSRxNZS0v3drHKVbk4AKCROj6hNjwqTDAfJqyVWbDVduNNkC1Dj5CFOjrwgDEk2Zl1qgG9w7dDrDZQh4YSTLa1E8BeyzP7r+AMrvy9p4olv0tnN/yq0F7IPtezI9xQLXRtOw2hKj6F8vcSU5bogTvZ0cTU5hlTyHaMngardEz6OkKVe1xcOV43L2kO8SMXVTes/nCIbJJhd6ouP4vy75VRKcrciVqpRHlQ== 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=ZHIvTKO+UXoZEB1hgivgMMnofiDHu8X9nTf9H8NPZ4U=; b=B24a2TAuQjGUPaLYTiace+cXQKKT59eBAd5AxE1I4J7DjgFwfxLSUsLKtAlgs1EO4AQ4YhuKjuFnoZSdHXYRyWY9VT1ZO+uiOeHaad/Jfxh26fvZPxYP6a5p6NeiZlcHugc9l/7a4SDN+KsVac6IAliikORhLzjWLb7kQcZm6cz73IJWjn9k4w6KBBoaObgxe+/dFipKrf1e3qTxzqO4G2RLsdRBlSziinWKXuuk44FJX1DEBnzXAhwJTkFHfbzQyjW59ZMuMeozcMGhZMpdg3hkOxdWaIWtLLMCRuEKddo3YXvfmQ89zLvMbxf3S5ysnzq2LL/eJkO69iaqOR8mAQ== 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=ZHIvTKO+UXoZEB1hgivgMMnofiDHu8X9nTf9H8NPZ4U=; b=ToY4KI5U0h+5ch400B0ziRWDdVHbINPbzJUtpA0WQVtvxaTsOXXI7/cYoPf6gEORakwQjR8pLZ9sP2elv9dpsWK6gLI1co7LkxjJSQDTPTIVmRfqSsql4y3HJuJQ9DZwo6LuukCZ5YLgkLm6tZJmYSrwy3XuY6+tugGZxeiROrg= 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 BN0PR10MB5335.namprd10.prod.outlook.com (2603:10b6:408:127::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14; Sun, 11 Sep 2022 20:02:57 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1%7]) with mapi id 15.20.5588.020; Sun, 11 Sep 2022 20:02:57 +0000 From: Colin Foster To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Russell King , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Florian Fainelli , Vivien Didelot , Andrew Lunn , UNGLinuxDriver@microchip.com, Alexandre Belloni , Claudiu Manoil , Vladimir Oltean , Lee Jones Subject: [RFC v1 net-next 3/8] net: mscc: ocelot: expose stats layout definition to be used by other drivers Date: Sun, 11 Sep 2022 13:02:39 -0700 Message-Id: <20220911200244.549029-4-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220911200244.549029-1-colin.foster@in-advantage.com> References: <20220911200244.549029-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0318.namprd03.prod.outlook.com (2603:10b6:303:dd::23) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: baf7a9c2-e907-46fa-86ba-08da94309e2b X-MS-TrafficTypeDiagnostic: BN0PR10MB5335:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ld8kMVkZRWNFaseb+wsWByY4vYFk+l4gZ4u6aEryoXWTejXVLs7ZYAbMZ2HKRmL7SVMoF50V+SLX94BqDukcl3SkNgE6Ul1PZ4hL+QbaY+Dui8iVrnExQRFdBq3Fd36swrVMzUe6CrV0maP1C/xzI/xNgax1yGXgSRIt090FV9zyqxIKH9/HDj3oGlns/67RDqB22IivTI/GJ6Lg5ovsYbRL4b5MF+dv0Spo3QSNda0syKnUB/+Jfya50xrLgonnYpeJKnv8LdUcr2TVXdb5zkrMHXpo1b6r1w1LdDNEycMI8lyjNr4W1tX1Om5+mLjLn174bK2KEb/X5b/gB6RK4RIPFxfb7KPqJIxSfJjUJIpUxgZxfSvprTPEYI4EPrDj5QRVAWKmqoPEvaV4qX/29n2FSQMI7eF1SK19nrlyyWrpxTgm3fbzZyiEW6ap6K3o0//ioBg/OZtZ9/A10b6ApW3qv8BT65jY6Hzoc3BHryvZ6cKfiAbKlXSMFqtbLfulowm+p921zXgHYxSyr4zQ6zy3MN2bjoVQzWSplHfzseI2fBLjuu0beIMZAzQDiTkoU80cfnp7+Z0tcVF8X4PqRdd51QpKDDhZe2wHGEegkkiM+0qoXKBw7TYVF40AaV6gLSIKhfPgs/TqIHkP8m9C4ZpEk2XpMMcq0D9eEilGsU4y3T/nlnKrjMmVdIRiGCJYjwbNRy7X9/RWldUwsmXXFjNBvMNDhSVyNcxfIqHGnm1rTYfa8mtNrH4TDdKJuvRv3FnmdDr06BMolB57ids5BA== 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:(13230016)(396003)(136003)(366004)(39830400003)(376002)(346002)(38350700002)(38100700002)(8676002)(4326008)(66946007)(36756003)(86362001)(66556008)(66476007)(2906002)(83380400001)(186003)(2616005)(6512007)(6506007)(1076003)(52116002)(478600001)(6486002)(6666004)(26005)(316002)(54906003)(44832011)(41300700001)(8936002)(5660300002)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qM3MtDNie9Whn5JJYU6StPeY+W3jONDHaD2AiIR3tzDpqf1UeitRz6ZlG2xE?= =?us-ascii?Q?INWxhiSZbKH2ABtMfk0z5pLpkYsApCsaZMTEg5vROMvImSFPArqbNBuot1p9?= =?us-ascii?Q?hd2xshl2YoE6HHE/rAQxtZb/FazcFCAC8wbGiiTQhZED7Rc0Zs9HN/oxq9CD?= =?us-ascii?Q?3pCs+RykknaC4nzc28eduRB7/eDTvKhenM+1T1nBuUvWFZIyUiG9os4pIG2V?= =?us-ascii?Q?8AF0BnGUmggD03qflBitFx0wuBwfpzDtRReHUSNT+Y2DOvRlUF7MJjsNW379?= =?us-ascii?Q?rjQTXbWz1WPdpK4Iu9jcUsnQVzsjXveN18mzG0MvKtZef/bNRLfLL2SymJll?= =?us-ascii?Q?L3gBW7oEgsMIZbswoN9V8f7l1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KipikuwxhGTUaQqFUJ4i1iPeO0F3MJtQHyxYW17xjY6tQVeIVP6HLlEf?= =?us-ascii?Q?k/QIN1+lwr16kq30n8aDBO0biIQktas8QLmk5x3dkrCTkRecfxkWL3EpmhS4?= =?us-ascii?Q?n1q3y65fcbL2kBogdvnrXRbUHjTAkL8l7hVtMjeHeyH7MyFIe33U5G9Q/PG8?= =?us-ascii?Q?rFqCyIkSYQSZgI/sookk2NuG1sgkuWYjt96UyllzXLrqEQD0zoaKqnDLeqo9?= =?us-ascii?Q?VBQkrsssLfm2fME4/5Y9XtAOfAbVKTKBVYNEzjhCD1wn0aNgOEBxK/3DpWT9?= =?us-ascii?Q?mbu7ibfG0yFBJboaPW/edjzYXlVNuPs7T/ZkWiLQiATHovwUx6KQZnwyM3W2?= =?us-ascii?Q?2Q=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: baf7a9c2-e907-46fa-86ba-08da94309e2b X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2022 20:02:56.0902 (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: QLJgeFwxVVCipsCm7e6yPcuwc8EIwvBZF+WKd/QNgJFR03PbUNHkFhu1n+VcGLwzq0IbgEF0AKSayrV0gQOgqsbrXBPymn5T7j50Fo+VZro= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5335 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, T_SCC_BODY_TEXT_LINE 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 --- 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 e9c7740f20e9..7673ed76358b 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -38,10 +38,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 @@ -76,7 +72,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