Newsgroups: comp.sources.misc Path: wupost!uunet!sparky!kent From: Warren Tucker Subject: v22i093: ecu - ECU async comm package rev 3.10, Patch05d/5 Message-ID: <1991Sep4.160242.28439@sparky.IMD.Sterling.COM> Followup-To: comp.sources.d X-Md4-Signature: 25c70fa7a94676b4fdbae34128b4009c Sender: kent@sparky.IMD.Sterling.COM (Kent Landfield) Organization: Sterling Software, IMD References: Date: Wed, 4 Sep 1991 16:02:42 GMT Approved: kent@sparky.imd.sterling.com Lines: 1580 Submitted-by: Warren Tucker Posting-number: Volume 22, Issue 93 Archive-name: ecu/patch05d Environment: SCO, XENIX, ISC, SUNOS4.1, SYSVR4 Patch-To: ecu: Volume 21, Issue 53-89 #!/bin/sh # this is p5.04 (part 4 of ecu/patch05) # do not concatenate these parts, unpack them in order with /bin/sh # file PATCH5.01 continued # if test ! -r _shar_seq_.tmp; then echo 'Please unpack part 1 first!' exit 1 fi (read Scheck if test "$Scheck" != 4; then echo Please unpack part "$Scheck" next! exit 1 else exit 0 fi ) < _shar_seq_.tmp || exit 1 if test ! -f _shar_wnt_.tmp; then echo 'x - still skipping PATCH5.01' else echo 'x - continuing file PATCH5.01' sed 's/^X//' << 'SHAR_EOF' >> 'PATCH5.01' && X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:12-04-1990-05:36-wht-creation */ X--- 6,12 ---- X which does not get along with termio.h AT ALL X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by aega84!lh */ X /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:12-04-1990-05:36-wht-creation */ X*** /export/home/wht/src/ecu314/z/ecurz.c Wed Sep 4 00:25:16 1991 X--- z/ecurz.c Mon Sep 2 02:03:49 1991 X*************** X*** 1,4 **** X! char *numeric_revision = "ecurz 3.14"; X /*+------------------------------------------------------------------------- X ecurz.c - X/Y/ZMODEM receive program X Derived from public domain source by Chuck Forsberg, Omen Technologies X--- 1,4 ---- X! char *numeric_revision = "ecurz 3.15"; X /*+------------------------------------------------------------------------- X ecurz.c - X/Y/ZMODEM receive program X Derived from public domain source by Chuck Forsberg, Omen Technologies X*************** X*** 57,63 **** X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:04-30-1991-18:33-wht@n4hgf-gcc version coredumping on putc(); use fputc() */ X /*:03-27-1991-21:21-wht@n4hgf-dont bump error count on send ZRPOS */ X--- 57,63 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by aega84!lh */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:04-30-1991-18:33-wht@n4hgf-gcc version coredumping on putc(); use fputc() */ X /*:03-27-1991-21:21-wht@n4hgf-dont bump error count on send ZRPOS */ X*** /export/home/wht/src/ecu314/z/ecusz.c Wed Sep 4 00:25:16 1991 X--- z/ecusz.c Sun Sep 1 21:15:07 1991 X*************** X*** 1,4 **** X! char *numeric_revision = "ecusz 3.14"; X #define BUFFERED_WRITE X /*+------------------------------------------------------------------------- X ecusz.c - X/Y/ZMODEM send program X--- 1,4 ---- X! char *numeric_revision = "ecusz 3.15"; X #define BUFFERED_WRITE X /*+------------------------------------------------------------------------- X ecusz.c - X/Y/ZMODEM send program X*************** X*** 66,72 **** X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:02-03-1991-17:27-wht@n4hgf-version number change - see zcurses.c */ X /*:12-18-1990-21:26-wht@n4hgf-better output control */ X--- 66,74 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:09-01-1991-14:18-wht@n4hgf2-improve sun flushline */ X! /*:08-29-1991-02:17-wht@n4hgf2-flush "rz" to line before nap */ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by aega84!lh */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:02-03-1991-17:27-wht@n4hgf-version number change - see zcurses.c */ X /*:12-18-1990-21:26-wht@n4hgf-better output control */ X*************** X*** 465,483 **** X xsendline(ch); X } /* end of sendline */ X X flushline() X { X struct termio tio; X #ifdef BUFFERED_WRITE X fflush(iofp); X #endif X ioctl(iofd,TCGETA,(char *)&tio); X ioctl(iofd,TCSETAW,(char *)&tio); X! } X X main(argc,argv) X int argc; X! char *argv[]; X { X register char *cp; X char **patts = paths; X--- 467,512 ---- X xsendline(ch); X } /* end of sendline */ X X+ /*+------------------------------------------------------------------------- X+ flushline() - ensure all queued data to line is on the wire X+ --------------------------------------------------------------------------*/ X+ void X flushline() X { X+ #if defined(sun) X+ int retries = 50; X+ int outq_count; X+ int old_outq_count = 0; X+ #else X struct termio tio; X+ #endif X+ X #ifdef BUFFERED_WRITE X fflush(iofp); X #endif X+ X+ #if defined(sun) X+ do { X+ ioctl(iofd,TIOCOUTQ,&outq_count); X+ if(!outq_count) X+ break; X+ if(old_outq_count == outq_count) /* don't hang if flow control lock */ X+ retries--; X+ old_outq_count = outq_count; X+ Nap(50); X+ } while(outq_count && retries); X+ #else X ioctl(iofd,TCGETA,(char *)&tio); X ioctl(iofd,TCSETAW,(char *)&tio); X! #endif X! } /* end of flushline */ X X+ /*+------------------------------------------------------------------------- X+ main(argc,argv) X+ --------------------------------------------------------------------------*/ X main(argc,argv) X int argc; X! char **argv; X { X register char *cp; X char **patts = paths; X*************** X*** 702,708 **** X write(iofd,"rz\r",3); X else /* wht -- why not? */ X write(iofd,"rb\r",3); /* wht */ X! Nap(2000L); X report_str("",-1); X if(!Nozmodem) X { X--- 731,738 ---- X write(iofd,"rz\r",3); X else /* wht -- why not? */ X write(iofd,"rb\r",3); /* wht */ X! flushline(); X! Nap(750L); X report_str("",-1); X if(!Nozmodem) X { X*************** X*** 727,733 **** X Exitcode = 253; X exit(Exitcode ? Exitcode : (skip_count > 127) ? 127 : skip_count); X /*NOTREACHED*/ X! } X X /*+------------------------------------------------------------------------- X wcsend(argc,argp) -- send group of files X--- 757,764 ---- X Exitcode = 253; X exit(Exitcode ? Exitcode : (skip_count > 127) ? 127 : skip_count); X /*NOTREACHED*/ X! } /* end of main */ X! X X /*+------------------------------------------------------------------------- X wcsend(argc,argp) -- send group of files X*** /export/home/wht/src/ecu314/z/zcommon.c Wed Sep 4 00:25:17 1991 X--- z/zcommon.c Mon Sep 2 02:38:48 1991 X*************** X*** 16,30 **** X--- 16,36 ---- X X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X+ /*:08-30-1991-20:09-wht@n4hgf2-sun Nap was not returning a value */ X+ /*:08-30-1991-02:34-jdeitch@jadpc.cts.com-fix no hzmsec */ X /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */ X X #include X+ #include X #include X #include X #include X #include X+ #include X+ #include X+ #include X #include "zmodem.h" X X #if defined(sun) || defined(SVR4) X*************** X*** 188,193 **** X--- 194,200 ---- X * Return non 0 iff something to read from io descriptor f X */ X rdchk(f) X+ int f; X { X static long lf; X X*************** X*** 465,494 **** X As it is nap() is nearly useless. I believe select() suffers X from the same deficiency (< 1000 msec timeout becomes 1000 msec) but X I haven't "proven" it yet. X --------------------------------------------------------------------------*/ X long X Nap(msec) X long msec; X { X! #if defined(sun) || defined(SVR4) X struct timeval timer; X! timer.tv_sec = 0; X! timer.tv_usec = 1000L * msec; X! select(0,0,0,0,&timer); X #else X #if defined(M_XENIX) || defined(WORKING_UNIX_NAP) X return(nap(msec)); X #else X! #ifdef NEED_SHORT_INTERVALS /* borrow hzmsec setup from ecu.c if need to >*/ X if(msec < hzmsec) X msec = hzmsec; X- #endif X if(nap(msec) < 0) X return(-1); X return(msec); X #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */ X #endif /* sun */ X X } /* end of Nap */ X /* end of zcommon.c */ X /* vi: set tabstop=4 shiftwidth=4: */ X--- 472,518 ---- X As it is nap() is nearly useless. I believe select() suffers X from the same deficiency (< 1000 msec timeout becomes 1000 msec) but X I haven't "proven" it yet. X+ X+ On the sun, we use select to accomplish the nap requirement. X --------------------------------------------------------------------------*/ X long X Nap(msec) X long msec; X { X! #if defined(sun) X struct timeval timer; X! timer.tv_sec = msec / 1000; X! timer.tv_usec = (msec % 1000L) * 1000L; X! if(select(32,0,0,0,&timer) < 0) X! return(-1); X! return(msec); X #else X #if defined(M_XENIX) || defined(WORKING_UNIX_NAP) X return(nap(msec)); X #else X! #if defined(M_UNIX) || defined(ISC) || defined(SVR4) X! static ulong hzmsec = 0L; X! if(!hzmsec) /* learn tick rate for various timers */ X! { X! int hz; X! if(getenv("HZ")) X! hz = atoi(getenv("HZ")); X! else X! hz = HZ; X! hzmsec = (ulong)(1000 / hz) + 2; X! } X if(msec < hzmsec) X msec = hzmsec; X if(nap(msec) < 0) X return(-1); X return(msec); X+ #else X+ # include "porting.attion.needed.here" X+ #endif /* defined(M_UNIX) || defined(ISC) || defined(SVR4) */ X #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */ X #endif /* sun */ X X } /* end of Nap */ X+ X /* end of zcommon.c */ X /* vi: set tabstop=4 shiftwidth=4: */ X*** /export/home/wht/src/ecu314/z/zcurses.c Wed Sep 4 00:25:17 1991 X--- z/zcurses.c Mon Sep 2 20:39:49 1991 X*************** X*** 18,26 **** X 12| _55____________________________________________________ | comment str X 13| _55____________________________________________________ | remote info X 14`----------------------------------------------------------' X! 14| FE ___ OE ___ rcvd ________ xmtd ________ RTS _ CTS _ X 15| flow xmtr CTS ____ XOFF ____ rcvr RTS ____ XOFF ____ X X Defined functions: X clear_area(win,row,col,len) X clear_area_char(win,row,col,len,fillchar) X--- 18,31 ---- X 12| _55____________________________________________________ | comment str X 13| _55____________________________________________________ | remote info X 14`----------------------------------------------------------' X! X! 14| FE ___ OE ___ rcvd ________ xmtd ________ RTS _ CTS _ FASI X 15| flow xmtr CTS ____ XOFF ____ rcvr RTS ____ XOFF ____ X+ 16| queues: xmtr _____ of _____ rcvr _____ of _____ X X+ 14| Output queue depth ______ RTS _ CTS _ sun X+ 15| Input queue depth ______ Input queue avail ______ X+ X Defined functions: X clear_area(win,row,col,len) X clear_area_char(win,row,col,len,fillchar) X*************** X*** 60,66 **** X X ------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X--- 65,72 ---- X X ------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:09-02-1991-01:12-wht@n4hgf2-show sun driver information */ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by aega84!lh */ X /*:08-23-1991-18:33-wht@n4hgf2-disable force no curses for tty vs. line speed */ X /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X*************** X*** 86,92 **** X #if defined(M_SYSV) X # include X #else X! #if defined(ISC) X # include X # include X #endif X--- 92,98 ---- X #if defined(M_SYSV) X # include X #else X! #if defined(ISC) || defined(SVR4) X # include X # include X #endif X*************** X*** 113,122 **** X--- 119,133 ---- X unsigned char sHR = at_HR; X X #if defined(FASI) X+ #define WIN_LINES 18 X+ #else X+ #if defined(sun) X #define WIN_LINES 17 X #else X #define WIN_LINES 15 X+ #endif /* sun */ X #endif /* FASI */ X+ X #define WIN_COLS 60 X #define WIN_TOPY 2 X #define WIN_LEFTX 8 X*************** X*** 128,133 **** X--- 139,145 ---- X extern int force_no_curses; X extern int skip_count; X extern int npats; X+ extern int iofd; X extern long rxpos; X extern int log_packets; X extern long Txpos; X*************** X*** 179,185 **** X--- 191,202 ---- X #if defined(FASI) X " FE ___ OE ___ rcvd ________ xmtd ________ RTS _ CTS _ ", X " flow xmtr CTS ____ XOFF ____ rcvr RTS ____ XOFF ____ ", X+ " queues: xmtr _____ of _____ rcvr _____ of _____ ", X #endif /* FASI */ X+ #if defined(sun) X+ " Output queue depth ______ RTS _ CTS _ ", X+ " Input queue depth ______ Input queue avail ______ ", X+ #endif X /*`----------------------------------------------------------' */ X (char *)0 X }; X*************** X*** 277,283 **** X case S_IFBLK: *rtn = 'b'; break; /* block special */ X case S_IFREG: *rtn = '-'; break; /* regular */ X X! #if defined(BSD) X case S_IFLNK: *rtn = 'l'; break; /* symbolic link */ X case S_IFSOCK: *rtn = 's'; break; /* socket */ X #endif X--- 294,300 ---- X case S_IFBLK: *rtn = 'b'; break; /* block special */ X case S_IFREG: *rtn = '-'; break; /* regular */ X X! #if defined(BSD) || defined(SVR4) X case S_IFLNK: *rtn = 'l'; break; /* symbolic link */ X case S_IFSOCK: *rtn = 's'; break; /* socket */ X #endif X*************** X*** 529,535 **** X int X determine_output_mode() X { X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X int monitor_type; X #endif X struct stat dn; X--- 546,552 ---- X int X determine_output_mode() X { X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) || defined(SVR4) X int monitor_type; X #endif X struct stat dn; X*************** X*** 546,552 **** X return(1); X } X X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X if(ioctl(0,CONS_GET,&monitor_type) < 0) /* not multiscreen */ X { X #endif X--- 563,569 ---- X return(1); X } X X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) || defined(SVR4) X if(ioctl(0,CONS_GET,&monitor_type) < 0) /* not multiscreen */ X { X #endif X*************** X*** 599,605 **** X #ifdef TTY_VS_LINE_SPEED_NO_CURSES X test_tty_and_line_baud(); X #endif X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) X } X #endif X X--- 616,622 ---- X #ifdef TTY_VS_LINE_SPEED_NO_CURSES X test_tty_and_line_baud(); X #endif X! #if defined(M_UNIX) || defined(ISC) || defined(M_XENIX) || defined(SVR4) X } X #endif X X*************** X*** 631,639 **** X return; X X #if defined(FASI) X- { extern int iofd; X (void)ioctl(iofd,FASIC_SIP,&fip_start); X- } X #endif /* FASI */ X X if(!initscr()) X--- 648,654 ---- X*************** X*** 647,656 **** X--- 662,673 ---- X report_init_complete = 1; X win = newwin(WIN_LINES,WIN_COLS,WIN_TOPY,WIN_LEFTX); X box(win,sVR,sHR); X+ #ifndef SVR4 X wmove(win,0,0); waddch(win,sTL); X wmove(win,win->_maxy - 1,0); waddch(win,sBL); X wmove(win,win->_maxy - 1,win->_maxx - 1); waddch(win,sBR); X wmove(win,0,win->_maxx - 1); waddch(win,sTR); X+ #endif X wmove(win,0,2); X wstandout(win); X waddch(win,'['); X*************** X*** 660,667 **** X--- 677,689 ---- X waddch(win,' '); X waddch(win,']'); X wstandend(win); X+ #ifdef SVR4 X+ whline(win, (unsigned long)(sHR & 0x00ff), 2); X+ wmove(win,0, 8 + strlen(title)); X+ #else X waddch(win,sHR); X waddch(win,sHR); X+ #endif X waddch(win,' '); X itmp = WIN_COLS - 2 - 7 - strlen(title); X curr_dir[itmp] = 0; X*************** X*** 841,846 **** X--- 863,879 ---- X xmtr XOFF count: row 15 col 28 len 4 X rcvr CTS count: row 15 col 42 len 4 X rcvr XOFF count: row 15 col 52 len 4 X+ xmtr queue depth row 16 col 16 len 5 X+ xmtr queue size row 16 col 25 len 5 (one time) X+ rcvr queue depth row 16 col 37 len 5 X+ rcvr queue size row 16 col 46 len 5 (one time) X+ X+ If sun, X+ output queue depth row 14 col 23 len 6 X+ RTS status row 14 col 35 len 1 X+ CTS status row 14 col 42 len 1 X+ input queue depth row 15 col 23 len 6 X+ input queue avail row 15 col 49 len 6 X --------------------------------------------------------------------------*/ X report_rx_tx_count() X { X*************** X*** 849,856 **** X #if defined(FASI) X unsigned long ltmp; X struct fas_info now; X- extern int iofd; X #endif /* FASI */ X X register char *cptr; X X--- 882,894 ---- X #if defined(FASI) X unsigned long ltmp; X struct fas_info now; X #endif /* FASI */ X+ #if defined(sun) X+ uint output_queue; X+ uint input_avail; X+ uint input_size; X+ uint modem_lines; X+ #endif X X register char *cptr; X X*************** X*** 886,891 **** X--- 924,930 ---- X #if defined(FASI) X if(!ioctl(iofd,FASIC_SIP,&now)) X { X+ static int statics = 0; /* one time display flag */ X if((ltmp = now.framing_errors - fip_start.framing_errors) > 999L) X ltmp = 999L; X sprintf(s128,"%-3lu",ltmp); X*************** X*** 941,948 **** X--- 980,1049 ---- X sprintf(s128,"%-4lu",ltmp); X wmove(win,15,51); X waddstr(win,s128); X+ X+ if(now.xmit_ring_cnt > 99999) X+ now.xmit_ring_cnt = 99999; X+ sprintf(s128,"%-5u",now.xmit_ring_cnt); X+ wmove(win,16,16); X+ waddstr(win,s128); X+ X+ if(now.recv_ring_cnt > 99999) X+ now.recv_ring_cnt = 99999; X+ sprintf(s128,"%-5u",now.recv_ring_cnt); X+ wmove(win,16,37); X+ waddstr(win,s128); X+ X+ if(!statics) X+ { X+ statics = 1; X+ ltmp = XMIT_BUFF_SIZE; X+ if(ltmp > 99999) X+ ltmp = 99999; X+ sprintf(s128,"%-5lu",ltmp); X+ wmove(win,16,25); X+ waddstr(win,s128); X+ X+ ltmp = RECV_BUFF_SIZE; X+ if(ltmp > 99999) X+ ltmp = 99999; X+ sprintf(s128,"%-5lu",ltmp); X+ wmove(win,16,46); X+ waddstr(win,s128); X+ } X } X #endif /* FASI */ X+ X+ #if defined(sun) X+ output_queue = 0; X+ ioctl(iofd,TIOCOUTQ,(int *)&output_queue); X+ if(output_queue > 999999) X+ output_queue = 999999; X+ sprintf(s128,"%6u",output_queue); X+ wmove(win,14,23); X+ waddstr(win,s128); X+ X+ modem_lines = 0; X+ ioctl(iofd,TIOCMGET,(int *)&modem_lines); X+ wmove(win,14,35); X+ waddch(win,(modem_lines & TIOCM_RTS) ? 'T' : 'F'); X+ wmove(win,14,42); X+ waddch(win,(modem_lines & TIOCM_CTS) ? 'T' : 'F'); X+ X+ input_size = 0; X+ input_avail = 0; X+ ioctl(iofd,TIOCISPACE,(int *)&input_avail); X+ ioctl(iofd,TIOCISIZE,(int *)&input_size); X+ if(input_size > 999999) X+ input_size = 999999; X+ if(input_avail > 999999) X+ input_avail = 999999; X+ sprintf(s128,"%6u",input_size - input_avail); X+ wmove(win,15,23); X+ waddstr(win,s128); X+ sprintf(s128,"%6u",input_avail); X+ wmove(win,15,49); X+ waddstr(win,s128); X+ #endif X X report_window(); X X*** /export/home/wht/src/ecu314/z/zmodem.h Wed Sep 4 00:25:17 1991 X--- z/zmodem.h Sun Sep 1 14:28:39 1991 X*************** X*** 2,8 **** X zmodem.h -- common include filefor ecurz/ecusz X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by slootman@dri.nl */ X /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:08-14-1990-20:41-wht@n4hgf-ecu3.00-flush old edit history */ X--- 2,8 ---- X zmodem.h -- common include filefor ecurz/ecusz X --------------------------------------------------------------------------*/ X /*+:EDITS:*/ X! /*:08-28-1991-14:08-wht@n4hgf2-SVR4 cleanup by aega84!lh */ X /*:08-21-1991-06:23-wht@n4hgf-sun porting */ X /*:07-25-1991-12:59-wht@n4hgf-ECU release 3.10 */ X /*:08-14-1990-20:41-wht@n4hgf-ecu3.00-flush old edit history */ X*************** X*** 26,33 **** X X #include X #include X- #include X #if defined(sun) X #undef ECHO X #undef NL0 X #undef NL1 X--- 26,40 ---- X X #include X #include X #if defined(sun) X+ #include X+ #define termio termios X+ #undef TCGETA X+ #undef TCSETA X+ #undef TCSETAW X+ #define TCGETA TCGETS X+ #define TCSETA TCSETS X+ #define TCSETAW TCSETSW X #undef ECHO X #undef NL0 X #undef NL1 X*************** X*** 47,53 **** X #undef FLUSHO X #undef PENDIN X #undef NOFLSH X! #endif X #include X #include X #define MODE2OK X--- 54,62 ---- X #undef FLUSHO X #undef PENDIN X #undef NOFLSH X! #else X! #include X! #endif /* sun */ X #include X #include X #define MODE2OK SHAR_EOF echo 'File PATCH5.01 is complete' && chmod 0664 PATCH5.01 || echo 'restore of PATCH5.01 failed' Wc_c="`wc -c < 'PATCH5.01'`" test 157812 -eq "$Wc_c" || echo 'PATCH5.01: original size 157812, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= fasi/fas.h ============== if test ! -d 'fasi'; then echo 'x - creating directory fasi' mkdir 'fasi' fi if test -f 'fasi/fas.h' -a X"$1" != X"-c"; then echo 'x - skipping fasi/fas.h (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting fasi/fas.h (Text)' sed 's/^X//' << 'SHAR_EOF' > 'fasi/fas.h' && X/* This file contains various defines for the FAS async driver. X If you change anything here you have to recompile the driver module. X*/ X/*+:EDITS:*/ X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */ X/*:06-04-1991-19:41-wht@n4hgf-add FASIC_SIP_CHANGE */ X/*:01-20-1991-16:17-wht@n4hgf-add fas_names */ X/*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes */ X X/* Alas, SCO idinstall has no -z (Define) option like ISC does */ X#if !defined(FASI) X#define FASI X#endif X#if !defined(SCO) X#define SCO X#endif X X#if !defined (M_I286) && !defined(__STDC__) X#ident "@(#)fas.h 2.08" X#endif X X/* Uncomment the following line if you need asyputchar and asygetchar. X This is only required if you link the kernel without the original X asy driver and these functions aren't provided by any other kernel X module. X*/ X/* #define NEED_PUT_GETCHAR /* */ X X/* Uncomment the following line if you have VP/ix support in the X kernel. X*/ X/* #define HAVE_VPIX /* */ X X/* Uncomment the following line if you need init8250. DosMerge needs X this function, but only if you link the kernel without the original X asy driver. X*/ X/* #define NEED_INIT8250 /* */ X X#if defined (VPIX) X#undef VPIX X#endif X X#if defined (HAVE_VPIX) X#define VPIX X#endif X X#if defined (XENIX) Xtypedef unsigned char unchar; Xtypedef unsigned long ulong; X/* X** Union for use by all device handler ioctl routines. X*/ Xunion ioctl_arg { X struct termio *stparg; /* ptr to termio struct */ X char *cparg; /* ptr to character */ X char carg; /* character */ X int *iparg; /* ptr to integer */ X int iarg; /* integer */ X long *lparg; /* ptr to long */ X long larg; /* long */ X}; X#endif X X#if defined (TRUE) X#undef TRUE X#endif X#define TRUE (1) X X#if defined (FALSE) X#undef FALSE X#endif X#define FALSE (0) X X/* Initial line control register. Value will only be meaningful for X asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_LINE_CONTROL LC_WORDLEN_8 X X/* Initial baud rate. Value will only be meaningful for X asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_BAUD_RATE (BAUD_BASE/9600) X X/* Initial modem control register. This should probably not have to X be touched. It is here because some terminals used as the console X require one or more of the modem signals set. It is only meaningful X for asyputchar and asygetchar and they are only meaningful if X NEED_PUT_GETCHAR is defined. X*/ X#define INITIAL_MDM_CONTROL 0 X X/****************************************************/ X/* Nothing past this line should have to be changed */ X/****************************************************/ X X#define NUM_INT_VECTORS 32 /* number of possible int vectors, but X only the first eight are normally used X */ X X#define MAX_UNITS 16 /* we will only use that many units */ X X/* Miscellaneous Constants */ X X#define BAUD_BASE (1843200 / 16) /* 115200 bps */ X#define HANGUP_DELAY 500 /* in milli-seconds */ X#define HANGUP_TIME 1000 /* in milli-seconds */ X#define RECOVER_TIME 30 /* in seconds */ X#define BREAK_TIME 250 /* in milli-seconds */ X#define EVENT_TIME 20 /* in milli-seconds */ X#if defined (M_I286) X#define RECV_BUFF_SIZE 1000 /* receiver ring buffer size (MAX) */ X#define XMIT_BUFF_SIZE 500 /* transmitter ring buffer size */ X#else X#if defined(FASI) /* we'll make do with less */ X#define RECV_BUFF_SIZE 3500 /* receiver ring buffer size (MAX) */ X#define XMIT_BUFF_SIZE 500 /* transmitter ring buffer size */ X#else /* FASI */ X#define RECV_BUFF_SIZE 5000 /* receiver ring buffer size (MAX) */ X#define XMIT_BUFF_SIZE 2500 /* transmitter ring buffer size */ X#endif /* FASI */ X#endif /* M_I286 */ X X#define RBS RECV_BUFF_SIZE X X#define SW_LOW_WATER ((int)(RBS*0.5)) /* 50% MAX sw flow control */ X#define SW_HIGH_WATER ((int)(RBS*0.8)) /* 80% MAX trigger levels */ X#if defined(FASI) /* experiment */ X#define HW_LOW_WATER (RBS-300) /* MAX - 300 hw flow control */ X#define HW_HIGH_WATER (RBS-100) /* MAX - 100 trigger levels */ X#else X#define HW_LOW_WATER (RBS-500) /* MAX - 500 hw flow control */ X#define HW_HIGH_WATER (RBS-300) /* MAX - 300 trigger levels */ X#endif X#define MAX_UNIX_FILL (TTYHOG) /* read buffer max UNIX fill level */ X#define MAX_VPIX_FILL 64 /* read buffer max VP/ix fill level */ X#define MIN_READ_CHUNK 32 /* must be <= MAX_????_FILL/2 */ X#define MAX_MSI_CNT 1000 /* max modem status ints per second */ X#define READ_PORT 0x0100 /* read command for fas_init_seq */ X#define NO_FIFO 0x10000 /* force FIFOs off */ X#define SOFT_INIT 0 /* init registers if cflag changed */ X#define HARD_INIT 1 /* init registers w/o checking cflag */ X#if defined (XENIX) X#define SPLWRK spl5 /* SPL for character processing */ X#define SPLINT spl7 /* SPL to disable FAS interrupts */ X#else X#define SPLWRK spl6 /* SPL for character processing */ X#define SPLINT spltty /* SPL to disable FAS interrupts */ X#endif X X#if ((EVENT_TIME) * (HZ) / 1000) == 0 X#undef EVENT_TIME X#define EVENT_TIME (1000 / (HZ)) X#endif X X#if (MAX_UNIX_FILL) > (TTYHOG) X#undef MAX_UNIX_FILL X#define MAX_UNIX_FILL (TTYHOG) X#endif X X#if (MAX_VPIX_FILL) > (TTYHOG) X#undef MAX_VPIX_FILL X#define MAX_VPIX_FILL (TTYHOG) X#endif X X#if (MIN_READ_CHUNK) > ((MAX_UNIX_FILL) / 2) X#undef MIN_READ_CHUNK X#define MIN_READ_CHUNK ((MAX_UNIX_FILL) / 2) X#endif X X#if (MIN_READ_CHUNK) > ((MAX_VPIX_FILL) / 2) X#undef MIN_READ_CHUNK X#define MIN_READ_CHUNK ((MAX_VPIX_FILL) / 2) X#endif X X#define MAX_INPUT_FIFO_SIZE INPUT_NS_FIFO_SIZE X#define MAX_OUTPUT_FIFO_SIZE OUTPUT_NS_FIFO_SIZE X X X/* Here are the modem control flags for the fas_modem array in space.c. X They are arranged in three 8-bit masks which are combined to a 32-bit X word. Each of these 32-bit words represents one entry in the fas_modem X array. X X The lowest byte is used as a mask to manipulate the modem control X register for modem disable. Use the MC_* macros to build the mask. X X The second lowest byte is used as a mask to manipulate the modem control X register for modem enable during dialout. Use the MC_* macros to build X the mask and shift them 8 bits to the left. X X The second highest byte is used as a mask to manipulate the modem control X register for modem enable during dialin. Use the MC_* macros to build X the mask and shift them 16 bits to the left. X X The highest byte is used to mask signals from the modem status X register that will be used as the carrier detect signal. Use the MS_* X macros to build the mask and shift them 24 bits to the left. If you use X more than one signal, carrier is considered on only when all signals X are on. X X Here are some useful macros for the space.c file. You may create your X own macros if you have some special requirements not met by the X predefined ones. X*/ X X/* modem disable (choose one) */ X#define DI_RTS MC_SET_RTS /* RTS disables modem */ X#define DI_DTR MC_SET_DTR /* DTR disables modem */ X#define DI_RTS_AND_DTR (MC_SET_RTS | MC_SET_DTR) X X/* modem enable for dialout (choose one) */ X#define EO_RTS (MC_SET_RTS << 8) /* RTS enables modem */ X#define EO_DTR (MC_SET_DTR << 8) /* DTR enables modem */ X#define EO_RTS_AND_DTR ((MC_SET_RTS | MC_SET_DTR) << 8) X X/* modem enable for dialin (choose one) */ X#define EI_RTS (MC_SET_RTS << 16) /* RTS enables modem */ X#define EI_DTR (MC_SET_DTR << 16) /* DTR enables modem */ X#define EI_RTS_AND_DTR ((MC_SET_RTS | MC_SET_DTR) << 16) X X/* carrier detect signal (choose one) */ X#define CA_DCD (MS_DCD_PRESENT << 24) /* DCD is carr. detect */ X#define CA_CTS (MS_CTS_PRESENT << 24) /* CTS is carr. detect */ X#define CA_DSR (MS_DSR_PRESENT << 24) /* DSR is carr. detect */ X X X/* Here are the hardware handshake flags for the fas_flow array in space.c. X They are arranged in three 8-bit masks which are combined to a 32-bit X word. Each of these 32-bit words represents one entry in the fas_flow X array. X X The lowest byte is used as a mask to manipulate the modem control X register for input flow control. Use the MC_* macros to build the mask. X X The second lowest byte is used to mask signals from the modem status X register that will be used for output flow control. Use the MS_* macros X to build the mask and shift them 8 bits to the left. If you use more X than one signal, output is allowed only when all signals are on. X X The second highest byte is used to mask signals from the modem status X register that will be used to enable the output flow control selected X by the second lowest byte. Use the MS_* macros to build the mask and X shift them 16 bits to the left. If you use more than one signal, output X flow control is enabled only when all signals are on. X X The highest byte is used as a mask to manipulate the modem control X register for output half duplex flow control. Use the MC_* macros to X build the mask and shift them 24 bits to the left. X X Here are some useful macros for the space.c file. You may create your X own macros if you have some special requirements not met by the X predefined ones. X*/ X X/* input flow control (choose one) */ X#define HI_RTS MC_SET_RTS /* RTS input flow ctrl */ X#define HI_DTR MC_SET_DTR /* DTR input flow ctrl */ X#define HI_RTS_AND_DTR (MC_SET_RTS | MC_SET_DTR) X X/* output flow control (choose one) */ X#define HO_CTS (MS_CTS_PRESENT << 8) /* CTS output flow ctrl */ X#define HO_DSR (MS_DSR_PRESENT << 8) /* DSR output flow ctrl */ X#define HO_CTS_AND_DSR ((MS_CTS_PRESENT | MS_DSR_PRESENT) << 8) X#define HO_CTS_ON_DSR ((MS_CTS_PRESENT << 8) | (MS_DSR_PRESENT << 16)) X#define HO_CTS_ON_DSR_AND_DCD ((MS_CTS_PRESENT << 8) \ X | ((MS_DSR_PRESENT | MS_DCD_PRESENT) << 16)) X X/* output hdx flow control (choose one) */ X#define HX_RTS (MC_SET_RTS << 24) /* RTS hdx flow ctrl */ X#define HX_DTR (MC_SET_DTR << 24) /* DTR hdx flow ctrl */ X#define HX_RTS_AND_DTR ((MC_SET_RTS | MC_SET_DTR) << 24) X X X/* define the local open flags */ X X#define OS_DEVICE_CLOSED 0x0000 X#define OS_OPEN_FOR_DIALOUT 0x0001 X#define OS_OPEN_FOR_GETTY 0x0002 X#define OS_WAIT_OPEN 0x0004 X#define OS_NO_DIALOUT 0x0008 X#define OS_FAKE_CARR_ON 0x0010 X#define OS_CLOCAL 0x0020 X#define OS_HWO_HANDSHAKE 0x0040 X#define OS_HWI_HANDSHAKE 0x0080 X#define OS_HDX_HANDSHAKE 0x0100 X#define OS_EXCLUSIVE_OPEN_1 0x0200 X#define OS_EXCLUSIVE_OPEN_2 0x0400 /* SYSV 3.2 Xenix compatibility */ X X#define OS_OPEN_STATES (OS_OPEN_FOR_DIALOUT | OS_OPEN_FOR_GETTY) X#define OS_TEST_MASK (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \ X | OS_FAKE_CARR_ON | OS_CLOCAL \ X | OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \ X | OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1 \ X | OS_EXCLUSIVE_OPEN_2) X#define OS_SU_TEST_MASK (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \ X | OS_FAKE_CARR_ON | OS_CLOCAL \ X | OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \ X | OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1) X X/* define the device status flags */ X X#define DF_DEVICE_CONFIGURED 0x0001 /* device is configured */ X#define DF_DEVICE_IS_NS16550A 0x0002 /* it's an NS16550A */ X#define DF_DEVICE_IS_I82510 0x0004 /* it's an I82510 */ X#define DF_CTL_FIRST 0x0008 /* write ctl port at first access */ X#define DF_CTL_EVERY 0x0010 /* write ctl port at every access */ X#define DF_DEVICE_OPEN 0x0020 /* physical device is open */ X#define DF_DEVICE_LOCKED 0x0040 /* physical device locked */ X#define DF_MODEM_ENABLED 0x0080 /* modem enabled */ X#define DF_XMIT_BUSY 0x0100 /* transmitter busy */ X#define DF_XMIT_BREAK 0x0200 /* transmitter sends break */ X#define DF_XMIT_LOCKED 0x0400 /* transmitter locked against output */ X#define DF_DO_HANGUP 0x0800 /* delayed hangup request */ X#define DF_DO_BREAK 0x1000 /* delayed break request */ X#define DF_GUARD_TIMEOUT 0x2000 /* protect last char from corruption */ X#define DF_NS16550A_DROP_MODE 0x4000 /* receiver trigger level is dropped */ X X/* define the flow control status flags */ X X#define FF_HWO_HANDSHAKE 0x0001 /* output hw handshake enabled */ X#define FF_HWI_HANDSHAKE 0x0002 /* input hw handshake enabled */ X#define FF_HDX_HANDSHAKE 0x0004 /* output hdx hw handshake enabled */ X#define FF_HWO_STOPPED 0x0008 /* output stopped by hw handshake */ X#define FF_HWI_STOPPED 0x0010 /* input stopped by hw handshake */ X#define FF_HDX_STARTED 0x0020 /* output buffer contains characters */ X#define FF_SWO_STOPPED 0x0040 /* output stopped by sw flow control */ X#define FF_SWI_STOPPED 0x0080 /* input stopped by sw flow control */ X#define FF_SW_FC_REQ 0x0100 /* sw input flow control request */ X#define FF_RXFER_STOPPED 0x0200 /* rxfer function stopped */ X X/* define the scheduled events flags */ X X#define EF_DO_RXFER 0x0001 /* rxfer function request */ X#define EF_DO_XXFER 0x0002 /* xxfer function request */ X#define EF_DO_BRKINT 0x0004 /* break int request */ X#define EF_DO_MPROC 0x0008 /* mproc function request */ X#define EF_SIGNAL_VPIX 0x0010 /* send pseudorupt to VP/ix */ X X/* define an easy way to reference the port structures */ X X#define RCV_DATA_PORT (fip->port_0) X#define XMT_DATA_PORT (fip->port_0) X#define INT_ENABLE_PORT (fip->port_1) X#define INT_ID_PORT (fip->port_2) X#define NS_FIFO_CTL_PORT (fip->port_2) X#define I_BANK_PORT (fip->port_2) X#define LINE_CTL_PORT (fip->port_3) X#define MDM_CTL_PORT (fip->port_4) X#define I_IDM_PORT (fip->port_4) X#define LINE_STATUS_PORT (fip->port_5) X#define I_RCM_PORT (fip->port_5) X#define MDM_STATUS_PORT (fip->port_6) X#define I_TCM_PORT (fip->port_6) X#define DIVISOR_LSB_PORT (fip->port_0) X#define DIVISOR_MSB_PORT (fip->port_1) X#define CTL_PORT (fip->ctl_port) X X/* modem control port */ X X#define MC_SET_DTR 0x01 X#define MC_SET_RTS 0x02 X#define MC_SET_OUT1 0x04 X#define MC_SET_OUT2 0x08 /* tristates int line when false */ X#define MC_SET_LOOPBACK 0x10 X X#define MC_ANY_CONTROL (MC_SET_DTR | MC_SET_RTS) X X/* modem status port */ X X#define MS_CTS_DELTA 0x01 X#define MS_DSR_DELTA 0x02 X#define MS_RING_TEDGE 0x04 X#define MS_DCD_DELTA 0x08 X#define MS_CTS_PRESENT 0x10 X#define MS_DSR_PRESENT 0x20 X#define MS_RING_PRESENT 0x40 X#define MS_DCD_PRESENT 0x80 X X#define MS_ANY_DELTA (MS_CTS_DELTA | MS_DSR_DELTA | MS_RING_TEDGE \ X | MS_DCD_DELTA) X#define MS_ANY_PRESENT (MS_CTS_PRESENT | MS_DSR_PRESENT | MS_RING_PRESENT \ X | MS_DCD_PRESENT) X X/* interrupt enable port */ X X#define IE_NONE 0x00 X#define IE_RECV_DATA_AVAILABLE 0x01 X#define IE_XMIT_HOLDING_BUFFER_EMPTY 0x02 X#define IE_LINE_STATUS 0x04 X#define IE_MODEM_STATUS 0x08 X X#define IE_INIT_MODE (IE_RECV_DATA_AVAILABLE | IE_XMIT_HOLDING_BUFFER_EMPTY \ X | IE_LINE_STATUS | IE_MODEM_STATUS) X X/* interrupt id port */ X X#define II_NO_INTS_PENDING 0x01 X#define II_CODE_MASK 0x07 X#define II_MODEM_STATE 0x00 X#define II_XMTD_CHAR 0x02 X#define II_RCVD_CHAR 0x04 X#define II_RCV_ERROR 0x06 X#define II_NS_FIFO_TIMEOUT 0x08 X#define II_NS_FIFO_ENABLED 0xC0 X X/* line control port */ X X#define LC_WORDLEN_MASK 0x03 X#define LC_WORDLEN_5 0x00 X#define LC_WORDLEN_6 0x01 X#define LC_WORDLEN_7 0x02 X#define LC_WORDLEN_8 0x03 X#define LC_STOPBITS_LONG 0x04 X#define LC_ENABLE_PARITY 0x08 X#define LC_EVEN_PARITY 0x10 X#define LC_STICK_PARITY 0x20 X#define LC_SET_BREAK_LEVEL 0x40 X#define LC_ENABLE_DIVISOR 0x80 X X/* line status port */ X X#define LS_RCV_AVAIL 0x01 X#define LS_OVERRUN 0x02 X#define LS_PARITY_ERROR 0x04 X#define LS_FRAMING_ERROR 0x08 X#define LS_BREAK_DETECTED 0x10 X#define LS_XMIT_AVAIL 0x20 X#define LS_XMIT_COMPLETE 0x40 X#define LS_ERROR_IN_NS_FIFO 0x80 /* NS16550A only */ X X#define LS_RCV_INT (LS_RCV_AVAIL | LS_OVERRUN | LS_PARITY_ERROR \ X | LS_FRAMING_ERROR | LS_BREAK_DETECTED) X X/* fifo control port (NS16550A only) */ X X#define NS_FIFO_ENABLE 0x01 X#define NS_FIFO_CLR_RECV 0x02 X#define NS_FIFO_CLR_XMIT 0x04 X#define NS_FIFO_START_DMA 0x08 X#define NS_FIFO_SIZE_1 0x00 X#define NS_FIFO_SIZE_4 0x40 X#define NS_FIFO_SIZE_8 0x80 X#define NS_FIFO_SIZE_14 0xC0 X#define NS_FIFO_SIZE_MASK 0xC0 X X#define NS_FIFO_CLEAR_CMD 0 X#define NS_FIFO_DROP_CMD (NS_FIFO_SIZE_1 | NS_FIFO_ENABLE) X#define NS_FIFO_SETUP_CMD (NS_FIFO_SIZE_4 | NS_FIFO_ENABLE) X#define NS_FIFO_INIT_CMD (NS_FIFO_SETUP_CMD | NS_FIFO_CLR_RECV \ X | NS_FIFO_CLR_XMIT) X X#define INPUT_NS_FIFO_SIZE 16 X#define OUTPUT_NS_FIFO_SIZE 16 X X/* fifo control ports (i82510 only) */ X X#define I_BANK_0 0x00 X#define I_BANK_1 0x20 X#define I_BANK_2 0x40 X#define I_BANK_3 0x60 X#define I_FIFO_ENABLE 0x08 X#define I_FIFO_CLR_RECV 0x30 X#define I_FIFO_CLR_XMIT 0x0c X X#define I_FIFO_CLEAR_CMD 0 X#define I_FIFO_SETUP_CMD I_FIFO_ENABLE X X#define INPUT_I_FIFO_SIZE 4 X#define OUTPUT_I_FIFO_SIZE 4 X X/* defines for ioctl calls (VP/ix) */ X X#define AIOC ('A'<<8) X#define AIOCINTTYPE (AIOC|60) /* set interrupt type */ X#define AIOCDOSMODE (AIOC|61) /* set DOS mode */ X#define AIOCNONDOSMODE (AIOC|62) /* reset DOS mode */ X#define AIOCSERIALOUT (AIOC|63) /* serial device data write */ X#define AIOCSERIALIN (AIOC|64) /* serial device data read */ X#define AIOCSETSS (AIOC|65) /* set start/stop chars */ X#define AIOCINFO (AIOC|66) /* tell us what device we are */ X X/* ioctl alternate names used by VP/ix */ X X#define VPC_SERIAL_DOS AIOCDOSMODE X#define VPC_SERIAL_NONDOS AIOCNONDOSMODE X#define VPC_SERIAL_INFO AIOCINFO X#define VPC_SERIAL_OUT AIOCSERIALOUT X#define VPC_SERIAL_IN AIOCSERIALIN X X#if defined(FASI) X#define FASIC ('~' << 8) X#define FASIC_SIP (FASIC | 16) /* get entire fas_info struct */ X#define FASIC_SIP_CHANGE (FASIC | 17) /* get entire fas_info struct X * after wait for change */ X#define FASIC_MSR (FASIC | 18) /* get various registers */ X#define FASIC_LCR (FASIC | 19) X#define FASIC_IER (FASIC | 20) X#define FASIC_MCR (FASIC | 21) X#define FASIC_DVR_IDENT (FASIC | 22) /* get driver revision */ X#define FASIC_SPACE_IDENT (FASIC | 23) /* get space.c revision */ X#define FASIC_RESET_STAT (FASIC | 24) /* reset statistics */ X#endif /* FASI */ X X/* serial in/out requests */ X X#define SO_DIVLLSB 1 X#define SO_DIVLMSB 2 X#define SO_LCR 3 X#define SO_MCR 4 X#define SI_MSR 1 X#define SIO_MASK(x) (1<<((x)-1)) X X X/* This structure contains everything one would like to know about X an open device. There is one of it for each physical unit. X X We use several unions to eliminate most integer type conversions X at run-time. The standard UNIX V 3.X/386 C compiler forces all X operands in expressions and all function parameters to type int. X To save some time, with the means of unions we deliver type int X at the proper locations while dealing with the original type X wherever int would be slower. X X This is highly compiler implementation specific. But for the sake X of speed the end justifies the means. X X Take care that the size of the area that contains the various X structure fields (up to, but excluding the ring buffers) X is <= 128 bytes. Otherwise a 4-byte offset is used to access X some of the structure fields. For the first 128 bytes a 1-byte X offset is used, which is faster. X*/ X Xstruct fas_info X{ X struct tty *tty; /* the tty structure */ X struct fas_info *prev_int_user;/* link to previous fas_info struct */ X struct fas_info *next_int_user;/* link to next fas_info struct */ X int timeout_idx; /* timeout index for untimeout () */ X uint iflag; /* current terminal input flags */ X uint cflag; /* current terminal hardware control flags */ X union { /* flags about the device state */ X ushort s; X uint i; X } device_flags; X union { /* flags about the flow control state */ X ushort s; X uint i; X } flow_flags; X union { /* flags about the scheduled events */ X ushort s; X uint i; X } event_flags; X uint o_state; /* current open state */ X uint po_state; /* previous open state */ X union { /* modem control masks */ X struct { X unchar di; /* mask for modem disable */ X unchar eo; /* mask for modem enable (dialout) */ X unchar ei; /* mask for modem enable (dialin) */ X unchar ca; /* mask for carrier detect */ X } m; X ulong l; X } modem; X union { /* hardware flow control masks */ X struct { X unchar ic; /* control mask for inp. flow ctrl */ X unchar oc; /* control mask for outp. flow ctrl */ X unchar oe; /* enable mask for outp. flow ctrl */ X unchar hc; /* control mask for hdx flow ctrl */ X } m; X ulong l; X } flow; X unchar msr; /* modem status register value */ X unchar new_msr; /* new modem status register value */ X unchar mcr; /* modem control register value */ X unchar lcr; /* line control register value */ X unchar ier; /* interrupt enable register value */ X unchar vec; /* interrupt vector for this struct */ X unchar msi_cnt; /* modem status interrupt counter */ X#if defined (HAVE_VPIX) X unchar v86_intmask; /* VP/ix pseudorupt mask */ X v86_t *v86_proc; /* VP/ix v86proc pointer for pseudorupts */ X struct termss v86_ss; /* VP/ix start/stop characters */ X#endif X uint ctl_port; /* muliplexer control port */ X union { /* uart port addresses and control values */ X uint addr; X struct { X ushort addr; X unchar ctl; X } p; X } port_0, port_1, port_2, port_3, port_4, port_5, port_6; X uint recv_ring_cnt; /* receiver ring buffer counter */ X unchar *recv_ring_put_ptr; /* recv ring buf put ptr */ X unchar *recv_ring_take_ptr; /* recv ring buf take ptr */ X ushort xmit_fifo_size; /* transmitter FIFO size */ X ushort xmit_ring_size; /* transmitter ring buffer size */ X uint xmit_ring_cnt; /* transmitter ring buffer counter */ X unchar *xmit_ring_put_ptr; /* xmit ring buf put ptr */ X unchar *xmit_ring_take_ptr; /* xmit ring buf take ptr */ X#if defined(FASI) X unsigned long characters_received; X unsigned long characters_transmitted; X unsigned long modem_status_events; X unsigned long overrun_errors; X unsigned long framing_errors; X unsigned long parity_errors; X unsigned long rings_detected; X unsigned long breaks_detected; X unsigned long xmtr_hw_flow_count; X unsigned long xmtr_sw_flow_count; X unsigned long rcvr_hw_flow_count; X unsigned long rcvr_sw_flow_count; X#endif /* FASI */ X unchar recv_buffer [RECV_BUFF_SIZE]; /* recv ring buf */ X unchar xmit_buffer [XMIT_BUFF_SIZE]; /* xmit ring buf */ X}; X X#if defined(FASI) Xstruct fas_name X{ X char name[8]; X}; X#endif SHAR_EOF chmod 0644 fasi/fas.h || echo 'restore of fasi/fas.h failed' Wc_c="`wc -c < 'fasi/fas.h'`" test 21859 -eq "$Wc_c" || echo 'fasi/fas.h: original size 21859, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= ckermit/ckutio-ecu.dif ============== if test ! -d 'ckermit'; then echo 'x - creating directory ckermit' mkdir 'ckermit' fi if test -f 'ckermit/ckutio-ecu.dif' -a X"$1" != X"-c"; then echo 'x - skipping ckermit/ckutio-ecu.dif (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting ckermit/ckutio-ecu.dif (Text)' sed 's/^X//' << 'SHAR_EOF' > 'ckermit/ckutio-ecu.dif' && X0a1,5 X> #define ECU_MODS X> #ifdef ECU_MODS X> char *ckxv = "Unix tty I/O, 4F(056)/ecu mods by wht@n4hgf, 14 Jul 91"; X> static int ecu_calling = 0; X> #else X1a7,9 X> #endif X> /*+:EDITS:*/ X> /*:07-14-1991-15:46-wht@n4hgf-ECU mods for 4F */ X645a654,655 X> /****** b e f o r e ****************************************************/ X> #ifndef ECU_MODS X665a676,724 X> #endif X> X> /****** a f t e r ******************************************************/ X> #ifdef ECU_MODS X> if(isdigit(*ttname)) X> { X> xlocal = *lcl = 1; /* force local if fd passed to program */ X> debug(F111,"ttopen numeric ttname, new local",ttname,xlocal); X> ttyfd = atoi(ttname); X> debug(F101,"ttyfd passed as numeric=","",ttyfd); X> ecu_calling = 1; X> /* Get tty device settings */ X> #ifndef UXIII X> gtty(ttyfd,&ttold); /* Get sgtty info */ X> gtty(ttyfd,&ttraw); /* And a copy of it for packets*/ X> gtty(ttyfd,&tttvt); /* And one for virtual tty service */ X> #else X> ioctl(ttyfd,TCGETA,&ttold); /* Same deal for Sys III, Sys V */ X> ioctl(ttyfd,TCGETA,&ttraw); X> ioctl(ttyfd,TCGETA,&tttvt); X> #endif /* not uxiii */ X> return(0); X> } X> else X> { X> #ifdef UXIII X> #ifdef ATT7300 X> /* X> Open comms line without waiting for carrier so initial call does not hang X> because state of "modem" is likely unknown at the initial call -jrd. X> */ X> ttyfd = open(ttname,O_RDWR | O_NDELAY); X> #else X> ttyfd = open(ttname,O_RDWR | (modem ? O_NDELAY : 0) ); X> #endif /* att7300 */ X> #else /* not uxiii */ X> #ifdef O_NDELAY X> ttyfd = open(ttname,O_RDWR | (modem ? O_NDELAY : 0) ); X> #else /* O_NDELAY not defined */ X> ttyfd = open(ttname,2); X> #endif /* O_NDELAY */ X> #endif /* uxiii */ X> debug(F111,"ttopen","modem",modem); X> debug(F101," ttyfd","",ttyfd); X> X> } X> #endif /* ECU_MODS */ X> /***********************************************************************/ X> X849a909,916 X> #ifdef ECU_MODS X> if(ecu_calling) X> { X> debug(F101,"ttclos disabled for ecu","",0); X> return(0); X> } X> #endif X> X903a971,978 X> #endif X> X> #ifdef ECU_MODS X> if(ecu_calling) X> { X> debug(F101,"tthang disabled for ecu","",0); X> return(0); X> } SHAR_EOF chmod 0644 ckermit/ckutio-ecu.dif || echo 'restore of ckermit/ckutio-ecu.dif failed' Wc_c="`wc -c < 'ckermit/ckutio-ecu.dif'`" test 2337 -eq "$Wc_c" || echo 'ckermit/ckutio-ecu.dif: original size 2337, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= memmove/README ============== if test ! -d 'memmove'; then echo 'x - creating directory memmove' mkdir 'memmove' fi if test -f 'memmove/README' -a X"$1" != X"-c"; then echo 'x - skipping memmove/README (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting memmove/README (Text)' sed 's/^X//' << 'SHAR_EOF' > 'memmove/README' && XThis memmove is courtesy of Chip Salzenberg with some hel,p from XRoger Cornelius. I hacked out the .asm versions. X XChip Salzenberg: X> SCO's memmove() function in the 3.2v2 development system libc.a X> library has an insidious bug: it trashes the EBX register. This X> register is used to hold register variables. I suspect the bug crept X> in due to a simple-minded translation of a '286 routine, because on X> the '286, BX need not be preserved. X> X> The fix is to replace memmove.o in /lib/libc.a with the version X> included below. Note that if you use profiling, you must also put a X> profiling version of memmove() in /usr/lib/libp/libc.a. X> X> To assemble the non-profiling version: X> X> as -m -o memmove.o memmove.s X X(How strange that this bug has gone unnoticed for so long...) X XRoger Cornelius : X> The following will build the profiling memmove.o correctly: X> X> m4 profile.s memmove.s > memmove_p.s # order is important! X> as -o memmove_p.o memmove_p.s X> X> Note also that manually running memmove.s through m4 (instead of X> using as -m) before assembling will also save 100 or so bytes in the X> .o file for the non-profiling version. SHAR_EOF chmod 0664 memmove/README || echo 'restore of memmove/README failed' Wc_c="`wc -c < 'memmove/README'`" test 1169 -eq "$Wc_c" || echo 'memmove/README: original size 1169, current size' "$Wc_c" rm -f _shar_wnt_.tmp fi # ============= memmove/memmove.s ============== if test -f 'memmove/memmove.s' -a X"$1" != X"-c"; then echo 'x - skipping memmove/memmove.s (File already exists)' rm -f _shar_wnt_.tmp else > _shar_wnt_.tmp echo 'x - extracting memmove/memmove.s (Text)' sed 's/^X//' << 'SHAR_EOF' > 'memmove/memmove.s' && X/+------------------------------------------------------------------ X/ memmove.s X/ X/ $Id: memmove.s,v 1.3 1991/06/05 19:15:44 chip Exp $ X/ X/ Implementation of memmove(), which is inexplicably missing X/ from the SCO Unix C library. X/ X/ for profiling version, X/ m4 profile.s memmove.s > memmove_p.s # order is important! X/ as -o memmove_p.o memmove_p.s X/ X/ Note also that manually running memmove.s through m4 (instead of X/ using as -m) before assembling will also save 100 or so bytes in X/ the .o file for the non-profiling version. X/ X/------------------------------------------------------------------- X X .globl memmove Xmemmove: Xifdef(`PROFILE',` X .bss X.L1: .=.+4 X .text X mov $.L1,%edx SHAR_EOF true || echo 'restore of memmove/memmove.s failed' fi echo 'End of ecu/patch05 part 4' echo 'File memmove/memmove.s is continued in part 5' echo 5 > _shar_seq_.tmp exit 0 exit 0 # Just in case...