aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_hw.h
diff options
context:
space:
mode:
authorAjit Khaparde <ajitk@serverengines.com>2009-09-03 23:12:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-07 04:56:38 -0400
commit84517482e19bc775de7b3b4e998dee2f506bc34e (patch)
treeae3491a5cf8891feef8c2896ef50758d763646f2 /drivers/net/benet/be_hw.h
parent384824281caa9ac4b76664033416f1eac4a652fe (diff)
be2net: Changes to support flashing of the be2 network adapter
Changes to support flashing of the be2 network adapter using the request_firmware() & ethtool infrastructure. The trigger to flash the device will come from ethtool utility. The driver will invoke request_firmware() to start the flash process. The file containing the flash image is expected to be available in /lib/firmware/ Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_hw.h')
-rw-r--r--drivers/net/benet/be_hw.h85
1 files changed, 84 insertions, 1 deletions
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h
index d28f0c679bc8..a3394b4aa14a 100644
--- a/drivers/net/benet/be_hw.h
+++ b/drivers/net/benet/be_hw.h
@@ -204,7 +204,7 @@ struct amap_eth_rx_compl {
204 u8 numfrags[3]; /* dword 1 */ 204 u8 numfrags[3]; /* dword 1 */
205 u8 rss_flush; /* dword 2 */ 205 u8 rss_flush; /* dword 2 */
206 u8 cast_enc[2]; /* dword 2 */ 206 u8 cast_enc[2]; /* dword 2 */
207 u8 qnq; /* dword 2 */ 207 u8 vtm; /* dword 2 */
208 u8 rss_bank; /* dword 2 */ 208 u8 rss_bank; /* dword 2 */
209 u8 rsvd1[23]; /* dword 2 */ 209 u8 rsvd1[23]; /* dword 2 */
210 u8 lro_pkt; /* dword 2 */ 210 u8 lro_pkt; /* dword 2 */
@@ -216,3 +216,86 @@ struct amap_eth_rx_compl {
216struct be_eth_rx_compl { 216struct be_eth_rx_compl {
217 u32 dw[4]; 217 u32 dw[4];
218}; 218};
219
220/* Flashrom related descriptors */
221#define IMAGE_TYPE_FIRMWARE 160
222#define IMAGE_TYPE_BOOTCODE 224
223#define IMAGE_TYPE_OPTIONROM 32
224
225#define NUM_FLASHDIR_ENTRIES 32
226
227#define FLASHROM_TYPE_ISCSI_ACTIVE 0
228#define FLASHROM_TYPE_BIOS 2
229#define FLASHROM_TYPE_PXE_BIOS 3
230#define FLASHROM_TYPE_FCOE_BIOS 8
231#define FLASHROM_TYPE_ISCSI_BACKUP 9
232#define FLASHROM_TYPE_FCOE_FW_ACTIVE 10
233#define FLASHROM_TYPE_FCOE_FW_BACKUP 11
234
235#define FLASHROM_OPER_FLASH 1
236#define FLASHROM_OPER_SAVE 2
237
238#define FLASH_IMAGE_MAX_SIZE (1310720) /* Max firmware image size */
239#define FLASH_BIOS_IMAGE_MAX_SIZE (262144) /* Max OPTION ROM image sz */
240
241/* Offsets for components on Flash. */
242#define FLASH_iSCSI_PRIMARY_IMAGE_START (1048576)
243#define FLASH_iSCSI_BACKUP_IMAGE_START (2359296)
244#define FLASH_FCoE_PRIMARY_IMAGE_START (3670016)
245#define FLASH_FCoE_BACKUP_IMAGE_START (4980736)
246#define FLASH_iSCSI_BIOS_START (7340032)
247#define FLASH_PXE_BIOS_START (7864320)
248#define FLASH_FCoE_BIOS_START (524288)
249
250struct controller_id {
251 u32 vendor;
252 u32 device;
253 u32 subvendor;
254 u32 subdevice;
255};
256
257struct flash_file_hdr {
258 u8 sign[32];
259 u32 cksum;
260 u32 antidote;
261 struct controller_id cont_id;
262 u32 file_len;
263 u32 chunk_num;
264 u32 total_chunks;
265 u32 num_imgs;
266 u8 build[24];
267};
268
269struct flash_section_hdr {
270 u32 format_rev;
271 u32 cksum;
272 u32 antidote;
273 u32 build_no;
274 u8 id_string[64];
275 u32 active_entry_mask;
276 u32 valid_entry_mask;
277 u32 org_content_mask;
278 u32 rsvd0;
279 u32 rsvd1;
280 u32 rsvd2;
281 u32 rsvd3;
282 u32 rsvd4;
283};
284
285struct flash_section_entry {
286 u32 type;
287 u32 offset;
288 u32 pad_size;
289 u32 image_size;
290 u32 cksum;
291 u32 entry_point;
292 u32 rsvd0;
293 u32 rsvd1;
294 u8 ver_data[32];
295};
296
297struct flash_section_info {
298 u8 cookie[32];
299 struct flash_section_hdr fsec_hdr;
300 struct flash_section_entry fsec_entry[32];
301};