Skip to content
/ linux Public

Commit fc53f5f

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: reg: Add Management Cable IO and Notifications register
Add the Management Cable IO and Notifications register. It will be used to retrieve the power mode status of a module in subsequent patches and whether a module is present in a cage or not. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f10ba08 commit fc53f5f

File tree

1 file changed

+34
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10402,6 +10402,39 @@ static inline void mlxsw_reg_mlcr_pack(char *payload, u8 local_port,
1040210402
MLXSW_REG_MLCR_DURATION_MAX : 0);
1040310403
}
1040410404

10405+
/* MCION - Management Cable IO and Notifications Register
10406+
* ------------------------------------------------------
10407+
* The MCION register is used to query transceiver modules' IO pins and other
10408+
* notifications.
10409+
*/
10410+
#define MLXSW_REG_MCION_ID 0x9052
10411+
#define MLXSW_REG_MCION_LEN 0x18
10412+
10413+
MLXSW_REG_DEFINE(mcion, MLXSW_REG_MCION_ID, MLXSW_REG_MCION_LEN);
10414+
10415+
/* reg_mcion_module
10416+
* Module number.
10417+
* Access: Index
10418+
*/
10419+
MLXSW_ITEM32(reg, mcion, module, 0x00, 16, 8);
10420+
10421+
enum {
10422+
MLXSW_REG_MCION_MODULE_STATUS_BITS_PRESENT_MASK = BIT(0),
10423+
MLXSW_REG_MCION_MODULE_STATUS_BITS_LOW_POWER_MASK = BIT(8),
10424+
};
10425+
10426+
/* reg_mcion_module_status_bits
10427+
* Module IO status as defined by SFF.
10428+
* Access: RO
10429+
*/
10430+
MLXSW_ITEM32(reg, mcion, module_status_bits, 0x04, 0, 16);
10431+
10432+
static inline void mlxsw_reg_mcion_pack(char *payload, u8 module)
10433+
{
10434+
MLXSW_REG_ZERO(mcion, payload);
10435+
mlxsw_reg_mcion_module_set(payload, module);
10436+
}
10437+
1040510438
/* MTPPS - Management Pulse Per Second Register
1040610439
* --------------------------------------------
1040710440
* This register provides the device PPS capabilities, configure the PPS in and
@@ -12446,6 +12479,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
1244612479
MLXSW_REG(mgir),
1244712480
MLXSW_REG(mrsr),
1244812481
MLXSW_REG(mlcr),
12482+
MLXSW_REG(mcion),
1244912483
MLXSW_REG(mtpps),
1245012484
MLXSW_REG(mtutc),
1245112485
MLXSW_REG(mpsc),

0 commit comments

Comments
 (0)