11 #define ICU_OCW2 (ICU_BASE + 0)
12 #define ICU_MASK (ICU_BASE + 1)
25 #define UART_DL_LSB 0x00
26 #define UART_DL_MSB 0x01
41 #define FLAG_KEEP_DTR 1
42 #define FLAG_SUPPRESS_RTS 2
45 #define UART_IS_NONE 0
46 #define UART_IS_8250 1
47 #define UART_IS_16450 2
48 #define UART_IS_16550 3
49 #define UART_IS_16550A 4
51 #define DEFAULT_BUFFERSIZE 2048
52 #define MAX_BUFFERSIZE 0x40000000
54 #define COMM_CHECKED_CHIPTYPE 1
55 #define COMM_HAVE_BUFFER 2
60 #define LAST_IRQ (FIRST_IRQ+IRQ_COUNT-1)
64 #define COMM_PROPS( n ) &comm_props[n-1]
65 #define IRQ_PROPS( n ) &irq_props[n-FIRST_IRQ]
82 #ifndef FB_MANAGED_IRQ
85 void (*irq_handler) ( void );
129 int parity,
int data,
int stop );
130 static int comm_isr(
unsigned irq );
131 static int comm_init(
int com_num,
unsigned int baseaddr,
int irq );
134 #ifndef FB_MANAGED_IRQ
143 #define ENABLE() enable()
144 #define DISABLE() disable()
148 #define ENABLE() fb_dos_sti()
149 #define DISABLE() fb_dos_cli()
155 int baud,
int parity,
int data,
int stop,
156 int txbufsize,
int rxbufsize,
int flags,
int irq );
165 #ifndef FB_MANAGED_IRQ
184 { 0x3f8, 4, 4, 0, 0, 0, 0, 0 },
185 { 0x2f8, 3, 3, 0, 0, 0, 0, 0 },
186 { 0x3e8, 4, 4, 0, 0, 0, 0, 0 },
187 { 0x2e8, 3, 3, 0, 0, 0, 0, 0 }
218 buf->
data = malloc( size );
228 return ( buf->
size != 0 );
274 outportb( baseaddr +
UART_LCR ,0x1b );
275 if ( inportb( baseaddr +
UART_LCR ) != 0x1b )
278 outportb( baseaddr +
UART_LCR, 0x3 );
283 outportb( baseaddr +
UART_SCR, 0x55 );
284 if ( inportb( baseaddr +
UART_SCR ) != 0x55 )
287 outportb( baseaddr +
UART_SCR, 0xAA );
288 if ( inportb( baseaddr +
UART_SCR ) != 0xAA )
293 tmp = inportb( baseaddr +
UART_IIR);
295 if ( ( tmp & 0x80 ) == 0 )
297 if ( ( tmp & 0x40 ) == 0 )
301 outportb( baseaddr +
UART_FCR, 0x0 );
308 int divisor, lsb, msb, tmp;
310 if(( baud < 50 ) || ( baud > 115200 ))
313 divisor = 115200 / baud;
314 lsb = divisor & 0xff;
317 tmp = inportb( baseaddr +
UART_LCR );
319 outportb( baseaddr +
UART_LCR, tmp );
324 tmp = inportb( baseaddr +
UART_LCR );
326 outportb( baseaddr +
UART_LCR, tmp );
332 int parity,
int data,
int stop )
389 outportb( baseaddr +
UART_LCR, fmt );
394 #ifndef FB_MANAGED_IRQ
502 #ifndef FB_MANAGED_IRQ
529 #ifndef FB_MANAGED_IRQ
554 if( _go32_dpmi_allocate_real_mode_callback_iret (&ip->
new_rmhandler, &ip->
regs) )
596 static int comm_init(
int com_num,
unsigned int baseaddr,
int irq )
602 if( com_num < 1 || com_num >
MAX_COMM )
629 for( i = 0; i < 17; i++ )
632 if( (tmp & 0x38) == 0 )
654 #ifndef FB_MANAGED_IRQ
729 if( ip->
first == com_num )
737 if( comm_props[i].next == com_num )
755 #ifndef FB_MANAGED_IRQ
769 int baud,
int parity,
int data,
int stop,
770 int txbufsize,
int rxbufsize,
int flags,
int irq )
775 if( com_num < 1 || com_num >
MAX_COMM )
836 if( com_num < 1 || com_num >
MAX_COMM )
900 const char *pszDevice,
992 unsigned char *
p = (
unsigned char *)data;
998 for( i=0; i<length; i++ )
1016 size_t n = *pLength, i, count = 0;
1018 unsigned char *
p = (
unsigned char *)data;
1021 for( i = 0; i < n; i++ )