From patchwork Sun Oct 22 08:56:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13431764 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 116EBA51 for ; Sun, 22 Oct 2023 08:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=@siemens.com header.b="EYb7t8Qh" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2045.outbound.protection.outlook.com [40.107.20.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC8BF4; Sun, 22 Oct 2023 01:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=heuc4dlKagMKJIG7W46UKfA9DUaeyf7573jZWZwmc07llnTNItkPvaF9X5jckrUERyKUPctnd+kNQ46uaUzSD+NWbW+duSWEGmlc+WqyHeFBkUzs/BgLKM8fC5N/SPSpY7QmQvCPgoje+2f0FP+OqPu9fYjCAqvB5rRMI0qAPDPGctvU2WsVBsbSL2Jry9/wnrE4lolK/E2Alsd3ZeTLvIP50bnvI3yD1q5GL64xcf30SGEm4OMZZkHGkit7cA222ka4gsY4gzFS/U7DS1NYCJExlBZFbOYcYuJ6apbIs5HdUpyFUtnsRdXkJx83BD79jJcN/1YIgk7c/yrbJE+Ipw== 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=U0mN5A8kLa9tAVoIzDWEiZrnvpll+/l3Kr8ECEfw0GQ=; b=RLnmgU/mhB3/fwHT/o1BRrhkXL/R0aLWeq3uitNEjx7rVD7Pqc/H4nIqfe7DlOM6aExmI1u/0NryOiDEefdyI3vtZAcNfopmcCfDPsT1jHDxAaglrftJWaG7Lg9h2Cf5hUTuE5Rp/W21svAREM+izt5mEgaEnFVexM5q+vktsyhkTJvoU+Nmb8WYTxfeuxgkGmNAX9YdCNhXymXn7/hHulaSiON/739f6wNLXIFU+zR8mRlplNb0ylzDf7fZTMxIqowFv09puPgdAEbbmbLYZEfQ+82nTmQtYQn5axZZXmgPLo3fWCpZaEoiLaT7H71xdDSA/W2sSijaiWnpHB78PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U0mN5A8kLa9tAVoIzDWEiZrnvpll+/l3Kr8ECEfw0GQ=; b=EYb7t8QhUmw8mAJtj/dvlzYzcNMNGMKYrbalIPHkgbkrCh7We4UiRZL6YUA2yvfOmcyKZK6Hirde6/hbivuCmz8U2wu3YQXX22Djgl/MAtl4aXXNu4tf9JeDNtjkkzFQCPhMCpVuqiwPbjUyT5vDnV94Tv18nfX+g8KPhaHPHRupfAzrFx4l5ldtnwIP/vaW3NxqXnoT/cc0ofmFoC+jHZadGqjhsO6U/BIMcoVB4EC6SjhCbmsn81/DBXRyIA9/zgejvW6lxRWcHDyZ2+dwQpByR1AFqHpb7sKFCDbX99RyBAlNeuqIs3AC9arj6IjxJbLbbxPjFpkX63VJdskJNg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) by AM9PR10MB4005.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:1f5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.26; Sun, 22 Oct 2023 08:56:24 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::2a90:96cb:b3f:6e5]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::2a90:96cb:b3f:6e5%2]) with mapi id 15.20.6907.025; Sun, 22 Oct 2023 08:56:24 +0000 Message-ID: <895ae9c1-b6dd-4a97-be14-6f2b73c7b2b5@siemens.com> Date: Sun, 22 Oct 2023 10:56:22 +0200 User-Agent: Mozilla Thunderbird From: Jan Kiszka Subject: [PATCH] net: ti: icssg-prueth: Add phys_port_name support Content-Language: en-US To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , MD Danish Anwar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Lopes Ivo, Diogo Miguel (T CED IFD-PT)" , Nishanth Menon , "Su, Bao Cheng (RC-CN DF FA R&D)" X-ClientProxiedBy: FR0P281CA0106.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::7) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|AM9PR10MB4005:EE_ X-MS-Office365-Filtering-Correlation-Id: b6e09368-9ba2-429a-d447-08dbd2dcc4f9 X-LD-Processed: 38ae3bcd-9579-4fd4-adda-b42e1495d55a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VNCrGJaFLqpQHeoDBOGRVaAcMbmITykxAGkxf0tvvWsPf+AQgzDGN7spaDEqvzqxjOVx2R43qBiRYuGEguzTmPBow29cJ/b+VMqhDNmpXeNdNKzKyRHiDwv6Mpve5zagNG1lFcDu+Kdn6EfRS3QnGh06hcAlWN/hDGXB3REcvzUyM+0tZ0TIH0eNZPnqbhOEUx7Ph/r9x3n1zfL2bpfe64fX81CMuL4ulvxH2kes8MlLw3+e2tcYzsJuzdP4t8oodUvrLRBKnpcH6aTMyMP4BkzAhvyfm56nMlOQ19wyrHRNEqORMiE7p9Fv5wXxT74ViAwvmT1HUpR/fikKUxTwdz2AXz5svm8ROnmwQcqiGwr3IGwf2p3GMYycOtLyomvr9dW46nCNXk7y3Xm1/MbzjZMRqdnewv1hk0UkUwDVw0hwvsS43CH4IlmKQw1jssaz+ef5HTtcQuaMLoXNBMPdOSwQAZWVjQxCPR2GiZk8vDsKz15EJlWKbQ3M5wF7fzOHhDL9orlEBvWYsz86PG4U3ElIav1pegcHo24m3nfqypueENUms4LVGCt2XRGY5Jrzbqsl2AinoRPUWxGnkChcJv7mWvOMXmc8DQgT+zY/+pDeZ1ZawiCTQJuYzGqPGDsxCPnoqJA3yqdjzi5frNhAQw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(346002)(136003)(366004)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(316002)(66556008)(54906003)(66476007)(66946007)(41300700001)(110136005)(4326008)(2616005)(31696002)(8936002)(82960400001)(2906002)(6486002)(44832011)(107886003)(31686004)(86362001)(5660300002)(6506007)(8676002)(478600001)(36756003)(26005)(6512007)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?uFM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hPQ4mmn56/dOx9eh/BV+YMP9+t910umLt?= =?utf-8?q?Y22lPT137fy/P5ztHMWwntVxbzrfv3ww31nf3ILb33RhoIJc70y9g4J1/q0JB+SAy?= =?utf-8?q?lstzVUwyoU2iMr6uxDbj+4sclAvmkFZrNYSJTz8OoAhsumUuvHR6agj8+OwFL0wlJ?= =?utf-8?q?7i2adPujjJ6winhy0fcW8MGO+0ymhTMdJHK/tHmc/Rq+MG0QEaEt1+bPiCTGOsECb?= =?utf-8?q?LhNu3rdyT91bYh9UQpWJMHgI/WVSiZDovm8Qhec8RWThhqItQCSR8rozP50UsZW26?= =?utf-8?q?Lb/XGQ+2N/p73CTD+QawBDbLdjPDHg4kBVWHILekxnHt8jytx7/3e0wvkHU2l+Y/E?= =?utf-8?q?LzPnhLKy5+lIbkuzSdipPqAGjFI8vE/HTJeU/YRk/ldUsOi4L6JMmcJUemXbfP48A?= =?utf-8?q?DarPZSriYGUD78lZK5HRTlFuiwjTX2z8FzaUZAeDr5JLdnEdePCJzkG9B7rXqoFX5?= =?utf-8?q?wKmPwJ41O332+pJFPvFZ+0VV9H/Y2pJlB8FJ4zhjelWMxsr+QGiKgBVDHAn5Mxq9e?= =?utf-8?q?5uS2zdwTGGHFqq1EVQGRswDiJVDe74iy/dmt6ImZEC2NgMFA3jUUNZMn6NHftxScT?= =?utf-8?q?3xkF9L2RrKDn98V31z8MWpDWupXKX95ftvs9vQ8JyJxM3Z7+F6PXNS789PIuPDt4b?= =?utf-8?q?BSOHq4QHiJct?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6e09368-9ba2-429a-d447-08dbd2dcc4f9 X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2023 08:56:24.3521 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i+8JdtuHq4bGIG9unJKcJuoTFT1j6pkxdSUaYnKf0rSzDVyMWNBTPsIzMv1aKMmp192ZpvNP1iyDi3MzEKjaDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR10MB4005 X-Patchwork-Delegate: kuba@kernel.org From: Jan Kiszka Helps identifying the ports in udev rules e.g. Signed-off-by: Jan Kiszka Reviewed-by: Jacob Keller --- Seems such logic was lost during the upstream rewrite of the SDK version. drivers/net/ethernet/ti/icssg/icssg_prueth.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c index 4914d0ef58e9..ffae89a6ccc5 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c @@ -1653,6 +1653,19 @@ static void emac_ndo_get_stats64(struct net_device *ndev, stats->tx_dropped = ndev->stats.tx_dropped; } +static int emac_ndo_get_phys_port_name(struct net_device *ndev, char *name, + size_t len) +{ + struct prueth_emac *emac = netdev_priv(ndev); + int ret; + + ret = snprintf(name, len, "p%d", emac->port_id); + if (ret >= len) + return -EINVAL; + + return 0; +} + static const struct net_device_ops emac_netdev_ops = { .ndo_open = emac_ndo_open, .ndo_stop = emac_ndo_stop, @@ -1663,6 +1676,7 @@ static const struct net_device_ops emac_netdev_ops = { .ndo_set_rx_mode = emac_ndo_set_rx_mode, .ndo_eth_ioctl = emac_ndo_ioctl, .ndo_get_stats64 = emac_ndo_get_stats64, + .ndo_get_phys_port_name = emac_ndo_get_phys_port_name, }; /* get emac_port corresponding to eth_node name */