sio_isa.c revision 93010
138494Sobrien/*
2174294Sobrien * Copyright (c) 2001 M. Warner Losh.  All rights reserved.
338494Sobrien *
438494Sobrien * Redistribution and use in source and binary forms, with or without
538494Sobrien * modification, are permitted provided that the following conditions
638494Sobrien * are met:
738494Sobrien * 1. Redistributions of source code must retain the above copyright
838494Sobrien *    notice, this list of conditions and the following disclaimer.
938494Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1038494Sobrien *    notice, this list of conditions and the following disclaimer in the
1138494Sobrien *    documentation and/or other materials provided with the distribution.
1238494Sobrien *
1338494Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1438494Sobrien * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1538494Sobrien * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1638494Sobrien * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1738494Sobrien * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1838494Sobrien * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1938494Sobrien * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2042629Sobrien * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2138494Sobrien * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2238494Sobrien * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2338494Sobrien *
2438494Sobrien * $FreeBSD: head/sys/dev/sio/sio_isa.c 93010 2002-03-23 12:13:34Z bde $
2538494Sobrien */
2638494Sobrien
2738494Sobrien#include <sys/param.h>
2838494Sobrien#include <sys/systm.h>
2938494Sobrien#include <sys/bus.h>
3038494Sobrien#include <sys/conf.h>
3138494Sobrien#include <sys/kernel.h>
3238494Sobrien#include <sys/lock.h>
3338494Sobrien#include <sys/malloc.h>
3438494Sobrien#include <sys/mutex.h>
3538494Sobrien#include <sys/module.h>
3638494Sobrien#include <sys/tty.h>
3738494Sobrien#include <machine/bus_pio.h>
3838494Sobrien#include <machine/bus.h>
3938494Sobrien#include <sys/timepps.h>
40174294Sobrien
4138494Sobrien#include <dev/sio/siovar.h>
4238494Sobrien
4338494Sobrien#include <isa/isareg.h>
4438494Sobrien#include <isa/isavar.h>
4538494Sobrien
4638494Sobrienstatic	int	sio_isa_attach(device_t dev);
4738494Sobrienstatic	int	sio_isa_probe(device_t dev);
4838494Sobrien
4938494Sobrienstatic device_method_t sio_isa_methods[] = {
50174294Sobrien	/* Device interface */
51174294Sobrien	DEVMETHOD(device_probe,		sio_isa_probe),
52174294Sobrien	DEVMETHOD(device_attach,	sio_isa_attach),
53174294Sobrien
54174294Sobrien	{ 0, 0 }
55174294Sobrien};
56174294Sobrien
57174294Sobrienstatic driver_t sio_isa_driver = {
58174294Sobrien	sio_driver_name,
59174294Sobrien	sio_isa_methods,
60174294Sobrien	0,
61174294Sobrien};
62174294Sobrien
63174294Sobrienstatic struct isa_pnp_id sio_ids[] = {
6438494Sobrien	{0x0005d041, "Standard PC COM port"},	/* PNP0500 */
6538494Sobrien	{0x0105d041, "16550A-compatible COM port"},	/* PNP0501 */
6638494Sobrien	{0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */
6738494Sobrien	{0x1005d041, "Generic IRDA-compatible device"},	/* PNP0510 */
6838494Sobrien	{0x1105d041, "Generic IRDA-compatible device"},	/* PNP0511 */
6938494Sobrien	/* Devices that do not have a compatid */
7038494Sobrien	{0x12206804, NULL},     /* ACH2012 - 5634BTS 56K Video Ready Modem */
7138494Sobrien	{0x7602a904, NULL},	/* AEI0276 - 56K v.90 Fax Modem (LKT) */
7238494Sobrien	{0x00007905, NULL},	/* AKY0000 - 56K Plug&Play Modem */
7338494Sobrien	{0x01405407, NULL},	/* AZT4001 - AZT3000 PnP SOUND DEVICE, MODEM */
7438494Sobrien	{0x56039008, NULL},	/* BDP0356 - Best Data 56x2 */
7538494Sobrien	{0x56159008, NULL},	/* BDP1556 - B.D. Smart One 56SPS,Voice Modem*/
7638494Sobrien	{0x36339008, NULL},	/* BDP3336 - Best Data Prods. 336F */
7738494Sobrien	{0x0014490a, NULL},	/* BRI1400 - Boca 33.6 PnP */
7838494Sobrien	{0x0015490a, NULL},	/* BRI1500 - Internal Fax Data */
7938494Sobrien	{0x0034490a, NULL},	/* BRI3400 - Internal ACF Modem */
8038494Sobrien	{0x0094490a, NULL},	/* BRI9400 - Boca K56Flex PnP */
8138494Sobrien	{0x00b4490a, NULL},	/* BRIB400 - Boca 56k PnP */
8238494Sobrien	{0x0030320d, NULL},	/* CIR3000 - Cirrus Logic V43 */
8338494Sobrien	{0x0100440e, NULL},	/* CRD0001 - Cardinal MVP288IV ? */
8438494Sobrien	{0x01308c0e, NULL},	/* CTL3001 - Creative Labs Phoneblaster */
8538494Sobrien	{0x36033610, NULL},     /* DAV0336 - DAVICOM 336PNP MODEM */
8638494Sobrien	{0x0000aa1a, NULL},	/* FUJ0000 - FUJITSU Modem 33600 PNP/I2 */
8738494Sobrien	{0x1200c31e, NULL},	/* GVC0012 - VF1128HV-R9 (win modem?) */
8838494Sobrien	{0x0303c31e, NULL},	/* GVC0303 - MaxTech 33.6 PnP D/F/V */
8938494Sobrien	{0x0505c31e, NULL},	/* GVC0505 - GVC 56k Faxmodem */
9038494Sobrien	{0x0116c31e, NULL},	/* GVC1601 - Rockwell V.34 Plug & Play Modem */
9138494Sobrien	{0x0050c31e, NULL},	/* GVC5000 - some GVC modem */
9238494Sobrien	{0x3800f91e, NULL},	/* GWY0038 - Telepath with v.90 */
9338494Sobrien	{0x9062f91e, NULL},	/* GWY6290 - Telepath with x2 Technology */
9438494Sobrien	{0x8100e425, NULL},	/* IOD0081 - I-O DATA DEVICE,INC. IFML-560 */
9538494Sobrien	{0x71004d24, NULL},     /* IBM0071 - IBM ThinkPad 240 IrDA controller*/
9638494Sobrien	{0x21002534, NULL},	/* MAE0021 - Jetstream Int V.90 56k Voice Series 2*/
97119679Smbr	{0x0000f435, NULL},	/* MOT0000 - Motorola ModemSURFR 33.6 Intern */
9838494Sobrien	{0x5015f435, NULL},	/* MOT1550 - Motorola ModemSURFR 56K Modem */
9938494Sobrien	{0xf015f435, NULL},	/* MOT15F0 - Motorola VoiceSURFR 56K Modem */
10038494Sobrien	{0x6045f435, NULL},	/* MOT4560 - Motorola ? */
10138494Sobrien	{0x61e7a338, NULL},	/* NECE761 - 33.6Modem */
10238494Sobrien 	{0x08804f3f, NULL},	/* OZO8008 - Zoom  (33.6k Modem) */
10338494Sobrien	{0x0f804f3f, NULL},	/* OZO800f - Zoom 2812 (56k Modem) */
104119679Smbr	{0x39804f3f, NULL},	/* OZO8039 - Zoom 56k flex */
10538494Sobrien	{0x00914f3f, NULL},	/* OZO9100 - Zoom 2919 (K56 Faxmodem) */
10638494Sobrien	{0x3024a341, NULL},	/* PMC2430 - Pace 56 Voice Internal Modem */
10738494Sobrien	{0x1000eb49, NULL},	/* ROK0010 - Rockwell ? */
10838494Sobrien	{0x1200b23d, NULL},     /* RSS0012 - OMRON ME5614ISA */
10938494Sobrien	{0x5002734a, NULL},	/* RSS0250 - 5614Jx3(G) Internal Modem */
11038494Sobrien	{0x6202734a, NULL},	/* RSS0262 - 5614Jx3[G] V90+K56Flex Modem */
11138494Sobrien	{0x1010104d, NULL},	/* SHP1010 - Rockwell 33600bps Modem */
11238494Sobrien	{0x10f0a34d, NULL},	/* SMCF010 - SMC IrCC*/
11338494Sobrien	{0xc100ad4d, NULL},	/* SMM00C1 - Leopard 56k PnP */
11438494Sobrien	{0x9012b04e, NULL},	/* SUP1290 - Supra ? */
11538494Sobrien	{0x1013b04e, NULL},	/* SUP1310 - SupraExpress 336i PnP */
11638494Sobrien	{0x8013b04e, NULL},	/* SUP1380 - SupraExpress 288i PnP Voice */
11738494Sobrien	{0x8113b04e, NULL},	/* SUP1381 - SupraExpress 336i PnP Voice */
11838494Sobrien	{0x5016b04e, NULL},	/* SUP1650 - Supra 336i Sp Intl */
11938494Sobrien	{0x7016b04e, NULL},	/* SUP1670 - Supra 336i V+ Intl */
12038494Sobrien	{0x7420b04e, NULL},	/* SUP2070 - Supra ? */
12138494Sobrien	{0x8020b04e, NULL},	/* SUP2080 - Supra ? */
12238494Sobrien	{0x8420b04e, NULL},	/* SUP2084 - SupraExpress 56i PnP */
12338494Sobrien	{0x7121b04e, NULL},	/* SUP2171 - SupraExpress 56i Sp? */
12438494Sobrien	{0x8024b04e, NULL},	/* SUP2480 - Supra ? */
125174294Sobrien	{0x01007256, NULL},	/* USR0001 - U.S. Robotics Inc., Sportster W */
12638494Sobrien	{0x02007256, NULL},	/* USR0002 - U.S. Robotics Inc. Sportster 33. */
12738494Sobrien	{0x04007256, NULL},	/* USR0004 - USR Sportster 14.4k */
12838494Sobrien	{0x06007256, NULL},	/* USR0006 - USR Sportster 33.6k */
12938494Sobrien	{0x11007256, NULL},	/* USR0011 - USR ? */
13038494Sobrien	{0x01017256, NULL},	/* USR0101 - USR ? */
13138494Sobrien	{0x30207256, NULL},	/* USR2030 - U.S.Robotics Inc. Sportster 560 */
13238494Sobrien	{0x50207256, NULL},	/* USR2050 - U.S.Robotics Inc. Sportster 33. */
133119679Smbr	{0x70207256, NULL},	/* USR2070 - U.S.Robotics Inc. Sportster 560 */
13438494Sobrien	{0x30307256, NULL},	/* USR3030 - U.S. Robotics 56K FAX INT */
13538494Sobrien	{0x31307256, NULL},	/* USR3031 - U.S. Robotics 56K FAX INT */
13638494Sobrien	{0x50307256, NULL},	/* USR3050 - U.S. Robotics 56K FAX INT */
13738494Sobrien	{0x70307256, NULL},	/* USR3070 - U.S. Robotics 56K Voice INT */
13838494Sobrien	{0x90307256, NULL},	/* USR3090 - USR ? */
13938494Sobrien	{0x70917256, NULL},	/* USR9170 - U.S. Robotics 56K FAX INT */
14038494Sobrien	{0x90917256, NULL},	/* USR9190 - USR 56k Voice INT */
14138494Sobrien	{0x0300695c, NULL},	/* WCI0003 - Fax/Voice/Modem/Speakphone/Asvd */
142119679Smbr	{0x01a0896a, NULL},	/* ZTIA001 - Zoom Internal V90 Faxmodem */
14382794Sobrien	{0x61f7896a, NULL},	/* ZTIF761 - Zoom ComStar 33.6 */
14438494Sobrien	{0}
14538494Sobrien};
14682794Sobrien
147119679Smbrstatic int
14838494Sobriensio_isa_probe(dev)
14982794Sobrien	device_t	dev;
15082794Sobrien{
15138494Sobrien	/* Check isapnp ids */
15238494Sobrien	if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO)
153119679Smbr		return (ENXIO);
15438494Sobrien	return (sioprobe(dev, 0, 0UL, 0));
15538494Sobrien}
15638494Sobrien
157119679Smbrstatic int
15838494Sobriensio_isa_attach(dev)
15938494Sobrien	device_t	dev;
16038494Sobrien{
16182794Sobrien	return (sioattach(dev, 0, 0UL));
16238494Sobrien}
16338494Sobrien
16438494SobrienDRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
16538494SobrienDRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);
16638494Sobrien