]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Sun, 27 Jan 2008 16:13:25 +0000 (18:13 +0200)
committerRoland Dreier <rolandd@cisco.com>
Tue, 5 Feb 2008 04:20:43 +0000 (20:20 -0800)
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: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/main.c
drivers/net/mlx4/fw.c
drivers/net/mlx4/fw.h
drivers/net/mlx4/main.c

index d8287d9db41e5a8eb0bb3167db75635c266b4960..d2f50b62fcb6ff7a44786967dc5758ae956285fd 100644 (file)
@@ -468,6 +468,7 @@ static int init_node_data(struct mlx4_ib_dev *dev)
        if (err)
                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);
 
 out:
index 535a4461d88c6d720758e15d7fd21a67676a0fd9..61dc4951d6b0a61b2e1af9e535d0c14384c79e8e 100644 (file)
@@ -617,9 +617,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter)
        int err;
 
 #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_VSD_OFFSET           0x20
 
@@ -633,9 +630,6 @@ int mlx4_QUERY_ADAPTER(struct mlx4_dev *dev, struct mlx4_adapter *adapter)
        if (err)
                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);
 
        get_board_id(outbox + QUERY_ADAPTER_VSD_OFFSET / 4,
index 7e1dd9e25cfbabb9fa995d51c2c1fbf149518de6..e16dec890413dddbfcce48e7b79686f068703c8c 100644 (file)
@@ -99,9 +99,6 @@ struct mlx4_dev_cap {
 };
 
 struct mlx4_adapter {
-       u32  vendor_id;
-       u32  device_id;
-       u32  revision_id;
        char board_id[MLX4_BOARD_ID_LEN];
        u8   inta_pin;
 };
index a028d8a012ffa85accff96d290315d8aff1baf3f..859617d622b9993e2e797945e3478c76baf97533 100644 (file)
@@ -534,7 +534,6 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
        }
 
        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);
 
        return 0;