]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sfc: rip out MDIO support
authorEdward Cree <ecree.xilinx@gmail.com>
Thu, 20 Mar 2025 17:57:10 +0000 (17:57 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 14:55:10 +0000 (07:55 -0700)
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>
drivers/net/ethernet/sfc/ef100_netdev.c
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/mcdi_port.c
drivers/net/ethernet/sfc/mcdi_port_common.c
drivers/net/ethernet/sfc/net_driver.h

index 7f7d560cb2b4c956ad46ce794a593f3f4fda7829..d941f073f1ebf033c4e14ec3d3f851aef8107861 100644 (file)
@@ -452,7 +452,6 @@ int ef100_probe_netdev(struct efx_probe_data *probe_data)
                                  NETIF_F_HIGHDMA | NETIF_F_ALL_TSO;
        netif_set_tso_max_segs(net_dev,
                               ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT);
-       efx->mdio.dev = net_dev;
 
        rc = efx_ef100_init_datapath_caps(efx);
        if (rc < 0)
index 650136dfc642fd9f6b709ac79cff6d418151682c..112e55b98ed3b69cf81af17ee17f5e57dd8ee859 100644 (file)
@@ -474,28 +474,6 @@ void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
        }
 }
 
-/**************************************************************************
- *
- * ioctls
- *
- *************************************************************************/
-
-/* Net device ioctl
- * Context: process, rtnl_lock() held.
- */
-static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd)
-{
-       struct efx_nic *efx = efx_netdev_priv(net_dev);
-       struct mii_ioctl_data *data = if_mii(ifr);
-
-       /* Convert phy_id from older PRTAD/DEVAD format */
-       if ((cmd == SIOCGMIIREG || cmd == SIOCSMIIREG) &&
-           (data->phy_id & 0xfc00) == 0x0400)
-               data->phy_id ^= MDIO_PHY_ID_C45 | 0x0400;
-
-       return mdio_mii_ioctl(&efx->mdio, data, cmd);
-}
-
 /**************************************************************************
  *
  * Kernel net device interface
@@ -593,7 +571,6 @@ static const struct net_device_ops efx_netdev_ops = {
        .ndo_tx_timeout         = efx_watchdog,
        .ndo_start_xmit         = efx_hard_start_xmit,
        .ndo_validate_addr      = eth_validate_addr,
-       .ndo_eth_ioctl          = efx_ioctl,
        .ndo_change_mtu         = efx_change_mtu,
        .ndo_set_mac_address    = efx_set_mac_address,
        .ndo_set_rx_mode        = efx_set_rx_mode,
@@ -1201,7 +1178,6 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
        rc = efx_init_struct(efx, pci_dev);
        if (rc)
                goto fail1;
-       efx->mdio.dev = net_dev;
 
        pci_info(pci_dev, "Solarflare NIC detected\n");
 
index ad4694fa3ddae6b02d9f3a4d8d77f8f42f0e5d01..7b236d291d8c2fda018164d6c9d04cc77b40c213 100644 (file)
 #include "selftest.h"
 #include "mcdi_port_common.h"
 
-static int efx_mcdi_mdio_read(struct net_device *net_dev,
-                             int prtad, int devad, u16 addr)
-{
-       struct efx_nic *efx = efx_netdev_priv(net_dev);
-       MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_READ_IN_LEN);
-       MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_READ_OUT_LEN);
-       size_t outlen;
-       int rc;
-
-       MCDI_SET_DWORD(inbuf, MDIO_READ_IN_BUS, efx->mdio_bus);
-       MCDI_SET_DWORD(inbuf, MDIO_READ_IN_PRTAD, prtad);
-       MCDI_SET_DWORD(inbuf, MDIO_READ_IN_DEVAD, devad);
-       MCDI_SET_DWORD(inbuf, MDIO_READ_IN_ADDR, addr);
-
-       rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_READ, inbuf, sizeof(inbuf),
-                         outbuf, sizeof(outbuf), &outlen);
-       if (rc)
-               return rc;
-
-       if (MCDI_DWORD(outbuf, MDIO_READ_OUT_STATUS) !=
-           MC_CMD_MDIO_STATUS_GOOD)
-               return -EIO;
-
-       return (u16)MCDI_DWORD(outbuf, MDIO_READ_OUT_VALUE);
-}
-
-static int efx_mcdi_mdio_write(struct net_device *net_dev,
-                              int prtad, int devad, u16 addr, u16 value)
-{
-       struct efx_nic *efx = efx_netdev_priv(net_dev);
-       MCDI_DECLARE_BUF(inbuf, MC_CMD_MDIO_WRITE_IN_LEN);
-       MCDI_DECLARE_BUF(outbuf, MC_CMD_MDIO_WRITE_OUT_LEN);
-       size_t outlen;
-       int rc;
-
-       MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_BUS, efx->mdio_bus);
-       MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_PRTAD, prtad);
-       MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_DEVAD, devad);
-       MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_ADDR, addr);
-       MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_VALUE, value);
-
-       rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_WRITE, inbuf, sizeof(inbuf),
-                         outbuf, sizeof(outbuf), &outlen);
-       if (rc)
-               return rc;
-
-       if (MCDI_DWORD(outbuf, MDIO_WRITE_OUT_STATUS) !=
-           MC_CMD_MDIO_STATUS_GOOD)
-               return -EIO;
-
-       return 0;
-}
 
 u32 efx_mcdi_phy_get_caps(struct efx_nic *efx)
 {
@@ -97,12 +45,7 @@ int efx_mcdi_port_probe(struct efx_nic *efx)
 {
        int rc;
 
-       /* Set up MDIO structure for PHY */
-       efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22;
-       efx->mdio.mdio_read = efx_mcdi_mdio_read;
-       efx->mdio.mdio_write = efx_mcdi_mdio_write;
-
-       /* Fill out MDIO structure, loopback modes, and initial link state */
+       /* Fill out loopback modes and initial link state */
        rc = efx_mcdi_phy_probe(efx);
        if (rc != 0)
                return rc;
