NetBSD-Bugs archive

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

Re: kern/38757



The following reply was made to PR kern/38757; it has been noted by GNATS.

From: Hauke Fath <hf%spg.tu-darmstadt.de@localhost>
To: Robert Swindells <rjs%fdy2.demon.co.uk@localhost>
Cc: Hauke Fath {TUD} <hf%spg.tu-darmstadt.de@localhost>, 
gnats-bugs%netbsd.org@localhost
Subject: Re: kern/38757
Date: Thu, 14 Aug 2008 14:13:31 +0200

 At 20:29 Uhr +0200 13.08.2008, Hauke Fath wrote:
 >--- begin forwarded text
 >
 >From: Robert Swindells <rjs%fdy2.demon.co.uk@localhost>
 >To: hauke%Espresso.Rhein-Neckar.de@localhost
 >Subject: Re: NetBSD Problem Report #38757
 >Date: Tue, 12 Aug 2008 22:13:40 +0100 (BST)
 >
 >
 >Would you be able to try out the following patch ?
 
 
 Works nicely, thanks!
 
        hauke
 
 
 >Robert Swindells
 >
 >Index: smc91cxx.c
 >===================================================================
 >RCS file: /cvsroot/src/sys/dev/ic/smc91cxx.c,v
 >retrieving revision 1.69
 >diff -u -r1.69 smc91cxx.c
 >--- smc91cxx.c        25 May 2008 16:21:54 -0000      1.69
 >+++ smc91cxx.c        12 Aug 2008 21:02:27 -0000
 >@@ -133,7 +133,6 @@
 >
 >  /* XXX Hardware padding doesn't work yet(?) */
 >  #define     SMC91CXX_SW_PAD
 >-#define      SMC91CXX_NO_BYTE_WRITE
 >
 >  const char *smc91cxx_idstrs[] = {
 >      NULL,                           /* 0 */
 >@@ -773,6 +772,7 @@
 >      oddbyte = smc91cxx_copy_tx_frame(sc, m);
 >
 >  #ifdef SMC91CXX_SW_PAD
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >  #if BYTE_ORDER == LITTLE_ENDIAN
 >      if (pad > 1 && (pad & 1)) {
 >              bus_space_write_2(bst, bsh, DATA_REG_W, oddbyte << 0);
 >@@ -784,6 +784,7 @@
 >              oddbyte = 0;
 >      }
 >  #endif
 >+#endif
 >
 >      /*
 >       * Push out padding.
 >@@ -794,6 +795,7 @@
 >      }
 >  #endif
 >
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >      /*
 >       * Push out control byte and unused packet byte.  The control byte
 >       * is 0, meaning the packet is even lengthed and no special
 >@@ -806,6 +808,10 @@
 >      bus_space_write_2(bst, bsh, DATA_REG_W,
 >          (oddbyte << 8) | (pad ? CTLB_ODD : 0));
 >  #endif
 >+#else
 >+     if (pad)
 >+             bus_space_write_1(bst, bsh, DATA_REG_B, 0);
 >+#endif
 >
 >      /*
 >       * Enable transmit interrupts and let the chip go.  Set a watchdog
 >@@ -913,6 +919,10 @@
 >                      panic("smc91cxx_copy_tx_frame: p != lim");
 >  #endif
 >      }
 >+#ifndef SMC91CXX_NO_BYTE_WRITE
 >+     if (leftover)
 >+             bus_space_write_1(bst, bsh, DATA_REG_B, dbuf);
 >+#endif
 >      return dbuf;
 >  }
 >
 >@@ -928,7 +938,10 @@
 >      bus_space_tag_t bst = sc->sc_bst;
 >      bus_space_handle_t bsh = sc->sc_bsh;
 >      u_int8_t mask, interrupts, status;
 >-     u_int16_t packetno, tx_status, card_stats, v;
 >+     u_int16_t packetno, tx_status, card_stats;
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >+     u_int16_t v;
 >+#endif
 >
 >      if ((sc->sc_flags & SMC_FLAGS_ENABLED) == 0 ||
 >          !device_is_active(&sc->sc_dev))
 >@@ -939,6 +952,7 @@
 >      /*
 >       * Obtain the current interrupt status and mask.
 >       */
 >+#ifdef SMC91CXX_NO_BYTE_WRITE
 >      v = bus_space_read_2(bst, bsh, INTR_STAT_REG_B);
 >
 >      /*
 >@@ -953,6 +967,15 @@
 >      mask = v & 0xff;
 >  #endif
 >      KDASSERT(mask == sc->sc_intmask);
 >+#else
 >+     mask = bus_space_read_1(bst, bsh, INTR_MASK_REG_B);
 >+
 >+     /*
 >+      * Get the set of interrupt which occurred and eliminate any
 >+      * which are not enabled.
 >+      */
 >+     interrupts = bus_space_read_1(bst, bsh, INTR_STAT_REG_B);
 >+#endif
 >      status = interrupts & mask;
 >
 >      /* Ours? */
 >
 >--- end forwarded text
 
 -- 
       The ASCII Ribbon Campaign                    Hauke Fath
 ()     No HTML/RTF in email            Institut für Nachrichtentechnik
 /\     No Word docs in email                     TU Darmstadt
       Respect for open standards              Ruf +49-6151-16-3281
 


Home | Main Index | Thread Index | Old Index