Commit 5eaec6d8 authored by Danielle Ratson's avatar Danielle Ratson Committed by David S. Miller
Browse files

mlxsw: Add netdev argument to mlxsw_env_get_module_info()



The next patches will forbid querying the port module's EEPROM info when
its type is RJ45 as in this case no transceiver module can ever be
connected to the port.

Add netdev argument to mlxsw_env_get_module_info() so it could be used
to print an error to the kernel log via netdev_err().

Signed-off-by: default avatarDanielle Ratson <danieller@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6af5f7b6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -206,7 +206,8 @@ int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module,
	return 0;
}

int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module,
int mlxsw_env_get_module_info(struct net_device *netdev,
			      struct mlxsw_core *mlxsw_core, int module,
			      struct ethtool_modinfo *modinfo)
{
	u8 module_info[MLXSW_REG_MCIA_EEPROM_MODULE_INFO_SIZE];
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@ struct ethtool_eeprom;
int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module,
					 int off, int *temp);

int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module,
int mlxsw_env_get_module_info(struct net_device *netdev,
			      struct mlxsw_core *mlxsw_core, int module,
			      struct ethtool_modinfo *modinfo);

int mlxsw_env_get_module_eeprom(struct net_device *netdev,
+2 −1
Original line number Diff line number Diff line
@@ -110,7 +110,8 @@ static int mlxsw_m_get_module_info(struct net_device *netdev,
	struct mlxsw_m_port *mlxsw_m_port = netdev_priv(netdev);
	struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core;

	return mlxsw_env_get_module_info(core, mlxsw_m_port->module, modinfo);
	return mlxsw_env_get_module_info(netdev, core, mlxsw_m_port->module,
					 modinfo);
}

static int
+1 −1
Original line number Diff line number Diff line
@@ -1035,7 +1035,7 @@ static int mlxsw_sp_get_module_info(struct net_device *netdev,
	struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(netdev);
	struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;

	return mlxsw_env_get_module_info(mlxsw_sp->core,
	return mlxsw_env_get_module_info(netdev, mlxsw_sp->core,
					 mlxsw_sp_port->mapping.module,
					 modinfo);
}