diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2011-03-08 10:35:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-14 17:49:29 -0400 |
commit | ea0f0d8bc6d13c2580d668ecf95297d5105a57fc (patch) | |
tree | 28bd119f7a175684ff5ffbb252a0d64a5fc981ab /drivers/net/enic | |
parent | 1faa4356a3bd89ea11fb92752d897cff3a20ec0e (diff) |
enic: Support newer version of firmware devcmd CMD_MCPU_FW_INFO
This patch provides support to the newer version of firmware devcmd CMD_MCPU_FW_INFO
that returns additional information (ASIC type and revision) about the underlying hardware.
This knowledge is required by the driver to implement any hardware specific features.
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/enic.h | 2 | ||||
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 7 | ||||
-rw-r--r-- | drivers/net/enic/vnic_devcmd.h | 38 |
3 files changed, 44 insertions, 3 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index e816bbb9fbf9..3a3c3c8a3a9b 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define DRV_NAME "enic" | 33 | #define DRV_NAME "enic" |
34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" | 34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" |
35 | #define DRV_VERSION "2.1.1.10" | 35 | #define DRV_VERSION "2.1.1.12" |
36 | #define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc" | 36 | #define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc" |
37 | 37 | ||
38 | #define ENIC_BARS_MAX 6 | 38 | #define ENIC_BARS_MAX 6 |
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index c489e72107de..c089b362a36f 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -408,10 +408,17 @@ int vnic_dev_fw_info(struct vnic_dev *vdev, | |||
408 | if (!vdev->fw_info) | 408 | if (!vdev->fw_info) |
409 | return -ENOMEM; | 409 | return -ENOMEM; |
410 | 410 | ||
411 | memset(vdev->fw_info, 0, sizeof(struct vnic_devcmd_fw_info)); | ||
412 | |||
411 | a0 = vdev->fw_info_pa; | 413 | a0 = vdev->fw_info_pa; |
414 | a1 = sizeof(struct vnic_devcmd_fw_info); | ||
412 | 415 | ||
413 | /* only get fw_info once and cache it */ | 416 | /* only get fw_info once and cache it */ |
414 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO, &a0, &a1, wait); | 417 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO, &a0, &a1, wait); |
418 | if (err == ERR_ECMDUNKNOWN) { | ||
419 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO_OLD, | ||
420 | &a0, &a1, wait); | ||
421 | } | ||
415 | } | 422 | } |
416 | 423 | ||
417 | *fw_info = vdev->fw_info; | 424 | *fw_info = vdev->fw_info; |
diff --git a/drivers/net/enic/vnic_devcmd.h b/drivers/net/enic/vnic_devcmd.h index 9abb3d51dea1..d833a071bac5 100644 --- a/drivers/net/enic/vnic_devcmd.h +++ b/drivers/net/enic/vnic_devcmd.h | |||
@@ -80,8 +80,34 @@ | |||
80 | enum vnic_devcmd_cmd { | 80 | enum vnic_devcmd_cmd { |
81 | CMD_NONE = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_NONE, 0), | 81 | CMD_NONE = _CMDC(_CMD_DIR_NONE, _CMD_VTYPE_NONE, 0), |
82 | 82 | ||
83 | /* mcpu fw info in mem: (u64)a0=paddr to struct vnic_devcmd_fw_info */ | 83 | /* |
84 | CMD_MCPU_FW_INFO = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 1), | 84 | * mcpu fw info in mem: |
85 | * in: | ||
86 | * (u64)a0=paddr to struct vnic_devcmd_fw_info | ||
87 | * action: | ||
88 | * Fills in struct vnic_devcmd_fw_info (128 bytes) | ||
89 | * note: | ||
90 | * An old definition of CMD_MCPU_FW_INFO | ||
91 | */ | ||
92 | CMD_MCPU_FW_INFO_OLD = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ALL, 1), | ||
93 | |||
94 | /* | ||
95 | * mcpu fw info in mem: | ||
96 | * in: | ||
97 | * (u64)a0=paddr to struct vnic_devcmd_fw_info | ||
98 | * (u16)a1=size of the structure | ||
99 | * out: | ||
100 | * (u16)a1=0 for in:a1 = 0, | ||
101 | * data size actually written for other values. | ||
102 | * action: | ||
103 | * Fills in first 128 bytes of vnic_devcmd_fw_info for in:a1 = 0, | ||
104 | * first in:a1 bytes for 0 < in:a1 <= 132, | ||
105 | * 132 bytes for other values of in:a1. | ||
106 | * note: | ||
107 | * CMD_MCPU_FW_INFO and CMD_MCPU_FW_INFO_OLD have the same enum 1 | ||
108 | * for source compatibility. | ||
109 | */ | ||
110 | CMD_MCPU_FW_INFO = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ALL, 1), | ||
85 | 111 | ||
86 | /* dev-specific block member: | 112 | /* dev-specific block member: |
87 | * in: (u16)a0=offset,(u8)a1=size | 113 | * in: (u16)a0=offset,(u8)a1=size |
@@ -291,11 +317,19 @@ enum vnic_devcmd_error { | |||
291 | ERR_EMAXRES = 10, | 317 | ERR_EMAXRES = 10, |
292 | }; | 318 | }; |
293 | 319 | ||
320 | /* | ||
321 | * note: hw_version and asic_rev refer to the same thing, | ||
322 | * but have different formats. hw_version is | ||
323 | * a 32-byte string (e.g. "A2") and asic_rev is | ||
324 | * a 16-bit integer (e.g. 0xA2). | ||
325 | */ | ||
294 | struct vnic_devcmd_fw_info { | 326 | struct vnic_devcmd_fw_info { |
295 | char fw_version[32]; | 327 | char fw_version[32]; |
296 | char fw_build[32]; | 328 | char fw_build[32]; |
297 | char hw_version[32]; | 329 | char hw_version[32]; |
298 | char hw_serial_number[32]; | 330 | char hw_serial_number[32]; |
331 | u16 asic_type; | ||
332 | u16 asic_rev; | ||
299 | }; | 333 | }; |
300 | 334 | ||
301 | struct vnic_devcmd_notify { | 335 | struct vnic_devcmd_notify { |