Commit 8f4ebdb0 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: Make PMAOS pack function more generic

The PMAOS register has enable bits (e.g., PMAOS.ee) that allow changing
only a subset of the fields, which is exactly what subsequent patches
will need to do. Instead of passing multiple arguments to its pack
function, only pass the module index and let the rest be set by the
different callers.

No functional changes intended.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef23841b
...@@ -684,8 +684,10 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core, ...@@ -684,8 +684,10 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core,
for (i = 0; i < module_count; i++) { for (i = 0; i < module_count; i++) {
char pmaos_pl[MLXSW_REG_PMAOS_LEN]; char pmaos_pl[MLXSW_REG_PMAOS_LEN];
mlxsw_reg_pmaos_pack(pmaos_pl, i, mlxsw_reg_pmaos_pack(pmaos_pl, i);
MLXSW_REG_PMAOS_E_GENERATE_EVENT); mlxsw_reg_pmaos_e_set(pmaos_pl,
MLXSW_REG_PMAOS_E_GENERATE_EVENT);
mlxsw_reg_pmaos_ee_set(pmaos_pl, true);
err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl); err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(pmaos), pmaos_pl);
if (err) if (err)
return err; return err;
......
...@@ -5747,13 +5747,10 @@ enum mlxsw_reg_pmaos_e { ...@@ -5747,13 +5747,10 @@ enum mlxsw_reg_pmaos_e {
*/ */
MLXSW_ITEM32(reg, pmaos, e, 0x04, 0, 2); 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 module)
enum mlxsw_reg_pmaos_e e)
{ {
MLXSW_REG_ZERO(pmaos, payload); MLXSW_REG_ZERO(pmaos, payload);
mlxsw_reg_pmaos_module_set(payload, module); mlxsw_reg_pmaos_module_set(payload, module);
mlxsw_reg_pmaos_e_set(payload, e);
mlxsw_reg_pmaos_ee_set(payload, true);
} }
/* PPLR - Port Physical Loopback Register /* PPLR - Port Physical Loopback Register
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment