/*********************************************************************** * file: h/sys/oc.h * part#: * internal sequence#: * * ************************************************************** * * " c Copyright Hewlett-Packard Company, 1984.* All * * * rights are reserved. Copying or other reproduction * * * of this program except for archival purposes is * * * prohibited without the prior written consent of * * * Hewlett-Packard Company." * * ************************************************************** * * Pisces Q-DOS project * Fred Taft * ----------------------------------------------------- * initial 4/83 fdt * * Add t_state to ocio structure 5/2/83 fdt * * Added modem states 7/14/83 fdt * * Added ri_time field to oc structure. 10/12/83 fdt * * Removed the driver_type field from the * oc structure. 10/18/83 fdt * * Removed all 1200 baud modem equates. 4/3/84 fdt * * Removed modem_lines field from ocio * structure. 8/16/84 fdt * *********************************************************************/ /* Define the size of the handshake array */ #define NHSC 4 /* An oc structure is needed for each UNIX character device that * is used for normal terminal IO. */ struct oc { unsigned long control_bits; /* control settings */ unsigned long events; /* event flags */ unsigned long t_state; /* internal state */ unsigned char pulse_digit; /* digit being dialed */ unsigned long ri_time; /* time when ring detected */ unsigned int valid_rings; /* rings detected during AA */ unsigned char handshake [NHSC]; /* handshake characters */ }; /* Define the new structure to be used by calls to Ioctl */ struct ocio { unsigned long cntl_bits; /* cntl & status bits */ unsigned char handshake [NHSC]; /* handshake characters */ }; /* Define the structure to be used for dialing digits */ struct dial_data { unsigned char dial_type; unsigned char digit; }; /* Device Commands */ #define T_ACK -1 /* Dialing types */ #define PULSE_DIAL 0x00 #define DTMF_DIAL 0x01 /* Default handshaking character definitions */ #define CENQ 5 /* Ascii ENQ */ #define CACK 6 /* Ascii ACK */ #define CXON 17 /* Ascii XON */ #define CXOFF 19 /* Ascii XOFF */ /* Indices into handshaking array */ #define VENQ 0 #define VACK 1 #define VXON 2 #define VXOFF 3 /* Control Setting Equates */ #define MODEM3_12 0x0001 /* Device type = 300/1200 baud modem */ #define MODEM1200 0x0002 /* Device type = 1200 baud modem */ #define RS232 0x0003 /* Device type = RS232 card */ #define DEV_TYPE 0x0003 /* Mask for device type field */ #define ENABLETX 0x0020 /* Enable Hardware Hndske - xmitter */ #define ENABLERX 0x0040 /* Enable Hardware Hndske - rcvr */ #define ANSWER 0x0400 /* Place modem in answer mode */ #define ENQACKON 0x2000 /* Enable terminal ENQ/ACK Hndske */ /* Event Flags */ #define DELTACTS 0x0001 /* CTS line has changed state */ #define DELTADSR 0x0002 /* DSR line has changed state */ #define DELTARI 0x0004 /* RI line has changed state */ #define DELTADCD 0x0008 /* DCD line has changed state */ #define BREAK_RECVD 0x0010 /* Break was received */ #define INPUT_OVERRUN 0x0020 /* The input buffer has overrun */ /* Internal States */ #define TTACK 0x0001 /* Send an ACK when possible */ #define FORCE_1200 0x0002 /* Force 1200 baud mode */ #define FORCE_300 0x0004 /* Force 300 baud mode */ #define START_OF_RING 0x0008 /* Start of ring detected */ #define WAITING_4_CONNECTION 0x0010 /* Waiting for handshake to complete */ #define CONNECTION 0x0020 /* Connection established */ #define ENABLE_MOUT 0x0040 /* Enable modem output */ #define PHONE_OFF 0x0080 /* Phone is in offhook state */ #define DIALING 0x0100 /* In process of dialing a number */ #define DIAL_MODE 0x0200 /* In dialing mode */ #define AUTO_ANSWER_MODE 0x0400 /* In auto answer mode */ #define TEST_MODE 0x0800 /* In a test mode */ #define ENABLE_MOUT12 0x1000 /* Enable 1200 baud output */ #define DCD_TIMEOUT_PENDING 0x2000 /* DCD timeout is active */ #define CHECK_STATE1 0x4000 #define CHECK_STATE2 0x8000 #define CHECK_STATE3 0x10000 #define CHECK_STATE4 0x20000 #define CHECK_STATE5 0x40000 #define CHECK_STATE6 0x80000 #define CHECK_STATE7 0x100000 #define CHECK_STATE8 0x200000 #define CHECK_STATE9 0x400000 #define CHECK_STATE10 0x800000 #define CHECK_STATE11 0x1000000 #define CHECK_STATE12 0x2000000 #define CHECK_STATE13 0x4000000 #define CHECK_STATES 0x7FFC000 #define RECV12 0x8000000 /* Enable 1200 bd receiver */ #define WAIT_4_TRPE 0x10000000 /* Driver is waiting for TRPE */ /* Ioctl calls */ #define sIOC ('s'<<8) #define GETCTLBITS (sIOC|1) #define SETCTLBITS (sIOC|2) #define GETEVENTS (sIOC|3) #define DIALDIGIT (sIOC|4) #define START_DIAL (sIOC|6) #define END_DIAL (sIOC|7) #define PICKUP_PHONE (sIOC|8) #define HANGUP (sIOC|9) #define AUTO_ANSWER (sIOC|0xA)