summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2004-11-17 04:25:10 +0000
committeryongari <yongari@FreeBSD.org>2004-11-17 04:25:10 +0000
commitb1b71135eede8c1a1f006cbfb49fe7d39b380d5c (patch)
treeddb6dd6a8f88d3b09ff0e9caa9ed1c1da2d917de /sys
parent0e542df6cbf1a200e2b5dd3e1fdf8fa8b25faf45 (diff)
downloadFreeBSD-src-b1b71135eede8c1a1f006cbfb49fe7d39b380d5c.zip
FreeBSD-src-b1b71135eede8c1a1f006cbfb49fe7d39b380d5c.tar.gz
Make interrupt coalescing work on big endian systems.
Also change struct ucode.length to be in number of elements (u_int32_t) to help endian handling. MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fxp/if_fxp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 81e44c1..7d482c9 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -2624,7 +2624,7 @@ static u_int32_t fxp_ucode_d101s[] = D101S_RCVBUNDLE_UCODE;
static u_int32_t fxp_ucode_d102[] = D102_B_RCVBUNDLE_UCODE;
static u_int32_t fxp_ucode_d102c[] = D102_C_RCVBUNDLE_UCODE;
-#define UCODE(x) x, sizeof(x)
+#define UCODE(x) x, sizeof(x)/sizeof(u_int32_t)
struct ucode {
u_int32_t revision;
@@ -2651,6 +2651,7 @@ fxp_load_ucode(struct fxp_softc *sc)
{
struct ucode *uc;
struct fxp_cb_ucode *cbp;
+ int i;
for (uc = ucode_table; uc->ucode != NULL; uc++)
if (sc->revision == uc->revision)
@@ -2661,7 +2662,8 @@ fxp_load_ucode(struct fxp_softc *sc)
cbp->cb_status = 0;
cbp->cb_command = htole16(FXP_CB_COMMAND_UCODE | FXP_CB_COMMAND_EL);
cbp->link_addr = 0xffffffff; /* (no) next command */
- memcpy(cbp->ucode, uc->ucode, uc->length);
+ for (i = 0; i < uc->length; i++)
+ cbp->ucode[i] = htole32(uc->ucode[i]);
if (uc->int_delay_offset)
*(u_int16_t *)&cbp->ucode[uc->int_delay_offset] =
htole16(sc->tunable_int_delay + sc->tunable_int_delay / 2);
OpenPOWER on IntegriCloud