Wed Jan 29 05:39:48 2020 UTC ()
Adopt <net/if_stats.h>.


(thorpej)
diff -r1.34 -r1.35 src/sys/arch/sun2/dev/if_ec.c
diff -r1.70 -r1.71 src/sys/arch/sun3/dev/if_ie.c

cvs diff -r1.34 -r1.35 src/sys/arch/sun2/dev/if_ec.c (expand / switch to unified diff)

--- src/sys/arch/sun2/dev/if_ec.c 2019/05/29 10:07:29 1.34
+++ src/sys/arch/sun2/dev/if_ec.c 2020/01/29 05:39:48 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ec.c,v 1.34 2019/05/29 10:07:29 msaitoh Exp $ */ 1/* $NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matthew Fredette. 8 * by Matthew Fredette.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * 3Com 3C400 device driver 33 * 3Com 3C400 device driver
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.34 2019/05/29 10:07:29 msaitoh Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $");
38 38
39#include "opt_inet.h" 39#include "opt_inet.h"
40#include "opt_ns.h" 40#include "opt_ns.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/errno.h> 44#include <sys/errno.h>
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46#include <sys/mbuf.h> 46#include <sys/mbuf.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48#include <sys/syslog.h> 48#include <sys/syslog.h>
49#include <sys/device.h> 49#include <sys/device.h>
50#include <sys/endian.h> 50#include <sys/endian.h>
@@ -409,37 +409,37 @@ ec_intr(void *arg) @@ -409,37 +409,37 @@ ec_intr(void *arg)
409 /* Receive a packet. */ 409 /* Receive a packet. */
410 if (recv_second) 410 if (recv_second)
411 ec_recv(sc, recv_second); 411 ec_recv(sc, recv_second);
412 412
413 retval++; 413 retval++;
414 } 414 }
415 /* Check for a transmitted packet. */ 415 /* Check for a transmitted packet. */
416 if (ifp->if_flags & IFF_OACTIVE) { 416 if (ifp->if_flags & IFF_OACTIVE) {
417 417
418 /* If we got a collision. */ 418 /* If we got a collision. */
419 if (ECREG_CSR_RD & EC_CSR_JAM) { 419 if (ECREG_CSR_RD & EC_CSR_JAM) {
420 ECREG_CSR_WR(ECREG_CSR_RD & 420 ECREG_CSR_WR(ECREG_CSR_RD &
421 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK)); 421 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK));
422 sc->sc_ethercom.ec_if.if_collisions++; 422 if_statinc(ifp, if_collisions);
423 retval++; 423 retval++;
424 ec_coll(sc); 424 ec_coll(sc);
425 425
426 } 426 }
427 /* If we transmitted a packet. */ 427 /* If we transmitted a packet. */
428 else if ((ECREG_CSR_RD & EC_CSR_TBSW) == 0) { 428 else if ((ECREG_CSR_RD & EC_CSR_TBSW) == 0) {
429 ECREG_CSR_WR(ECREG_CSR_RD & 429 ECREG_CSR_WR(ECREG_CSR_RD &
430 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK)); 430 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK));
431 retval++; 431 retval++;
432 sc->sc_ethercom.ec_if.if_opackets++; 432 if_statinc(ifp, if_opackets);
433 sc->sc_jammed = 0; 433 sc->sc_jammed = 0;
434 ifp->if_flags &= ~IFF_OACTIVE; 434 ifp->if_flags &= ~IFF_OACTIVE;
435 if_schedule_deferred_start(ifp); 435 if_schedule_deferred_start(ifp);
436 } 436 }
437 } else { 437 } else {
438 438
439 /* Make sure we disable transmitter interrupts. */ 439 /* Make sure we disable transmitter interrupts. */
440 ECREG_CSR_WR(ECREG_CSR_RD & 440 ECREG_CSR_WR(ECREG_CSR_RD &
441 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK)); 441 (EC_CSR_BINT | EC_CSR_AINT | EC_CSR_PAMASK));
442 } 442 }
443 443
444 return retval; 444 return retval;
445} 445}
@@ -516,27 +516,27 @@ ec_recv(struct ec_softc *sc, int intbit) @@ -516,27 +516,27 @@ ec_recv(struct ec_softc *sc, int intbit)
516 } 516 }
517 } 517 }
518 break; 518 break;
519 } 519 }
520 520
521 if (total_length == 0) { 521 if (total_length == 0) {
522 /* Pass the packet up. */ 522 /* Pass the packet up. */
523 if_percpuq_enqueue(ifp->if_percpuq, m0); 523 if_percpuq_enqueue(ifp->if_percpuq, m0);
524 524
525 } else { 525 } else {
526 /* Something went wrong. */ 526 /* Something went wrong. */
527 if (m0 != NULL) 527 if (m0 != NULL)
528 m_freem(m0); 528 m_freem(m0);
529 ifp->if_ierrors++; 529 if_statinc(ifp, if_ierrors);
530 } 530 }
531 531
532 /* Give the receive buffer back to the card. */ 532 /* Give the receive buffer back to the card. */
533 buf = EC_CSR_INT_BUF(intbit); 533 buf = EC_CSR_INT_BUF(intbit);
534 bus_space_write_2(sc->sc_iot, sc->sc_ioh, buf, 0); 534 bus_space_write_2(sc->sc_iot, sc->sc_ioh, buf, 0);
535 ECREG_CSR_WR((ECREG_CSR_RD & EC_CSR_INTPA) | 535 ECREG_CSR_WR((ECREG_CSR_RD & EC_CSR_INTPA) |
536 EC_CSR_INT_BSW(intbit) | intbit); 536 EC_CSR_INT_BSW(intbit) | intbit);
537} 537}
538 538
539int 539int
540ec_mediachange(struct ifnet *ifp) 540ec_mediachange(struct ifnet *ifp)
541{ 541{
542 542
@@ -619,27 +619,27 @@ ec_ioctl(struct ifnet *ifp, u_long cmd,  @@ -619,27 +619,27 @@ ec_ioctl(struct ifnet *ifp, u_long cmd,
619 return error; 619 return error;
620} 620}
621 621
622/* 622/*
623 * Collision routine. 623 * Collision routine.
624 */ 624 */
625void 625void
626ec_coll(struct ec_softc *sc) 626ec_coll(struct ec_softc *sc)
627{ 627{
628 struct ifnet *ifp = &sc->sc_ethercom.ec_if; 628 struct ifnet *ifp = &sc->sc_ethercom.ec_if;
629 u_short jams; 629 u_short jams;
630 630
631 if ((++sc->sc_colliding) >= EC_COLLISIONS_JAMMED) { 631 if ((++sc->sc_colliding) >= EC_COLLISIONS_JAMMED) {
632 sc->sc_ethercom.ec_if.if_oerrors++; 632 if_statinc(ifp, if_oerrors);
633 if (!sc->sc_jammed) 633 if (!sc->sc_jammed)
634 printf("%s: ethernet jammed\n", 634 printf("%s: ethernet jammed\n",
635 device_xname(sc->sc_dev)); 635 device_xname(sc->sc_dev));
636 sc->sc_jammed = 1; 636 sc->sc_jammed = 1;
637 sc->sc_colliding = 0; 637 sc->sc_colliding = 0;
638 ifp->if_flags &= ~IFF_OACTIVE; 638 ifp->if_flags &= ~IFF_OACTIVE;
639 if_schedule_deferred_start(ifp); 639 if_schedule_deferred_start(ifp);
640 } else { 640 } else {
641 jams = MAX(sc->sc_colliding, EC_BACKOFF_PRNG_COLL_MAX); 641 jams = MAX(sc->sc_colliding, EC_BACKOFF_PRNG_COLL_MAX);
642 sc->sc_backoff_seed = 642 sc->sc_backoff_seed =
643 ((sc->sc_backoff_seed * EC_BACKOFF_PRNG_MUL) + 643 ((sc->sc_backoff_seed * EC_BACKOFF_PRNG_MUL) +
644 EC_BACKOFF_PRNG_ADD) & EC_BACKOFF_PRNG_MASK; 644 EC_BACKOFF_PRNG_ADD) & EC_BACKOFF_PRNG_MASK;
645 bus_space_write_2(sc->sc_iot, sc->sc_ioh, ECREG_BACKOFF, 645 bus_space_write_2(sc->sc_iot, sc->sc_ioh, ECREG_BACKOFF,
@@ -648,17 +648,17 @@ ec_coll(struct ec_softc *sc) @@ -648,17 +648,17 @@ ec_coll(struct ec_softc *sc)
648 EC_CSR_JAM | EC_CSR_TINT | EC_CSR_JINT); 648 EC_CSR_JAM | EC_CSR_TINT | EC_CSR_JINT);
649 } 649 }
650} 650}
651 651
652/* 652/*
653 * Device timeout routine. 653 * Device timeout routine.
654 */ 654 */
655void 655void
656ec_watchdog(struct ifnet *ifp) 656ec_watchdog(struct ifnet *ifp)
657{ 657{
658 struct ec_softc *sc = ifp->if_softc; 658 struct ec_softc *sc = ifp->if_softc;
659 659
660 log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev)); 660 log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev));
661 sc->sc_ethercom.ec_if.if_oerrors++; 661 if_statinc(ifp, if_oerrors);
662 662
663 ec_reset(ifp); 663 ec_reset(ifp);
664} 664}

