Deleted Added
full compact
if_sn.c (60536) if_sn.c (63090)
1/*
2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com>
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

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

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com>
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

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

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $FreeBSD: head/sys/dev/sn/if_sn.c 60536 2000-05-14 02:18:43Z archie $
31 * $FreeBSD: head/sys/dev/sn/if_sn.c 63090 2000-07-13 22:54:34Z archie $
32 */
33
34/*
35 * This is a driver for SMC's 9000 series of Ethernet adapters.
36 *
37 * This FreeBSD driver is derived from the smc9194 Linux driver by
38 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman.
39 * This driver also shamelessly borrows from the FreeBSD ep driver

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

217 ifp->if_output = ether_output;
218 ifp->if_start = snstart;
219 ifp->if_ioctl = snioctl;
220 ifp->if_watchdog = snwatchdog;
221 ifp->if_init = sninit;
222 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
223 ifp->if_timer = 0;
224
32 */
33
34/*
35 * This is a driver for SMC's 9000 series of Ethernet adapters.
36 *
37 * This FreeBSD driver is derived from the smc9194 Linux driver by
38 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman.
39 * This driver also shamelessly borrows from the FreeBSD ep driver

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

217 ifp->if_output = ether_output;
218 ifp->if_start = snstart;
219 ifp->if_ioctl = snioctl;
220 ifp->if_watchdog = snwatchdog;
221 ifp->if_init = sninit;
222 ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
223 ifp->if_timer = 0;
224
225 if_attach(ifp);
226 ether_ifattach(ifp);
225 ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
227
228 /*
229 * Fill the hardware address into ifa_addr if we find an AF_LINK
230 * entry. We need to do this so bpf's can get the hardware addr of
231 * this card. netstat likes this too!
232 */
233 ifa = TAILQ_FIRST(&ifp->if_addrhead);
234 while ((ifa != 0) && (ifa->ifa_addr != 0) &&
235 (ifa->ifa_addr->sa_family != AF_LINK))
236 ifa = TAILQ_NEXT(ifa, ifa_link);
237
238 if ((ifa != 0) && (ifa->ifa_addr != 0)) {
239 sdl = (struct sockaddr_dl *) ifa->ifa_addr;
240 sdl->sdl_type = IFT_ETHER;
241 sdl->sdl_alen = ETHER_ADDR_LEN;
242 sdl->sdl_slen = 0;
243 bcopy(sc->arpcom.ac_enaddr, LLADDR(sdl), ETHER_ADDR_LEN);
244 }
245
226
227 /*
228 * Fill the hardware address into ifa_addr if we find an AF_LINK
229 * entry. We need to do this so bpf's can get the hardware addr of
230 * this card. netstat likes this too!
231 */
232 ifa = TAILQ_FIRST(&ifp->if_addrhead);
233 while ((ifa != 0) && (ifa->ifa_addr != 0) &&
234 (ifa->ifa_addr->sa_family != AF_LINK))
235 ifa = TAILQ_NEXT(ifa, ifa_link);
236
237 if ((ifa != 0) && (ifa->ifa_addr != 0)) {
238 sdl = (struct sockaddr_dl *) ifa->ifa_addr;
239 sdl->sdl_type = IFT_ETHER;
240 sdl->sdl_alen = ETHER_ADDR_LEN;
241 sdl->sdl_slen = 0;
242 bcopy(sc->arpcom.ac_enaddr, LLADDR(sdl), ETHER_ADDR_LEN);
243 }
244
246 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
247
248 return 0;
249}
250
251
252/*
253 * Reset and initialize the chip
254 */
255void

--- 1236 unchanged lines hidden ---
245 return 0;
246}
247
248
249/*
250 * Reset and initialize the chip
251 */
252void

--- 1236 unchanged lines hidden ---