Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 2/4] mlx4: Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value
@ 2024-09-12  6:40 Krzysztof Olędzki
  2024-09-12 16:03 ` Krzysztof Olędzki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Krzysztof Olędzki @ 2024-09-12  6:40 UTC (permalink / raw)
  To: Ido Schimmel, Tariq Toukan, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Yishai Hadas
  Cc: netdev@vger.kernel.org, linux-rdma

Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value.

Also, remove MLX4_ATTR_EXTENDED_PORT_INFO which should have been done in
commit 8154c07fe14e ("mlx4_core: Get rid of redundant ext_port_cap flags").

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
---
 drivers/net/ethernet/mellanox/mlx4/port.c | 8 ++++----
 include/linux/mlx4/device.h               | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c
index 6dbd505e7f30..1ebd459d1d21 100644
--- a/drivers/net/ethernet/mellanox/mlx4/port.c
+++ b/drivers/net/ethernet/mellanox/mlx4/port.c
@@ -2052,7 +2052,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id)
 	inmad->class_version = 0x1;
 	inmad->mgmt_class = 0x1;
 	inmad->base_version = 0x1;
-	inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */
+	inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO);
 
 	cable_info = (struct mlx4_cable_info *)inmad->data;
 	cable_info->dev_mem_address = 0;
@@ -2071,7 +2071,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id)
 		ret = be16_to_cpu(outmad->status);
 		mlx4_warn(dev,
 			  "MLX4_CMD_MAD_IFC Get Module ID attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n",
-			  0xFF60, port, I2C_ADDR_LOW, 0, 1, ret,
+			  MLX4_ATTR_CABLE_INFO, port, I2C_ADDR_LOW, 0, 1, ret,
 			  cable_info_mad_err_str(ret));
 		ret = -ret;
 		goto out;
@@ -2170,7 +2170,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
 	inmad->class_version = 0x1;
 	inmad->mgmt_class = 0x1;
 	inmad->base_version = 0x1;
-	inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */
+	inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO);
 
 	if (offset < I2C_PAGE_SIZE && offset + size > I2C_PAGE_SIZE)
 		/* Cross pages reads are not allowed
@@ -2195,7 +2195,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
 		ret = be16_to_cpu(outmad->status);
 		mlx4_warn(dev,
 			  "MLX4_CMD_MAD_IFC Get Module info attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n",
-			  0xFF60, port, i2c_addr, offset, size,
+			  MLX4_ATTR_CABLE_INFO, port, i2c_addr, offset, size,
 			  ret, cable_info_mad_err_str(ret));
 
 		if (i2c_addr == I2C_ADDR_HIGH &&
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index a75bfb2a4438..4f2ff466b459 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -265,7 +265,7 @@ enum {
 };
 
 
-#define MLX4_ATTR_EXTENDED_PORT_INFO	cpu_to_be16(0xff90)
+#define MLX4_ATTR_CABLE_INFO		0xff60
 
 enum {
 	MLX4_BMME_FLAG_WIN_TYPE_2B	= 1 <<  1,
-- 
2.46.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-13  4:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12  6:40 [PATCH net-next 2/4] mlx4: Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value Krzysztof Olędzki
2024-09-12 16:03 ` Krzysztof Olędzki
2024-09-13  4:26 ` kernel test robot
2024-09-13  4:48 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox