Deleted Added
full compact
smc90cx6.c (257176) smc90cx6.c (271849)
1/* $NetBSD: smc90cx6.c,v 1.38 2001/07/07 15:57:53 thorpej Exp $ */
2
3#include <sys/cdefs.h>
1/* $NetBSD: smc90cx6.c,v 1.38 2001/07/07 15:57:53 thorpej Exp $ */
2
3#include <sys/cdefs.h>
4__FBSDID("$FreeBSD: head/sys/dev/cm/smc90cx6.c 257176 2013-10-26 17:58:36Z glebius $");
4__FBSDID("$FreeBSD: head/sys/dev/cm/smc90cx6.c 271849 2014-09-19 03:51:26Z glebius $");
5
6/*-
7 * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
8 * All rights reserved.
9 *
10 * This code is derived from software contributed to The NetBSD Foundation
11 * by Ignatios Souvatzis.
12 *

--- 494 unchanged lines hidden (view full) ---

507
508 if (m == 0) {
509 /*
510 * in case s.th. goes wrong with mem, drop it
511 * to make sure the receiver can be started again
512 * count it as input error (we dont have any other
513 * detectable)
514 */
5
6/*-
7 * Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
8 * All rights reserved.
9 *
10 * This code is derived from software contributed to The NetBSD Foundation
11 * by Ignatios Souvatzis.
12 *

--- 494 unchanged lines hidden (view full) ---

507
508 if (m == 0) {
509 /*
510 * in case s.th. goes wrong with mem, drop it
511 * to make sure the receiver can be started again
512 * count it as input error (we dont have any other
513 * detectable)
514 */
515 ifp->if_ierrors++;
515 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
516 goto cleanup;
517 }
518
519 m->m_pkthdr.rcvif = ifp;
520
521 /*
522 * Align so that IP packet will be longword aligned. Here we
523 * assume that m_data of new packet is longword aligned.

--- 15 unchanged lines hidden (view full) ---

539 * second +2 bytes are for src/dst addresses
540 */
541 if ((len + 2 + 2) > MHLEN) {
542 /* attach an mbuf cluster */
543 MCLGET(m, M_NOWAIT);
544
545 /* Insist on getting a cluster */
546 if ((m->m_flags & M_EXT) == 0) {
516 goto cleanup;
517 }
518
519 m->m_pkthdr.rcvif = ifp;
520
521 /*
522 * Align so that IP packet will be longword aligned. Here we
523 * assume that m_data of new packet is longword aligned.

--- 15 unchanged lines hidden (view full) ---

539 * second +2 bytes are for src/dst addresses
540 */
541 if ((len + 2 + 2) > MHLEN) {
542 /* attach an mbuf cluster */
543 MCLGET(m, M_NOWAIT);
544
545 /* Insist on getting a cluster */
546 if ((m->m_flags & M_EXT) == 0) {
547 ifp->if_ierrors++;
547 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
548 goto cleanup;
549 }
550 }
551
552 if (m == 0) {
548 goto cleanup;
549 }
550 }
551
552 if (m == 0) {
553 ifp->if_ierrors++;
553 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
554 goto cleanup;
555 }
556
557 type = GETMEM(cm_ram_ptr + offset);
558 m->m_data += 1 + arc_isphds(type);
559 /* mbuf filled with ARCnet addresses */
560 m->m_pkthdr.len = m->m_len = len + 2;
561

--- 5 unchanged lines hidden (view full) ---

567 rman_get_bustag(sc->mem_res), rman_get_bushandle(sc->mem_res),
568 cm_ram_ptr + offset, mtod(m, u_char *) + 2, len);
569
570 CM_UNLOCK(sc);
571 arc_input(ifp, m);
572 CM_LOCK(sc);
573
574 m = NULL;
554 goto cleanup;
555 }
556
557 type = GETMEM(cm_ram_ptr + offset);
558 m->m_data += 1 + arc_isphds(type);
559 /* mbuf filled with ARCnet addresses */
560 m->m_pkthdr.len = m->m_len = len + 2;
561

