Deleted Added
full compact
if_wl.c (46112) if_wl.c (48645)
1/* $Id: if_wl.c,v 1.20 1999/01/12 00:36:31 eivind Exp $ */
1/* $Id: if_wl.c,v 1.21 1999/04/27 11:15:02 phk Exp $ */
2/*
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions
5 * are met:
6 * 1. Redistributions of source code must retain all copyright
7 * notices, this list of conditions and the following disclaimer.
8 * 2. The names of the authors may not be used to endorse or promote products
9 * derived from this software withough specific prior written permission

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

185 * 2. In the current design, we only do one write at a time,
186 * though the hardware is capable of chaining and possibly
187 * even batching. The problem is that we only make one
188 * transmit buffer available in sram space.
189 */
190
191#include "wl.h"
192#include "opt_wavelan.h"
2/*
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions
5 * are met:
6 * 1. Redistributions of source code must retain all copyright
7 * notices, this list of conditions and the following disclaimer.
8 * 2. The names of the authors may not be used to endorse or promote products
9 * derived from this software withough specific prior written permission

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

185 * 2. In the current design, we only do one write at a time,
186 * though the hardware is capable of chaining and possibly
187 * even batching. The problem is that we only make one
188 * transmit buffer available in sram space.
189 */
190
191#include "wl.h"
192#include "opt_wavelan.h"
193#include "bpfilter.h"
193#include "bpf.h"
194#include "opt_inet.h"
195
196#include <sys/param.h>
197#include <sys/systm.h>
198#include <sys/sockio.h>
199#include <sys/mbuf.h>
200#include <sys/socket.h>
201#include <sys/syslog.h>

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

209
210#ifdef INET
211#include <netinet/in.h>
212#include <netinet/in_systm.h>
213#include <netinet/ip.h>
214#include <netinet/if_ether.h>
215#endif
216
194#include "opt_inet.h"
195
196#include <sys/param.h>
197#include <sys/systm.h>
198#include <sys/sockio.h>
199#include <sys/mbuf.h>
200#include <sys/socket.h>
201#include <sys/syslog.h>

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

209
210#ifdef INET
211#include <netinet/in.h>
212#include <netinet/in_systm.h>
213#include <netinet/ip.h>
214#include <netinet/if_ether.h>
215#endif
216
217#if NBPFILTER > 0
217#if NBPF > 0
218#include <net/bpf.h>
219#endif
220
221#include <machine/clock.h>
222
223#include <i386/isa/isa_device.h>
224
225#include <i386/isa/ic/if_wl_i82586.h> /* Definitions for the Intel chip */

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

505 /* no entries
506 ifp->if_watchdog
507 ifp->if_done
508 ifp->if_reset
509 */
510 if_attach(ifp);
511 ether_ifattach(ifp);
512
218#include <net/bpf.h>
219#endif
220
221#include <machine/clock.h>
222
223#include <i386/isa/isa_device.h>
224
225#include <i386/isa/ic/if_wl_i82586.h> /* Definitions for the Intel chip */

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

505 /* no entries
506 ifp->if_watchdog
507 ifp->if_done
508 ifp->if_reset
509 */
510 if_attach(ifp);
511 ether_ifattach(ifp);
512
513#if NBPFILTER > 0
513#if NBPF > 0
514 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
515#endif
516
517 bcopy(&sc->wl_addr[0], sc->wl_ac.ac_enaddr, WAVELAN_ADDR_SIZE);
518 printf("%s%d: address %6D, NWID 0x%02x%02x", ifp->if_name, ifp->if_unit,
519 sc->wl_ac.ac_enaddr, ":", sc->nwid[0], sc->nwid[1]);
520 if (sc->freq24)
521 printf(", Freq %d MHz",sc->freq24); /* 2.4 Gz */

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

890 if (xmt_watch) printf("wl%d: busy?!",unit);
891 return; /* hey, why are we busy? */
892 }
893
894 /* get ourselves some data */
895 ifp = &(sc->wl_if);
896 IF_DEQUEUE(&ifp->if_snd, m);
897 if (m != (struct mbuf *)0) {
514 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
515#endif
516
517 bcopy(&sc->wl_addr[0], sc->wl_ac.ac_enaddr, WAVELAN_ADDR_SIZE);
518 printf("%s%d: address %6D, NWID 0x%02x%02x", ifp->if_name, ifp->if_unit,
519 sc->wl_ac.ac_enaddr, ":", sc->nwid[0], sc->nwid[1]);
520 if (sc->freq24)
521 printf(", Freq %d MHz",sc->freq24); /* 2.4 Gz */

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

890 if (xmt_watch) printf("wl%d: busy?!",unit);
891 return; /* hey, why are we busy? */
892 }
893
894 /* get ourselves some data */
895 ifp = &(sc->wl_if);
896 IF_DEQUEUE(&ifp->if_snd, m);
897 if (m != (struct mbuf *)0) {
898#if NBPFILTER > 0
898#if NBPF > 0
899 /* let BPF see it before we commit it */
900 if (ifp->if_bpf) {
901 bpf_mtap(ifp, m);
902 }
903#endif
904 sc->tbusy++;
905 /* set the watchdog timer so that if the board
906 * fails to interrupt we will restart

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

1075 rbd.buffer_addr += bytes;
1076 }
1077
1078 bytes = min(bytes_in_mbuf, bytes_in_msg);
1079 }
1080
1081 m->m_pkthdr.len = clen;
1082
899 /* let BPF see it before we commit it */
900 if (ifp->if_bpf) {
901 bpf_mtap(ifp, m);
902 }
903#endif
904 sc->tbusy++;
905 /* set the watchdog timer so that if the board
906 * fails to interrupt we will restart

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

1075 rbd.buffer_addr += bytes;
1076 }
1077
1078 bytes = min(bytes_in_mbuf, bytes_in_msg);
1079 }
1080
1081 m->m_pkthdr.len = clen;
1082
1083#if NBPFILTER > 0
1083#if NBPF > 0
1084 /*
1085 * Check if there's a BPF listener on this interface. If so, hand off
1086 * the raw packet to bpf.
1087 */
1088 if (ifp->if_bpf) {
1089 /* bpf assumes header is in mbufs. It isn't. We can
1090 * fool it without allocating memory as follows.
1091 * Trick borrowed from if_ie.c

--- 1611 unchanged lines hidden ---
1084 /*
1085 * Check if there's a BPF listener on this interface. If so, hand off
1086 * the raw packet to bpf.
1087 */
1088 if (ifp->if_bpf) {
1089 /* bpf assumes header is in mbufs. It isn't. We can
1090 * fool it without allocating memory as follows.
1091 * Trick borrowed from if_ie.c

--- 1611 unchanged lines hidden ---