提交 893da759 编写于 作者: J Jack Morgenstein 提交者: Roland Dreier

mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()

The firmware QUERY_ADAPTER command does not return vendor_id,
device_id, and revision_id; eliminate these fields from the query.

Initialize the rev_id field of the mlx4 device via init_node_data (MAD
IFC query), as is done in the query_device verb implementation.
Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 6ccef1de
...@@ -468,6 +468,7 @@ static int init_node_data(struct mlx4_ib_dev *dev) ...@@ -468,6 +468,7 @@ static int init_node_data(struct mlx4_ib_dev *dev)
if (err) if (err)
goto out; goto out;
dev->dev->rev_id = be32_to_cpup((__be32 *) (out_mad->data + 32));
memcpy(&dev->ib_dev.node_guid, out_mad->data + 12, 8); memcpy(&dev->ib_dev.node_guid, out_mad->data + 12, 8);
out: out:
......
...@@ -617,9 +617,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter) ...@@ -617,9 +617,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter)
int err; int err;
#define QUERY_ADAPTER_OUT_SIZE 0x100 #define QUERY_ADAPTER_OUT_SIZE 0x100
#define QUERY_ADAPTER_VENDOR_ID_OFFSET 0x00
#define QUERY_ADAPTER_DEVICE_ID_OFFSET 0x04
#define QUERY_ADAPTER_REVISION_ID_OFFSET 0x08
#define QUERY_ADAPTER_INTA_PIN_OFFSET 0x10 #define QUERY_ADAPTER_INTA_PIN_OFFSET 0x10
#define QUERY_ADAPTER_VSD_OFFSET 0x20 #define QUERY_ADAPTER_VSD_OFFSET 0x20
...@@ -633,9 +630,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter) ...@@ -633,9 +630,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter)
if (err) if (err)
goto out; goto out;
MLX4_GET(adapter->vendor_id, outbox, QUERY_ADAPTER_VENDOR_ID_OFFSET);
MLX4_GET(adapter->device_id, outbox, QUERY_ADAPTER_DEVICE_ID_OFFSET);
MLX4_GET(adapter->revision_id, outbox, QUERY_ADAPTER_REVISION_ID_OFFSET);
MLX4_GET(adapter->inta_pin, outbox, QUERY_ADAPTER_INTA_PIN_OFFSET); MLX4_GET(adapter->inta_pin, outbox, QUERY_ADAPTER_INTA_PIN_OFFSET);
get_board_id(outbox + QUERY_ADAPTER_VSD_OFFSET / 4, get_board_id(outbox + QUERY_ADAPTER_VSD_OFFSET / 4,
......
...@@ -99,9 +99,6 @@ struct mlx4_dev_cap { ...@@ -99,9 +99,6 @@ struct mlx4_dev_cap {
}; };
struct mlx4_adapter { struct mlx4_adapter {
u32 vendor_id;
u32 device_id;
u32 revision_id;
char board_id[MLX4_BOARD_ID_LEN]; char board_id[MLX4_BOARD_ID_LEN];
u8 inta_pin; u8 inta_pin;
}; };
......
...@@ -534,7 +534,6 @@ static int mlx4_init_hca(struct mlx4_dev *dev) ...@@ -534,7 +534,6 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
} }
priv->eq_table.inta_pin = adapter.inta_pin; priv->eq_table.inta_pin = adapter.inta_pin;
dev->rev_id = adapter.revision_id;
memcpy(dev->board_id, adapter.board_id, sizeof dev->board_id); memcpy(dev->board_id, adapter.board_id, sizeof dev->board_id);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册