Deleted Added
full compact
if_de.c (102412) if_de.c (106936)
1/* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */
2
1/* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */
2
3/* $FreeBSD: head/sys/dev/de/if_de.c 102412 2002-08-25 13:23:09Z charnier $ */
3/* $FreeBSD: head/sys/dev/de/if_de.c 106936 2002-11-14 23:49:09Z sam $ */
4
5/*-
6 * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:

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

3562 if (accept
3563#if defined(TULIP_COPY_RXDATA)
3564 && m0 != NULL
3565#endif
3566 ) {
3567#if !defined(TULIP_COPY_RXDATA)
3568 ms->m_pkthdr.len = total_len;
3569 ms->m_pkthdr.rcvif = ifp;
4
5/*-
6 * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:

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

3562 if (accept
3563#if defined(TULIP_COPY_RXDATA)
3564 && m0 != NULL
3565#endif
3566 ) {
3567#if !defined(TULIP_COPY_RXDATA)
3568 ms->m_pkthdr.len = total_len;
3569 ms->m_pkthdr.rcvif = ifp;
3570 m_adj(ms, sizeof(struct ether_header));
3571 ether_input(ifp, &eh, ms);
3570 (*ifp->if_input)(ifp, ms);
3572#else
3573#ifdef BIG_PACKET
3574#error BIG_PACKET is incompatible with TULIP_COPY_RXDATA
3575#endif
3576 m0->m_data += 2; /* align data after header */
3577 m_copydata(ms, 0, total_len, mtod(m0, caddr_t));
3578 m0->m_len = m0->m_pkthdr.len = total_len;
3579 m0->m_pkthdr.rcvif = ifp;
3571#else
3572#ifdef BIG_PACKET
3573#error BIG_PACKET is incompatible with TULIP_COPY_RXDATA
3574#endif
3575 m0->m_data += 2; /* align data after header */
3576 m_copydata(ms, 0, total_len, mtod(m0, caddr_t));
3577 m0->m_len = m0->m_pkthdr.len = total_len;
3578 m0->m_pkthdr.rcvif = ifp;
3580 m_adj(m0, sizeof(struct ether_header));
3581 ether_input(ifp, &eh, m0);
3579 (*ifp->if_input)(ifp, m0);
3582 m0 = ms;
3583#endif /* ! TULIP_COPY_RXDATA */
3584 }
3585 ms = m0;
3586 }
3587 if (ms == NULL) {
3588 /*
3589 * Couldn't allocate a new buffer. Don't bother

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

4329 clsize = PAGE_SIZE;
4330 }
4331 } while ((m0 = m0->m_next) != NULL);
4332#endif /* TULIP_BUS_DMA */
4333
4334 /*
4335 * bounce a copy to the bpf listener, if any.
4336 */
3580 m0 = ms;
3581#endif /* ! TULIP_COPY_RXDATA */
3582 }
3583 ms = m0;
3584 }
3585 if (ms == NULL) {
3586 /*
3587 * Couldn't allocate a new buffer. Don't bother

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

4327 clsize = PAGE_SIZE;
4328 }
4329 } while ((m0 = m0->m_next) != NULL);
4330#endif /* TULIP_BUS_DMA */
4331
4332 /*
4333 * bounce a copy to the bpf listener, if any.
4334 */
4337 if (sc->tulip_if.if_bpf != NULL)
4338 bpf_mtap(&sc->tulip_if, m);
4335 BPF_MTAP(&sc->tulip_if, m);
4339
4340 /*
4341 * The descriptors have been filled in. Now get ready
4342 * to transmit.
4343 */
4344 _IF_ENQUEUE(&sc->tulip_txq, m);
4345 m = NULL;
4346

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

4553 int error = 0;
4554
4555#if defined(TULIP_USE_SOFTINTR)
4556 s = splnet();
4557#else
4558 s = splimp();
4559#endif
4560 switch (cmd) {
4336
4337 /*
4338 * The descriptors have been filled in. Now get ready
4339 * to transmit.
4340 */
4341 _IF_ENQUEUE(&sc->tulip_txq, m);
4342 m = NULL;
4343

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

4550 int error = 0;
4551
4552#if defined(TULIP_USE_SOFTINTR)
4553 s = splnet();
4554#else
4555 s = splimp();
4556#endif
4557 switch (cmd) {
4561 case SIOCSIFADDR:
4562 case SIOCGIFADDR: {
4563 error = ether_ioctl(ifp, cmd, data);
4564 break;
4565 }
4566
4567 case SIOCSIFFLAGS: {
4568 tulip_addr_filter(sc); /* reinit multicast filter */
4569 tulip_init(sc);
4570 break;
4571 }
4572
4573 case SIOCSIFMEDIA:
4574 case SIOCGIFMEDIA: {

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

4616#endif
4617#ifdef SIOCGCHIPID
4618 case SIOCGCHIPID: {
4619 ifr->ifr_metric = (int) sc->tulip_chipid;
4620 break;
4621 }
4622#endif
4623 default: {
4558 case SIOCSIFFLAGS: {
4559 tulip_addr_filter(sc); /* reinit multicast filter */
4560 tulip_init(sc);
4561 break;
4562 }
4563
4564 case SIOCSIFMEDIA:
4565 case SIOCGIFMEDIA: {

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

4607#endif
4608#ifdef SIOCGCHIPID
4609 case SIOCGCHIPID: {
4610 ifr->ifr_metric = (int) sc->tulip_chipid;
4611 break;
4612 }
4613#endif
4614 default: {
4624 error = EINVAL;
4615 error = ether_ioctl(ifp, cmd, data);
4625 break;
4626 }
4627 }
4628
4629 splx(s);
4630 TULIP_PERFEND(ifioctl);
4631 return error;
4632}

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

4808 ifmedia_init(&sc->tulip_ifmedia, 0,
4809 tulip_ifmedia_change,
4810 tulip_ifmedia_status);
4811 sc->tulip_flags &= ~TULIP_DEVICEPROBE;
4812 tulip_ifmedia_add(sc);
4813
4814 tulip_reset(sc);
4815
4616 break;
4617 }
4618 }
4619
4620 splx(s);
4621 TULIP_PERFEND(ifioctl);
4622 return error;
4623}

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

4799 ifmedia_init(&sc->tulip_ifmedia, 0,
4800 tulip_ifmedia_change,
4801 tulip_ifmedia_status);
4802 sc->tulip_flags &= ~TULIP_DEVICEPROBE;
4803 tulip_ifmedia_add(sc);
4804
4805 tulip_reset(sc);
4806
4816 ether_ifattach(&(sc)->tulip_if, ETHER_BPF_SUPPORTED);
4807 ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
4817 ifp->if_snd.ifq_maxlen = ifqmaxlen;
4818}
4819
4820#if defined(TULIP_BUS_DMA)
4821#if !defined(TULIP_BUS_DMA_NOTX) || !defined(TULIP_BUS_DMA_NORX)
4822static int
4823tulip_busdma_allocmem(
4824 tulip_softc_t * const sc,

--- 447 unchanged lines hidden ---
4808 ifp->if_snd.ifq_maxlen = ifqmaxlen;
4809}
4810
4811#if defined(TULIP_BUS_DMA)
4812#if !defined(TULIP_BUS_DMA_NOTX) || !defined(TULIP_BUS_DMA_NORX)
4813static int
4814tulip_busdma_allocmem(
4815 tulip_softc_t * const sc,

--- 447 unchanged lines hidden ---