tg3: Cleanup firmware parsing code

The current firmware header parsing is complicated due to interpreting it as a
u32 array and accessing header members via array offsets. Add tg3_firmware_hdr
structure to access the firmware fields instead of hardcoding offsets. The same
header format will be used for individual firmware fragments in the 57766.

The fw_hdr and tg3 structures have all the information required for
loading the fw. Remove the redundant fw_info structure and pass fw_hdr
instead.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Nithin Sujir
2013-03-06 17:02:32 +00:00
committed by David S. Miller
parent f4bffb28d6
commit 77997ea3f4
2 changed files with 34 additions and 36 deletions

View File

@@ -3065,6 +3065,13 @@ enum TG3_FLAGS {
TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */
};
struct tg3_firmware_hdr {
__be32 version; /* unused for fragments */
__be32 base_addr;
__be32 len;
};
#define TG3_FW_HDR_LEN (sizeof(struct tg3_firmware_hdr))
struct tg3 {
/* begin "general, frequently-used members" cacheline section */