Commit ec4a514a authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

mlxsw: reg: Update module_type values in PMTM register and map them to width



There are couple new values that PMTM register can return
in module_type field. Add them and map them to module width in
mlxsw_core_module_max_width(). Fix the existing names on the way.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37e1244a
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -2201,13 +2201,22 @@ int mlxsw_core_module_max_width(struct mlxsw_core *mlxsw_core, u8 module)
	/* Here we need to get the module width according to the module type. */
	/* Here we need to get the module width according to the module type. */


	switch (module_type) {
	switch (module_type) {
	case MLXSW_REG_PMTM_MODULE_TYPE_C2C8X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_QSFP_DD: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_OSFP:
		return 8;
	case MLXSW_REG_PMTM_MODULE_TYPE_C2C4X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_4X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_4X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_QSFP:
	case MLXSW_REG_PMTM_MODULE_TYPE_QSFP:
		return 4;
		return 4;
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_2X:
	case MLXSW_REG_PMTM_MODULE_TYPE_C2C2X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_2X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_SFP_DD: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_DSFP:
		return 2;
		return 2;
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_SFP: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_C2C1X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_1X:
	case MLXSW_REG_PMTM_MODULE_TYPE_BP_1X: /* fall through */
	case MLXSW_REG_PMTM_MODULE_TYPE_SFP:
		return 1;
		return 1;
	default:
	default:
		return -EINVAL;
		return -EINVAL;
+18 −4
Original line number Original line Diff line number Diff line
@@ -5440,15 +5440,29 @@ enum mlxsw_reg_pmtm_module_type {
	/* Backplane with 4 lanes */
	/* Backplane with 4 lanes */
	MLXSW_REG_PMTM_MODULE_TYPE_BP_4X,
	MLXSW_REG_PMTM_MODULE_TYPE_BP_4X,
	/* QSFP */
	/* QSFP */
	MLXSW_REG_PMTM_MODULE_TYPE_BP_QSFP,
	MLXSW_REG_PMTM_MODULE_TYPE_QSFP,
	/* SFP */
	/* SFP */
	MLXSW_REG_PMTM_MODULE_TYPE_BP_SFP,
	MLXSW_REG_PMTM_MODULE_TYPE_SFP,
	/* Backplane with single lane */
	/* Backplane with single lane */
	MLXSW_REG_PMTM_MODULE_TYPE_BP_1X = 4,
	MLXSW_REG_PMTM_MODULE_TYPE_BP_1X = 4,
	/* Backplane with two lane */
	/* Backplane with two lane */
	MLXSW_REG_PMTM_MODULE_TYPE_BP_2X = 8,
	MLXSW_REG_PMTM_MODULE_TYPE_BP_2X = 8,
	/* Chip2Chip */
	/* Chip2Chip4x */
	MLXSW_REG_PMTM_MODULE_TYPE_C2C = 10,
	MLXSW_REG_PMTM_MODULE_TYPE_C2C4X = 10,
	/* Chip2Chip2x */
	MLXSW_REG_PMTM_MODULE_TYPE_C2C2X,
	/* Chip2Chip1x */
	MLXSW_REG_PMTM_MODULE_TYPE_C2C1X,
	/* QSFP-DD */
	MLXSW_REG_PMTM_MODULE_TYPE_QSFP_DD = 14,
	/* OSFP */
	MLXSW_REG_PMTM_MODULE_TYPE_OSFP,
	/* SFP-DD */
	MLXSW_REG_PMTM_MODULE_TYPE_SFP_DD,
	/* DSFP */
	MLXSW_REG_PMTM_MODULE_TYPE_DSFP,
	/* Chip2Chip8x */
	MLXSW_REG_PMTM_MODULE_TYPE_C2C8X,
};
};


/* reg_pmtm_module_type
/* reg_pmtm_module_type