[BACK]Return to am79900.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / ic

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/ic/am79900.c between version 1.18 and 1.19

version 1.18, 2007/08/26 22:36:36 version 1.19, 2008/04/04 12:25:07
Line 180  am79900_config(struct am79900_softc *sc)
Line 180  am79900_config(struct am79900_softc *sc)
                 sc->lsc.sc_tbufaddr[i] = mem;                  sc->lsc.sc_tbufaddr[i] = mem;
   
         if (mem > sc->lsc.sc_memsize)          if (mem > sc->lsc.sc_memsize)
                 panic("%s: memsize", sc->lsc.sc_dev.dv_xname);                  panic("%s: memsize", device_xname(sc->lsc.sc_dev));
 }  }
   
 /*  /*
Line 194  am79900_meminit(struct lance_softc *sc)
Line 194  am79900_meminit(struct lance_softc *sc)
         struct leinit init;          struct leinit init;
         struct lermd rmd;          struct lermd rmd;
         struct letmd tmd;          struct letmd tmd;
         u_int8_t *myaddr;          uint8_t *myaddr;
   
 #if NBPFILTER > 0  #if NBPFILTER > 0
         if (ifp->if_flags & IFF_PROMISC)          if (ifp->if_flags & IFF_PROMISC)
Line 281  am79900_rint(struct lance_softc *sc)
Line 281  am79900_rint(struct lance_softc *sc)
                                 if ((rmd.rmd1 & LE_R1_OFLO) == 0) {                                  if ((rmd.rmd1 & LE_R1_OFLO) == 0) {
                                         if (rmd.rmd1 & LE_R1_FRAM)                                          if (rmd.rmd1 & LE_R1_FRAM)
                                                 printf("%s: framing error\n",                                                  printf("%s: framing error\n",
                                                     sc->sc_dev.dv_xname);                                                      device_xname(sc->sc_dev));
                                         if (rmd.rmd1 & LE_R1_CRC)                                          if (rmd.rmd1 & LE_R1_CRC)
                                                 printf("%s: crc mismatch\n",                                                  printf("%s: crc mismatch\n",
                                                     sc->sc_dev.dv_xname);                                                      device_xname(sc->sc_dev));
                                 }                                  }
 #endif  #endif
                         } else {                          } else {
                                 if (rmd.rmd1 & LE_R1_OFLO)                                  if (rmd.rmd1 & LE_R1_OFLO)
                                         printf("%s: overflow\n",                                          printf("%s: overflow\n",
                                             sc->sc_dev.dv_xname);                                              device_xname(sc->sc_dev));
                         }                          }
                         if (rmd.rmd1 & LE_R1_BUFF)                          if (rmd.rmd1 & LE_R1_BUFF)
                                 printf("%s: receive buffer error\n",                                  printf("%s: receive buffer error\n",
                                     sc->sc_dev.dv_xname);                                      device_xname(sc->sc_dev));
                         ifp->if_ierrors++;                          ifp->if_ierrors++;
                 } else if ((rmd.rmd1 & (LE_R1_STP | LE_R1_ENP)) !=                  } else if ((rmd.rmd1 & (LE_R1_STP | LE_R1_ENP)) !=
                     (LE_R1_STP | LE_R1_ENP)) {                      (LE_R1_STP | LE_R1_ENP)) {
                         printf("%s: dropping chained buffer\n",                          printf("%s: dropping chained buffer\n",
                             sc->sc_dev.dv_xname);                              device_xname(sc->sc_dev));
                         ifp->if_ierrors++;                          ifp->if_ierrors++;
                 } else {                  } else {
 #ifdef LEDEBUG  #ifdef LEDEBUG
Line 360  am79900_tint(struct lance_softc *sc)
Line 360  am79900_tint(struct lance_softc *sc)
                 if (tmd.tmd1 & LE_T1_ERR) {                  if (tmd.tmd1 & LE_T1_ERR) {
                         if (tmd.tmd2 & LE_T2_BUFF)                          if (tmd.tmd2 & LE_T2_BUFF)
                                 printf("%s: transmit buffer error\n",                                  printf("%s: transmit buffer error\n",
                                     sc->sc_dev.dv_xname);                                      device_xname(sc->sc_dev));
                         else if (tmd.tmd2 & LE_T2_UFLO)                          else if (tmd.tmd2 & LE_T2_UFLO)
                                 printf("%s: underflow\n", sc->sc_dev.dv_xname);                                  printf("%s: underflow\n",
                                       device_xname(sc->sc_dev));
                         if (tmd.tmd2 & (LE_T2_BUFF | LE_T2_UFLO)) {                          if (tmd.tmd2 & (LE_T2_BUFF | LE_T2_UFLO)) {
                                 lance_reset(sc);                                  lance_reset(sc);
                                 return;                                  return;
Line 373  am79900_tint(struct lance_softc *sc)
Line 374  am79900_tint(struct lance_softc *sc)
                                         (*sc->sc_nocarrier)(sc);                                          (*sc->sc_nocarrier)(sc);
                                 else                                  else
                                         printf("%s: lost carrier\n",                                          printf("%s: lost carrier\n",
                                             sc->sc_dev.dv_xname);                                              device_xname(sc->sc_dev));
                         }                          }
                         if (tmd.tmd2 & LE_T2_LCOL)                          if (tmd.tmd2 & LE_T2_LCOL)
                                 ifp->if_collisions++;                                  ifp->if_collisions++;
                         if (tmd.tmd2 & LE_T2_RTRY) {                          if (tmd.tmd2 & LE_T2_RTRY) {
 #ifdef LEDEBUG  #ifdef LEDEBUG
                                 printf("%s: excessive collisions\n",                                  printf("%s: excessive collisions\n",
                                     sc->sc_dev.dv_xname);                                      device_xname(sc->sc_dev));
 #endif  #endif
                                 ifp->if_collisions += 16;                                  ifp->if_collisions += 16;
                         }                          }
Line 415  int
Line 416  int
 am79900_intr(void *arg)  am79900_intr(void *arg)
 {  {
         struct lance_softc *sc = arg;          struct lance_softc *sc = arg;
         u_int16_t isr;          uint16_t isr;
   
         isr = (*sc->sc_rdcsr)(sc, LE_CSR0) | sc->sc_saved_csr0;          isr = (*sc->sc_rdcsr)(sc, LE_CSR0) | sc->sc_saved_csr0;
         sc->sc_saved_csr0 = 0;          sc->sc_saved_csr0 = 0;
 #if defined(LEDEBUG) && LEDEBUG > 1  #if defined(LEDEBUG) && LEDEBUG > 1
         if (sc->sc_debug)          if (sc->sc_debug)
                 printf("%s: am79900_intr entering with isr=%04x\n",                  printf("%s: am79900_intr entering with isr=%04x\n",
                     sc->sc_dev.dv_xname, isr);                      device_xname(sc->sc_dev), isr);
 #endif  #endif
         if ((isr & LE_C0_INTR) == 0)          if ((isr & LE_C0_INTR) == 0)
                 return (0);                  return (0);
Line 433  am79900_intr(void *arg)
Line 434  am79900_intr(void *arg)
         if (isr & LE_C0_ERR) {          if (isr & LE_C0_ERR) {
                 if (isr & LE_C0_BABL) {                  if (isr & LE_C0_BABL) {
 #ifdef LEDEBUG  #ifdef LEDEBUG
                         printf("%s: babble\n", sc->sc_dev.dv_xname);                          printf("%s: babble\n", device_xname(sc->sc_dev));
 #endif  #endif
                         ifp->if_oerrors++;                          ifp->if_oerrors++;
                 }                  }
 #if 0  #if 0
                 if (isr & LE_C0_CERR) {                  if (isr & LE_C0_CERR) {
                         printf("%s: collision error\n", sc->sc_dev.dv_xname);                          printf("%s: collision error\n",
                               device_xname(sc->sc_dev));
                         ifp->if_collisions++;                          ifp->if_collisions++;
                 }                  }
 #endif  #endif
                 if (isr & LE_C0_MISS) {                  if (isr & LE_C0_MISS) {
 #ifdef LEDEBUG  #ifdef LEDEBUG
                         printf("%s: missed packet\n", sc->sc_dev.dv_xname);                          printf("%s: missed packet\n", device_xname(sc->sc_dev));
 #endif  #endif
                         ifp->if_ierrors++;                          ifp->if_ierrors++;
                 }                  }
                 if (isr & LE_C0_MERR) {                  if (isr & LE_C0_MERR) {
                         printf("%s: memory error\n", sc->sc_dev.dv_xname);                          printf("%s: memory error\n", device_xname(sc->sc_dev));
                         lance_reset(sc);                          lance_reset(sc);
                         return (1);                          return (1);
                 }                  }
         }          }
   
         if ((isr & LE_C0_RXON) == 0) {          if ((isr & LE_C0_RXON) == 0) {
                 printf("%s: receiver disabled\n", sc->sc_dev.dv_xname);                  printf("%s: receiver disabled\n", device_xname(sc->sc_dev));
                 ifp->if_ierrors++;                  ifp->if_ierrors++;
                 lance_reset(sc);                  lance_reset(sc);
                 return (1);                  return (1);
         }          }
         if ((isr & LE_C0_TXON) == 0) {          if ((isr & LE_C0_TXON) == 0) {
                 printf("%s: transmitter disabled\n", sc->sc_dev.dv_xname);                  printf("%s: transmitter disabled\n", device_xname(sc->sc_dev));
                 ifp->if_oerrors++;                  ifp->if_oerrors++;
                 lance_reset(sc);                  lance_reset(sc);
                 return (1);                  return (1);
Line 579  static void
Line 581  static void
 am79900_recv_print(struct lance_softc *sc, int no)  am79900_recv_print(struct lance_softc *sc, int no)
 {  {
         struct lermd rmd;          struct lermd rmd;
         u_int16_t len;          uint16_t len;
         struct ether_header eh;          struct ether_header eh;
   
         (*sc->sc_copyfromdesc)(sc, &rmd, LE_RMDADDR(sc, no), sizeof(rmd));          (*sc->sc_copyfromdesc)(sc, &rmd, LE_RMDADDR(sc, no), sizeof(rmd));
         len = (rmd.rmd2  & 0xfff) - 4;          len = (rmd.rmd2  & 0xfff) - 4;
         printf("%s: receive buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,          printf("%s: receive buffer %d, len = %d\n",
             len);              device_xname(sc->sc_dev), no, len);
         printf("%s: status %04x\n", sc->sc_dev.dv_xname,          printf("%s: status %04x\n", device_xname(sc->sc_dev),
             (*sc->sc_rdcsr)(sc, LE_CSR0));              (*sc->sc_rdcsr)(sc, LE_CSR0));
         printf("%s: adr %08x, flags/blen %08x\n",          printf("%s: adr %08x, flags/blen %08x\n",
             sc->sc_dev.dv_xname, rmd.rmd0, rmd.rmd1);              device_xname(sc->sc_dev), rmd.rmd0, rmd.rmd1);
         if (len >= sizeof(eh)) {          if (len >= sizeof(eh)) {
                 (*sc->sc_copyfrombuf)(sc, &eh, LE_RBUFADDR(sc, no), sizeof(eh));                  (*sc->sc_copyfrombuf)(sc, &eh, LE_RBUFADDR(sc, no), sizeof(eh));
                 printf("%s: dst %s", sc->sc_dev.dv_xname,                  printf("%s: dst %s", device_xname(sc->sc_dev),
                         ether_sprintf(eh.ether_dhost));                          ether_sprintf(eh.ether_dhost));
                 printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),                  printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
                         ntohs(eh.ether_type));                          ntohs(eh.ether_type));
Line 603  static void
Line 605  static void
 am79900_xmit_print(struct lance_softc *sc, int no)  am79900_xmit_print(struct lance_softc *sc, int no)
 {  {
         struct letmd tmd;          struct letmd tmd;
         u_int16_t len;          uint16_t len;
         struct ether_header eh;          struct ether_header eh;
   
         (*sc->sc_copyfromdesc)(sc, &tmd, LE_TMDADDR(sc, no), sizeof(tmd));          (*sc->sc_copyfromdesc)(sc, &tmd, LE_TMDADDR(sc, no), sizeof(tmd));
         len = -(tmd.tmd1 & 0xfff);          len = -(tmd.tmd1 & 0xfff);
         printf("%s: transmit buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,          printf("%s: transmit buffer %d, len = %d\n",
             len);              device_xname(sc->sc_dev), no, len);
         printf("%s: status %04x\n", sc->sc_dev.dv_xname,          printf("%s: status %04x\n", device_xname(sc->sc_dev),
             (*sc->sc_rdcsr)(sc, LE_CSR0));              (*sc->sc_rdcsr)(sc, LE_CSR0));
         printf("%s: adr %08x, flags/blen %08x\n",          printf("%s: adr %08x, flags/blen %08x\n",
             sc->sc_dev.dv_xname, tmd.tmd0, tmd.tmd1);              device_xname(sc->sc_dev), tmd.tmd0, tmd.tmd1);
         if (len >= sizeof(eh)) {          if (len >= sizeof(eh)) {
                 (*sc->sc_copyfrombuf)(sc, &eh, LE_TBUFADDR(sc, no), sizeof(eh));                  (*sc->sc_copyfrombuf)(sc, &eh, LE_TBUFADDR(sc, no), sizeof(eh));
                 printf("%s: dst %s", sc->sc_dev.dv_xname,                  printf("%s: dst %s", device_xname(sc->sc_dev),
                         ether_sprintf(eh.ether_dhost));                          ether_sprintf(eh.ether_dhost));
                 printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),                  printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
                     ntohs(eh.ether_type));                      ntohs(eh.ether_type));

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

CVSweb <webmaster@jp.NetBSD.org>