atkbdc_isa.c (69781) | atkbdc_isa.c (78135) |
---|---|
1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 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 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 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 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 69781 2000-12-08 21:51:06Z dwmalone $ | 26 * $FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 78135 2001-06-12 09:40:04Z peter $ |
27 */ 28 29#include "opt_kbd.h" 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/bus.h> --- 129 unchanged lines hidden (view full) --- 164 child = device_add_child(dev, name, unit); 165 device_set_ivars(child, kdev); 166} 167 168static int 169atkbdc_attach(device_t dev) 170{ 171 atkbdc_softc_t *sc; | 27 */ 28 29#include "opt_kbd.h" 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/bus.h> --- 129 unchanged lines hidden (view full) --- 164 child = device_add_child(dev, name, unit); 165 device_set_ivars(child, kdev); 166} 167 168static int 169atkbdc_attach(device_t dev) 170{ 171 atkbdc_softc_t *sc; |
172 int unit; | 172 int unit, dunit; |
173 int error; 174 int rid; 175 int i; | 173 int error; 174 int rid; 175 int i; |
176 const char *name; | 176 const char *name, *dname; |
177 178 unit = device_get_unit(dev); 179 sc = *(atkbdc_softc_t **)device_get_softc(dev); 180 if (sc == NULL) { 181 /* 182 * We have to maintain two copies of the kbdc_softc struct, 183 * as the low-level console needs to have access to the 184 * keyboard controller before kbdc is probed and attached. --- 25 unchanged lines hidden (view full) --- 210 return error; 211 } 212 *(atkbdc_softc_t **)device_get_softc(dev) = sc; 213 214 /* 215 * Add all devices configured to be attached to atkbdc0. 216 */ 217 name = device_get_nameunit(dev); | 177 178 unit = device_get_unit(dev); 179 sc = *(atkbdc_softc_t **)device_get_softc(dev); 180 if (sc == NULL) { 181 /* 182 * We have to maintain two copies of the kbdc_softc struct, 183 * as the low-level console needs to have access to the 184 * keyboard controller before kbdc is probed and attached. --- 25 unchanged lines hidden (view full) --- 210 return error; 211 } 212 *(atkbdc_softc_t **)device_get_softc(dev) = sc; 213 214 /* 215 * Add all devices configured to be attached to atkbdc0. 216 */ 217 name = device_get_nameunit(dev); |
218 i = -1; 219 while ((i = resource_query_string(i, "at", name)) != -1) 220 atkbdc_add_device(dev, resource_query_name(i), 221 resource_query_unit(i)); | 218 i = 0; 219 while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0) 220 atkbdc_add_device(dev, dname, dunit); |
222 223 /* 224 * and atkbdc? 225 */ 226 name = device_get_name(dev); | 221 222 /* 223 * and atkbdc? 224 */ 225 name = device_get_name(dev); |
227 i = -1; 228 while ((i = resource_query_string(i, "at", name)) != -1) 229 atkbdc_add_device(dev, resource_query_name(i), 230 resource_query_unit(i)); | 226 i = 0; 227 while ((resource_find_match(&i, &dname, &dunit, "at", name)) == 0) 228 atkbdc_add_device(dev, dname, dunit); |
231 232 bus_generic_attach(dev); 233 234 return 0; 235} 236 237static int 238atkbdc_print_child(device_t bus, device_t dev) --- 79 unchanged lines hidden --- | 229 230 bus_generic_attach(dev); 231 232 return 0; 233} 234 235static int 236atkbdc_print_child(device_t bus, device_t dev) --- 79 unchanged lines hidden --- |