Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3521035ybi; Fri, 5 Jul 2019 08:48:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuoXcpz7YNSE5TfaLjHQqsrZK9h1Sne2LRmJNHKgOX6TmJUBuV1L5qOccv77Ges3x9X/xV X-Received: by 2002:a63:fc52:: with SMTP id r18mr6211664pgk.378.1562341718863; Fri, 05 Jul 2019 08:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562341718; cv=none; d=google.com; s=arc-20160816; b=I6u1lJnoHfyVoLZAuvscMTBpV91Iduy/+JFDz4mm+/w2styHfZUp6m4u4KRWsVCwWF c9fwZPfYwfxe4JI0H8gIg2qIIVMLWe2Xh+t7wnbVLYp5IrobkqPCZ4ngTB/4G92EwS4N zdNJBYD6PDZI2iZrmmbnGhgEkDKkKXTIJXkDf4ojQ2RJFjsJbVxZRM+qPAadtxIoVdaM qm5IzgoWAyXJkUjv6WBz0sIskUdSvAWaFd6Jwr+zlvWU20x7Ut+DwqpLaouYIqUfcdF0 WK0oTcUceUQXTbipfMkxal8t2PxHyI8hUD6gnvU8v1WmQaMEVW/yf6dGR9GufHls6tDm gDPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Eu4NF4HrnGo/7A1pNT63h1AAG1LTTTtktchtYZjb2sg=; b=q+zETAHAArjj/e6llWkUXCAtm+dcC/GFSTShMnHjqVlaChOWz2uRntl2k+pEDAUCYa j4PiGOqOYYqu5aT/myfPm/De29CSCk0Qm4H1Mqwxiw8/U6dGdiuUHpkU1qKfYYDlVIGD 1heEr2yTRCl6HtTXHO78EBwYjhilJzOL+KIJ5y1Sqa606vp5a8A+FZ0FKLqhVVCT1bFk R29MRP4Fmj0Bs1Gwkl6MPGO+UGqgb1YCkr/46s19fCCx0US6UEFtqWKBq/8tGt04cfL4 Rwjak33wI27p5h+vDOXG2rXF0P4GNJx2/kcYotQXgFBYr1R1CFK/kz+XbytqeyriWwvr OB6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay21si7192985pjb.34.2019.07.05.08.48.23; Fri, 05 Jul 2019 08:48:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727498AbfGEO1b (ORCPT + 99 others); Fri, 5 Jul 2019 10:27:31 -0400 Received: from inva021.nxp.com ([92.121.34.21]:50634 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfGEO1U (ORCPT ); Fri, 5 Jul 2019 10:27:20 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 26EE1200761; Fri, 5 Jul 2019 16:27:19 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1A631200E8B; Fri, 5 Jul 2019 16:27:19 +0200 (CEST) Received: from fsr-ub1464-137.ea.freescale.net (fsr-ub1464-137.ea.freescale.net [10.171.82.114]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id CDEE9204D6; Fri, 5 Jul 2019 16:27:18 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: ruxandra.radulescu@nxp.com, Razvan Stefanescu , Ioana Ciornei Subject: [PATCH v2 4/6] staging: fsl-dpaa2/ethsw: Add ndo_get_phys_port_name Date: Fri, 5 Jul 2019 17:27:14 +0300 Message-Id: <1562336836-17119-5-git-send-email-ioana.ciornei@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1562336836-17119-1-git-send-email-ioana.ciornei@nxp.com> References: <1562336836-17119-1-git-send-email-ioana.ciornei@nxp.com> Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Razvan Stefanescu Add the ndo_get_phys_port_name callback to the ethsw driver. Signed-off-by: Razvan Stefanescu Signed-off-by: Ioana Ciornei --- Changes in v2: - none drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index 9f1617164865..341c36b3a76d 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -516,6 +516,19 @@ static int swdev_get_port_parent_id(struct net_device *dev, return 0; } +static int port_get_phys_name(struct net_device *netdev, char *name, + size_t len) +{ + struct ethsw_port_priv *port_priv = netdev_priv(netdev); + int err; + + err = snprintf(name, len, "p%d", port_priv->idx); + if (err >= len) + return -EINVAL; + + return 0; +} + static const struct net_device_ops ethsw_port_ops = { .ndo_open = port_open, .ndo_stop = port_stop, @@ -528,6 +541,7 @@ static int swdev_get_port_parent_id(struct net_device *dev, .ndo_start_xmit = port_dropframe, .ndo_get_port_parent_id = swdev_get_port_parent_id, + .ndo_get_phys_port_name = port_get_phys_name, }; static void ethsw_links_state_update(struct ethsw_core *ethsw) -- 1.9.1