if_ic.c (67882) | if_ic.c (69152) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/iicbus/if_ic.c 67882 2000-10-29 13:57:19Z phk $ | 26 * $FreeBSD: head/sys/dev/iicbus/if_ic.c 69152 2000-11-25 07:35:38Z jlemon $ |
27 */ 28 29/* 30 * I2C bus IP driver 31 */ 32 33#ifdef _KERNEL 34#include <sys/param.h> --- 266 unchanged lines hidden (view full) --- 301 goto err; 302 303 if ((len = sc->ic_xfercnt) == 0) 304 break; /* ignore */ 305 306 if (len <= ICHDRLEN) 307 goto err; 308 | 27 */ 28 29/* 30 * I2C bus IP driver 31 */ 32 33#ifdef _KERNEL 34#include <sys/param.h> --- 266 unchanged lines hidden (view full) --- 301 goto err; 302 303 if ((len = sc->ic_xfercnt) == 0) 304 break; /* ignore */ 305 306 if (len <= ICHDRLEN) 307 goto err; 308 |
309 if (IF_QFULL(&ipintrq)) { 310 IF_DROP(&ipintrq); 311 break; 312 } 313 | |
314 len -= ICHDRLEN; 315 sc->ic_if.if_ipackets ++; 316 sc->ic_if.if_ibytes += len; 317 318 if (sc->ic_if.if_bpf) 319 bpf_tap(&sc->ic_if, sc->ic_ifbuf, len + ICHDRLEN); 320 321 top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, &sc->ic_if, 0); 322 323 if (top) { | 309 len -= ICHDRLEN; 310 sc->ic_if.if_ipackets ++; 311 sc->ic_if.if_ibytes += len; 312 313 if (sc->ic_if.if_bpf) 314 bpf_tap(&sc->ic_if, sc->ic_ifbuf, len + ICHDRLEN); 315 316 top = m_devget(sc->ic_ifbuf + ICHDRLEN, len, 0, &sc->ic_if, 0); 317 318 if (top) { |
324 IF_ENQUEUE(&ipintrq, top); 325 schednetisr(NETISR_IP); | 319 if (IF_HANDOFF(&ipintrq, top, NULL)) 320 schednetisr(NETISR_IP); |
326 } 327 break; 328 329 err: 330 printf("ic%d: errors (%d)!\n", unit, sc->ic_iferrs); 331 332 sc->ic_iferrs = 0; /* reset error count */ 333 sc->ic_if.if_ierrors ++; --- 122 unchanged lines hidden --- | 321 } 322 break; 323 324 err: 325 printf("ic%d: errors (%d)!\n", unit, sc->ic_iferrs); 326 327 sc->ic_iferrs = 0; /* reset error count */ 328 sc->ic_if.if_ierrors ++; --- 122 unchanged lines hidden --- |