Skip to content
/ linux Public

Commit 655cbb1

Browse files
vadimp-nvidiakuba-moo
authored andcommitted
mlxsw: reg: Extend MCION register with new slot number field
Extend MCION (Management Cable IO and Notifications Register) with new field specifying the slot number. The purpose of this field is to support access to MCION register for query cage transceiver on modular system. For non-modular systems the 'module' number uniquely identifies the transceiver location. For modular systems the transceivers are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'module', specifying cage transceiver within the line card. Signed-off-by: Vadim Pasternak <vadimp@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 89dd6fc commit 655cbb1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_env.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 module,
520520

521521
params->policy = mlxsw_env->module_info[module].power_mode_policy;
522522

523-
mlxsw_reg_mcion_pack(mcion_pl, module);
523+
mlxsw_reg_mcion_pack(mcion_pl, 0, module);
524524
err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcion), mcion_pl);
525525
if (err) {
526526
NL_SET_ERR_MSG_MOD(extack, "Failed to retrieve module's power mode");

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10521,6 +10521,12 @@ MLXSW_REG_DEFINE(mcion, MLXSW_REG_MCION_ID, MLXSW_REG_MCION_LEN);
1052110521
*/
1052210522
MLXSW_ITEM32(reg, mcion, module, 0x00, 16, 8);
1052310523

10524+
/* reg_mcion_slot_index
10525+
* Slot index.
10526+
* Access: Index
10527+
*/
10528+
MLXSW_ITEM32(reg, mcion, slot_index, 0x00, 12, 4);
10529+
1052410530
enum {
1052510531
MLXSW_REG_MCION_MODULE_STATUS_BITS_PRESENT_MASK = BIT(0),
1052610532
MLXSW_REG_MCION_MODULE_STATUS_BITS_LOW_POWER_MASK = BIT(8),
@@ -10532,9 +10538,10 @@ enum {
1053210538
*/
1053310539
MLXSW_ITEM32(reg, mcion, module_status_bits, 0x04, 0, 16);
1053410540

10535-
static inline void mlxsw_reg_mcion_pack(char *payload, u8 module)
10541+
static inline void mlxsw_reg_mcion_pack(char *payload, u8 slot_index, u8 module)
1053610542
{
1053710543
MLXSW_REG_ZERO(mcion, payload);
10544+
mlxsw_reg_mcion_slot_index_set(payload, slot_index);
1053810545
mlxsw_reg_mcion_module_set(payload, module);
1053910546
}
1054010547

0 commit comments

Comments
 (0)