sio.c (37683) | sio.c (38297) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 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 * from: @(#)com.c 7.5 (Berkeley) 5/16/91 | 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 --- 17 unchanged lines hidden (view full) --- 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 * from: @(#)com.c 7.5 (Berkeley) 5/16/91 |
34 * $Id: sio.c,v 1.62 1998/06/24 13:37:23 kato Exp $ | 34 * $Id: sio.c,v 1.63 1998/07/15 12:18:32 bde Exp $ |
35 */ 36 37#include "opt_comconsole.h" 38#include "opt_compat.h" 39#include "opt_ddb.h" 40#include "opt_devfs.h" 41#include "opt_sio.h" 42#include "sio.h" --- 91 unchanged lines hidden (view full) --- 134#include <sys/systm.h> 135#include <sys/reboot.h> 136#include <sys/malloc.h> 137#include <sys/tty.h> 138#include <sys/proc.h> 139#include <sys/conf.h> 140#include <sys/dkstat.h> 141#include <sys/fcntl.h> | 35 */ 36 37#include "opt_comconsole.h" 38#include "opt_compat.h" 39#include "opt_ddb.h" 40#include "opt_devfs.h" 41#include "opt_sio.h" 42#include "sio.h" --- 91 unchanged lines hidden (view full) --- 134#include <sys/systm.h> 135#include <sys/reboot.h> 136#include <sys/malloc.h> 137#include <sys/tty.h> 138#include <sys/proc.h> 139#include <sys/conf.h> 140#include <sys/dkstat.h> 141#include <sys/fcntl.h> |
142#include <sys/interrupt.h> |
|
142#include <sys/kernel.h> 143#include <sys/syslog.h> 144#include <sys/sysctl.h> 145#ifdef DEVFS 146#include <sys/devfsext.h> 147#endif 148 149#include <machine/clock.h> | 143#include <sys/kernel.h> 144#include <sys/syslog.h> 145#include <sys/sysctl.h> 146#ifdef DEVFS 147#include <sys/devfsext.h> 148#endif 149 150#include <machine/clock.h> |
151#include <machine/ipl.h> |
|
150 151#ifdef PC98 152#include <pc98/pc98/pc98.h> 153#include <pc98/pc98/pc98_machdep.h> 154#include <i386/isa/icu.h> 155#include <i386/isa/isa_device.h> 156#include <pc98/pc98/sioreg.h> 157#include <i386/isa/ic/i8251.h> --- 232 unchanged lines hidden (view full) --- 390 void *devfs_token_ttyl; 391 void *devfs_token_ttyi; 392 void *devfs_token_cuaa; 393 void *devfs_token_cual; 394 void *devfs_token_cuai; 395#endif 396}; 397 | 152 153#ifdef PC98 154#include <pc98/pc98/pc98.h> 155#include <pc98/pc98/pc98_machdep.h> 156#include <i386/isa/icu.h> 157#include <i386/isa/isa_device.h> 158#include <pc98/pc98/sioreg.h> 159#include <i386/isa/ic/i8251.h> --- 232 unchanged lines hidden (view full) --- 392 void *devfs_token_ttyl; 393 void *devfs_token_ttyi; 394 void *devfs_token_cuaa; 395 void *devfs_token_cual; 396 void *devfs_token_cuai; 397#endif 398}; 399 |
398/* 399 * XXX public functions in drivers should be declared in headers produced 400 * by `config', not here. 401 */ 402 403/* Interrupt handling entry point. */ 404void siopoll __P((void)); 405 406/* Device switch entry points. */ 407#define sioreset noreset 408#define siommap nommap 409#define siostrategy nostrategy 410 | |
411#ifdef COM_ESP 412static int espattach __P((struct isa_device *isdp, struct com_s *com, 413 Port_t esp_port)); 414#endif 415static int sioattach __P((struct isa_device *dev)); 416static timeout_t siobusycheck; 417static timeout_t siodtrwakeup; 418static void comhardclose __P((struct com_s *com)); 419static void siointr1 __P((struct com_s *com)); 420static int commctl __P((struct com_s *com, int bits, int how)); 421static int comparam __P((struct tty *tp, struct termios *t)); | 400#ifdef COM_ESP 401static int espattach __P((struct isa_device *isdp, struct com_s *com, 402 Port_t esp_port)); 403#endif 404static int sioattach __P((struct isa_device *dev)); 405static timeout_t siobusycheck; 406static timeout_t siodtrwakeup; 407static void comhardclose __P((struct com_s *com)); 408static void siointr1 __P((struct com_s *com)); 409static int commctl __P((struct com_s *com, int bits, int how)); 410static int comparam __P((struct tty *tp, struct termios *t)); |
411static swihand_t siopoll; |
|
422static int sioprobe __P((struct isa_device *dev)); 423static void siosettimeout __P((void)); 424static void comstart __P((struct tty *tp)); 425static timeout_t comwakeup; 426static void disc_optim __P((struct tty *tp, struct termios *t, 427 struct com_s *com)); 428 429#ifdef DSI_SOFT_MODEM --- 25 unchanged lines hidden (view full) --- 455 ttpoll, nommap, NULL, driver_name, 456 NULL, -1, 457}; 458 459static int comconsole = -1; 460static volatile speed_t comdefaultrate = CONSPEED; 461static u_int com_events; /* input chars + weighted output completions */ 462static Port_t siocniobase; | 412static int sioprobe __P((struct isa_device *dev)); 413static void siosettimeout __P((void)); 414static void comstart __P((struct tty *tp)); 415static timeout_t comwakeup; 416static void disc_optim __P((struct tty *tp, struct termios *t, 417 struct com_s *com)); 418 419#ifdef DSI_SOFT_MODEM --- 25 unchanged lines hidden (view full) --- 445 ttpoll, nommap, NULL, driver_name, 446 NULL, -1, 447}; 448 449static int comconsole = -1; 450static volatile speed_t comdefaultrate = CONSPEED; 451static u_int com_events; /* input chars + weighted output completions */ 452static Port_t siocniobase; |
453static bool_t siopoll_registered; |
|
463static int sio_timeout; 464static int sio_timeouts_until_log; 465static struct callout_handle sio_timeout_handle 466 = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle); 467#if 0 /* XXX */ 468static struct tty *sio_tty[NSIOTOT]; 469#else 470static struct tty sio_tty[NSIOTOT]; --- 983 unchanged lines hidden (view full) --- 1454 UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); 1455 com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw, 1456 unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR, 1457 UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); 1458 com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw, 1459 unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR, 1460 UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); 1461#endif | 454static int sio_timeout; 455static int sio_timeouts_until_log; 456static struct callout_handle sio_timeout_handle 457 = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle); 458#if 0 /* XXX */ 459static struct tty *sio_tty[NSIOTOT]; 460#else 461static struct tty sio_tty[NSIOTOT]; --- 983 unchanged lines hidden (view full) --- 1445 UID_UUCP, GID_DIALER, 0660, "cuaa%r", unit); 1446 com->devfs_token_cuai = devfs_add_devswf(&sio_cdevsw, 1447 unit | CALLOUT_MASK | CONTROL_INIT_STATE, DV_CHR, 1448 UID_UUCP, GID_DIALER, 0660, "cuaia%r", unit); 1449 com->devfs_token_cual = devfs_add_devswf(&sio_cdevsw, 1450 unit | CALLOUT_MASK | CONTROL_LOCK_STATE, DV_CHR, 1451 UID_UUCP, GID_DIALER, 0660, "cuala%r", unit); 1452#endif |
1453 if (!siopoll_registered) { 1454 register_swi(SWI_TTY, siopoll); 1455 siopoll_registered = TRUE; 1456 } |
|
1462 com->id_flags = isdp->id_flags; /* Heritate id_flags for later */ 1463 return (1); 1464} 1465 1466static int 1467sioopen(dev, flag, mode, p) 1468 dev_t dev; 1469 int flag; --- 969 unchanged lines hidden (view full) --- 2439 } 2440#ifdef PC98 2441 } 2442#endif 2443 splx(s); 2444 return (0); 2445} 2446 | 1457 com->id_flags = isdp->id_flags; /* Heritate id_flags for later */ 1458 return (1); 1459} 1460 1461static int 1462sioopen(dev, flag, mode, p) 1463 dev_t dev; 1464 int flag; --- 969 unchanged lines hidden (view full) --- 2434 } 2435#ifdef PC98 2436 } 2437#endif 2438 splx(s); 2439 return (0); 2440} 2441 |
2447void | 2442static void |
2448siopoll() 2449{ 2450 int unit; 2451 2452 if (com_events == 0) 2453 return; 2454repeat: 2455 for (unit = 0; unit < NSIOTOT; ++unit) { --- 1868 unchanged lines hidden --- | 2443siopoll() 2444{ 2445 int unit; 2446 2447 if (com_events == 0) 2448 return; 2449repeat: 2450 for (unit = 0; unit < NSIOTOT; ++unit) { --- 1868 unchanged lines hidden --- |