Skip to content

Commit e0f06bb

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbe: Return error when getting PHY address if PHY access is not supported
In cases where PHY register access is not supported, don't mislead a caller into thinking that it is supported by returning a PHY address. Instead, return -EOPNOTSUPP when PHY access is not supported. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent a9e2971 commit e0f06bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8529,6 +8529,10 @@ static int ixgbe_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
85298529
return ixgbe_ptp_set_ts_config(adapter, req);
85308530
case SIOCGHWTSTAMP:
85318531
return ixgbe_ptp_get_ts_config(adapter, req);
8532+
case SIOCGMIIPHY:
8533+
if (!adapter->hw.phy.ops.read_reg)
8534+
return -EOPNOTSUPP;
8535+
/* fall through */
85328536
default:
85338537
return mdio_mii_ioctl(&adapter->hw.phy.mdio, if_mii(req), cmd);
85348538
}

0 commit comments

Comments
 (0)