PRIVATE int get_request;
-PRIVATE char *rnames[] = {
- "TIOCGETP",
- "TIOCSETP",
- "TIOCGETC",
- "TIOCSETC"
-};
-
-#define GETPNAME 0
-#define SETPNAME 1
-#define GETCNAME 2
-#define SETCNAME 3
-
/*
* decode ioctl call
* send or receive = 'R' or 'S'
int sr;
message *m;
{
-int rq;
int request, device;
int high;
long spek, flags;
-int ispeed, ospeed, speed, erase, kill;
-int t_intrc, t_quitc, t_startc, t_stopc, t_brk, t_eof;
device = m->m2_i1;
request = m->m2_i3;
if ( sr == 'R') request = get_request;
- switch(request) {
- case TIOCGETP:
- case TIOCSETP:
- rq = (request == TIOCGETP) ? GETPNAME : SETPNAME;
- if (sr == 'S') {
- get_request = request;
- Printf( "Sending %s ",rnames[rq] );
- if ( request == TIOCGETP ) break;
- }
-
- if ( (sr == 'R') && (request == TIOCSETP) ) break;
-
- erase = (spek >> 8) & BYTE;
- kill = spek & BYTE;
- flags = flags & 0xFFFF;
- speed = (spek >> 16) & 0xFFFFL;
- ispeed = speed & BYTE;
- ospeed = (speed >> 8) & BYTE;
- Printf("%s erase=%d kill=%d speed=%d/%d flags=%lx ",
- rnames[rq], erase, kill, ispeed, ospeed, flags);
- break;
-
- case TIOCGETC:
- case TIOCSETC:
- rq = (request == TIOCGETC) ? GETCNAME : SETCNAME;
- if (sr == 'S') {
- get_request = request;
- Printf( "Sending %s ",rnames[rq] );
- if ( request == TIOCGETC ) break;
- }
-
- if ( (sr == 'R') && (request == TIOCSETC) ) break;
-
- t_intrc = (spek >> 24) & BYTE;
- t_quitc = (spek >> 16) & BYTE;
- t_startc = (spek >> 8) & BYTE;
- t_stopc = (spek >> 0) & BYTE;
- t_brk = flags & BYTE;
- t_eof = (flags >> 8 ) & BYTE;
- Printf("%s int %d quit %d start %d stop %d brk %d eof %d\n",
- rnames[rq],
- t_intrc, t_quitc, t_startc, t_stopc, t_brk, t_eof);
- break;
-
- default:
-
-#ifdef __i86 /* 16 bit */
- if ( sr == 'S' ) {
- Printf("Sending ");
- get_request = request;
- }
- else
- Printf("Receiving ");
-
- Printf("Other IOCTL device=%d request=%c|%d\n",
- device, (request >> 8) & BYTE, request & BYTE );
-
- break;
-#endif
-
-#ifdef __i386 /* 32 bit encoding */
- if ( sr == 'S' ) {
- Printf("Sending (%lx) ", request);
- get_request = request;
- }
- else
- Printf("Receiving (%lx) ", request);
+ if ( sr == 'S' ) {
+ Printf("Sending (%lx) ", request);
+ get_request = request;
+ }
+ else
+ Printf("Receiving (%lx) ", request);
- high = ( request & 0xFFFF0000 ) >> 16 ;
- request &= _IOCTYPE_MASK;
-
- Printf("Other IOCTL device=%d request=%c|%d flags=%x size =%d\n",
- device, (request >> 8) & BYTE, request & BYTE,
- (high & ~_IOCPARM_MASK ),
- (high & _IOCPARM_MASK )
- );
- break;
-#endif
- }
- Printf("\n");
+ high = ( request & 0xFFFF0000 ) >> 16 ;
+ request &= _IOCTYPE_MASK;
+
+ Printf("Other IOCTL device=%d request=%c|%d flags=%x size =%d\n",
+ device, (request >> 8) & BYTE, request & BYTE,
+ (high & ~_IOCPARM_MASK ),
+ (high & _IOCPARM_MASK )
+ );
+ Printf("\n");
}
#define TIOCSFON_OLD _IOW('T', 20, u8_t [8192])
#define TIOCSFON _IOW_BIG(1, u8_t [8192])
-/* Legacy <sgtty.h> */
-#define TIOCGETP _IOR('t', 1, struct sgttyb)
-#define TIOCSETP _IOW('t', 2, struct sgttyb)
-#define TIOCGETC _IOR('t', 3, struct tchars)
-#define TIOCSETC _IOW('t', 4, struct tchars)
-
/* Keyboard ioctls. */
#define KIOCBELL _IOW('k', 1, struct kio_bell)
#define KIOCSLEDS _IOW('k', 2, struct kio_leds)