From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
jiri@nvidia.com, vadimp@nvidia.com, mlxsw@nvidia.com,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 09/10] mlxsw: Make PMAOS pack function more generic
Date: Wed, 15 Sep 2021 13:13:13 +0300 [thread overview]
Message-ID: <20210915101314.407476-10-idosch@idosch.org> (raw)
In-Reply-To: <20210915101314.407476-1-idosch@idosch.org>
From: Ido Schimmel <idosch@nvidia.com>
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: Ido Schimmel <idosch@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core_env.c | 6 ++++--
drivers/net/ethernet/mellanox/mlxsw/reg.h | 5 +----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
index c7b7254061ee..a474629643aa 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_env.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_env.c
@@ -684,8 +684,10 @@ mlxsw_env_module_oper_state_event_enable(struct mlxsw_core *mlxsw_core,
for (i = 0; i < module_count; i++) {
char pmaos_pl[MLXSW_REG_PMAOS_LEN];
- mlxsw_reg_pmaos_pack(pmaos_pl, i,
- MLXSW_REG_PMAOS_E_GENERATE_EVENT);
+ mlxsw_reg_pmaos_pack(pmaos_pl, i);
+ 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);
if (err)
return err;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 667856f00728..6c96e124e4c8 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -5747,13 +5747,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,
- enum mlxsw_reg_pmaos_e e)
+static inline void mlxsw_reg_pmaos_pack(char *payload, u8 module)
{
MLXSW_REG_ZERO(pmaos, payload);
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
--
2.31.1
next prev parent reply other threads:[~2021-09-15 10:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 10:13 [PATCH net-next 00/10] mlxsw: Add support for transceiver modules reset Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 01/10] mlxsw: core: Initialize switch driver last Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 02/10] mlxsw: core: Remove mlxsw_core_is_initialized() Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 03/10] mlxsw: core_env: Defer handling of module temperature warning events Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 04/10] mlxsw: core_env: Convert 'module_info_lock' to a mutex Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 05/10] mlxsw: spectrum: Do not return an error in ndo_stop() Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 06/10] mlxsw: spectrum: Do not return an error in mlxsw_sp_port_module_unmap() Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 07/10] mlxsw: Track per-module port status Ido Schimmel
2021-09-15 10:13 ` [PATCH net-next 08/10] mlxsw: reg: Add fields to PMAOS register Ido Schimmel
2021-09-15 10:13 ` Ido Schimmel [this message]
2021-09-15 10:13 ` [PATCH net-next 10/10] mlxsw: Add support for transceiver modules reset Ido Schimmel
2021-09-15 15:30 ` [PATCH net-next 00/10] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210915101314.407476-10-idosch@idosch.org \
--to=idosch@idosch.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=idosch@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=vadimp@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.