diff options
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/reg.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index edad7cb62475..2618e9cf3aab 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h | |||
@@ -4518,6 +4518,54 @@ static inline void mlxsw_reg_mfsm_pack(char *payload, u8 tacho) | |||
4518 | mlxsw_reg_mfsm_tacho_set(payload, tacho); | 4518 | mlxsw_reg_mfsm_tacho_set(payload, tacho); |
4519 | } | 4519 | } |
4520 | 4520 | ||
4521 | /* MFSL - Management Fan Speed Limit Register | ||
4522 | * ------------------------------------------ | ||
4523 | * The Fan Speed Limit register is used to configure the fan speed | ||
4524 | * event / interrupt notification mechanism. Fan speed threshold are | ||
4525 | * defined for both under-speed and over-speed. | ||
4526 | */ | ||
4527 | #define MLXSW_REG_MFSL_ID 0x9004 | ||
4528 | #define MLXSW_REG_MFSL_LEN 0x0C | ||
4529 | |||
4530 | MLXSW_REG_DEFINE(mfsl, MLXSW_REG_MFSL_ID, MLXSW_REG_MFSL_LEN); | ||
4531 | |||
4532 | /* reg_mfsl_tacho | ||
4533 | * Fan tachometer index. | ||
4534 | * Access: Index | ||
4535 | */ | ||
4536 | MLXSW_ITEM32(reg, mfsl, tacho, 0x00, 24, 4); | ||
4537 | |||
4538 | /* reg_mfsl_tach_min | ||
4539 | * Tachometer minimum value (minimum RPM). | ||
4540 | * Access: RW | ||
4541 | */ | ||
4542 | MLXSW_ITEM32(reg, mfsl, tach_min, 0x04, 0, 16); | ||
4543 | |||
4544 | /* reg_mfsl_tach_max | ||
4545 | * Tachometer maximum value (maximum RPM). | ||
4546 | * Access: RW | ||
4547 | */ | ||
4548 | MLXSW_ITEM32(reg, mfsl, tach_max, 0x08, 0, 16); | ||
4549 | |||
4550 | static inline void mlxsw_reg_mfsl_pack(char *payload, u8 tacho, | ||
4551 | u16 tach_min, u16 tach_max) | ||
4552 | { | ||
4553 | MLXSW_REG_ZERO(mfsl, payload); | ||
4554 | mlxsw_reg_mfsl_tacho_set(payload, tacho); | ||
4555 | mlxsw_reg_mfsl_tach_min_set(payload, tach_min); | ||
4556 | mlxsw_reg_mfsl_tach_max_set(payload, tach_max); | ||
4557 | } | ||
4558 | |||
4559 | static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho, | ||
4560 | u16 *p_tach_min, u16 *p_tach_max) | ||
4561 | { | ||
4562 | if (p_tach_min) | ||
4563 | *p_tach_min = mlxsw_reg_mfsl_tach_min_get(payload); | ||
4564 | |||
4565 | if (p_tach_max) | ||
4566 | *p_tach_max = mlxsw_reg_mfsl_tach_max_get(payload); | ||
4567 | } | ||
4568 | |||
4521 | /* MTCAP - Management Temperature Capabilities | 4569 | /* MTCAP - Management Temperature Capabilities |
4522 | * ------------------------------------------- | 4570 | * ------------------------------------------- |
4523 | * This register exposes the capabilities of the device and | 4571 | * This register exposes the capabilities of the device and |
@@ -5228,6 +5276,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { | |||
5228 | MLXSW_REG(mfcr), | 5276 | MLXSW_REG(mfcr), |
5229 | MLXSW_REG(mfsc), | 5277 | MLXSW_REG(mfsc), |
5230 | MLXSW_REG(mfsm), | 5278 | MLXSW_REG(mfsm), |
5279 | MLXSW_REG(mfsl), | ||
5231 | MLXSW_REG(mtcap), | 5280 | MLXSW_REG(mtcap), |
5232 | MLXSW_REG(mtmp), | 5281 | MLXSW_REG(mtmp), |
5233 | MLXSW_REG(mpat), | 5282 | MLXSW_REG(mpat), |