index 76ea26722ca4698355f4054555d531b8aa277ee2..dae684194ac8c92b6f8955f3e87c7816632269bf 100644 (file)
@@ -448,15 +448,6 @@ int efx_mcdi_phy_probe(struct efx_nic *efx)
        efx->phy_data = phy_data;
        efx->phy_type = phy_data->type;
 
-       efx->mdio_bus = phy_data->channel;
-       efx->mdio.prtad = phy_data->port;
-       efx->mdio.mmds = phy_data->mmd_mask & ~(1 << MC_CMD_MMD_CLAUSE22);
-       efx->mdio.mode_support = 0;
-       if (phy_data->mmd_mask & (1 << MC_CMD_MMD_CLAUSE22))
-               efx->mdio.mode_support |= MDIO_SUPPORTS_C22;
-       if (phy_data->mmd_mask & ~(1 << MC_CMD_MMD_CLAUSE22))
-               efx->mdio.mode_support |= MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22;
-
        caps = MCDI_DWORD(outbuf, GET_LINK_OUT_CAP);
        if (caps & (1 << MC_CMD_PHY_CAP_AN_LBN))
                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
        cmd->base.port = mcdi_to_ethtool_media(phy_cfg->media);
        cmd->base.phy_address = phy_cfg->port;
        cmd->base.autoneg = !!(efx->link_advertising[0] & ADVERTISED_Autoneg);
-       cmd->base.mdio_support = (efx->mdio.mode_support &
-                             (MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22));
 
        mcdi_to_ethtool_linkset(phy_cfg->media, phy_cfg->supported_cap,
                                cmd->link_modes.supported);
index 8b0689f749b53d2b8b8f7658c24a35b4ca2a9495..6912661b5a3ddb6b63ca30afc1b545dd49b8bff9 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/ethtool.h>
 #include <linux/if_vlan.h>
 #include <linux/timer.h>
-#include <linux/mdio.h>
+#include <linux/mii.h>
 #include <linux/list.h>
 #include <linux/pci.h>
 #include <linux/device.h>
@@ -956,8 +956,6 @@ struct efx_mae;
  * @stats_buffer: DMA buffer for statistics
  * @phy_type: PHY type
  * @phy_data: PHY private data (including PHY-specific stats)
- * @mdio: PHY MDIO interface
- * @mdio_bus: PHY MDIO bus ID (only used by Siena)
  * @phy_mode: PHY operating mode. Serialised by @mac_lock.
  * @link_advertising: Autonegotiation advertising flags
  * @fec_config: Forward Error Correction configuration flags.  For bit positions
@@ -1132,8 +1130,6 @@ struct efx_nic {
 
        unsigned int phy_type;
        void *phy_data;
-       struct mdio_if_info mdio;
-       unsigned int mdio_bus;
        enum efx_phy_mode phy_mode;
 
        __ETHTOOL_DECLARE_LINK_MODE_MASK(link_advertising);