diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2011-03-22 18:38:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-23 15:24:20 -0400 |
commit | 725c89997e03d71b09ea3c17c997da0712b9d835 (patch) | |
tree | d141987aec9ae90d43e3f44e3facee921ec6f526 /drivers/net | |
parent | 14c07b1358ede1664652bb9b28d9ace5fe6f7f92 (diff) |
mlx4_en: Reporting HW revision in ethtool -i
HW revision is derived from device ID and rev id.
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mlx4/en_ethtool.c | 15 | ||||
-rw-r--r-- | drivers/net/mlx4/main.c | 2 | ||||
-rw-r--r-- | drivers/net/mlx4/mlx4_en.h | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c index c1f351f6ae57..62ace6c72b42 100644 --- a/drivers/net/mlx4/en_ethtool.c +++ b/drivers/net/mlx4/en_ethtool.c | |||
@@ -45,7 +45,20 @@ mlx4_en_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo) | |||
45 | struct mlx4_en_priv *priv = netdev_priv(dev); | 45 | struct mlx4_en_priv *priv = netdev_priv(dev); |
46 | struct mlx4_en_dev *mdev = priv->mdev; | 46 | struct mlx4_en_dev *mdev = priv->mdev; |
47 | 47 | ||
48 | sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id); | 48 | switch (mdev->dev->rev_id) { |
49 | case 0xa0: | ||
50 | if (dev->dev_id >= MLX4_EN_CX3_LOW_ID && dev->dev_id <= MLX4_EN_CX3_HIGH_ID) | ||
51 | sprintf(drvinfo->driver, DRV_NAME " (%s_CX-3)", mdev->dev->board_id); | ||
52 | else | ||
53 | sprintf(drvinfo->driver, DRV_NAME " (%s_CX)", mdev->dev->board_id); | ||
54 | break; | ||
55 | case 0xb0: | ||
56 | sprintf(drvinfo->driver, DRV_NAME " (%s_CX-2)", mdev->dev->board_id); | ||
57 | break; | ||
58 | default: | ||
59 | sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id); | ||
60 | break; | ||
61 | } | ||
49 | strncpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")", 32); | 62 | strncpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")", 32); |
50 | sprintf(drvinfo->fw_version, "%d.%d.%d", | 63 | sprintf(drvinfo->fw_version, "%d.%d.%d", |
51 | (u16) (mdev->dev->caps.fw_ver >> 32), | 64 | (u16) (mdev->dev->caps.fw_ver >> 32), |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 42d4fb477870..5bebb8800ab2 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -1139,6 +1139,8 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1139 | INIT_LIST_HEAD(&priv->pgdir_list); | 1139 | INIT_LIST_HEAD(&priv->pgdir_list); |
1140 | mutex_init(&priv->pgdir_mutex); | 1140 | mutex_init(&priv->pgdir_mutex); |
1141 | 1141 | ||
1142 | pci_read_config_byte(pdev, PCI_REVISION_ID, &dev->rev_id); | ||
1143 | |||
1142 | /* | 1144 | /* |
1143 | * Now reset the HCA before we touch the PCI capabilities or | 1145 | * Now reset the HCA before we touch the PCI capabilities or |
1144 | * attempt a firmware command, since a boot ROM may have left | 1146 | * attempt a firmware command, since a boot ROM may have left |
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 07aea8d0beeb..ad4df66750bc 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h | |||
@@ -216,6 +216,9 @@ struct mlx4_en_tx_desc { | |||
216 | 216 | ||
217 | #define MLX4_EN_USE_SRQ 0x01000000 | 217 | #define MLX4_EN_USE_SRQ 0x01000000 |
218 | 218 | ||
219 | #define MLX4_EN_CX3_LOW_ID 0x1000 | ||
220 | #define MLX4_EN_CX3_HIGH_ID 0x1005 | ||
221 | |||
219 | struct mlx4_en_rx_alloc { | 222 | struct mlx4_en_rx_alloc { |
220 | struct page *page; | 223 | struct page *page; |
221 | u16 offset; | 224 | u16 offset; |