cvs diff -r1.70 -r1.71 src/sys/arch/sun3/dev/if_ie.c (expand / switch to unified diff)

--- src/sys/arch/sun3/dev/if_ie.c 2019/05/28 07:41:48 1.70
+++ src/sys/arch/sun3/dev/if_ie.c 2020/01/29 05:39:48 1.71
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_ie.c,v 1.70 2019/05/28 07:41:48 msaitoh Exp $ */ 1/* $NetBSD: if_ie.c,v 1.71 2020/01/29 05:39:48 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. 4 * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
5 * Copyright (c) 1992, 1993, University of Vermont and State 5 * Copyright (c) 1992, 1993, University of Vermont and State
6 * Agricultural College. 6 * Agricultural College.
7 * Copyright (c) 1992, 1993, Garrett A. Wollman. 7 * Copyright (c) 1992, 1993, Garrett A. Wollman.
8 * 8 *
9 * Portions: 9 * Portions:
10 * Copyright (c) 1994, 1995, Rafal K. Boni 10 * Copyright (c) 1994, 1995, Rafal K. Boni
11 * Copyright (c) 1990, 1991, William F. Jolitz 11 * Copyright (c) 1990, 1991, William F. Jolitz
12 * Copyright (c) 1990, The Regents of the University of California 12 * Copyright (c) 1990, The Regents of the University of California
13 * 13 *
14 * All rights reserved. 14 * All rights reserved.
@@ -88,27 +88,27 @@ @@ -88,27 +88,27 @@
88 buffer rather than being split off into various fields in the RFD. 88 buffer rather than being split off into various fields in the RFD.
89 This also means that we must include this header in the transmit 89 This also means that we must include this header in the transmit
90 buffer as well. 90 buffer as well.
91 91
92 By convention, all transmit commands, and only transmit commands, 92 By convention, all transmit commands, and only transmit commands,
93 shall have the I (IE_CMD_INTR) bit set in the command. This way, 93 shall have the I (IE_CMD_INTR) bit set in the command. This way,
94 when an interrupt arrives at ieintr(), it is immediately possible 94 when an interrupt arrives at ieintr(), it is immediately possible
95 to tell what precisely caused it. ANY OTHER command-sending 95 to tell what precisely caused it. ANY OTHER command-sending
96 routines should run at splnet(), and should post an acknowledgement 96 routines should run at splnet(), and should post an acknowledgement
97 to every interrupt they generate. 97 to every interrupt they generate.
98*/ 98*/
99 99
100#include <sys/cdefs.h> 100#include <sys/cdefs.h>
101__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.70 2019/05/28 07:41:48 msaitoh Exp $"); 101__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.71 2020/01/29 05:39:48 thorpej Exp $");
102 102
103#include "opt_inet.h" 103#include "opt_inet.h"
104#include "opt_ns.h" 104#include "opt_ns.h"
105 105
106#include <sys/param.h> 106#include <sys/param.h>
107#include <sys/systm.h> 107#include <sys/systm.h>
108#include <sys/mbuf.h> 108#include <sys/mbuf.h>
109#include <sys/buf.h> 109#include <sys/buf.h>
110#include <sys/protosw.h> 110#include <sys/protosw.h>
111#include <sys/socket.h> 111#include <sys/socket.h>
112#include <sys/ioctl.h> 112#include <sys/ioctl.h>
113#include <sys/errno.h> 113#include <sys/errno.h>
114#include <sys/syslog.h> 114#include <sys/syslog.h>
@@ -422,27 +422,27 @@ ie_setupram(struct ie_softc *sc) @@ -422,27 +422,27 @@ ie_setupram(struct ie_softc *sc)
422 return 1; 422 return 1;
423} 423}
424 424
425/* 425/*
426 * Device timeout/watchdog routine. Entered if the device neglects to 426 * Device timeout/watchdog routine. Entered if the device neglects to
427 * generate an interrupt after a transmit has been started on it. 427 * generate an interrupt after a transmit has been started on it.
428 */ 428 */
429static void 429static void
430iewatchdog(struct ifnet *ifp) 430iewatchdog(struct ifnet *ifp)
431{ 431{
432 struct ie_softc *sc = ifp->if_softc; 432 struct ie_softc *sc = ifp->if_softc;
433 433
434 log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev)); 434 log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev));
435 ++ifp->if_oerrors; 435 if_statinc(ifp, if_oerrors);
436 iereset(sc); 436 iereset(sc);
437} 437}
438 438
439/* 439/*
440 * What to do upon receipt of an interrupt. 440 * What to do upon receipt of an interrupt.
441 */ 441 */
442int 442int
443ie_intr(void *arg) 443ie_intr(void *arg)
444{ 444{
445 struct ie_softc *sc = arg; 445 struct ie_softc *sc = arg;
446 uint16_t status; 446 uint16_t status;
447 int loopcnt; 447 int loopcnt;
448 448
@@ -494,27 +494,27 @@ ie_intr(void *arg) @@ -494,27 +494,27 @@ ie_intr(void *arg)
494#endif 494#endif
495 } 495 }
496 496
497 /* 497 /*
498 * Receiver not ready (RNR) just means it has 498 * Receiver not ready (RNR) just means it has
499 * run out of resources (buffers or frames). 499 * run out of resources (buffers or frames).
500 * One can easily cause this with (i.e.) spray. 500 * One can easily cause this with (i.e.) spray.
501 * This is not a serious error, so be silent. 501 * This is not a serious error, so be silent.
502 */ 502 */
503 if (status & IE_ST_RNR) { 503 if (status & IE_ST_RNR) {
504#ifdef IEDEBUG 504#ifdef IEDEBUG
505 printf("%s: receiver not ready\n", device_xname(sc->sc_dev)); 505 printf("%s: receiver not ready\n", device_xname(sc->sc_dev));
506#endif 506#endif
507 sc->sc_if.if_ierrors++; 507 if_statinc(&sc->sc_if, if_ierrors);
508 iereset(sc); 508 iereset(sc);
509 } 509 }
510 510
511#ifdef IEDEBUG 511#ifdef IEDEBUG
512 if ((status & IE_ST_ALLDONE) && (sc->sc_debug & IED_CNA)) 512 if ((status & IE_ST_ALLDONE) && (sc->sc_debug & IED_CNA))
513 printf("%s: cna\n", device_xname(sc->sc_dev)); 513 printf("%s: cna\n", device_xname(sc->sc_dev));
514#endif 514#endif
515 515
516 status = sc->scb->ie_status; 516 status = sc->scb->ie_status;
517 if (status & IE_ST_WHENCE) { 517 if (status & IE_ST_WHENCE) {
518 /* It still wants service... */ 518 /* It still wants service... */
519 if (--loopcnt > 0) 519 if (--loopcnt > 0)
520 goto loop; 520 goto loop;
@@ -532,31 +532,31 @@ ie_intr(void *arg) @@ -532,31 +532,31 @@ ie_intr(void *arg)
532void 532void
533ierint(struct ie_softc *sc) 533ierint(struct ie_softc *sc)
534{ 534{
535 volatile struct ie_sys_ctl_block *scb = sc->scb; 535 volatile struct ie_sys_ctl_block *scb = sc->scb;
536 int i, status; 536 int i, status;
537 static int timesthru = 1024; 537 static int timesthru = 1024;
538 538
539 i = sc->rfhead; 539 i = sc->rfhead;
540 for (;;) { 540 for (;;) {
541 status = sc->rframes[i]->ie_fd_status; 541 status = sc->rframes[i]->ie_fd_status;
542 542
543 if ((status & IE_FD_COMPLETE) && (status & IE_FD_OK)) { 543 if ((status & IE_FD_COMPLETE) && (status & IE_FD_OK)) {
544 if (!--timesthru) { 544 if (!--timesthru) {
545 sc->sc_if.if_ierrors += 545 if_statadd(&sc->sc_if, if_ierrors,
546 SWAP(scb->ie_err_crc) + 546 SWAP(scb->ie_err_crc) +
547 SWAP(scb->ie_err_align) + 547 SWAP(scb->ie_err_align) +
548 SWAP(scb->ie_err_resource) + 548 SWAP(scb->ie_err_resource) +
549 SWAP(scb->ie_err_overrun); 549 SWAP(scb->ie_err_overrun));
550 scb->ie_err_crc = 0; 550 scb->ie_err_crc = 0;
551 scb->ie_err_align = 0; 551 scb->ie_err_align = 0;
552 scb->ie_err_resource = 0; 552 scb->ie_err_resource = 0;
553 scb->ie_err_overrun = 0; 553 scb->ie_err_overrun = 0;
554 timesthru = 1024; 554 timesthru = 1024;
555 } 555 }
556 ie_readframe(sc, i); 556 ie_readframe(sc, i);
557 } else { 557 } else {
558 if ((status & IE_FD_RNR) != 0 && 558 if ((status & IE_FD_RNR) != 0 &&
559 (scb->ie_status & IE_RU_READY) == 0) { 559 (scb->ie_status & IE_RU_READY) == 0) {
560 sc->rframes[0]->ie_fd_buf_desc = vtop16sw(sc, 560 sc->rframes[0]->ie_fd_buf_desc = vtop16sw(sc,
561 __UNVOLATILE(sc->rbuffs[0])); 561 __UNVOLATILE(sc->rbuffs[0]));
562 scb->ie_recv_list = vtop16sw(sc, 562 scb->ie_recv_list = vtop16sw(sc,
@@ -581,49 +581,49 @@ ietint(struct ie_softc *sc) @@ -581,49 +581,49 @@ ietint(struct ie_softc *sc)
581 int status; 581 int status;
582 582
583 ifp = &sc->sc_if; 583 ifp = &sc->sc_if;
584 584
585 ifp->if_timer = 0; 585 ifp->if_timer = 0;
586 ifp->if_flags &= ~IFF_OACTIVE; 586 ifp->if_flags &= ~IFF_OACTIVE;
587 587
588 status = sc->xmit_cmds[sc->xctail]->ie_xmit_status; 588 status = sc->xmit_cmds[sc->xctail]->ie_xmit_status;
589 589
590 if (!(status & IE_STAT_COMPL) || (status & IE_STAT_BUSY)) 590 if (!(status & IE_STAT_COMPL) || (status & IE_STAT_BUSY))
591 printf("%s: command still busy!\n", __func__); 591 printf("%s: command still busy!\n", __func__);
592 592
593 if (status & IE_STAT_OK) { 593 if (status & IE_STAT_OK) {
594 ifp->if_opackets++; 594 if_statadd2(ifp, if_opackets, 1,
595 ifp->if_collisions += SWAP(status & IE_XS_MAXCOLL); 595 if_collisions, SWAP(status & IE_XS_MAXCOLL));
596 } else { 596 } else {
597 ifp->if_oerrors++; 597 if_statinc(ifp, if_oerrors);
598 /* 598 /*
599 * XXX 599 * XXX
600 * Check SQE and DEFERRED? 600 * Check SQE and DEFERRED?
601 * What if more than one bit is set? 601 * What if more than one bit is set?
602 */ 602 */
603 if (status & IE_STAT_ABORT) 603 if (status & IE_STAT_ABORT)
604 printf("%s: send aborted\n", device_xname(sc->sc_dev)); 604 printf("%s: send aborted\n", device_xname(sc->sc_dev));
605 if (status & IE_XS_LATECOLL) 605 if (status & IE_XS_LATECOLL)
606 printf("%s: late collision\n", 606 printf("%s: late collision\n",
607 device_xname(sc->sc_dev)); 607 device_xname(sc->sc_dev));
608 if (status & IE_XS_NOCARRIER) 608 if (status & IE_XS_NOCARRIER)
609 printf("%s: no carrier\n", device_xname(sc->sc_dev)); 609 printf("%s: no carrier\n", device_xname(sc->sc_dev));
610 if (status & IE_XS_LOSTCTS) 610 if (status & IE_XS_LOSTCTS)
611 printf("%s: lost CTS\n", device_xname(sc->sc_dev)); 611 printf("%s: lost CTS\n", device_xname(sc->sc_dev));
612 if (status & IE_XS_UNDERRUN) 612 if (status & IE_XS_UNDERRUN)
613 printf("%s: DMA underrun\n", device_xname(sc->sc_dev)); 613 printf("%s: DMA underrun\n", device_xname(sc->sc_dev));
614 if (status & IE_XS_EXCMAX) { 614 if (status & IE_XS_EXCMAX) {
615 /* Do not print this one (too noisy). */ 615 /* Do not print this one (too noisy). */
616 ifp->if_collisions += 16; 616 if_statadd(ifp, if_collisions, 16);
617 } 617 }
618 } 618 }
619 619
620 /* 620 /*
621 * If multicast addresses were added or deleted while we 621 * If multicast addresses were added or deleted while we
622 * were transmitting, mc_reset() set the want_mcsetup flag 622 * were transmitting, mc_reset() set the want_mcsetup flag
623 * indicating that we should do it. 623 * indicating that we should do it.
624 */ 624 */
625 if (sc->want_mcsetup) { 625 if (sc->want_mcsetup) {
626 mc_setup(sc, (void *)sc->xmit_cbuffs[sc->xctail]); 626 mc_setup(sc, (void *)sc->xmit_cbuffs[sc->xctail]);
627 sc->want_mcsetup = 0; 627 sc->want_mcsetup = 0;
628 } 628 }
629 629
@@ -886,27 +886,27 @@ ie_readframe(struct ie_softc *sc, int nu @@ -886,27 +886,27 @@ ie_readframe(struct ie_softc *sc, int nu
886 886
887 /* Advance the RFD list, since we're done with this descriptor. */ 887 /* Advance the RFD list, since we're done with this descriptor. */
888 sc->rframes[num]->ie_fd_status = SWAP(0); 888 sc->rframes[num]->ie_fd_status = SWAP(0);
889 sc->rframes[num]->ie_fd_last |= IE_FD_LAST; 889 sc->rframes[num]->ie_fd_last |= IE_FD_LAST;
890 sc->rframes[sc->rftail]->ie_fd_last &= ~IE_FD_LAST; 890 sc->rframes[sc->rftail]->ie_fd_last &= ~IE_FD_LAST;
891 sc->rftail = (sc->rftail + 1) % sc->nframes; 891 sc->rftail = (sc->rftail + 1) % sc->nframes;
892 sc->rfhead = (sc->rfhead + 1) % sc->nframes; 892 sc->rfhead = (sc->rfhead + 1) % sc->nframes;
893 893
894 if (status & IE_FD_OK) { 894 if (status & IE_FD_OK) {
895 m = ieget(sc); 895 m = ieget(sc);
896 ie_drop_packet_buffer(sc); 896 ie_drop_packet_buffer(sc);
897 } 897 }
898 if (m == 0) { 898 if (m == 0) {
899 sc->sc_if.if_ierrors++; 899 if_statinc(&sc->sc_if, if_ierrors);
900 return; 900 return;
901 } 901 }
902 902
903#ifdef IEDEBUG 903#ifdef IEDEBUG
904 if (sc->sc_debug & IED_READFRAME) { 904 if (sc->sc_debug & IED_READFRAME) {
905 struct ether_header *eh = mtod(m, struct ether_header *); 905 struct ether_header *eh = mtod(m, struct ether_header *);
906 906
907 printf("%s: frame from ether %s type 0x%x\n", 907 printf("%s: frame from ether %s type 0x%x\n",
908 device_xname(sc->sc_dev), 908 device_xname(sc->sc_dev),
909 ether_sprintf(eh->ether_shost), (u_int)eh->ether_type); 909 ether_sprintf(eh->ether_shost), (u_int)eh->ether_type);
910 } 910 }
911#endif 911#endif
912 912