From patchwork Sun Sep 11 20:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12973044 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0DAEC6FA83 for ; Sun, 11 Sep 2022 20:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiIKUD0 (ORCPT ); Sun, 11 Sep 2022 16:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbiIKUDF (ORCPT ); Sun, 11 Sep 2022 16:03:05 -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 454FE27DD9; Sun, 11 Sep 2022 13:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WSIIW15Be6C9yxHYs010WpYsLzk6Y50d51VpgqDodT+ayO5RHoQ4XRYgKk59WQOVg6zJJ0aESV1YoKP9YTs0RpmVkeEf5qad6E7GEqMnsH+/r6mNTRx4UzqxzhZezWKCUR32M8TUDz2qVkfTpz9w4QNQc3xDrmE/uzCg3+hMG+GCv3/zVER9UQ4iiunFXBgkmbwDpKShh9CxxCR8QIQb5ZCg+9q6mDf4osEq0ACYSb50nRuj3zI+XEnIaVEaEus17qopB89vrkxbLStvuUkXvGu6Xr7QOXiu5gd1eoZWrfdWmIuh1/9R9+hBJkd711BirdxvKq8S4EK4UYW4kyjbQA== 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=z5az35p9O8xlhDt6pRnLRlMQ1zJXMFlctQDBw2XWpiw=; b=ewS0d4MFraBGvamYrVZFuMdiU/j82Xq/5s3ONbYQLYSTQn2KBTfiLo2G1LUqPKrmzR5zMbi/TzuszpbwpSzc076Hge4nT6qly5vThmgTSt2i4LhqKxKpJ9c49VLAWwc6MY6bzlezgsA4dpn0vgutzCm/bXU5wvu7AZn6+SF0pXl/ybBNiPgel87I4N6E9MjMlchp45htPCfHJUGGZID5DpWeMkgZY0hM9iNs+4gg5/b6RemZflPDzUd5nzzWRqDL3RoGt8MWG1KYeBP1raVzhsagmH9G0hWhMe0cQMafVDM0rRavy0cdgvxPZm/0q2vs4VD4f0Jnz33zUk3YLeD5VQ== 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=z5az35p9O8xlhDt6pRnLRlMQ1zJXMFlctQDBw2XWpiw=; b=Ow8Xtn3kKw4Ky607q0Jyw0bJ2Uo9auMpz6D5HmJ9SD1wpU8r1R3cY5LRdkj7eIqdQ3sEtI5GWl5+QJHY7OSVEmxq8OpLwVPuhtoVALJfoJ8zjSC8/aS5NQFnqeIzORC9XRcg3tR5UorajTGvfupEvVdkSDBCx8iBP+sG2cLBuMY= 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 4/8] net: mscc: ocelot: expose vcap_props structure Date: Sun, 11 Sep 2022 13:02:40 -0700 Message-Id: <20220911200244.549029-5-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> 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: d2806812-e9dc-4b76-d0b0-08da94309e77 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: Z+gBskCqe7dR7DdAl16CLufoSmz6FQHnS0PzpYDEnlFek0w+cFYnnjqBh8L1F5LFOfl0uUFW74Tmuiao+FTw+sE24uiEj2n1tvxe1bM3OTBXUbCDBzzd8PyW3X0etHzgStcdpXsZEsrHeYp99Gp/hUmjZpQ8Fg4anhHSn8ausWIxEqlm5qnxXkowczUFx+YA4Xs3F30xuBW/bcnnANdH3YSZD7YfC6szS+gqvrhnCK0O5Kn672M4tiz/p4P1SqNbJAFue14nTpAXMBsCz0fKDqW12NKjQTFzilAMtzjbqluVKy67FIzF9/W3ddx7ibh9C1iyfnWpvqpFr1hxYzAhOA8e+S7ubDApHYoXueJnK3Kn14o6WL7C/Y3X4Dt7CYKSe8QArwGIoUkm8WyzIni8etXfISy97+hts8qvIrIy/+kk2tXf8zwU4SS1huQtJPLwJjPmfOIIwj2bocGPYL2GM6TSYhYClvuc1foYcODsH3A+6VrYdntejrQJOdIG4DJI+v7cvo2X58KSKtYXDvYjiecSsKSTBwB0dM0FCPCbhZrXOWgqir08HRUnDbtFlouZVFPd4ynisOtWHZOwpZZTLEI5HSYgsNEhDSZQv0ZtITySsv8xC8xQWfCuGra1XvoS1L4FsibWtP3exfYvOhFRes2IDfqYdyQuVamOR5Jk2p/SS0QzlrrLDDBAOQ8OqUaOcZT6atSwDCg8HF4VUUcJHNJ01MnEza9t3YCThISPHOA5+s1Y/MDeXNop05nGdaWr 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: O6CDSSHnMbf1ujOuK15oZYIwt7A5XafJp53Wbeoke1eAMRS+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u2x2WTusas86x34NcXngZpI808NjfYUCMChmMCptB+GP3tSaH7fulLABABBZP0wF5QRE0WCpxCLpbQ9jJznw2X6Kup0Hf4uskPOtqP46ELE28wnR0UMqQz5FQZAEzqCATI66UAKd6V5gy5CdRSY+Eev1q6jzNpjYe1OKRJg7WL+obMY8Ox4ebuc6kxhoEEP4Lfm/h0TsEyNoHLbfbRBCLKodfoP7XKpk2xBc7ERjLGAf+jc5fXAnKNJ9a6pkxLajhWPJr/HdFQecAL2jUwee0nyjCCADvLOdoLOY+RRbkS/opk7LsoZ0bRal7sb8Ge8GFZISqp47HlMATxHsWuNbVfl+gZjnt3u2Coyyen2QbCbZalMj83CUPUsAiEWEH9sJJdYB9sku++CIWaSW0fmNtiZAP31txsoHvg9u5SgedCl8qojQpkhrZaHNqLYWBab17EUE6GGyMsOHajeK0fBJKNk4N+1soedk1SXFCtVmTw== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2806812-e9dc-4b76-d0b0-08da94309e77 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.5746 (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: 1oCn5O154zSmhmo0AlBbO9CEsUBnR1O57W8I36u5A0e5fwipZAn5O2gKtyFSRJzUsd3F9/4kqj2ry0vVe4OpD63b8ZZ1ei70WqObvrHTjSU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5335 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC 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 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 7673ed76358b..6191bca7a9c4 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -161,49 +161,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];