diff options
author | Jon Mason <jon.mason@exar.com> | 2010-11-10 23:25:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-11 12:30:21 -0500 |
commit | e8ac175615b9458a00193c55617b5b8865e67817 (patch) | |
tree | 31c688b4b9d2a3578ef712d05534bca4395e6281 /drivers/net/vxge/vxge-config.h | |
parent | 8424e00dfd5282026a93996a165fc4079d382169 (diff) |
vxge: add support for ethtool firmware flashing
Add the ability in the vxge driver to flash firmware via ethtool.
Updated to include comments from Ben Hutchings.
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-config.h')
-rw-r--r-- | drivers/net/vxge/vxge-config.h | 71 |
1 files changed, 68 insertions, 3 deletions
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h index 6a81014df597..95230bda0653 100644 --- a/drivers/net/vxge/vxge-config.h +++ b/drivers/net/vxge/vxge-config.h | |||
@@ -29,6 +29,15 @@ | |||
29 | #define VXGE_HW_MAX_MTU 9600 | 29 | #define VXGE_HW_MAX_MTU 9600 |
30 | #define VXGE_HW_DEFAULT_MTU 1500 | 30 | #define VXGE_HW_DEFAULT_MTU 1500 |
31 | 31 | ||
32 | #define VXGE_HW_MAX_ROM_IMAGES 8 | ||
33 | |||
34 | struct eprom_image { | ||
35 | u8 is_valid:1; | ||
36 | u8 index; | ||
37 | u8 type; | ||
38 | u16 version; | ||
39 | }; | ||
40 | |||
32 | #ifdef VXGE_DEBUG_ASSERT | 41 | #ifdef VXGE_DEBUG_ASSERT |
33 | /** | 42 | /** |
34 | * vxge_assert | 43 | * vxge_assert |
@@ -148,6 +157,47 @@ enum vxge_hw_device_link_state { | |||
148 | }; | 157 | }; |
149 | 158 | ||
150 | /** | 159 | /** |
160 | * enum enum vxge_hw_fw_upgrade_code - FW upgrade return codes. | ||
161 | * @VXGE_HW_FW_UPGRADE_OK: All OK send next 16 bytes | ||
162 | * @VXGE_HW_FW_UPGRADE_DONE: upload completed | ||
163 | * @VXGE_HW_FW_UPGRADE_ERR: upload error | ||
164 | * @VXGE_FW_UPGRADE_BYTES2SKIP: skip bytes in the stream | ||
165 | * | ||
166 | */ | ||
167 | enum vxge_hw_fw_upgrade_code { | ||
168 | VXGE_HW_FW_UPGRADE_OK = 0, | ||
169 | VXGE_HW_FW_UPGRADE_DONE = 1, | ||
170 | VXGE_HW_FW_UPGRADE_ERR = 2, | ||
171 | VXGE_FW_UPGRADE_BYTES2SKIP = 3 | ||
172 | }; | ||
173 | |||
174 | /** | ||
175 | * enum enum vxge_hw_fw_upgrade_err_code - FW upgrade error codes. | ||
176 | * @VXGE_HW_FW_UPGRADE_ERR_CORRUPT_DATA_1: corrupt data | ||
177 | * @VXGE_HW_FW_UPGRADE_ERR_BUFFER_OVERFLOW: buffer overflow | ||
178 | * @VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_3: invalid .ncf file | ||
179 | * @VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_4: invalid .ncf file | ||
180 | * @VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_5: invalid .ncf file | ||
181 | * @VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_6: invalid .ncf file | ||
182 | * @VXGE_HW_FW_UPGRADE_ERR_CORRUPT_DATA_7: corrupt data | ||
183 | * @VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_8: invalid .ncf file | ||
184 | * @VXGE_HW_FW_UPGRADE_ERR_GENERIC_ERROR_UNKNOWN: generic error unknown type | ||
185 | * @VXGE_HW_FW_UPGRADE_ERR_FAILED_TO_FLASH: failed to flash image check failed | ||
186 | */ | ||
187 | enum vxge_hw_fw_upgrade_err_code { | ||
188 | VXGE_HW_FW_UPGRADE_ERR_CORRUPT_DATA_1 = 1, | ||
189 | VXGE_HW_FW_UPGRADE_ERR_BUFFER_OVERFLOW = 2, | ||
190 | VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_3 = 3, | ||
191 | VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_4 = 4, | ||
192 | VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_5 = 5, | ||
193 | VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_6 = 6, | ||
194 | VXGE_HW_FW_UPGRADE_ERR_CORRUPT_DATA_7 = 7, | ||
195 | VXGE_HW_FW_UPGRADE_ERR_INV_NCF_FILE_8 = 8, | ||
196 | VXGE_HW_FW_UPGRADE_ERR_GENERIC_ERROR_UNKNOWN = 9, | ||
197 | VXGE_HW_FW_UPGRADE_ERR_FAILED_TO_FLASH = 10 | ||
198 | }; | ||
199 | |||
200 | /** | ||
151 | * struct vxge_hw_device_date - Date Format | 201 | * struct vxge_hw_device_date - Date Format |
152 | * @day: Day | 202 | * @day: Day |
153 | * @month: Month | 203 | * @month: Month |
@@ -454,7 +504,6 @@ struct vxge_hw_device_config { | |||
454 | * See also: vxge_hw_driver_initialize(). | 504 | * See also: vxge_hw_driver_initialize(). |
455 | */ | 505 | */ |
456 | struct vxge_hw_uld_cbs { | 506 | struct vxge_hw_uld_cbs { |
457 | |||
458 | void (*link_up)(struct __vxge_hw_device *devh); | 507 | void (*link_up)(struct __vxge_hw_device *devh); |
459 | void (*link_down)(struct __vxge_hw_device *devh); | 508 | void (*link_down)(struct __vxge_hw_device *devh); |
460 | void (*crit_err)(struct __vxge_hw_device *devh, | 509 | void (*crit_err)(struct __vxge_hw_device *devh, |
@@ -721,6 +770,7 @@ struct __vxge_hw_device { | |||
721 | u32 debug_level; | 770 | u32 debug_level; |
722 | u32 level_err; | 771 | u32 level_err; |
723 | u32 level_trace; | 772 | u32 level_trace; |
773 | u16 eprom_versions[VXGE_HW_MAX_ROM_IMAGES]; | ||
724 | }; | 774 | }; |
725 | 775 | ||
726 | #define VXGE_HW_INFO_LEN 64 | 776 | #define VXGE_HW_INFO_LEN 64 |
@@ -2032,7 +2082,22 @@ __vxge_hw_device_is_privilaged(u32 host_type, u32 func_id); | |||
2032 | #define VXGE_HW_MIN_SUCCESSIVE_IDLE_COUNT 5 | 2082 | #define VXGE_HW_MIN_SUCCESSIVE_IDLE_COUNT 5 |
2033 | #define VXGE_HW_MAX_POLLING_COUNT 100 | 2083 | #define VXGE_HW_MAX_POLLING_COUNT 100 |
2034 | 2084 | ||
2035 | int vxge_hw_vpath_wait_receive_idle(struct __vxge_hw_device *hldev, u32 vp_id); | 2085 | void |
2086 | vxge_hw_device_wait_receive_idle(struct __vxge_hw_device *hldev); | ||
2087 | |||
2088 | enum vxge_hw_status | ||
2089 | vxge_hw_upgrade_read_version(struct __vxge_hw_device *hldev, u32 *major, | ||
2090 | u32 *minor, u32 *build); | ||
2091 | |||
2092 | enum vxge_hw_status vxge_hw_flash_fw(struct __vxge_hw_device *hldev); | ||
2036 | 2093 | ||
2037 | void vxge_hw_device_wait_receive_idle(struct __vxge_hw_device *hldev); | 2094 | enum vxge_hw_status |
2095 | vxge_update_fw_image(struct __vxge_hw_device *hldev, const u8 *filebuf, | ||
2096 | int size); | ||
2097 | |||
2098 | enum vxge_hw_status | ||
2099 | vxge_hw_vpath_eprom_img_ver_get(struct __vxge_hw_device *hldev, | ||
2100 | struct eprom_image *eprom_image_data); | ||
2101 | |||
2102 | int vxge_hw_vpath_wait_receive_idle(struct __vxge_hw_device *hldev, u32 vp_id); | ||
2038 | #endif | 2103 | #endif |