| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_axe.c,v 1.49 2011/08/25 02:27:31 pgoyette Exp $ */ | | 1 | /* $NetBSD: if_axe.c,v 1.50 2011/08/25 02:29:08 pgoyette Exp $ */ |
2 | /* $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */ | | 2 | /* $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> | | 5 | * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org> |
6 | * | | 6 | * |
7 | * Permission to use, copy, modify, and distribute this software for any | | 7 | * Permission to use, copy, modify, and distribute this software for any |
8 | * purpose with or without fee is hereby granted, provided that the above | | 8 | * purpose with or without fee is hereby granted, provided that the above |
9 | * copyright notice and this permission notice appear in all copies. | | 9 | * copyright notice and this permission notice appear in all copies. |
10 | * | | 10 | * |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| @@ -79,27 +79,27 @@ | | | @@ -79,27 +79,27 @@ |
79 | * Note that this device appears to only support loading the station | | 79 | * Note that this device appears to only support loading the station |
80 | * address via autload from the EEPROM (i.e. there's no way to manaully | | 80 | * address via autload from the EEPROM (i.e. there's no way to manaully |
81 | * set it). | | 81 | * set it). |
82 | * | | 82 | * |
83 | * (Adam Weinberger wanted me to name this driver if_gir.c.) | | 83 | * (Adam Weinberger wanted me to name this driver if_gir.c.) |
84 | */ | | 84 | */ |
85 | | | 85 | |
86 | /* | | 86 | /* |
87 | * Ported to OpenBSD 3/28/2004 by Greg Taleck <taleck@oz.net> | | 87 | * Ported to OpenBSD 3/28/2004 by Greg Taleck <taleck@oz.net> |
88 | * with bits and pieces from the aue and url drivers. | | 88 | * with bits and pieces from the aue and url drivers. |
89 | */ | | 89 | */ |
90 | | | 90 | |
91 | #include <sys/cdefs.h> | | 91 | #include <sys/cdefs.h> |
92 | __KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.49 2011/08/25 02:27:31 pgoyette Exp $"); | | 92 | __KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.50 2011/08/25 02:29:08 pgoyette Exp $"); |
93 | | | 93 | |
94 | #if defined(__NetBSD__) | | 94 | #if defined(__NetBSD__) |
95 | #ifndef _MODULE | | 95 | #ifndef _MODULE |
96 | #include "opt_inet.h" | | 96 | #include "opt_inet.h" |
97 | #include "rnd.h" | | 97 | #include "rnd.h" |
98 | #endif | | 98 | #endif |
99 | #endif | | 99 | #endif |
100 | | | 100 | |
101 | | | 101 | |
102 | #include <sys/param.h> | | 102 | #include <sys/param.h> |
103 | #include <sys/bus.h> | | 103 | #include <sys/bus.h> |
104 | #include <sys/device.h> | | 104 | #include <sys/device.h> |
105 | #include <sys/kernel.h> | | 105 | #include <sys/kernel.h> |
| @@ -202,28 +202,26 @@ static void axe_miibus_writereg(device_t | | | @@ -202,28 +202,26 @@ static void axe_miibus_writereg(device_t |
202 | static void axe_miibus_statchg(device_t); | | 202 | static void axe_miibus_statchg(device_t); |
203 | static int axe_cmd(struct axe_softc *, int, int, int, void *); | | 203 | static int axe_cmd(struct axe_softc *, int, int, int, void *); |
204 | static void axe_reset(struct axe_softc *sc); | | 204 | static void axe_reset(struct axe_softc *sc); |
205 | static int axe_ifmedia_upd(struct ifnet *); | | 205 | static int axe_ifmedia_upd(struct ifnet *); |
206 | static void axe_ifmedia_sts(struct ifnet *, struct ifmediareq *); | | 206 | static void axe_ifmedia_sts(struct ifnet *, struct ifmediareq *); |
207 | | | 207 | |
208 | static void axe_setmulti(struct axe_softc *); | | 208 | static void axe_setmulti(struct axe_softc *); |
209 | static void axe_lock_mii(struct axe_softc *sc); | | 209 | static void axe_lock_mii(struct axe_softc *sc); |
210 | static void axe_unlock_mii(struct axe_softc *sc); | | 210 | static void axe_unlock_mii(struct axe_softc *sc); |
211 | | | 211 | |
212 | static void axe_ax88178_init(struct axe_softc *); | | 212 | static void axe_ax88178_init(struct axe_softc *); |
213 | static void axe_ax88772_init(struct axe_softc *); | | 213 | static void axe_ax88772_init(struct axe_softc *); |
214 | | | 214 | |
215 | extern int usbdebug; /* XXX */ | | | |
216 | | | | |
217 | /* Get exclusive access to the MII registers */ | | 215 | /* Get exclusive access to the MII registers */ |
218 | static void | | 216 | static void |
219 | axe_lock_mii(struct axe_softc *sc) | | 217 | axe_lock_mii(struct axe_softc *sc) |
220 | { | | 218 | { |
221 | | | 219 | |
222 | sc->axe_refcnt++; | | 220 | sc->axe_refcnt++; |
223 | mutex_enter(&sc->axe_mii_lock); | | 221 | mutex_enter(&sc->axe_mii_lock); |
224 | } | | 222 | } |
225 | | | 223 | |
226 | static void | | 224 | static void |
227 | axe_unlock_mii(struct axe_softc *sc) | | 225 | axe_unlock_mii(struct axe_softc *sc) |
228 | { | | 226 | { |
229 | | | 227 | |
| @@ -1465,29 +1463,27 @@ MODULE(MODULE_CLASS_DRIVER, if_axe, NULL | | | @@ -1465,29 +1463,27 @@ MODULE(MODULE_CLASS_DRIVER, if_axe, NULL |
1465 | | | 1463 | |
1466 | #ifdef _MODULE | | 1464 | #ifdef _MODULE |
1467 | #include "ioconf.c" | | 1465 | #include "ioconf.c" |
1468 | #endif | | 1466 | #endif |
1469 | | | 1467 | |
1470 | static int | | 1468 | static int |
1471 | if_axe_modcmd(modcmd_t cmd, void *aux) | | 1469 | if_axe_modcmd(modcmd_t cmd, void *aux) |
1472 | { | | 1470 | { |
1473 | int error = 0; | | 1471 | int error = 0; |
1474 | | | 1472 | |
1475 | switch (cmd) { | | 1473 | switch (cmd) { |
1476 | case MODULE_CMD_INIT: | | 1474 | case MODULE_CMD_INIT: |
1477 | #ifdef _MODULE | | 1475 | #ifdef _MODULE |
1478 | usbdebug++; /* XXX */ | | | |
1479 | error = config_init_component(cfdriver_ioconf_axe, | | 1476 | error = config_init_component(cfdriver_ioconf_axe, |
1480 | cfattach_ioconf_axe, cfdata_ioconf_axe); | | 1477 | cfattach_ioconf_axe, cfdata_ioconf_axe); |
1481 | usbdebug--; /* XXX */ | | | |
1482 | #endif | | 1478 | #endif |
1483 | return error; | | 1479 | return error; |
1484 | case MODULE_CMD_FINI: | | 1480 | case MODULE_CMD_FINI: |
1485 | #ifdef _MODULE | | 1481 | #ifdef _MODULE |
1486 | error = config_fini_component(cfdriver_ioconf_axe, | | 1482 | error = config_fini_component(cfdriver_ioconf_axe, |
1487 | cfattach_ioconf_axe, cfdata_ioconf_axe); | | 1483 | cfattach_ioconf_axe, cfdata_ioconf_axe); |
1488 | #endif | | 1484 | #endif |
1489 | return error; | | 1485 | return error; |
1490 | default: | | 1486 | default: |
1491 | return ENOTTY; | | 1487 | return ENOTTY; |
1492 | } | | 1488 | } |
1493 | } | | 1489 | } |