Skip to content

Commit c339fcd

Browse files
Edward Creekuba-moo
authored andcommitted
sfc: rip out MDIO support
Unlike Siena, no EF10 board ever had an external PHY, and consequently MDIO handling isn't even built into the firmware. Since Siena has been split out into its own driver, the MDIO code can be deleted from the sfc driver. Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Link: https://patch.msgid.link/aa689d192ddaef7abe82709316c2be648a7bd66e.1742493017.git.ecree.xilinx@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 652e2c7 commit c339fcd

File tree

5 files changed

+2
-99
lines changed

5 files changed

+2
-99
lines changed

drivers/net/ethernet/sfc/ef100_netdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
452452
NETIF_F_HIGHDMA | NETIF_F_ALL_TSO;
453453
netif_set_tso_max_segs(net_dev,
454454
ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT);
455-
efx->mdio.dev = net_dev;
456455

457456
rc = efx_ef100_init_datapath_caps(efx);
458457
if (rc < 0)

drivers/net/ethernet/sfc/efx.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -474,28 +474,6 @@ void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
474474
}
475475
}
476476

477-
/**************************************************************************
478-
*
479-
* ioctls
480-
*
481-
*************************************************************************/
482-
483-
/* Net device ioctl
484-
* Context: process, rtnl_lock() held.
485-
*/
486-
static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
487-
{
488-
struct efx_nic *efx = efx_netdev_priv(net_dev);
489-
struct mii_ioctl_data *data = if_mii(ifr);
490-
491-
/* Convert phy_id from older PRTAD/DEVAD format */
492-
if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) &&
493-
(data->phy_id & 0xfc00) == 0x0400)
494-
data->phy_id ^= MDIO_PHY_ID_C45 | 0x0400;
495-
496-
return mdio_mii_ioctl(&efx->mdio, data, cmd);
497-
}
498-
499477
/**************************************************************************
500478
*
501479
* Kernel net device interface
@@ -593,7 +571,6 @@ static const struct net_device_ops efx_netdev_ops = {
593571
.ndo_tx_timeout = efx_watchdog,
594572
.ndo_start_xmit = efx_hard_start_xmit,
595573
.ndo_validate_addr = eth_validate_addr,
596-
.ndo_eth_ioctl = efx_ioctl,
597574
.ndo_change_mtu = efx_change_mtu,
598575
.ndo_set_mac_address = efx_set_mac_address,
599576
.ndo_set_rx_mode = efx_set_rx_mode,
@@ -1201,7 +1178,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
12011178
rc = efx_init_struct(efx, pci_dev);
12021179
if (rc)
12031180
goto fail1;
1204-
efx->mdio.dev = net_dev;
12051181

12061182
pci_info(pci_dev, "Solarflare NIC detected\n");
12071183

drivers/net/ethernet/sfc/mcdi_port.c

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,6 @@
1717
#include "selftest.h"
1818
#include "mcdi_port_common.h"
1919

20-
static int efx_mcdi_mdio_read(struct net_device *net_dev,
21-
int prtad, int devad, u16 addr)
22-
{
23-
struct efx_nic *efx = efx_netdev_priv(net_dev);
24-
MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_READ_IN_LEN);
25-
MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_READ_OUT_LEN);
26-
size_t outlen;
27-
int rc;
28-
29-
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_BUS, efx->mdio_bus);
30-
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_PRTAD, prtad);
31-
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_DEVAD, devad);
32-
MCDI_SET_DWORD(inbuf, MDIO_READ_IN_ADDR, addr);
33-
34-
rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_READ, inbuf, sizeof(inbuf),
35-
outbuf, sizeof(outbuf), &outlen);
36-
if (rc)
37-
return rc;
38-
39-
if (MCDI_DWORD(outbuf, MDIO_READ_OUT_STATUS) !=
40-
MC_CMD_MDIO_STATUS_GOOD)
41-
return -EIO;
42-
43-
return (u16)MCDI_DWORD(outbuf, MDIO_READ_OUT_VALUE);
44-
}
45-
46-
static int efx_mcdi_mdio_write(struct net_device *net_dev,
47-
int prtad, int devad, u16 addr, u16 value)
48-
{
49-
struct efx_nic *efx = efx_netdev_priv(net_dev);
50-
MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_WRITE_IN_LEN);
51-
MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_WRITE_OUT_LEN);
52-
size_t outlen;
53-
int rc;
54-
55-
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_BUS, efx->mdio_bus);
56-
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_PRTAD, prtad);
57-
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_DEVAD, devad);
58-
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_ADDR, addr);
59-
MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_VALUE, value);
60-
61-
rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_WRITE, inbuf, sizeof(inbuf),
62-
outbuf, sizeof(outbuf), &outlen);
63-
if (rc)
64-
return rc;
65-
66-
if (MCDI_DWORD(outbuf, MDIO_WRITE_OUT_STATUS) !=
67-
MC_CMD_MDIO_STATUS_GOOD)
68-
return -EIO;
69-
70-
return 0;
71-
}
7220

7321
u32 efx_mcdi_phy_get_caps(struct efx_nic *efx)
7422
{
@@ -97,12 +45,7 @@ int efx_mcdi_port_probe(struct efx_nic *efx)
9745
{
9846
int rc;
9947

100-
/* Set up MDIO structure for PHY */
101-
efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22;
102-
efx->mdio.mdio_read = efx_mcdi_mdio_read;
103-
efx->mdio.mdio_write = efx_mcdi_mdio_write;
104-
105-
/* Fill out MDIO structure, loopback modes, and initial link state */
48+
/* Fill out loopback modes and initial link state */
10649
rc = efx_mcdi_phy_probe(efx);
10750
if (rc != 0)
10851
return rc;

