|
|
1.1 ! root 1: /* ! 2: * asy.h - support for 8250-family serial devices ! 3: */ ! 4: #ifndef ASY_H ! 5: #define ASY_H ! 6: ! 7: #include <sys/silo.h> ! 8: ! 9: extern int ASY_NUM; /* patched to number of ports */ ! 10: extern int ASYGP_NUM; /* patched to number of port groups */ ! 11: ! 12: #ifdef _I386 ! 13: #define MAX_ASY 32 /* maximum number of ports per driver */ ! 14: #define MAX_ASYGP 4 /* maximum number of port groups */ ! 15: #define MAX_SLOTS 16 /* maximum number of ports per group */ ! 16: #else ! 17: #define MAX_ASY 8 /* maximum number of ports per driver */ ! 18: #define MAX_ASYGP 2 /* maximum number of port groups */ ! 19: #define MAX_SLOTS 8 /* maximum number of ports per group */ ! 20: #endif ! 21: #define ASY_VERSION 4 /* driver and asypatch check this */ ! 22: ! 23: #define NO_ASYGP 99 ! 24: #define NO_CHANNEL 99 ! 25: ! 26: #define PT_SIMPLE 0 ! 27: #define PT_COMTROL 1 ! 28: #define PT_ARNET 2 ! 29: #define PT_GTEK 3 ! 30: #define PT_DIGI 4 ! 31: #define PT_MAX 5 /* one more than highest PT value used */ ! 32: ! 33: /* ! 34: * Fields that need to be patched during installation. ! 35: * These structs must be static. ! 36: */ ! 37: typedef struct asy0 { ! 38: short a_port; /* i/o address of uart */ ! 39: char a_irqno; /* irq number, if any */ ! 40: char a_speed; /* default baud, from sgtty.h/termio.h */ ! 41: char a_outs; /* settings for MC_OUT1/2 when open */ ! 42: char a_asy_gp; /* group number, or NO_ASYGP if none */ ! 43: char a_ixc; /* if 1, needs excl use of irq (COM1-4) */ ! 44: char a_nms; /* if 1, no modem status interrupts */ ! 45: } asy0_t; ! 46: ! 47: typedef struct asy_gp { ! 48: short stat_port; ! 49: char gp_type; ! 50: char irq; ! 51: char chan_list[MAX_SLOTS]; ! 52: } asy_gp_t; ! 53: ! 54: /* ! 55: * Fields that do not require patched initial values. ! 56: * This struct can be dynamically allocated. ! 57: */ ! 58: typedef struct asy1 { ! 59: silo_t a_in; /* raw input fifo */ ! 60: silo_t a_out; /* raw output fifo */ ! 61: TTY a_tty; /* stuff for line discipline */ ! 62: TIM a_tim; /* for irq timeout kluge */ ! 63: short a_in_use; /* increment with each open attempt */ ! 64: char a_ut; /* uart type */ ! 65: char a_lcr; /* lcr readback */ ! 66: int a_irq:1; /* true when open or hanging with irq's */ ! 67: int a_has_irq:1; /* irq vector is usable */ ! 68: int a_hopn:1; /* doing first open */ ! 69: int a_hcls:1; /* doing last close */ ! 70: int a_ohlt:1; /* CTS flow control has halted output */ ! 71: int a_modc:1; /* open with modem control */ ! 72: int a_poll:1; /* open in polled mode */ ! 73: int a_flc:1; /* open with RTS/CTS flow control */ ! 74: } asy1_t; ! 75: ! 76: /* ! 77: * Each irq number has a linked list. ! 78: * There is one node for each i/o port triggering the given irq number. ! 79: */ ! 80: struct irqnode { ! 81: struct irqnode *next; ! 82: struct irqnode *next_actv; ! 83: int (*func)(); ! 84: int arg; ! 85: }; ! 86: ! 87: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.