--- 5 unchanged lines hidden (view full) ---

567 rman_get_bustag(sc->mem_res), rman_get_bushandle(sc->mem_res),
568 cm_ram_ptr + offset, mtod(m, u_char *) + 2, len);
569
570 CM_UNLOCK(sc);
571 arc_input(ifp, m);
572 CM_LOCK(sc);
573
574 m = NULL;
575 ifp->if_ipackets++;
575 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
576
577cleanup:
578
579 if (m != NULL)
580 m_freem(m);
581
582 /* mark buffer as invalid by source id 0 */
583 PUTMEM(buffer << 9, 0);

--- 31 unchanged lines hidden (view full) ---

615 /*
616 * retransmit code:
617 * Normal situtations first for fast path:
618 * If acknowledgement received ok or broadcast, we're ok.
619 * else if
620 */
621
622 if (isr & CM_TMA || sc->sc_broadcast[buffer])
576
577cleanup:
578
579 if (m != NULL)
580 m_freem(m);
581
582 /* mark buffer as invalid by source id 0 */
583 PUTMEM(buffer << 9, 0);

--- 31 unchanged lines hidden (view full) ---

615 /*
616 * retransmit code:
617 * Normal situtations first for fast path:
618 * If acknowledgement received ok or broadcast, we're ok.
619 * else if
620 */
621
622 if (isr & CM_TMA || sc->sc_broadcast[buffer])
623 ifp->if_opackets++;
623 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
624#ifdef CMRETRANSMIT
625 else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0
626 && --sc->sc_retransmits[buffer] > 0) {
627 /* retransmit same buffer */
628 PUTREG(CMCMD, CM_TX(buffer));
629 return;
630 }
631#endif
632 else
624#ifdef CMRETRANSMIT
625 else if (ifp->if_flags & IFF_LINK2 && sc->sc_timer > 0
626 && --sc->sc_retransmits[buffer] > 0) {
627 /* retransmit same buffer */
628 PUTREG(CMCMD, CM_TX(buffer));
629 return;
630 }
631#endif
632 else
633 ifp->if_oerrors++;
633 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
634
635
636 /* We know we can accept another buffer at this point. */
637 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
638
639 if (--sc->sc_tx_fillcount > 0) {
640
641 /*

--- 83 unchanged lines hidden (view full) ---

725 }
726
727 if (maskedisr & CM_RECON) {
728 /*
729 * we dont need to:
730 * PUTREG(CMCMD, CM_CONF(CONF_LONG));
731 */
732 PUTREG(CMCMD, CM_CLR(CLR_RECONFIG));
634
635
636 /* We know we can accept another buffer at this point. */
637 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
638
639 if (--sc->sc_tx_fillcount > 0) {
640
641 /*

--- 83 unchanged lines hidden (view full) ---

725 }
726
727 if (maskedisr & CM_RECON) {
728 /*
729 * we dont need to:
730 * PUTREG(CMCMD, CM_CONF(CONF_LONG));
731 */
732 PUTREG(CMCMD, CM_CLR(CLR_RECONFIG));
733 ifp->if_collisions++;
733 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
734
735 /*
736 * If less than 2 seconds per reconfig:
737 * If ARC_EXCESSIVE_RECONFIGS
738 * since last burst, complain and set treshold for
739 * warnings to ARC_EXCESSIVE_RECONS_REWARN.
740 *
741 * This allows for, e.g., new stations on the cable, or

--- 186 unchanged lines hidden ---
734
735 /*
736 * If less than 2 seconds per reconfig:
737 * If ARC_EXCESSIVE_RECONFIGS
738 * since last burst, complain and set treshold for
739 * warnings to ARC_EXCESSIVE_RECONS_REWARN.
740 *
741 * This allows for, e.g., new stations on the cable, or

--- 186 unchanged lines hidden ---