Fri Jan 22 06:34:59 2016 UTC ()
Don't call atm_input directly

This should be the last one that was survived ifp->if_input replacements.

No functional change.


(ozaki-r)
diff -r1.94 -r1.95 src/sys/dev/ic/midway.c

cvs diff -r1.94 -r1.95 src/sys/dev/ic/Attic/midway.c (expand / switch to unified diff)

--- src/sys/dev/ic/Attic/midway.c 2012/03/13 18:40:31 1.94
+++ src/sys/dev/ic/Attic/midway.c 2016/01/22 06:34:59 1.95
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: midway.c,v 1.94 2012/03/13 18:40:31 elad Exp $ */ 1/* $NetBSD: midway.c,v 1.95 2016/01/22 06:34:59 ozaki-r Exp $ */
2/* (sync'd to midway.c 1.68) */ 2/* (sync'd to midway.c 1.68) */
3 3
4/* 4/*
5 * Copyright (c) 1996 Charles D. Cranor and Washington University. 5 * Copyright (c) 1996 Charles D. Cranor and Washington University.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * - support pvc sub interface 51 * - support pvc sub interface
52 * 52 *
53 * initial work on per-pvc-interface for ipv6 was done 53 * initial work on per-pvc-interface for ipv6 was done
54 * by Katsushi Kobayashi <ikob@cc.uec.ac.jp> of the WIDE Project. 54 * by Katsushi Kobayashi <ikob@cc.uec.ac.jp> of the WIDE Project.
55 * some of the extensions for pvc subinterfaces are merged from 55 * some of the extensions for pvc subinterfaces are merged from
56 * the CAIRN project written by Suresh Bhogavilli (suresh@isi.edu). 56 * the CAIRN project written by Suresh Bhogavilli (suresh@isi.edu).
57 * 57 *
58 * code cleanup: 58 * code cleanup:
59 * - remove WMAYBE related code. ENI WMAYBE DMA doesn't work. 59 * - remove WMAYBE related code. ENI WMAYBE DMA doesn't work.
60 * - remove updating if_lastchange for every packet. 60 * - remove updating if_lastchange for every packet.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.94 2012/03/13 18:40:31 elad Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.95 2016/01/22 06:34:59 ozaki-r Exp $");
65 65
66#include "opt_natm.h" 66#include "opt_natm.h"
67 67
68#undef EN_DEBUG 68#undef EN_DEBUG
69#undef EN_DEBUG_RANGE /* check ranges on en_read/en_write's? */ 69#undef EN_DEBUG_RANGE /* check ranges on en_read/en_write's? */
70#define EN_MBUF_OPT /* try and put more stuff in mbuf? */ 70#define EN_MBUF_OPT /* try and put more stuff in mbuf? */
71#define EN_DIAG 71#define EN_DIAG
72#define EN_STAT 72#define EN_STAT
73#ifndef EN_DMA 73#ifndef EN_DMA
74#define EN_DMA 1 /* use DMA? */ 74#define EN_DMA 1 /* use DMA? */
75#endif 75#endif
76#define EN_NOTXDMA 0 /* hook to disable tx DMA only */ 76#define EN_NOTXDMA 0 /* hook to disable tx DMA only */
77#define EN_NORXDMA 0 /* hook to disable rx DMA only */ 77#define EN_NORXDMA 0 /* hook to disable rx DMA only */
@@ -2758,27 +2758,27 @@ EN_INTR_TYPE en_intr(void *arg) @@ -2758,27 +2758,27 @@ EN_INTR_TYPE en_intr(void *arg)
2758 2758
2759#ifdef ATM_PVCEXT 2759#ifdef ATM_PVCEXT
2760 /* if there's a subinterface for this vci, override ifp. */ 2760 /* if there's a subinterface for this vci, override ifp. */
2761 ifp = en_vci2ifp(sc, sc->rxslot[slot].atm_vci); 2761 ifp = en_vci2ifp(sc, sc->rxslot[slot].atm_vci);
2762 ifp->if_ipackets++; 2762 ifp->if_ipackets++;
2763 m->m_pkthdr.rcvif = ifp; /* XXX */ 2763 m->m_pkthdr.rcvif = ifp; /* XXX */
2764#else 2764#else
2765 ifp = &sc->enif; 2765 ifp = &sc->enif;
2766 ifp->if_ipackets++; 2766 ifp->if_ipackets++;
2767#endif 2767#endif
2768 2768
2769 bpf_mtap(ifp, m); 2769 bpf_mtap(ifp, m);
2770 2770
2771 atm_input(ifp, &ah, m, sc->rxslot[slot].rxhand); 2771 ifp->if_input(ifp, &ah, m, sc->rxslot[slot].rxhand);
2772 } 2772 }
2773 2773
2774 } 2774 }
2775 EN_WRAPADD(0, MID_DRQ_N, idx, 1); 2775 EN_WRAPADD(0, MID_DRQ_N, idx, 1);
2776 }; 2776 };
2777 sc->drq_chip = MID_DRQ_REG2A(val); /* sync softc */ 2777 sc->drq_chip = MID_DRQ_REG2A(val); /* sync softc */
2778 2778
2779 if (sc->need_drqs) { /* true if we had a DRQ shortage */ 2779 if (sc->need_drqs) { /* true if we had a DRQ shortage */
2780 need_softserv = 1; 2780 need_softserv = 1;
2781 sc->need_drqs = 0; 2781 sc->need_drqs = 0;
2782#ifdef EN_DEBUG 2782#ifdef EN_DEBUG
2783 printf("%s: cleared need DRQ condition\n", device_xname(sc->sc_dev)); 2783 printf("%s: cleared need DRQ condition\n", device_xname(sc->sc_dev));
2784#endif 2784#endif