Commit 64e65a54 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Jakub Kicinski
Browse files

mlxsw: core_env: Pass slot index during PMAOS register write call



Pass the slot index down to PMAOS pack helper alongside with the module.

Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b691602c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
+2 −1
Original line number Diff line number Diff line
@@ -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);
}