public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare•com>
To: <linux-net-drivers@solarflare•com>, <davem@davemloft•net>
Cc: <netdev@vger•kernel.org>
Subject: [PATCH net-next 15/15] sfc_ef100: implement ndo_get_phys_port_{id,name}
Date: Fri, 3 Jul 2020 16:36:25 +0100	[thread overview]
Message-ID: <828362ba-e678-9e6b-d564-40ccf369c5d6@solarflare.com> (raw)
In-Reply-To: <14d4694e-2493-abd3-b76e-09e38a01b588@solarflare.com>

Signed-off-by: Edward Cree <ecree@solarflare•com>
---
 drivers/net/ethernet/sfc/ef100_netdev.c |  2 ++
 drivers/net/ethernet/sfc/ef100_nic.c    | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/sfc/ef100_netdev.c b/drivers/net/ethernet/sfc/ef100_netdev.c
index 3e4e7241d9a8..66e6c1159c0f 100644
--- a/drivers/net/ethernet/sfc/ef100_netdev.c
+++ b/drivers/net/ethernet/sfc/ef100_netdev.c
@@ -214,6 +214,8 @@ static const struct net_device_ops ef100_netdev_ops = {
 	.ndo_open               = ef100_net_open,
 	.ndo_stop               = ef100_net_stop,
 	.ndo_start_xmit         = ef100_hard_start_xmit,
+	.ndo_get_phys_port_id   = efx_get_phys_port_id,
+	.ndo_get_phys_port_name = efx_get_phys_port_name,
 };
 
 /*	Netdev registration
diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c
index 7c914b2f71c5..de7c428c63bb 100644
--- a/drivers/net/ethernet/sfc/ef100_nic.c
+++ b/drivers/net/ethernet/sfc/ef100_nic.c
@@ -406,6 +406,20 @@ static int ef100_reset(struct efx_nic *efx, enum reset_type reset_type)
 	return rc;
 }
 
+static int efx_ef100_get_phys_port_id(struct efx_nic *efx,
+				      struct netdev_phys_item_id *ppid)
+{
+	struct ef100_nic_data *nic_data = efx->nic_data;
+
+	if (!is_valid_ether_addr(nic_data->port_id))
+		return -EOPNOTSUPP;
+
+	ppid->id_len = ETH_ALEN;
+	memcpy(ppid->id, nic_data->port_id, ppid->id_len);
+
+	return 0;
+}
+
 static unsigned int ef100_check_caps(const struct efx_nic *efx,
 				     u8 flag, u32 offset)
 {
@@ -460,6 +474,8 @@ const struct efx_nic_type ef100_pf_nic_type = {
 	.rx_remove = efx_mcdi_rx_remove,
 	.rx_write = ef100_rx_write,
 
+	.get_phys_port_id = efx_ef100_get_phys_port_id,
+
 	.reconfigure_mac = ef100_reconfigure_mac,
 
 	/* Per-type bar/size configuration not used on ef100. Location of
@@ -542,6 +558,11 @@ static int ef100_probe_main(struct efx_nic *efx)
 
 	efx->max_vis = EF100_MAX_VIS;
 
+	rc = efx_mcdi_port_get_number(efx);
+	if (rc < 0)
+		goto fail;
+	efx->port_num = rc;
+
 	rc = ef100_phy_probe(efx);
 	if (rc)
 		goto fail;

      parent reply	other threads:[~2020-07-03 15:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 15:28 [PATCH net-next 00/15] sfc_ef100: driver for EF100 family NICs, part 1 Edward Cree
2020-07-03 15:30 ` [PATCH net-next 01/15] sfc_ef100: add EF100 register definitions Edward Cree
2020-07-03 15:30 ` [PATCH net-next 02/15] sfc_ef100: register accesses on EF100 Edward Cree
2020-07-03 15:31 ` [PATCH net-next 03/15] sfc_ef100: skeleton EF100 PF driver Edward Cree
2020-07-03 17:43   ` Jakub Kicinski
2020-07-03 17:46   ` kernel test robot
2020-07-08 19:16     ` Edward Cree
2020-07-03 17:46   ` [RFC PATCH] sfc_ef100: ef100_hard_start_xmit() can be static kernel test robot
2020-07-03 19:41   ` [PATCH net-next 03/15] sfc_ef100: skeleton EF100 PF driver kernel test robot
2020-07-04  4:16   ` kernel test robot
2020-07-07 18:34     ` Edward Cree
2020-07-08  3:15       ` [kbuild-all] " Xia, Hui
2020-07-03 15:31 ` [PATCH net-next 04/15] sfc_ef100: reset-handling stub Edward Cree
2020-07-03 15:32 ` [PATCH net-next 05/15] sfc_ef100: PHY probe stub Edward Cree
2020-07-03 15:32 ` [PATCH net-next 06/15] sfc_ef100: don't call efx_reset_down()/up() on EF100 Edward Cree
2020-07-04  2:15   ` kernel test robot
2020-07-03 15:33 ` [PATCH net-next 07/15] sfc_ef100: implement MCDI transport Edward Cree
2020-07-03 15:33 ` [PATCH net-next 08/15] sfc_ef100: implement ndo_open/close and EVQ probing Edward Cree
2020-07-03 15:34 ` [PATCH net-next 09/15] sfc_ef100: process events for MCDI completions Edward Cree
2020-07-03 15:34 ` [PATCH net-next 10/15] sfc_ef100: read datapath caps, implement check_caps Edward Cree
2020-07-03 15:35 ` [PATCH net-next 11/15] sfc_ef100: extend ef100_check_caps to cover datapath_caps3 Edward Cree
2020-07-03 15:35 ` [PATCH net-next 12/15] sfc_ef100: actually perform resets Edward Cree
2020-07-03 15:35 ` [PATCH net-next 13/15] sfc_ef100: probe the PHY and configure the MAC Edward Cree
2020-07-03 15:36 ` [PATCH net-next 14/15] sfc_ef100: read device MAC address at probe time Edward Cree
2020-07-03 15:36 ` Edward Cree [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=828362ba-e678-9e6b-d564-40ccf369c5d6@solarflare.com \
    --to=ecree@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-net-drivers@solarflare$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox