Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Swap the order of u_int16_t member in Tx/Rx descr...



details:   https://anonhg.NetBSD.org/src/rev/bada69f925fb
branches:  trunk
changeset: 486574:bada69f925fb
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri May 26 00:20:26 2000 +0000

description:
Swap the order of u_int16_t member in Tx/Rx descriptors
on big endian machines.

"Big endian mode" of smc83c170 actually works!
(i.e. no htole??()/le??toh() functions are needed.)

diffstat:

 sys/dev/ic/smc83c170reg.h |  22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r d2c138b0cc78 -r bada69f925fb sys/dev/ic/smc83c170reg.h
--- a/sys/dev/ic/smc83c170reg.h Fri May 26 00:14:41 2000 +0000
+++ b/sys/dev/ic/smc83c170reg.h Fri May 26 00:20:26 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smc83c170reg.h,v 1.5 1999/08/27 19:21:32 thorpej Exp $ */
+/*     $NetBSD: smc83c170reg.h,v 1.6 2000/05/26 00:20:26 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -49,11 +49,21 @@
  * EPIC transmit descriptor.  Must be 4-byte aligned.
  */
 struct epic_txdesc {
+#if BYTE_ORDER == BIG_ENDIAN
+       u_int16_t       et_txlength;    /* transmit length */
+       u_int16_t       et_txstatus;    /* transmit status; see below */
+#else
        u_int16_t       et_txstatus;    /* transmit status; see below */
        u_int16_t       et_txlength;    /* transmit length */
+#endif
        u_int32_t       et_bufaddr;     /* buffer address */
+#if BYTE_ORDER == BIG_ENDIAN
+       u_int16_t       et_control;     /* control word; see below */
+       u_int16_t       et_buflength;   /* buffer length */
+#else
        u_int16_t       et_buflength;   /* buffer length */
        u_int16_t       et_control;     /* control word; see below */
+#endif
        u_int32_t       et_nextdesc;    /* next descriptor pointer */
 };
 
@@ -82,11 +92,21 @@
  * EPIC receive descriptor.  Must be 4-byte aligned.
  */
 struct epic_rxdesc {
+#if BYTE_ORDER == BIG_ENDIAN
+       u_int16_t       er_rxlength;    /* receive frame length */
+       u_int16_t       er_rxstatus;    /* receive status; see below */
+#else
        u_int16_t       er_rxstatus;    /* receive status; see below */
        u_int16_t       er_rxlength;    /* receive frame length */
+#endif
        u_int32_t       er_bufaddr;     /* buffer address */
+#if BYTE_ORDER == BIG_ENDIAN
+       u_int16_t       er_control;     /* control word; see below */
+       u_int16_t       er_buflength;   /* buffer length */
+#else
        u_int16_t       er_buflength;   /* buffer length */
        u_int16_t       er_control;     /* control word; see below */
+#endif
        u_int32_t       er_nextdesc;    /* next descriptor pointer */
 };
 



Home | Main Index | Thread Index | Old Index