Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Edward Cree and committed by
Jakub Kicinski
c339fcdd 652e2c77

+2 -99
-1
drivers/net/ethernet/sfc/ef100_netdev.c
··· 452 452 NETIF_F_HIGHDMA | NETIF_F_ALL_TSO; 453 453 netif_set_tso_max_segs(net_dev, 454 454 ESE_EF100_DP_GZ_TSO_MAX_HDR_NUM_SEGS_DEFAULT); 455 - efx->mdio.dev = net_dev; 456 455 457 456 rc = efx_ef100_init_datapath_caps(efx); 458 457 if (rc < 0)
-24
drivers/net/ethernet/sfc/efx.c
··· 476 476 477 477 /************************************************************************** 478 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 - 499 - /************************************************************************** 500 - * 501 479 * Kernel net device interface 502 480 * 503 481 *************************************************************************/ ··· 571 593 .ndo_tx_timeout = efx_watchdog, 572 594 .ndo_start_xmit = efx_hard_start_xmit, 573 595 .ndo_validate_addr = eth_validate_addr, 574 - .ndo_eth_ioctl = efx_ioctl, 575 596 .ndo_change_mtu = efx_change_mtu, 576 597 .ndo_set_mac_address = efx_set_mac_address, 577 598 .ndo_set_rx_mode = efx_set_rx_mode, ··· 1178 1201 rc = efx_init_struct(efx, pci_dev); 1179 1202 if (rc) 1180 1203 goto fail1; 1181 - efx->mdio.dev = net_dev; 1182 1204 1183 1205 pci_info(pci_dev, "Solarflare NIC detected\n"); 1184 1206
+1 -58
drivers/net/ethernet/sfc/mcdi_port.c
··· 17 17 #include "selftest.h" 18 18 #include "mcdi_port_common.h" 19 19 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 - } 72 20 73 21 u32 efx_mcdi_phy_get_caps(struct efx_nic *efx) 74 22 { ··· 45 97 { 46 98 int rc; 47 99 48 - /* Set up MDIO structure for PHY */ 49 - efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; 50 - efx->mdio.mdio_read = efx_mcdi_mdio_read; 51 - efx->mdio.mdio_write = efx_mcdi_mdio_write; 52 - 53 - /* Fill out MDIO structure, loopback modes, and initial link state */ 100 + /* Fill out loopback modes and initial link state */ 54 101 rc = efx_mcdi_phy_probe(efx); 55 102 if (rc != 0) 56 103 return rc;
-11
drivers/net/ethernet/sfc/mcdi_port_common.c
··· 448 448 efx->phy_data = phy_data; 449 449 efx->phy_type = phy_data->type; 450 450 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 - 460 451 caps = MCDI_DWORD(outbuf, GET_LINK_OUT_CAP); 461 452 if (caps & (1 << MC_CMD_PHY_CAP_AN_LBN)) 462 453 mcdi_to_ethtool_linkset(phy_data->media, caps, ··· 537 546 cmd->base.port = mcdi_to_ethtool_media(phy_cfg->media); 538 547 cmd->base.phy_address = phy_cfg->port; 539 548 cmd->base.autoneg = !!(efx->link_advertising[0] & ADVERTISED_Autoneg); 540 - cmd->base.mdio_support = (efx->mdio.mode_support & 541 - (MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22)); 542 549 543 550 mcdi_to_ethtool_linkset(phy_cfg->media, phy_cfg->supported_cap, 544 551 cmd->link_modes.supported);
+1 -5
drivers/net/ethernet/sfc/net_driver.h
··· 15 15 #include <linux/ethtool.h> 16 16 #include <linux/if_vlan.h> 17 17 #include <linux/timer.h> 18 - #include <linux/mdio.h> 18 + #include <linux/mii.h> 19 19 #include <linux/list.h> 20 20 #include <linux/pci.h> 21 21 #include <linux/device.h> ··· 956 956 * @stats_buffer: DMA buffer for statistics 957 957 * @phy_type: PHY type 958 958 * @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) 961 959 * @phy_mode: PHY operating mode. Serialised by @mac_lock. 962 960 * @link_advertising: Autonegotiation advertising flags 963 961 * @fec_config: Forward Error Correction configuration flags. For bit positions ··· 1130 1132 1131 1133 unsigned int phy_type; 1132 1134 void *phy_data; 1133 - struct mdio_if_info mdio; 1134 - unsigned int mdio_bus; 1135 1135 enum efx_phy_mode phy_mode; 1136 1136 1137 1137 __ETHTOOL_DECLARE_LINK_MODE_MASK(link_advertising);