153887Smckusick /* 2*63308Sbostic * Copyright (c) 1992, 1993 3*63308Sbostic * The Regents of the University of California. All rights reserved. 453887Smckusick * 553887Smckusick * This code is derived from software contributed to Berkeley by 653887Smckusick * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc. 753887Smckusick * 853887Smckusick * %sccs.include.redist.c% 953887Smckusick * 1053887Smckusick * from: $Hdr: msreg.h,v 4.300 91/06/09 06:43:00 root Rel41 $ SONY 1153887Smckusick * 12*63308Sbostic * @(#)msreg.h 8.1 (Berkeley) 06/11/93 1353887Smckusick */ 1453887Smckusick 1553887Smckusick /* 1653887Smckusick * mouse register structure definition. 1753887Smckusick */ 1853887Smckusick 1953887Smckusick #ifndef __MSREG__ 2053887Smckusick #define __MSREG__ 1 2153887Smckusick 2253887Smckusick #ifdef KERNEL 2353887Smckusick 2453887Smckusick struct msreg { 2553887Smckusick /*00*/ u_char ms_control; /* CPU/IOP */ 2653887Smckusick #define MS_DONE 0x01 /* IOP has completed command from CPU */ 2753887Smckusick #define MS_EVREADY 0x02 /* IOP has made event report ready */ 2853887Smckusick /*01*/ u_char ms_command; /* CPU */ 2953887Smckusick #define MS_CPROBE 0 3053887Smckusick #define MS_CATTACH 1 3153887Smckusick #define MS_CSAMPLE 2 /* requset current value */ 3253887Smckusick #define MS_CSETEM 3 /* set event mask */ 3353887Smckusick #define MS_CSETXY 4 /* set current coordinate */ 3453887Smckusick #define MS_CSETPARAM 5 /* set mouse parameter (mag, delta) */ 3553887Smckusick #define MS_CQFLUSH 6 /* flush event queue */ 3653887Smckusick #define MS_CSETRANGE 7 /* set coordinate range */ 3753887Smckusick /*02*/ u_char ms_result; /* IOP */ 3853887Smckusick #define MS_ROK 0 /* done */ 3953887Smckusick #define MS_RERROR 1 /* failed */ 4053887Smckusick #define MS_REVENT 2 /* event has occured */ 4153887Smckusick /*03*/ u_char ms_eventmask; /* CPU */ 4253887Smckusick /*04*/ struct ms_param ms_param; /* CPU */ 4353887Smckusick /*0c*/ struct ms_coord ms_coord; /* CPU */ 4453887Smckusick /*14*/ struct ms_data ms_data; /* IOP */ 4553887Smckusick /*20*/ struct ms_event ms_event; /* IOP */ 4653887Smckusick /*38*/ int ms_unit; /* CPU */ 4753887Smckusick /*3c*/ int ms_sevcount; /*XXX*/ 4853887Smckusick /*40*/ struct ms_range ms_range; /* CPU */ 4953887Smckusick }; 5053887Smckusick 5153887Smckusick #define MS_S_BYTE 0 /* start byte */ 5253887Smckusick #define MS_X_BYTE 1 /* second byte */ 5353887Smckusick #define MS_Y_BYTE 2 /* third byte */ 5453887Smckusick #define MS_DB_SIZE 3 5553887Smckusick 5653887Smckusick #define MS_S_MARK 0x80 /* start mark (first byte)*/ 5753887Smckusick #define MS_S_X7 0x08 /* MSB(sign bit) of X */ 5853887Smckusick #define MS_S_Y7 0x10 /* MSB(sign bit) of Y */ 5953887Smckusick #define MS_S_SW1 0x01 /* left button is pressed */ 6053887Smckusick #define MS_S_SW2 0x02 /* right button is pressed */ 6153887Smckusick #define MS_S_SW3 0x04 /* middle button is pressed */ 6253887Smckusick 6353887Smckusick #define MS_X_X06 0x7f /* data bits of X (second byte) */ 6453887Smckusick #define MS_Y_Y06 0x7f /* data bits of Y (third byte) */ 6553887Smckusick 6653887Smckusick struct ms_stat { 6753887Smckusick int mss_stat; 6853887Smckusick #define MS_ACTIVE 0x01 6953887Smckusick #define MS_WAIT 0x02 /* waiting for command completion */ 7053887Smckusick #define MS_EVWAIT 0x04 /* waiting for event report */ 7153887Smckusick #define MS_RCOLL 0x08 /* select collsion on read */ 7253887Smckusick #define MS_WCOLL 0x10 /* select collsion on write */ 7353887Smckusick #define MS_NBIO 0x20 /* noblocked read write */ 7453887Smckusick #define MS_ASYNC 0x40 /* if event queued then send SIGIO */ 7553887Smckusick int mss_pgrp; 7653887Smckusick int mss_mode; 7753887Smckusick int mss_command; 7853887Smckusick int mss_eventmask; 7953887Smckusick struct ms_data mss_data; 8053887Smckusick struct ms_data mss_data_old; 8153887Smckusick struct ms_param mss_param; 8253887Smckusick struct ms_range mss_range; 8353887Smckusick struct proc *mss_rsel; 8453887Smckusick struct proc *mss_wsel; 8553887Smckusick struct ms_queue *mss_queue; 8653887Smckusick }; 8753887Smckusick 8853887Smckusick #define MSPRI (PZERO+1) 8953887Smckusick #define MSUNIT(dev) (minor(dev)&017) 9053887Smckusick #define MSOLDIF(dev) (minor(dev)&020) 9153887Smckusick 9253887Smckusick #endif /* KERNEL */ 9353887Smckusick #endif /* !__MSREG__ */ 94