diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-01-10 18:09:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-01-10 18:09:27 +0000 |
commit | f3b478bb782d65db891eac62ffa66cce82e41959 (patch) | |
tree | 856e1de30894002b844b0576f085afc32863835a | |
parent | e0768c85f433d308d90259d03e78ad29c0603087 (diff) |
change firmware byte order to be same on all architectures
THIS MEANS YOU NEED TO UPDATE YOUR FIRMWARE FILE BEFORE BOOTING WITH
A NEW KERNEL
tested by marco, biorn
-rw-r--r-- | sys/dev/microcode/bnx/build.c | 136 | ||||
-rw-r--r-- | sys/dev/pci/if_bnx.c | 165 |
2 files changed, 175 insertions, 126 deletions
diff --git a/sys/dev/microcode/bnx/build.c b/sys/dev/microcode/bnx/build.c index 0d7a40fb3f8..e404b2f12d6 100644 --- a/sys/dev/microcode/bnx/build.c +++ b/sys/dev/microcode/bnx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.3 2006/10/02 06:03:31 deraadt Exp $ */ +/* $OpenBSD: build.c,v 1.4 2007/01/10 18:09:25 deraadt Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -63,6 +63,15 @@ struct chunks { { bnx_rv2p_proc2, &bnx_rv2p_proc2len } }; +void +hswapn(u_int32_t *p, int wcount) +{ + for (; wcount; wcount -=4) { + *p = htonl(*p); + p++; + } +} + int main(int argc, char *argv[]) { @@ -77,68 +86,68 @@ main(int argc, char *argv[]) bzero(bf, sizeof *bf); /* initialize the file header */ - bf->bnx_COM_b06FwReleaseMajor = bnx_COM_b06FwReleaseMajor; - bf->bnx_COM_b06FwReleaseMinor = bnx_COM_b06FwReleaseMinor; - bf->bnx_COM_b06FwReleaseFix = bnx_COM_b06FwReleaseFix; - bf->bnx_COM_b06FwStartAddr = bnx_COM_b06FwStartAddr; - bf->bnx_COM_b06FwTextAddr = bnx_COM_b06FwTextAddr; - bf->bnx_COM_b06FwTextLen = bnx_COM_b06FwTextLen; - bf->bnx_COM_b06FwDataAddr = bnx_COM_b06FwDataAddr; - bf->bnx_COM_b06FwDataLen = bnx_COM_b06FwDataLen; - bf->bnx_COM_b06FwRodataAddr = bnx_COM_b06FwRodataAddr; - bf->bnx_COM_b06FwRodataLen = bnx_COM_b06FwRodataLen; - bf->bnx_COM_b06FwBssAddr = bnx_COM_b06FwBssAddr; - bf->bnx_COM_b06FwBssLen = bnx_COM_b06FwBssLen; - bf->bnx_COM_b06FwSbssAddr = bnx_COM_b06FwSbssAddr; - bf->bnx_COM_b06FwSbssLen = bnx_COM_b06FwSbssLen; - - bf->bnx_RXP_b06FwReleaseMajor = bnx_RXP_b06FwReleaseMajor; - bf->bnx_RXP_b06FwReleaseMinor = bnx_RXP_b06FwReleaseMinor; - bf->bnx_RXP_b06FwReleaseFix = bnx_RXP_b06FwReleaseFix; - bf->bnx_RXP_b06FwStartAddr = bnx_RXP_b06FwStartAddr; - bf->bnx_RXP_b06FwTextAddr = bnx_RXP_b06FwTextAddr; - bf->bnx_RXP_b06FwTextLen = bnx_RXP_b06FwTextLen; - bf->bnx_RXP_b06FwDataAddr = bnx_RXP_b06FwDataAddr; - bf->bnx_RXP_b06FwDataLen = bnx_RXP_b06FwDataLen; - bf->bnx_RXP_b06FwRodataAddr = bnx_RXP_b06FwRodataAddr; - bf->bnx_RXP_b06FwRodataLen = bnx_RXP_b06FwRodataLen; - bf->bnx_RXP_b06FwBssAddr = bnx_RXP_b06FwBssAddr; - bf->bnx_RXP_b06FwBssLen = bnx_RXP_b06FwBssLen; - bf->bnx_RXP_b06FwSbssAddr = bnx_RXP_b06FwSbssAddr; - bf->bnx_RXP_b06FwSbssLen = bnx_RXP_b06FwSbssLen; - - bf->bnx_TPAT_b06FwReleaseMajor = bnx_TPAT_b06FwReleaseMajor; - bf->bnx_TPAT_b06FwReleaseMinor = bnx_TPAT_b06FwReleaseMinor; - bf->bnx_TPAT_b06FwReleaseFix = bnx_TPAT_b06FwReleaseFix; - bf->bnx_TPAT_b06FwStartAddr = bnx_TPAT_b06FwStartAddr; - bf->bnx_TPAT_b06FwTextAddr = bnx_TPAT_b06FwTextAddr; - bf->bnx_TPAT_b06FwTextLen = bnx_TPAT_b06FwTextLen; - bf->bnx_TPAT_b06FwDataAddr = bnx_TPAT_b06FwDataAddr; - bf->bnx_TPAT_b06FwDataLen = bnx_TPAT_b06FwDataLen; - bf->bnx_TPAT_b06FwRodataAddr = bnx_TPAT_b06FwRodataAddr; - bf->bnx_TPAT_b06FwRodataLen = bnx_TPAT_b06FwRodataLen; - bf->bnx_TPAT_b06FwBssAddr = bnx_TPAT_b06FwBssAddr; - bf->bnx_TPAT_b06FwBssLen = bnx_TPAT_b06FwBssLen; - bf->bnx_TPAT_b06FwSbssAddr = bnx_TPAT_b06FwSbssAddr; - bf->bnx_TPAT_b06FwSbssLen = bnx_TPAT_b06FwSbssLen; - - bf->bnx_TXP_b06FwReleaseMajor = bnx_TXP_b06FwReleaseMajor; - bf->bnx_TXP_b06FwReleaseMinor = bnx_TXP_b06FwReleaseMinor; - bf->bnx_TXP_b06FwReleaseFix = bnx_TXP_b06FwReleaseFix; - bf->bnx_TXP_b06FwStartAddr = bnx_TXP_b06FwStartAddr; - bf->bnx_TXP_b06FwTextAddr = bnx_TXP_b06FwTextAddr; - bf->bnx_TXP_b06FwTextLen = bnx_TXP_b06FwTextLen; - bf->bnx_TXP_b06FwDataAddr = bnx_TXP_b06FwDataAddr; - bf->bnx_TXP_b06FwDataLen = bnx_TXP_b06FwDataLen; - bf->bnx_TXP_b06FwRodataAddr = bnx_TXP_b06FwRodataAddr; - bf->bnx_TXP_b06FwRodataLen = bnx_TXP_b06FwRodataLen; - bf->bnx_TXP_b06FwBssAddr = bnx_TXP_b06FwBssAddr; - bf->bnx_TXP_b06FwBssLen = bnx_TXP_b06FwBssLen; - bf->bnx_TXP_b06FwSbssAddr = bnx_TXP_b06FwSbssAddr; - bf->bnx_TXP_b06FwSbssLen = bnx_TXP_b06FwSbssLen; - - bf->bnx_rv2p_proc1len = bnx_rv2p_proc1len; - bf->bnx_rv2p_proc2len = bnx_rv2p_proc2len; + bf->bnx_COM_b06FwReleaseMajor = htonl(bnx_COM_b06FwReleaseMajor); + bf->bnx_COM_b06FwReleaseMinor = htonl(bnx_COM_b06FwReleaseMinor); + bf->bnx_COM_b06FwReleaseFix = htonl(bnx_COM_b06FwReleaseFix); + bf->bnx_COM_b06FwStartAddr = htonl(bnx_COM_b06FwStartAddr); + bf->bnx_COM_b06FwTextAddr = htonl(bnx_COM_b06FwTextAddr); + bf->bnx_COM_b06FwTextLen = htonl(bnx_COM_b06FwTextLen); + bf->bnx_COM_b06FwDataAddr = htonl(bnx_COM_b06FwDataAddr); + bf->bnx_COM_b06FwDataLen = htonl(bnx_COM_b06FwDataLen); + bf->bnx_COM_b06FwRodataAddr = htonl(bnx_COM_b06FwRodataAddr); + bf->bnx_COM_b06FwRodataLen = htonl(bnx_COM_b06FwRodataLen); + bf->bnx_COM_b06FwBssAddr = htonl(bnx_COM_b06FwBssAddr); + bf->bnx_COM_b06FwBssLen = htonl(bnx_COM_b06FwBssLen); + bf->bnx_COM_b06FwSbssAddr = htonl(bnx_COM_b06FwSbssAddr); + bf->bnx_COM_b06FwSbssLen = htonl(bnx_COM_b06FwSbssLen); + + bf->bnx_RXP_b06FwReleaseMajor = htonl(bnx_RXP_b06FwReleaseMajor); + bf->bnx_RXP_b06FwReleaseMinor = htonl(bnx_RXP_b06FwReleaseMinor); + bf->bnx_RXP_b06FwReleaseFix = htonl(bnx_RXP_b06FwReleaseFix); + bf->bnx_RXP_b06FwStartAddr = htonl(bnx_RXP_b06FwStartAddr); + bf->bnx_RXP_b06FwTextAddr = htonl(bnx_RXP_b06FwTextAddr); + bf->bnx_RXP_b06FwTextLen = htonl(bnx_RXP_b06FwTextLen); + bf->bnx_RXP_b06FwDataAddr = htonl(bnx_RXP_b06FwDataAddr); + bf->bnx_RXP_b06FwDataLen = htonl(bnx_RXP_b06FwDataLen); + bf->bnx_RXP_b06FwRodataAddr = htonl(bnx_RXP_b06FwRodataAddr); + bf->bnx_RXP_b06FwRodataLen = htonl(bnx_RXP_b06FwRodataLen); + bf->bnx_RXP_b06FwBssAddr = htonl(bnx_RXP_b06FwBssAddr); + bf->bnx_RXP_b06FwBssLen = htonl(bnx_RXP_b06FwBssLen); + bf->bnx_RXP_b06FwSbssAddr = htonl(bnx_RXP_b06FwSbssAddr); + bf->bnx_RXP_b06FwSbssLen = htonl(bnx_RXP_b06FwSbssLen); + + bf->bnx_TPAT_b06FwReleaseMajor = htonl(bnx_TPAT_b06FwReleaseMajor); + bf->bnx_TPAT_b06FwReleaseMinor = htonl(bnx_TPAT_b06FwReleaseMinor); + bf->bnx_TPAT_b06FwReleaseFix = htonl(bnx_TPAT_b06FwReleaseFix); + bf->bnx_TPAT_b06FwStartAddr = htonl(bnx_TPAT_b06FwStartAddr); + bf->bnx_TPAT_b06FwTextAddr = htonl(bnx_TPAT_b06FwTextAddr); + bf->bnx_TPAT_b06FwTextLen = htonl(bnx_TPAT_b06FwTextLen); + bf->bnx_TPAT_b06FwDataAddr = htonl(bnx_TPAT_b06FwDataAddr); + bf->bnx_TPAT_b06FwDataLen = htonl(bnx_TPAT_b06FwDataLen); + bf->bnx_TPAT_b06FwRodataAddr = htonl(bnx_TPAT_b06FwRodataAddr); + bf->bnx_TPAT_b06FwRodataLen = htonl(bnx_TPAT_b06FwRodataLen); + bf->bnx_TPAT_b06FwBssAddr = htonl(bnx_TPAT_b06FwBssAddr); + bf->bnx_TPAT_b06FwBssLen = htonl(bnx_TPAT_b06FwBssLen); + bf->bnx_TPAT_b06FwSbssAddr = htonl(bnx_TPAT_b06FwSbssAddr); + bf->bnx_TPAT_b06FwSbssLen = htonl(bnx_TPAT_b06FwSbssLen); + + bf->bnx_TXP_b06FwReleaseMajor = htonl(bnx_TXP_b06FwReleaseMajor); + bf->bnx_TXP_b06FwReleaseMinor = htonl(bnx_TXP_b06FwReleaseMinor); + bf->bnx_TXP_b06FwReleaseFix = htonl(bnx_TXP_b06FwReleaseFix); + bf->bnx_TXP_b06FwStartAddr = htonl(bnx_TXP_b06FwStartAddr); + bf->bnx_TXP_b06FwTextAddr = htonl(bnx_TXP_b06FwTextAddr); + bf->bnx_TXP_b06FwTextLen = htonl(bnx_TXP_b06FwTextLen); + bf->bnx_TXP_b06FwDataAddr = htonl(bnx_TXP_b06FwDataAddr); + bf->bnx_TXP_b06FwDataLen = htonl(bnx_TXP_b06FwDataLen); + bf->bnx_TXP_b06FwRodataAddr = htonl(bnx_TXP_b06FwRodataAddr); + bf->bnx_TXP_b06FwRodataLen = htonl(bnx_TXP_b06FwRodataLen); + bf->bnx_TXP_b06FwBssAddr = htonl(bnx_TXP_b06FwBssAddr); + bf->bnx_TXP_b06FwBssLen = htonl(bnx_TXP_b06FwBssLen); + bf->bnx_TXP_b06FwSbssAddr = htonl(bnx_TXP_b06FwSbssAddr); + bf->bnx_TXP_b06FwSbssLen = htonl(bnx_TXP_b06FwSbssLen); + + bf->bnx_rv2p_proc1len = htonl(bnx_rv2p_proc1len); + bf->bnx_rv2p_proc2len = htonl(bnx_rv2p_proc2len); printf("creating %s", FILENAME); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); @@ -155,6 +164,7 @@ main(int argc, char *argv[]) fflush(stdout); for (i = 0; i < sizeof(chunks) / sizeof(chunks[0]); i++) { + hswapn(chunks[i].start, *chunks[i].len); rlen = write(fd, chunks[i].start, *chunks[i].len); if (rlen == -1) { printf("\n"); diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index e639c53ed52..58a54a09664 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.37 2006/12/24 12:54:13 reyk Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.38 2007/01/10 18:09:26 deraadt Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -141,6 +141,8 @@ u_int32_t *bnx_TXP_b06FwSbss; u_int32_t *bnx_rv2p_proc1; u_int32_t *bnx_rv2p_proc2; +void nswaph(u_int32_t *p, int wcount); + /****************************************************************************/ /* BNX Driver Version */ /****************************************************************************/ @@ -424,6 +426,15 @@ bnx_probe(struct device *parent, void *match, void *aux) sizeof(bnx_devices)/sizeof(bnx_devices[0]))); } +void +nswaph(u_int32_t *p, int wcount) +{ + for (; wcount; wcount -=4) { + *p = ntohl(*p); + p++; + } +} + int bnx_read_firmware(struct bnx_softc *sc) { @@ -439,125 +450,153 @@ bnx_read_firmware(struct bnx_softc *sc) return error; if (size < sizeof (struct bnx_firmware_header)) { +fail: free(p, M_DEVBUF); return EINVAL; } hdr = (struct bnx_firmware_header *)p; - bnx_COM_b06FwReleaseMajor = hdr->bnx_COM_b06FwReleaseMajor; - bnx_COM_b06FwReleaseMinor = hdr->bnx_COM_b06FwReleaseMinor; - bnx_COM_b06FwReleaseFix = hdr->bnx_COM_b06FwReleaseFix; - bnx_COM_b06FwStartAddr = hdr->bnx_COM_b06FwStartAddr; - bnx_COM_b06FwTextAddr = hdr->bnx_COM_b06FwTextAddr; - bnx_COM_b06FwTextLen = hdr->bnx_COM_b06FwTextLen; - bnx_COM_b06FwDataAddr = hdr->bnx_COM_b06FwDataAddr; - bnx_COM_b06FwDataLen = hdr->bnx_COM_b06FwDataLen; - bnx_COM_b06FwRodataAddr = hdr->bnx_COM_b06FwRodataAddr; - bnx_COM_b06FwRodataLen = hdr->bnx_COM_b06FwRodataLen; - bnx_COM_b06FwBssAddr = hdr->bnx_COM_b06FwBssAddr; - bnx_COM_b06FwBssLen = hdr->bnx_COM_b06FwBssLen; - bnx_COM_b06FwSbssAddr = hdr->bnx_COM_b06FwSbssAddr; - bnx_COM_b06FwSbssLen = hdr->bnx_COM_b06FwSbssLen; - - bnx_RXP_b06FwReleaseMajor = hdr->bnx_RXP_b06FwReleaseMajor; - bnx_RXP_b06FwReleaseMinor = hdr->bnx_RXP_b06FwReleaseMinor; - bnx_RXP_b06FwReleaseFix = hdr->bnx_RXP_b06FwReleaseFix; - bnx_RXP_b06FwStartAddr = hdr->bnx_RXP_b06FwStartAddr; - bnx_RXP_b06FwTextAddr = hdr->bnx_RXP_b06FwTextAddr; - bnx_RXP_b06FwTextLen = hdr->bnx_RXP_b06FwTextLen; - bnx_RXP_b06FwDataAddr = hdr->bnx_RXP_b06FwDataAddr; - bnx_RXP_b06FwDataLen = hdr->bnx_RXP_b06FwDataLen; - bnx_RXP_b06FwRodataAddr = hdr->bnx_RXP_b06FwRodataAddr; - bnx_RXP_b06FwRodataLen = hdr->bnx_RXP_b06FwRodataLen; - bnx_RXP_b06FwBssAddr = hdr->bnx_RXP_b06FwBssAddr; - bnx_RXP_b06FwBssLen = hdr->bnx_RXP_b06FwBssLen; - bnx_RXP_b06FwSbssAddr = hdr->bnx_RXP_b06FwSbssAddr; - bnx_RXP_b06FwSbssLen = hdr->bnx_RXP_b06FwSbssLen; - - bnx_TPAT_b06FwReleaseMajor = hdr->bnx_TPAT_b06FwReleaseMajor; - bnx_TPAT_b06FwReleaseMinor = hdr->bnx_TPAT_b06FwReleaseMinor; - bnx_TPAT_b06FwReleaseFix = hdr->bnx_TPAT_b06FwReleaseFix; - bnx_TPAT_b06FwStartAddr = hdr->bnx_TPAT_b06FwStartAddr; - bnx_TPAT_b06FwTextAddr = hdr->bnx_TPAT_b06FwTextAddr; - bnx_TPAT_b06FwTextLen = hdr->bnx_TPAT_b06FwTextLen; - bnx_TPAT_b06FwDataAddr = hdr->bnx_TPAT_b06FwDataAddr; - bnx_TPAT_b06FwDataLen = hdr->bnx_TPAT_b06FwDataLen; - bnx_TPAT_b06FwRodataAddr = hdr->bnx_TPAT_b06FwRodataAddr; - bnx_TPAT_b06FwRodataLen = hdr->bnx_TPAT_b06FwRodataLen; - bnx_TPAT_b06FwBssAddr = hdr->bnx_TPAT_b06FwBssAddr; - bnx_TPAT_b06FwBssLen = hdr->bnx_TPAT_b06FwBssLen; - bnx_TPAT_b06FwSbssAddr = hdr->bnx_TPAT_b06FwSbssAddr; - bnx_TPAT_b06FwSbssLen = hdr->bnx_TPAT_b06FwSbssLen; - - bnx_TXP_b06FwReleaseMajor = hdr->bnx_TXP_b06FwReleaseMajor; - bnx_TXP_b06FwReleaseMinor = hdr->bnx_TXP_b06FwReleaseMinor; - bnx_TXP_b06FwReleaseFix = hdr->bnx_TXP_b06FwReleaseFix; - bnx_TXP_b06FwStartAddr = hdr->bnx_TXP_b06FwStartAddr; - bnx_TXP_b06FwTextAddr = hdr->bnx_TXP_b06FwTextAddr; - bnx_TXP_b06FwTextLen = hdr->bnx_TXP_b06FwTextLen; - bnx_TXP_b06FwDataAddr = hdr->bnx_TXP_b06FwDataAddr; - bnx_TXP_b06FwDataLen = hdr->bnx_TXP_b06FwDataLen; - bnx_TXP_b06FwRodataAddr = hdr->bnx_TXP_b06FwRodataAddr; - bnx_TXP_b06FwRodataLen = hdr->bnx_TXP_b06FwRodataLen; - bnx_TXP_b06FwBssAddr = hdr->bnx_TXP_b06FwBssAddr; - bnx_TXP_b06FwBssLen = hdr->bnx_TXP_b06FwBssLen; - bnx_TXP_b06FwSbssAddr = hdr->bnx_TXP_b06FwSbssAddr; - bnx_TXP_b06FwSbssLen = hdr->bnx_TXP_b06FwSbssLen; - - bnx_rv2p_proc1len = hdr->bnx_rv2p_proc1len; - bnx_rv2p_proc2len = hdr->bnx_rv2p_proc2len; + bnx_COM_b06FwReleaseMajor = ntohl(hdr->bnx_COM_b06FwReleaseMajor); + bnx_COM_b06FwReleaseMinor = ntohl(hdr->bnx_COM_b06FwReleaseMinor); + bnx_COM_b06FwReleaseFix = ntohl(hdr->bnx_COM_b06FwReleaseFix); + bnx_COM_b06FwStartAddr = ntohl(hdr->bnx_COM_b06FwStartAddr); + bnx_COM_b06FwTextAddr = ntohl(hdr->bnx_COM_b06FwTextAddr); + if (bnx_COM_b06FwTextAddr > size) { + printf("%s: probably trying to use old firmware\n", + sc->bnx_dev.dv_xname); + goto fail; + } + bnx_COM_b06FwTextLen = ntohl(hdr->bnx_COM_b06FwTextLen); + bnx_COM_b06FwDataAddr = ntohl(hdr->bnx_COM_b06FwDataAddr); + bnx_COM_b06FwDataLen = ntohl(hdr->bnx_COM_b06FwDataLen); + bnx_COM_b06FwRodataAddr = ntohl(hdr->bnx_COM_b06FwRodataAddr); + bnx_COM_b06FwRodataLen = ntohl(hdr->bnx_COM_b06FwRodataLen); + bnx_COM_b06FwBssAddr = ntohl(hdr->bnx_COM_b06FwBssAddr); + bnx_COM_b06FwBssLen = ntohl(hdr->bnx_COM_b06FwBssLen); + bnx_COM_b06FwSbssAddr = ntohl(hdr->bnx_COM_b06FwSbssAddr); + bnx_COM_b06FwSbssLen = ntohl(hdr->bnx_COM_b06FwSbssLen); + + bnx_RXP_b06FwReleaseMajor = ntohl(hdr->bnx_RXP_b06FwReleaseMajor); + bnx_RXP_b06FwReleaseMinor = ntohl(hdr->bnx_RXP_b06FwReleaseMinor); + bnx_RXP_b06FwReleaseFix = ntohl(hdr->bnx_RXP_b06FwReleaseFix); + bnx_RXP_b06FwStartAddr = ntohl(hdr->bnx_RXP_b06FwStartAddr); + bnx_RXP_b06FwTextAddr = ntohl(hdr->bnx_RXP_b06FwTextAddr); + bnx_RXP_b06FwTextLen = ntohl(hdr->bnx_RXP_b06FwTextLen); + bnx_RXP_b06FwDataAddr = ntohl(hdr->bnx_RXP_b06FwDataAddr); + bnx_RXP_b06FwDataLen = ntohl(hdr->bnx_RXP_b06FwDataLen); + bnx_RXP_b06FwRodataAddr = ntohl(hdr->bnx_RXP_b06FwRodataAddr); + bnx_RXP_b06FwRodataLen = ntohl(hdr->bnx_RXP_b06FwRodataLen); + bnx_RXP_b06FwBssAddr = ntohl(hdr->bnx_RXP_b06FwBssAddr); + bnx_RXP_b06FwBssLen = ntohl(hdr->bnx_RXP_b06FwBssLen); + bnx_RXP_b06FwSbssAddr = ntohl(hdr->bnx_RXP_b06FwSbssAddr); + bnx_RXP_b06FwSbssLen = ntohl(hdr->bnx_RXP_b06FwSbssLen); + + bnx_TPAT_b06FwReleaseMajor = ntohl(hdr->bnx_TPAT_b06FwReleaseMajor); + bnx_TPAT_b06FwReleaseMinor = ntohl(hdr->bnx_TPAT_b06FwReleaseMinor); + bnx_TPAT_b06FwReleaseFix = ntohl(hdr->bnx_TPAT_b06FwReleaseFix); + bnx_TPAT_b06FwStartAddr = ntohl(hdr->bnx_TPAT_b06FwStartAddr); + bnx_TPAT_b06FwTextAddr = ntohl(hdr->bnx_TPAT_b06FwTextAddr); + bnx_TPAT_b06FwTextLen = ntohl(hdr->bnx_TPAT_b06FwTextLen); + bnx_TPAT_b06FwDataAddr = ntohl(hdr->bnx_TPAT_b06FwDataAddr); + bnx_TPAT_b06FwDataLen = ntohl(hdr->bnx_TPAT_b06FwDataLen); + bnx_TPAT_b06FwRodataAddr = ntohl(hdr->bnx_TPAT_b06FwRodataAddr); + bnx_TPAT_b06FwRodataLen = ntohl(hdr->bnx_TPAT_b06FwRodataLen); + bnx_TPAT_b06FwBssAddr = ntohl(hdr->bnx_TPAT_b06FwBssAddr); + bnx_TPAT_b06FwBssLen = ntohl(hdr->bnx_TPAT_b06FwBssLen); + bnx_TPAT_b06FwSbssAddr = ntohl(hdr->bnx_TPAT_b06FwSbssAddr); + bnx_TPAT_b06FwSbssLen = ntohl(hdr->bnx_TPAT_b06FwSbssLen); + + bnx_TXP_b06FwReleaseMajor = ntohl(hdr->bnx_TXP_b06FwReleaseMajor); + bnx_TXP_b06FwReleaseMinor = ntohl(hdr->bnx_TXP_b06FwReleaseMinor); + bnx_TXP_b06FwReleaseFix = ntohl(hdr->bnx_TXP_b06FwReleaseFix); + bnx_TXP_b06FwStartAddr = ntohl(hdr->bnx_TXP_b06FwStartAddr); + bnx_TXP_b06FwTextAddr = ntohl(hdr->bnx_TXP_b06FwTextAddr); + bnx_TXP_b06FwTextLen = ntohl(hdr->bnx_TXP_b06FwTextLen); + bnx_TXP_b06FwDataAddr = ntohl(hdr->bnx_TXP_b06FwDataAddr); + bnx_TXP_b06FwDataLen = ntohl(hdr->bnx_TXP_b06FwDataLen); + bnx_TXP_b06FwRodataAddr = ntohl(hdr->bnx_TXP_b06FwRodataAddr); + bnx_TXP_b06FwRodataLen = ntohl(hdr->bnx_TXP_b06FwRodataLen); + bnx_TXP_b06FwBssAddr = ntohl(hdr->bnx_TXP_b06FwBssAddr); + bnx_TXP_b06FwBssLen = ntohl(hdr->bnx_TXP_b06FwBssLen); + bnx_TXP_b06FwSbssAddr = ntohl(hdr->bnx_TXP_b06FwSbssAddr); + bnx_TXP_b06FwSbssLen = ntohl(hdr->bnx_TXP_b06FwSbssLen); + + bnx_rv2p_proc1len = ntohl(hdr->bnx_rv2p_proc1len); + bnx_rv2p_proc2len = ntohl(hdr->bnx_rv2p_proc2len); q = p + sizeof(*hdr); bnx_COM_b06FwText = (u_int32_t *)q; q += bnx_COM_b06FwTextLen; + nswaph(bnx_COM_b06FwText, bnx_COM_b06FwTextLen); bnx_COM_b06FwData = (u_int32_t *)q; q += bnx_COM_b06FwDataLen; + nswaph(bnx_COM_b06FwData, bnx_COM_b06FwDataLen); bnx_COM_b06FwRodata = (u_int32_t *)q; q += bnx_COM_b06FwRodataLen; + nswaph(bnx_COM_b06FwRodata, bnx_COM_b06FwRodataLen); bnx_COM_b06FwBss = (u_int32_t *)q; q += bnx_COM_b06FwBssLen; + nswaph(bnx_COM_b06FwBss, bnx_COM_b06FwBssLen); bnx_COM_b06FwSbss = (u_int32_t *)q; q += bnx_COM_b06FwSbssLen; + nswaph(bnx_COM_b06FwSbss, bnx_COM_b06FwSbssLen); bnx_RXP_b06FwText = (u_int32_t *)q; q += bnx_RXP_b06FwTextLen; + nswaph(bnx_RXP_b06FwText, bnx_RXP_b06FwTextLen); bnx_RXP_b06FwData = (u_int32_t *)q; q += bnx_RXP_b06FwDataLen; + nswaph(bnx_RXP_b06FwData, bnx_RXP_b06FwDataLen); bnx_RXP_b06FwRodata = (u_int32_t *)q; q += bnx_RXP_b06FwRodataLen; + nswaph(bnx_RXP_b06FwRodata, bnx_RXP_b06FwRodataLen); bnx_RXP_b06FwBss = (u_int32_t *)q; q += bnx_RXP_b06FwBssLen; + nswaph(bnx_RXP_b06FwBss, bnx_RXP_b06FwBssLen); bnx_RXP_b06FwSbss = (u_int32_t *)q; q += bnx_RXP_b06FwSbssLen; + nswaph(bnx_RXP_b06FwSbss, bnx_RXP_b06FwSbssLen); bnx_TPAT_b06FwText = (u_int32_t *)q; q += bnx_TPAT_b06FwTextLen; + nswaph(bnx_TPAT_b06FwText, bnx_TPAT_b06FwTextLen); bnx_TPAT_b06FwData = (u_int32_t *)q; q += bnx_TPAT_b06FwDataLen; + nswaph(bnx_TPAT_b06FwData, bnx_TPAT_b06FwDataLen); bnx_TPAT_b06FwRodata = (u_int32_t *)q; q += bnx_TPAT_b06FwRodataLen; + nswaph(bnx_TPAT_b06FwRodata, bnx_TPAT_b06FwRodataLen); bnx_TPAT_b06FwBss = (u_int32_t *)q; q += bnx_TPAT_b06FwBssLen; + nswaph(bnx_TPAT_b06FwBss, bnx_TPAT_b06FwBssLen); bnx_TPAT_b06FwSbss = (u_int32_t *)q; q += bnx_TPAT_b06FwSbssLen; + nswaph(bnx_TPAT_b06FwSbss, bnx_TPAT_b06FwSbssLen); bnx_TXP_b06FwText = (u_int32_t *)q; q += bnx_TXP_b06FwTextLen; + nswaph(bnx_TXP_b06FwText, bnx_TXP_b06FwTextLen); bnx_TXP_b06FwData = (u_int32_t *)q; q += bnx_TXP_b06FwDataLen; + nswaph(bnx_TXP_b06FwData, bnx_TXP_b06FwDataLen); bnx_TXP_b06FwRodata = (u_int32_t *)q; q += bnx_TXP_b06FwRodataLen; + nswaph(bnx_TXP_b06FwRodata, bnx_TXP_b06FwRodataLen); bnx_TXP_b06FwBss = (u_int32_t *)q; q += bnx_TXP_b06FwBssLen; + nswaph(bnx_TXP_b06FwBss, bnx_TXP_b06FwBssLen); bnx_TXP_b06FwSbss = (u_int32_t *)q; q += bnx_TXP_b06FwSbssLen; + nswaph(bnx_TXP_b06FwSbss, bnx_TXP_b06FwSbssLen); bnx_rv2p_proc1 = (u_int32_t *)q; q += bnx_rv2p_proc1len; + nswaph(bnx_rv2p_proc1, bnx_rv2p_proc1len); bnx_rv2p_proc2 = (u_int32_t *)q; q += bnx_rv2p_proc2len; + nswaph(bnx_rv2p_proc2, bnx_rv2p_proc2len); if (q - p != size) { free(p, M_DEVBUF); |