mlxsw: core_env: Pass slot index during PMAOS register write call
authorVadim Pasternak <vadimp@nvidia.com>
Mon, 11 Apr 2022 14:46:56 +0000 (17:46 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Apr 2022 16:51:39 +0000 (09:51 -0700)
Pass the slot index down to PMAOS pack helper alongside with the module.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_env.c
drivers/net/ethernet/mellanox/mlxsw/reg.h

index 8b4205c..f1bb243 100644 (file)
@@ -448,7 +448,7 @@ static int mlxsw_env_module_reset(struct mlxsw_core *mlxsw_core, u8 module)
 {
        char pmaos_pl[MLXSW_REG_PMAOS_LEN];
 
-       mlxsw_reg_pmaos_pack(pmaos_pl, module);
+       mlxsw_reg_pmaos_pack(pmaos_pl, 0, module);
        mlxsw_reg_pmaos_rst_set(pmaos_pl, true);
 
        return mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl);
@@ -548,7 +548,7 @@ static int mlxsw_env_module_enable_set(struct mlxsw_core *mlxsw_core,
        enum mlxsw_reg_pmaos_admin_status admin_status;
        char pmaos_pl[MLXSW_REG_PMAOS_LEN];
 
-       mlxsw_reg_pmaos_pack(pmaos_pl, module);
+       mlxsw_reg_pmaos_pack(pmaos_pl, 0, module);
        admin_status = enable ? MLXSW_REG_PMAOS_ADMIN_STATUS_ENABLED :
                                MLXSW_REG_PMAOS_ADMIN_STATUS_DISABLED;
        mlxsw_reg_pmaos_admin_status_set(pmaos_pl, admin_status);
@@ -931,7 +931,7 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core)
        for (i = 0; i < mlxsw_core_env(mlxsw_core)->module_count; i++) {
                char pmaos_pl[MLXSW_REG_PMAOS_LEN];
 
-               mlxsw_reg_pmaos_pack(pmaos_pl, i);
+               mlxsw_reg_pmaos_pack(pmaos_pl, 0, i);
                mlxsw_reg_pmaos_e_set(pmaos_pl,
                                      MLXSW_REG_PMAOS_E_GENERATE_EVENT);
                mlxsw_reg_pmaos_ee_set(pmaos_pl, true);
index f0c90e6..03ef975 100644 (file)
@@ -5769,9 +5769,10 @@ enum mlxsw_reg_pmaos_e {
  */
 MLXSW_ITEM32(reg, pmaos, e, 0x04, 0, 2);
 
-static inline void mlxsw_reg_pmaos_pack(char *payload, u8 module)
+static inline void mlxsw_reg_pmaos_pack(char *payload, u8 slot_index, u8 module)
 {
        MLXSW_REG_ZERO(pmaos, payload);
+       mlxsw_reg_pmaos_slot_index_set(payload, slot_index);
        mlxsw_reg_pmaos_module_set(payload, module);
 }