drivers/net/ethernet/sfc/mcdi_port_common.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,6 @@ int efx_mcdi_phy_probe(struct efx_nic *efx)
448448
efx->phy_data = phy_data;
449449
efx->phy_type = phy_data->type;
450450

451-
efx->mdio_bus = phy_data->channel;
452-
efx->mdio.prtad = phy_data->port;
453-
efx->mdio.mmds = phy_data->mmd_mask & ~(1 << MC_CMD_MMD_CLAUSE22);
454-
efx->mdio.mode_support = 0;
455-
if (phy_data->mmd_mask & (1 << MC_CMD_MMD_CLAUSE22))
456-
efx->mdio.mode_support |= MDIO_SUPPORTS_C22;
457-
if (phy_data->mmd_mask & ~(1 << MC_CMD_MMD_CLAUSE22))
458-
efx->mdio.mode_support |= MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22;
459-
460451
caps = MCDI_DWORD(outbuf, GET_LINK_OUT_CAP);
461452
if (caps & (1 << MC_CMD_PHY_CAP_AN_LBN))
462453
mcdi_to_ethtool_linkset(phy_data->media, caps,
@@ -546,8 +537,6 @@ void efx_mcdi_phy_get_link_ksettings(struct efx_nic *efx, struct ethtool_link_ks
546537
cmd->base.port = mcdi_to_ethtool_media(phy_cfg->media);
547538
cmd->base.phy_address = phy_cfg->port;
548539
cmd->base.autoneg = !!(efx->link_advertising[0] & ADVERTISED_Autoneg);
549-
cmd->base.mdio_support = (efx->mdio.mode_support &
550-
(MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22));
551540

552541
mcdi_to_ethtool_linkset(phy_cfg->media, phy_cfg->supported_cap,
553542
cmd->link_modes.supported);

drivers/net/ethernet/sfc/net_driver.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/ethtool.h>
1616
#include <linux/if_vlan.h>
1717
#include <linux/timer.h>
18-
#include <linux/mdio.h>
18+
#include <linux/mii.h>
1919
#include <linux/list.h>
2020
#include <linux/pci.h>
2121
#include <linux/device.h>
@@ -956,8 +956,6 @@ struct efx_mae;
956956
* @stats_buffer: DMA buffer for statistics
957957
* @phy_type: PHY type
958958
* @phy_data: PHY private data (including PHY-specific stats)
959-
* @mdio: PHY MDIO interface
960-
* @mdio_bus: PHY MDIO bus ID (only used by Siena)
961959
* @phy_mode: PHY operating mode. Serialised by @mac_lock.
962960
* @link_advertising: Autonegotiation advertising flags
963961
* @fec_config: Forward Error Correction configuration flags. For bit positions
@@ -1132,8 +1130,6 @@ struct efx_nic {
11321130

11331131
unsigned int phy_type;
11341132
void *phy_data;
1135-
struct mdio_if_info mdio;
1136-
unsigned int mdio_bus;
11371133
enum efx_phy_mode phy_mode;
11381134

11391135
__ETHTOOL_DECLARE_LINK_MODE_MASK(link_advertising);

0 commit comments

Comments
 (0)