Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2666019rwb; Sat, 8 Oct 2022 11:54:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ZS7wXB1nN3GJZ42z+4lxgy10DFjPp8V4PEluP00G0t2qdnlzRb7JozC2EmBFV42uH2K+0 X-Received: by 2002:a05:6402:3486:b0:451:b8d3:c52c with SMTP id v6-20020a056402348600b00451b8d3c52cmr9876357edc.406.1665255293150; Sat, 08 Oct 2022 11:54:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1665255293; cv=pass; d=google.com; s=arc-20160816; b=VjzfQHiTqSZGoBTfSmhugcaVwK9vLmTI2zUV3guseWWYGOpM1UtzA6dGazgNfjRZYk cne82ClQzftd+msJW/uWpunzfS3xfNiLMlnZ5KEMtTu039N5m5WagCvlrs+9U2Vu/vUx jgJOQg26qphTVJzSg27bamK6ZbuMDUjxrjs/CNkvihS8+KDikf0ZqVfO320ba5WwJ6M9 EUOrHXSExaZFIUwnkIS5T+LbycYoTvpfgx3Alp99gUL4dGs9tjUk24hd/x22LLNc8isa +9var3qRjxhc3ocbYtYKcQluNRSzpl/Jl1giWJP85Y4sKxzJI5s5FNylTWv5HjTuMBGa /oxw== 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=V9X84gh9vCThnj4/kp+VyOwhl56grnNW+bYMKvfayrI=; b=OC8kfww2g2CU+SUYHUq/UsVof7fKe2wd/MQ820GGtU58jNxW767d92HcRwJ4AM/3jC fjp5Di4NNDTutMT8OXHXNBrr1/heEQikoacW+Xl2EHsjlF3pKdSBCCBxJeU3jAHPAqen BoY0kWteDyihoK3NcLSU1Ex2EWkwxRylzUuupYC9nHCjyZBiWE2TWyr8yRzWHjyWxdcS NEBirHL0xAdoKsXSbjD/ii7+pOnx9YsjHIaGriwi26BtERlp/wVzJrLKAlEzwlM4X1Mp 983QW5HHZD5vF7df7FH3DbzwudTx1Nbb1m2ncn6V9eW7LOy6POfjRDpun7aMpUjwWcXG S24Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="jO3ahK/h"; 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 nb25-20020a1709071c9900b00773db351c39si6279706ejc.64.2022.10.08.11.54.27; Sat, 08 Oct 2022 11:54:53 -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="jO3ahK/h"; 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 S229840AbiJHSwW (ORCPT + 99 others); Sat, 8 Oct 2022 14:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJHSwK (ORCPT ); Sat, 8 Oct 2022 14:52:10 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2102.outbound.protection.outlook.com [40.107.94.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205053F303; Sat, 8 Oct 2022 11:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caQYjFfmJ3xG8sEAgcffQx2xvEdwcNMfssChTriB2/RgvJ/ZKyepyOSm2xaq0j61G04As9L5120bYzjwkn7uCR/Ul3HlG9q+dL2mcjf5rQXCeAj/GUsALXMnXW4GNR54hdtV7dDR7bRjqLuJDBB6qjhLrOgtamVdorDZLbJ8TV1leQFvGVB8SQA0XZZxaCYiFd06mEKBgbvrJEuffnQgtKxipdnNU8ZQtavsWLX7g3EJyQje/6qx+N3xq1v4fQRhnfhdqi8byiWgMUO9bZVwleCpeooJ9uVxCO4/1/+Q/hWRglAn0boSOnm2auZR568FU5YVSRNZccrSE/YHRmh3XQ== 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=V9X84gh9vCThnj4/kp+VyOwhl56grnNW+bYMKvfayrI=; b=OzoXrXhAUncAtsCMGOkUzd1Cba/57u2xLVZna9Fn+2y2apqFRale8iuc48HuWWBz6N3XY28dYAFVhyIbfMiLsQE5yBPzaTGlN+l+rislUOr16HYaHlmmwZaplhAwVUcP+mf8u3aoUlPFvuP/gfx1mY5ee+XoH/wdJAbB4guTwrmU35npH/MRktLXe9qYrmDenM3Hw4/W+ABKSWqafKgNRSgFmK0xtxcQGz6pVCkOcnhX7rLpv0qJH+eWAbNWFNuMKonybHOMqw9AuCv5OgGRD5zQOtu5ue7KBNbtk4xsxnXbvqMRQhv2Cme5B4NiNkcfKoHj2fidkAjmyZdjjvQp5g== 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=V9X84gh9vCThnj4/kp+VyOwhl56grnNW+bYMKvfayrI=; b=jO3ahK/hJTcbpMc+BUpzQHf/8v9idv6kZfZJYr0XTHOOTRtAuEI+lRXSY+OLZYwMmmriFkiEBaB4G+SO/Ii08HW5nrqdmxgMNlqqxXqzC2HNbar7Fd37TUC2qAJVMxsk80qjS0CECnz0W2jgZYgcAkDZD8Afoifg48U4vXVNFK0= 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:06 +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:06 +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 04/17] net: mscc: ocelot: expose vcap_props structure Date: Sat, 8 Oct 2022 11:51:39 -0700 Message-Id: <20221008185152.2411007-5-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: 1ec486f4-8b98-4e88-bec4-08daa95e31ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O/xpbww8oENWK4/ADep0oZOwqo5L/aFwEVMRRHK/ypS0YcIH12XZpR+mjl5V8JFaRc8QnOkLwVAcv6StwzMo5SQAduH+/pbyCYvaP14sawOrPk0aipbT+3DjI3T/rIR4pV7PQvQbow6bNfhSalS9WQf5aQAz/n0JUEmolKsV4+ofkaqICQELKjqei5QPv96u8taiX/4hel0zialuyNXZJwD7T7913a8al7m71GRFIrI7w9FsEwyIckpbawUYtjhO1AD0p67Ga9c+334bi/4B3A4+ew3qt9uL3fdXKrtRBK4jypxk4GY4N9GMfbdPVw7OIv/qrWf9PxwSvy8t0Z+a7CceCBd7nyXeZQFmH6xfZqmNOryefJ1mkxSyQXibN/Oh7xlPhELbZZoy5MHr7HbiuGQJEkVnFyvVr0i/7IX460Gaj/ezk9q9ZPF05xwduyGuFyNWrs4dya2wkEol7MP9LWjdQ4jwcNo7dUZV07XIEgYeUG/0x1XJdqtdwrs5ss1oJxWWg7oLO5QeBtTySz6tRWcBkh8aXdoRRFl49UXQcC159S/oa+FnLjUzSQUOy6tTlMrO8IpKX3X2dyEtbKIxNehHUrk0RTQZATE6U5UL5ZtbST6JBUuxpgBUfica6zrs8Jy3Jt5i4SnXGczgq0JwCUXLtKqbYRvPVwKGMz4+nxRJ8R9xy492/c3Ln2uZuNFg5ygF42FacVPCqY3PjAorYGYY1m9GSxkFeGkb+QyuNSBveBSQ5ys+UCMwxOVu4X15zBpNwhfVqCvqNcsnqyvdRg== 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?nsh9aT1vOr7aO26v4YiAkC1/7VrKaft2+5uNxmDr/qrCI8fDbtHLD+lxtf3M?= =?us-ascii?Q?VjWx+/DcpQnEPWTGhTdOtOgSzz127cRkg2YCJwclZjYu8ruSzF+T7Kz4OoMN?= =?us-ascii?Q?q8oQtW5DJ5SzhsA1b7iRKwHxk/YOAF7SxtRqHBV+1e/6O7JQetSNxSjULxLQ?= =?us-ascii?Q?hltqsiqV5zy2CViSZo4IVREB9hztAryYfZzwydrATZ+61a9+lmjv+LjU+uyz?= =?us-ascii?Q?JxEwEAgwkscd/42AOstJyYhoWqe9fmCxv7J/iH7PKq2gsElXdK/NsJ67lApu?= =?us-ascii?Q?9SVoRT6ojWdZgaeGuazBjaIFiOdEeQpkxqz0LmFYAXofMfMkS3KsSWp/ErIj?= =?us-ascii?Q?VCdX5m4MDo/y1osZ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zGVp09H1zOf?= =?us-ascii?Q?W+IodVgld8w/JF5oV6qwZ3w22eJBOtaLMOMo9LHijKm/PZEoPZf3mmixTFF3?= =?us-ascii?Q?XJJNN054VR9XeN8Ltdsv/DTprOkrNu6P1yl7b6i+GBitbFKNvf1twuT5QBkr?= =?us-ascii?Q?peLlvG53VzpPt59QRSEaznqKW/pXYsUNwWRVCEXYIBPsY/RvdquG8KJUsh2i?= =?us-ascii?Q?+uRnf0mjPDHIwx7uRga7HMySdPrMcz7oQL+APsKdupq8+/ROcua/0tVrvoVa?= =?us-ascii?Q?3qYTGdnjAQuPy38piGXULXT5Fqw93vjUZgZDrLTdzfyFCJDKZdmdRaN5iMGE?= =?us-ascii?Q?VGlLJBUbty+4IG3QS6DwnqLnP12YHJBt7FSl5H8sXiheHMkHsc685dLdGhDp?= =?us-ascii?Q?Mw=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec486f4-8b98-4e88-bec4-08daa95e31ef 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.7568 (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: 54HsoY6HTUHEvx6+RMbPuAILE8DtcMj01watjroucQIvEl6QEdq70KBdy5FPGMSsWNl7GSS8FU9KjnHDs393GyO8P/0daZzqEwEQGRsrugo= 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 vcap_props structure is common to other devices, specifically the VSC7512 chip that can only be controlled externally. Export this structure so it doesn't need to be recreated. Signed-off-by: Colin Foster --- v1 - v4 from previous RFC: * No changes --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 43 --------------------- drivers/net/ethernet/mscc/vsc7514_regs.c | 44 ++++++++++++++++++++++ include/soc/mscc/vsc7514_regs.h | 1 + 3 files changed, 45 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index 4fb525f071ac..19e5486d1dbd 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -181,49 +181,6 @@ static const struct ocelot_ops ocelot_ops = { .netdev_to_port = ocelot_netdev_to_port, }; -static struct vcap_props vsc7514_vcap_props[] = { - [VCAP_ES0] = { - .action_type_width = 0, - .action_table = { - [ES0_ACTION_TYPE_NORMAL] = { - .width = 73, /* HIT_STICKY not included */ - .count = 1, - }, - }, - .target = S0, - .keys = vsc7514_vcap_es0_keys, - .actions = vsc7514_vcap_es0_actions, - }, - [VCAP_IS1] = { - .action_type_width = 0, - .action_table = { - [IS1_ACTION_TYPE_NORMAL] = { - .width = 78, /* HIT_STICKY not included */ - .count = 4, - }, - }, - .target = S1, - .keys = vsc7514_vcap_is1_keys, - .actions = vsc7514_vcap_is1_actions, - }, - [VCAP_IS2] = { - .action_type_width = 1, - .action_table = { - [IS2_ACTION_TYPE_NORMAL] = { - .width = 49, - .count = 2 - }, - [IS2_ACTION_TYPE_SMAC_SIP] = { - .width = 6, - .count = 4 - }, - }, - .target = S2, - .keys = vsc7514_vcap_is2_keys, - .actions = vsc7514_vcap_is2_actions, - }, -}; - static struct ptp_clock_info ocelot_ptp_clock_info = { .owner = THIS_MODULE, .name = "ocelot ptp", diff --git a/drivers/net/ethernet/mscc/vsc7514_regs.c b/drivers/net/ethernet/mscc/vsc7514_regs.c index d665522e18c6..c943da4dd1f1 100644 --- a/drivers/net/ethernet/mscc/vsc7514_regs.c +++ b/drivers/net/ethernet/mscc/vsc7514_regs.c @@ -644,3 +644,47 @@ const struct vcap_field vsc7514_vcap_is2_actions[] = { [VCAP_IS2_ACT_HIT_CNT] = { 49, 32 }, }; EXPORT_SYMBOL(vsc7514_vcap_is2_actions); + +struct vcap_props vsc7514_vcap_props[] = { + [VCAP_ES0] = { + .action_type_width = 0, + .action_table = { + [ES0_ACTION_TYPE_NORMAL] = { + .width = 73, /* HIT_STICKY not included */ + .count = 1, + }, + }, + .target = S0, + .keys = vsc7514_vcap_es0_keys, + .actions = vsc7514_vcap_es0_actions, + }, + [VCAP_IS1] = { + .action_type_width = 0, + .action_table = { + [IS1_ACTION_TYPE_NORMAL] = { + .width = 78, /* HIT_STICKY not included */ + .count = 4, + }, + }, + .target = S1, + .keys = vsc7514_vcap_is1_keys, + .actions = vsc7514_vcap_is1_actions, + }, + [VCAP_IS2] = { + .action_type_width = 1, + .action_table = { + [IS2_ACTION_TYPE_NORMAL] = { + .width = 49, + .count = 2 + }, + [IS2_ACTION_TYPE_SMAC_SIP] = { + .width = 6, + .count = 4 + }, + }, + .target = S2, + .keys = vsc7514_vcap_is2_keys, + .actions = vsc7514_vcap_is2_actions, + }, +}; +EXPORT_SYMBOL(vsc7514_vcap_props); diff --git a/include/soc/mscc/vsc7514_regs.h b/include/soc/mscc/vsc7514_regs.h index d2b5b6b86aff..a939849efd91 100644 --- a/include/soc/mscc/vsc7514_regs.h +++ b/include/soc/mscc/vsc7514_regs.h @@ -12,6 +12,7 @@ #include extern const struct ocelot_stat_layout vsc7514_stats_layout[]; +extern struct vcap_props vsc7514_vcap_props[]; extern const struct reg_field vsc7514_regfields[REGFIELD_MAX]; -- 2.25.1