isahint.c (74378) | isahint.c (78135) |
---|---|
1/*- 2 * Copyright (c) 1999 Doug Rabson 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 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Doug Rabson 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 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/isa/isahint.c 74378 2001-03-17 04:23:12Z nyan $ | 26 * $FreeBSD: head/sys/isa/isahint.c 78135 2001-06-12 09:40:04Z peter $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33#include <sys/module.h> 34#include <isa/isavar.h> --- 47 unchanged lines hidden (view full) --- 82 device_disable(child); 83} 84 85static void 86isahint_identify(driver_t *driver, device_t parent) 87{ 88 int i; 89 static char buf[] = "isaXXX"; | 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/bus.h> 33#include <sys/module.h> 34#include <isa/isavar.h> --- 47 unchanged lines hidden (view full) --- 82 device_disable(child); 83} 84 85static void 86isahint_identify(driver_t *driver, device_t parent) 87{ 88 int i; 89 static char buf[] = "isaXXX"; |
90 const char *dname; 91 int dunit; |
|
90 91 /* 92 * Add all devices configured to be attached to parent. 93 */ 94 sprintf(buf, "isa%d", device_get_unit(parent)); | 92 93 /* 94 * Add all devices configured to be attached to parent. 95 */ 96 sprintf(buf, "isa%d", device_get_unit(parent)); |
95 i = -1; 96 while ((i = resource_query_string(i, "at", buf)) != -1) { 97 if (strcmp(resource_query_name(i), "atkbd") == 0) | 97 i = 0; 98 while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { 99 if (strcmp(dname, "atkbd") == 0) |
98 continue; /* old GENERIC kludge */ | 100 continue; /* old GENERIC kludge */ |
99 isahint_add_device(parent, 100 resource_query_name(i), 101 resource_query_unit(i)); | 101 isahint_add_device(parent, dname, dunit); |
102 } 103 104 /* 105 * and isa? 106 */ | 102 } 103 104 /* 105 * and isa? 106 */ |
107 i = -1; 108 while ((i = resource_query_string(i, "at", "isa")) != -1) { 109 if (strcmp(resource_query_name(i), "atkbd") == 0) | 107 i = 0; 108 while ((resource_find_match(&i, &dname, &dunit, "at", "isa")) == 0) { 109 if (strcmp(dname, "atkbd") == 0) |
110 continue; /* old GENERIC kludge */ | 110 continue; /* old GENERIC kludge */ |
111 isahint_add_device(parent, 112 resource_query_name(i), 113 resource_query_unit(i)); | 111 isahint_add_device(parent, dname, dunit); |
114 } 115} 116 117static device_method_t isahint_methods[] = { 118 /* Device interface */ 119 DEVMETHOD(device_identify, isahint_identify), 120 121 { 0, 0 } 122}; 123 124static driver_t isahint_driver = { 125 "hint", 126 isahint_methods, 127 1, /* no softc */ 128}; 129 130static devclass_t hint_devclass; 131 132DRIVER_MODULE(isahint, isa, isahint_driver, hint_devclass, 0, 0); | 112 } 113} 114 115static device_method_t isahint_methods[] = { 116 /* Device interface */ 117 DEVMETHOD(device_identify, isahint_identify), 118 119 { 0, 0 } 120}; 121 122static driver_t isahint_driver = { 123 "hint", 124 isahint_methods, 125 1, /* no softc */ 126}; 127 128static devclass_t hint_devclass; 129 130DRIVER_MODULE(isahint, isa, isahint_driver, hint_devclass, 0, 0); |