sio.c (56788) | sio.c (57234) |
---|---|
1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 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 --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * | 1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 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 --- 16 unchanged lines hidden (view full) --- 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * |
33 * $FreeBSD: head/sys/dev/sio/sio.c 56788 2000-01-29 03:02:55Z bde $ | 33 * $FreeBSD: head/sys/dev/sio/sio.c 57234 2000-02-15 17:29:09Z bde $ |
34 * from: @(#)com.c 7.5 (Berkeley) 5/16/91 35 * from: i386/isa sio.c,v 1.234 36 */ 37 38#include "opt_comconsole.h" 39#include "opt_compat.h" 40#include "opt_ddb.h" 41#include "opt_sio.h" --- 645 unchanged lines hidden (view full) --- 687 * register and prepare to leave MCR_IENABLE clear in the mcr. 688 * Otherwise, prepare to set MCR_IENABLE in the mcr. 689 * Point idev to the device struct giving the correct id_irq. 690 * This is the struct for the master device if there is one. 691 */ 692 idev = dev; 693 mcr_image = MCR_IENABLE; 694#ifdef COM_MULTIPORT | 34 * from: @(#)com.c 7.5 (Berkeley) 5/16/91 35 * from: i386/isa sio.c,v 1.234 36 */ 37 38#include "opt_comconsole.h" 39#include "opt_compat.h" 40#include "opt_ddb.h" 41#include "opt_sio.h" --- 645 unchanged lines hidden (view full) --- 687 * register and prepare to leave MCR_IENABLE clear in the mcr. 688 * Otherwise, prepare to set MCR_IENABLE in the mcr. 689 * Point idev to the device struct giving the correct id_irq. 690 * This is the struct for the master device if there is one. 691 */ 692 idev = dev; 693 mcr_image = MCR_IENABLE; 694#ifdef COM_MULTIPORT |
695 if (COM_ISMULTIPORT(flags) && !COM_NOTAST4(flags)) { | 695 if (COM_ISMULTIPORT(flags)) { |
696 Port_t xiobase; 697 u_long io; 698 699 idev = devclass_get_device(sio_devclass, COM_MPMASTER(flags)); 700 if (idev == NULL) { 701 printf("sio%d: master device %d not configured\n", 702 device_get_unit(dev), COM_MPMASTER(flags)); 703 idev = dev; 704 } | 696 Port_t xiobase; 697 u_long io; 698 699 idev = devclass_get_device(sio_devclass, COM_MPMASTER(flags)); 700 if (idev == NULL) { 701 printf("sio%d: master device %d not configured\n", 702 device_get_unit(dev), COM_MPMASTER(flags)); 703 idev = dev; 704 } |
705 if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, NULL) == 0) { 706 xiobase = io; 707 if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL)) 708 outb(xiobase + com_scr, 0x80); /* no irq */ 709 else 710 outb(xiobase + com_scr, 0); | 705 if (!COM_NOTAST4(flags)) { 706 if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, 707 NULL) == 0) { 708 xiobase = io; 709 if (bus_get_resource(idev, SYS_RES_IRQ, 0, 710 NULL, NULL) == 0) 711 outb(xiobase + com_scr, 0x80); 712 else 713 outb(xiobase + com_scr, 0); 714 } 715 mcr_image = 0; |
711 } | 716 } |
712 mcr_image = 0; | |
713 } 714#endif /* COM_MULTIPORT */ 715 if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL) != 0) 716 mcr_image = 0; 717 718 bzero(failures, sizeof failures); 719 iobase = rman_get_start(port); 720 --- 285 unchanged lines hidden (view full) --- 1006 * device from sending before we are ready. 1007 */ 1008 bzero(com, sizeof *com); 1009 com->unit = unit; 1010 com->ioportres = port; 1011 com->cfcr_image = CFCR_8BITS; 1012 com->dtr_wait = 3 * hz; 1013 com->loses_outints = COM_LOSESOUTINTS(flags) != 0; | 717 } 718#endif /* COM_MULTIPORT */ 719 if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL) != 0) 720 mcr_image = 0; 721 722 bzero(failures, sizeof failures); 723 iobase = rman_get_start(port); 724 --- 285 unchanged lines hidden (view full) --- 1010 * device from sending before we are ready. 1011 */ 1012 bzero(com, sizeof *com); 1013 com->unit = unit; 1014 com->ioportres = port; 1015 com->cfcr_image = CFCR_8BITS; 1016 com->dtr_wait = 3 * hz; 1017 com->loses_outints = COM_LOSESOUTINTS(flags) != 0; |
1014 com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL); | 1018 com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL) != 0; |
1015 com->tx_fifo_size = 1; 1016 com->obufs[0].l_head = com->obuf1; 1017 com->obufs[1].l_head = com->obuf2; 1018 1019 com->iobase = iobase; 1020 com->data_port = iobase + com_data; 1021 com->int_id_port = iobase + com_iir; 1022 com->modem_ctl_port = iobase + com_mcr; --- 142 unchanged lines hidden (view full) --- 1165 1166 com->multiport = TRUE; 1167 printf(" (multiport"); 1168 if (unit == COM_MPMASTER(flags)) 1169 printf(" master"); 1170 printf(")"); 1171 masterdev = devclass_get_device(sio_devclass, 1172 COM_MPMASTER(flags)); | 1019 com->tx_fifo_size = 1; 1020 com->obufs[0].l_head = com->obuf1; 1021 com->obufs[1].l_head = com->obuf2; 1022 1023 com->iobase = iobase; 1024 com->data_port = iobase + com_data; 1025 com->int_id_port = iobase + com_iir; 1026 com->modem_ctl_port = iobase + com_mcr; --- 142 unchanged lines hidden (view full) --- 1169 1170 com->multiport = TRUE; 1171 printf(" (multiport"); 1172 if (unit == COM_MPMASTER(flags)) 1173 printf(" master"); 1174 printf(")"); 1175 masterdev = devclass_get_device(sio_devclass, 1176 COM_MPMASTER(flags)); |
1173 com->no_irq = bus_get_resource(masterdev, SYS_RES_IRQ, 0, NULL, 1174 NULL); | 1177 com->no_irq = (masterdev == NULL || bus_get_resource(masterdev, 1178 SYS_RES_IRQ, 0, NULL, NULL) != 0); |
1175 } 1176#endif /* COM_MULTIPORT */ 1177 if (unit == comconsole) 1178 printf(", console"); 1179 if (COM_IIR_TXRDYBUG(flags)) 1180 printf(" with a bogus IIR_TXRDY register"); 1181 printf("\n"); 1182 --- 1954 unchanged lines hidden --- | 1179 } 1180#endif /* COM_MULTIPORT */ 1181 if (unit == comconsole) 1182 printf(", console"); 1183 if (COM_IIR_TXRDYBUG(flags)) 1184 printf(" with a bogus IIR_TXRDY register"); 1185 printf("\n"); 1186 --- 1954 unchanged lines hidden --- |