1/*
2 * Copyright (c) 2001 M. Warner Losh. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/sio/sio_isa.c 119419 2003-08-24 18:03:45Z obrien $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>
37#include <sys/module.h>
38#include <sys/tty.h>
39#include <machine/bus_pio.h>
40#include <machine/bus.h>
41#include <sys/timepps.h>
42
43#include <dev/sio/siovar.h>
44
45#include <isa/isareg.h>
46#include <isa/isavar.h>
47
48static int sio_isa_attach(device_t dev);
49static int sio_isa_probe(device_t dev);
50
51static device_method_t sio_isa_methods[] = {
52 /* Device interface */
53 DEVMETHOD(device_probe, sio_isa_probe),
54 DEVMETHOD(device_attach, sio_isa_attach),
55
56 { 0, 0 }
57};
58
59static driver_t sio_isa_driver = {
60 sio_driver_name,
61 sio_isa_methods,
62 0,
63};
64
65static struct isa_pnp_id sio_ids[] = {
66 {0x0005d041, "Standard PC COM port"}, /* PNP0500 */
67 {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */
68 {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */
69 {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */
70 {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */
71 /* Devices that do not have a compatid */
72 {0x12206804, NULL}, /* ACH2012 - 5634BTS 56K Video Ready Modem */
73 {0x7602a904, NULL}, /* AEI0276 - 56K v.90 Fax Modem (LKT) */
74 {0x00007905, NULL}, /* AKY0000 - 56K Plug&Play Modem */
75 {0x21107905, NULL}, /* AKY1021 - 56K Plug&Play Modem */
76 {0x01405407, NULL}, /* AZT4001 - AZT3000 PnP SOUND DEVICE, MODEM */
77 {0x56039008, NULL}, /* BDP0356 - Best Data 56x2 */
78 {0x56159008, NULL}, /* BDP1556 - B.D. Smart One 56SPS,Voice Modem*/
79 {0x36339008, NULL}, /* BDP3336 - Best Data Prods. 336F */
80 {0x0014490a, NULL}, /* BRI1400 - Boca 33.6 PnP */
81 {0x0015490a, NULL}, /* BRI1500 - Internal Fax Data */
82 {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */
83 {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */
84 {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */
85 {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */
86 {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */
87 {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */
88 {0x36033610, NULL}, /* DAV0336 - DAVICOM 336PNP MODEM */
89 {0x01009416, NULL}, /* ETT0001 - E-Tech Bullet 33k6 PnP */
90 {0x0000aa1a, NULL}, /* FUJ0000 - FUJITSU Modem 33600 PNP/I2 */
91 {0x1200c31e, NULL}, /* GVC0012 - VF1128HV-R9 (win modem?) */
92 {0x0303c31e, NULL}, /* GVC0303 - MaxTech 33.6 PnP D/F/V */
93 {0x0505c31e, NULL}, /* GVC0505 - GVC 56k Faxmodem */
94 {0x0116c31e, NULL}, /* GVC1601 - Rockwell V.34 Plug & Play Modem */
95 {0x0050c31e, NULL}, /* GVC5000 - some GVC modem */
96 {0x3800f91e, NULL}, /* GWY0038 - Telepath with v.90 */
97 {0x9062f91e, NULL}, /* GWY6290 - Telepath with x2 Technology */
98 {0x8100e425, NULL}, /* IOD0081 - I-O DATA DEVICE,INC. IFML-560 */
99 {0x71004d24, NULL}, /* IBM0071 - IBM ThinkPad 240 IrDA controller*/
100 {0x21002534, NULL}, /* MAE0021 - Jetstream Int V.90 56k Voice Series 2*/
101 {0x0000f435, NULL}, /* MOT0000 - Motorola ModemSURFR 33.6 Intern */
102 {0x5015f435, NULL}, /* MOT1550 - Motorola ModemSURFR 56K Modem */
103 {0xf015f435, NULL}, /* MOT15F0 - Motorola VoiceSURFR 56K Modem */
104 {0x6045f435, NULL}, /* MOT4560 - Motorola ? */
105 {0x61e7a338, NULL}, /* NECE761 - 33.6Modem */
106 {0x0160633a, NULL}, /* NSC6001 - National Semi's IrDA Controller*/
107 {0x08804f3f, NULL}, /* OZO8008 - Zoom (33.6k Modem) */
108 {0x0f804f3f, NULL}, /* OZO800f - Zoom 2812 (56k Modem) */
109 {0x39804f3f, NULL}, /* OZO8039 - Zoom 56k flex */
110 {0x00914f3f, NULL}, /* OZO9100 - Zoom 2919 (K56 Faxmodem) */
111 {0x3024a341, NULL}, /* PMC2430 - Pace 56 Voice Internal Modem */
112 {0x1000eb49, NULL}, /* ROK0010 - Rockwell ? */
113 {0x1200b23d, NULL}, /* RSS0012 - OMRON ME5614ISA */
114 {0x5002734a, NULL}, /* RSS0250 - 5614Jx3(G) Internal Modem */
115 {0x6202734a, NULL}, /* RSS0262 - 5614Jx3[G] V90+K56Flex Modem */
116 {0x1010104d, NULL}, /* SHP1010 - Rockwell 33600bps Modem */
117 {0x10f0a34d, NULL}, /* SMCF010 - SMC IrCC*/
118 {0xc100ad4d, NULL}, /* SMM00C1 - Leopard 56k PnP */
119 {0x9012b04e, NULL}, /* SUP1290 - Supra ? */
120 {0x1013b04e, NULL}, /* SUP1310 - SupraExpress 336i PnP */
121 {0x8013b04e, NULL}, /* SUP1380 - SupraExpress 288i PnP Voice */
122 {0x8113b04e, NULL}, /* SUP1381 - SupraExpress 336i PnP Voice */
123 {0x5016b04e, NULL}, /* SUP1650 - Supra 336i Sp Intl */
124 {0x7016b04e, NULL}, /* SUP1670 - Supra 336i V+ Intl */
125 {0x7420b04e, NULL}, /* SUP2070 - Supra ? */
126 {0x8020b04e, NULL}, /* SUP2080 - Supra ? */
127 {0x8420b04e, NULL}, /* SUP2084 - SupraExpress 56i PnP */
128 {0x7121b04e, NULL}, /* SUP2171 - SupraExpress 56i Sp? */
129 {0x8024b04e, NULL}, /* SUP2480 - Supra ? */
130 {0x01007256, NULL}, /* USR0001 - U.S. Robotics Inc., Sportster W */
131 {0x02007256, NULL}, /* USR0002 - U.S. Robotics Inc. Sportster 33. */
132 {0x04007256, NULL}, /* USR0004 - USR Sportster 14.4k */
133 {0x06007256, NULL}, /* USR0006 - USR Sportster 33.6k */
134 {0x11007256, NULL}, /* USR0011 - USR ? */
135 {0x01017256, NULL}, /* USR0101 - USR ? */
136 {0x30207256, NULL}, /* USR2030 - U.S.Robotics Inc. Sportster 560 */
137 {0x50207256, NULL}, /* USR2050 - U.S.Robotics Inc. Sportster 33. */
138 {0x70207256, NULL}, /* USR2070 - U.S.Robotics Inc. Sportster 560 */
139 {0x30307256, NULL}, /* USR3030 - U.S. Robotics 56K FAX INT */
140 {0x31307256, NULL}, /* USR3031 - U.S. Robotics 56K FAX INT */
141 {0x50307256, NULL}, /* USR3050 - U.S. Robotics 56K FAX INT */
142 {0x70307256, NULL}, /* USR3070 - U.S. Robotics 56K Voice INT */
143 {0x90307256, NULL}, /* USR3090 - USR ? */
144 {0x70917256, NULL}, /* USR9170 - U.S. Robotics 56K FAX INT */
145 {0x90917256, NULL}, /* USR9190 - USR 56k Voice INT */
146 {0x04f0235c, NULL}, /* WACF004 - Wacom Tablet PC Screen*/
147 {0x0300695c, NULL}, /* WCI0003 - Fax/Voice/Modem/Speakphone/Asvd */
148 {0x01a0896a, NULL}, /* ZTIA001 - Zoom Internal V90 Faxmodem */
149 {0x61f7896a, NULL}, /* ZTIF761 - Zoom ComStar 33.6 */
150 {0}
151};
152
153static int
154sio_isa_probe(dev)
155 device_t dev;
156{
157 /* Check isapnp ids */
158 if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO)
159 return (ENXIO);
160 return (sioprobe(dev, 0, 0UL, 0));
161}
162
163static int
164sio_isa_attach(dev)
165 device_t dev;
166{
167 return (sioattach(dev, 0, 0UL));
168}
169
170DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
171DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);
2 * Copyright (c) 2001 M. Warner Losh. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/sio/sio_isa.c 119419 2003-08-24 18:03:45Z obrien $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/bus.h>
32#include <sys/conf.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/malloc.h>
36#include <sys/mutex.h>
37#include <sys/module.h>
38#include <sys/tty.h>
39#include <machine/bus_pio.h>
40#include <machine/bus.h>
41#include <sys/timepps.h>
42
43#include <dev/sio/siovar.h>
44
45#include <isa/isareg.h>
46#include <isa/isavar.h>
47
48static int sio_isa_attach(device_t dev);
49static int sio_isa_probe(device_t dev);
50
51static device_method_t sio_isa_methods[] = {
52 /* Device interface */
53 DEVMETHOD(device_probe, sio_isa_probe),
54 DEVMETHOD(device_attach, sio_isa_attach),
55
56 { 0, 0 }
57};
58
59static driver_t sio_isa_driver = {
60 sio_driver_name,
61 sio_isa_methods,
62 0,
63};
64
65static struct isa_pnp_id sio_ids[] = {
66 {0x0005d041, "Standard PC COM port"}, /* PNP0500 */
67 {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */
68 {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */
69 {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */
70 {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */
71 /* Devices that do not have a compatid */
72 {0x12206804, NULL}, /* ACH2012 - 5634BTS 56K Video Ready Modem */
73 {0x7602a904, NULL}, /* AEI0276 - 56K v.90 Fax Modem (LKT) */
74 {0x00007905, NULL}, /* AKY0000 - 56K Plug&Play Modem */
75 {0x21107905, NULL}, /* AKY1021 - 56K Plug&Play Modem */
76 {0x01405407, NULL}, /* AZT4001 - AZT3000 PnP SOUND DEVICE, MODEM */
77 {0x56039008, NULL}, /* BDP0356 - Best Data 56x2 */
78 {0x56159008, NULL}, /* BDP1556 - B.D. Smart One 56SPS,Voice Modem*/
79 {0x36339008, NULL}, /* BDP3336 - Best Data Prods. 336F */
80 {0x0014490a, NULL}, /* BRI1400 - Boca 33.6 PnP */
81 {0x0015490a, NULL}, /* BRI1500 - Internal Fax Data */
82 {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */
83 {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */
84 {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */
85 {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */
86 {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */
87 {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */
88 {0x36033610, NULL}, /* DAV0336 - DAVICOM 336PNP MODEM */
89 {0x01009416, NULL}, /* ETT0001 - E-Tech Bullet 33k6 PnP */
90 {0x0000aa1a, NULL}, /* FUJ0000 - FUJITSU Modem 33600 PNP/I2 */
91 {0x1200c31e, NULL}, /* GVC0012 - VF1128HV-R9 (win modem?) */
92 {0x0303c31e, NULL}, /* GVC0303 - MaxTech 33.6 PnP D/F/V */
93 {0x0505c31e, NULL}, /* GVC0505 - GVC 56k Faxmodem */
94 {0x0116c31e, NULL}, /* GVC1601 - Rockwell V.34 Plug & Play Modem */
95 {0x0050c31e, NULL}, /* GVC5000 - some GVC modem */
96 {0x3800f91e, NULL}, /* GWY0038 - Telepath with v.90 */
97 {0x9062f91e, NULL}, /* GWY6290 - Telepath with x2 Technology */
98 {0x8100e425, NULL}, /* IOD0081 - I-O DATA DEVICE,INC. IFML-560 */
99 {0x71004d24, NULL}, /* IBM0071 - IBM ThinkPad 240 IrDA controller*/
100 {0x21002534, NULL}, /* MAE0021 - Jetstream Int V.90 56k Voice Series 2*/
101 {0x0000f435, NULL}, /* MOT0000 - Motorola ModemSURFR 33.6 Intern */
102 {0x5015f435, NULL}, /* MOT1550 - Motorola ModemSURFR 56K Modem */
103 {0xf015f435, NULL}, /* MOT15F0 - Motorola VoiceSURFR 56K Modem */
104 {0x6045f435, NULL}, /* MOT4560 - Motorola ? */
105 {0x61e7a338, NULL}, /* NECE761 - 33.6Modem */
106 {0x0160633a, NULL}, /* NSC6001 - National Semi's IrDA Controller*/
107 {0x08804f3f, NULL}, /* OZO8008 - Zoom (33.6k Modem) */
108 {0x0f804f3f, NULL}, /* OZO800f - Zoom 2812 (56k Modem) */
109 {0x39804f3f, NULL}, /* OZO8039 - Zoom 56k flex */
110 {0x00914f3f, NULL}, /* OZO9100 - Zoom 2919 (K56 Faxmodem) */
111 {0x3024a341, NULL}, /* PMC2430 - Pace 56 Voice Internal Modem */
112 {0x1000eb49, NULL}, /* ROK0010 - Rockwell ? */
113 {0x1200b23d, NULL}, /* RSS0012 - OMRON ME5614ISA */
114 {0x5002734a, NULL}, /* RSS0250 - 5614Jx3(G) Internal Modem */
115 {0x6202734a, NULL}, /* RSS0262 - 5614Jx3[G] V90+K56Flex Modem */
116 {0x1010104d, NULL}, /* SHP1010 - Rockwell 33600bps Modem */
117 {0x10f0a34d, NULL}, /* SMCF010 - SMC IrCC*/
118 {0xc100ad4d, NULL}, /* SMM00C1 - Leopard 56k PnP */
119 {0x9012b04e, NULL}, /* SUP1290 - Supra ? */
120 {0x1013b04e, NULL}, /* SUP1310 - SupraExpress 336i PnP */
121 {0x8013b04e, NULL}, /* SUP1380 - SupraExpress 288i PnP Voice */
122 {0x8113b04e, NULL}, /* SUP1381 - SupraExpress 336i PnP Voice */
123 {0x5016b04e, NULL}, /* SUP1650 - Supra 336i Sp Intl */
124 {0x7016b04e, NULL}, /* SUP1670 - Supra 336i V+ Intl */
125 {0x7420b04e, NULL}, /* SUP2070 - Supra ? */
126 {0x8020b04e, NULL}, /* SUP2080 - Supra ? */
127 {0x8420b04e, NULL}, /* SUP2084 - SupraExpress 56i PnP */
128 {0x7121b04e, NULL}, /* SUP2171 - SupraExpress 56i Sp? */
129 {0x8024b04e, NULL}, /* SUP2480 - Supra ? */
130 {0x01007256, NULL}, /* USR0001 - U.S. Robotics Inc., Sportster W */
131 {0x02007256, NULL}, /* USR0002 - U.S. Robotics Inc. Sportster 33. */
132 {0x04007256, NULL}, /* USR0004 - USR Sportster 14.4k */
133 {0x06007256, NULL}, /* USR0006 - USR Sportster 33.6k */
134 {0x11007256, NULL}, /* USR0011 - USR ? */
135 {0x01017256, NULL}, /* USR0101 - USR ? */
136 {0x30207256, NULL}, /* USR2030 - U.S.Robotics Inc. Sportster 560 */
137 {0x50207256, NULL}, /* USR2050 - U.S.Robotics Inc. Sportster 33. */
138 {0x70207256, NULL}, /* USR2070 - U.S.Robotics Inc. Sportster 560 */
139 {0x30307256, NULL}, /* USR3030 - U.S. Robotics 56K FAX INT */
140 {0x31307256, NULL}, /* USR3031 - U.S. Robotics 56K FAX INT */
141 {0x50307256, NULL}, /* USR3050 - U.S. Robotics 56K FAX INT */
142 {0x70307256, NULL}, /* USR3070 - U.S. Robotics 56K Voice INT */
143 {0x90307256, NULL}, /* USR3090 - USR ? */
144 {0x70917256, NULL}, /* USR9170 - U.S. Robotics 56K FAX INT */
145 {0x90917256, NULL}, /* USR9190 - USR 56k Voice INT */
146 {0x04f0235c, NULL}, /* WACF004 - Wacom Tablet PC Screen*/
147 {0x0300695c, NULL}, /* WCI0003 - Fax/Voice/Modem/Speakphone/Asvd */
148 {0x01a0896a, NULL}, /* ZTIA001 - Zoom Internal V90 Faxmodem */
149 {0x61f7896a, NULL}, /* ZTIF761 - Zoom ComStar 33.6 */
150 {0}
151};
152
153static int
154sio_isa_probe(dev)
155 device_t dev;
156{
157 /* Check isapnp ids */
158 if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO)
159 return (ENXIO);
160 return (sioprobe(dev, 0, 0UL, 0));
161}
162
163static int
164sio_isa_attach(dev)
165 device_t dev;
166{
167 return (sioattach(dev, 0, 0UL));
168}
169
170DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
171DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);