atkbdc_isa.c (3aae7b16d2372c50b8167aafc39cc030e811afe0) atkbdc_isa.c (ada54f9e54741ff8921d27b945990a21147078a1)
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

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

168static int
169atkbdc_attach(device_t dev)
170{
171 atkbdc_softc_t *sc;
172 int unit;
173 int error;
174 int rid;
175 int i;
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

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

168static int
169atkbdc_attach(device_t dev)
170{
171 atkbdc_softc_t *sc;
172 int unit;
173 int error;
174 int rid;
175 int i;
176 const char *name;
176
177 unit = device_get_unit(dev);
178 sc = *(atkbdc_softc_t **)device_get_softc(dev);
179 if (sc == NULL) {
180 /*
181 * We have to maintain two copies of the kbdc_softc struct,
182 * as the low-level console needs to have access to the
183 * keyboard controller before kbdc is probed and attached.

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

208 bus_release_resource(dev, SYS_RES_IOPORT, 1, sc->port1);
209 return error;
210 }
211 *(atkbdc_softc_t **)device_get_softc(dev) = sc;
212
213 /*
214 * Add all devices configured to be attached to atkbdc0.
215 */
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.

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

209 bus_release_resource(dev, SYS_RES_IOPORT, 1, sc->port1);
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 */
216 for (i = resource_query_string(-1, "at", device_get_nameunit(dev));
217 i != -1;
218 i = resource_query_string(i, "at", device_get_nameunit(dev))) {
217 name = device_get_nameunit(dev);
218 i = -1;
219 while ((i = resource_query_string(i, "at", name)) != -1)
219 atkbdc_add_device(dev, resource_query_name(i),
220 resource_query_unit(i));
220 atkbdc_add_device(dev, resource_query_name(i),
221 resource_query_unit(i));
221 }
222
223 /*
224 * and atkbdc?
225 */
222
223 /*
224 * and atkbdc?
225 */
226 for (i = resource_query_string(-1, "at", device_get_name(dev));
227 i != -1;
228 i = resource_query_string(i, "at", device_get_name(dev))) {
226 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));
229 atkbdc_add_device(dev, resource_query_name(i),
230 resource_query_unit(i));
231 }
232
233 bus_generic_attach(dev);
234
235 return 0;
236}
237
238static int
239atkbdc_print_child(device_t bus, device_t dev)

--- 79 unchanged lines hidden ---
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 ---