summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1996-11-14 22:19:17 +0000
committersos <sos@FreeBSD.org>1996-11-14 22:19:17 +0000
commit5cc90762eaa845e5950abb6b1da4a7a1c8d4493e (patch)
tree650a2881d1f41e3f84cc51aa2e2bbbe5d8633068 /sys/alpha
parent9ac487e987d38affc737e37ce761c2e8a8278372 (diff)
downloadFreeBSD-src-5cc90762eaa845e5950abb6b1da4a7a1c8d4493e.zip
FreeBSD-src-5cc90762eaa845e5950abb6b1da4a7a1c8d4493e.tar.gz
Finally a start at sharing the kdb controller routines between
syscons and psm, curtesy Kazutaka Yokota with minor changes by me. This contains an update of the psm driver as well. This also fixes the breakage that I introduced to the psm driver by making syscons poll for keyboard events in the atempt to fix the hanging keyboard problem. It works perfectly for me, and I'd like to hear from all that have had keyboard/ps/2 mouse problems if this is the cure... Submitted by: Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/include/console.h16
-rw-r--r--sys/alpha/include/mouse.h100
2 files changed, 92 insertions, 24 deletions
diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h
index 3e641a7..de049da 100644
--- a/sys/alpha/include/console.h
+++ b/sys/alpha/include/console.h
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: console.h,v 1.24 1996/09/21 14:57:54 bde Exp $
+ * $Id: console.h,v 1.25 1996/09/30 23:00:23 sos Exp $
*/
#ifndef _MACHINE_CONSOLE_H_
@@ -278,20 +278,6 @@ typedef struct ssaver ssaver_t;
#define KB_BUF_FULL 0x02 /* kbd has char pending */
#define KB_READY 0x02 /* kbd ready for command */
#define KB_WRITE 0x43 /* kbd write command */
-#else
-#define KB_DATA 0x60 /* kbd data port */
-#define KB_STAT 0x64 /* kbd status port */
-#define KB_BUF_FULL 0x01 /* kbd has char pending */
-#define KB_READY 0x02 /* kbd ready for command */
-#define KB_MODE 0x4D /* kbd mode (trans, ints enable)*/
-#define KB_WRITE 0x60 /* kbd write command */
-#define KB_RESET_DONE 0xAA /* kbd reset command completed */
-#define KB_SETLEDS 0xED /* kbd set leds */
-#define KB_ECHO 0xEE /* kbd set leds */
-#define KB_SETRAD 0xF3 /* kbd set repeat&delay command */
-#define KB_ACK 0xFA /* kbd acknowledge answer */
-#define KB_RESEND 0xFE /* kbd resend cmd answer */
-#define KB_RESET 0xFF /* kbd reset */
#endif
/* video mode definitions */
diff --git a/sys/alpha/include/mouse.h b/sys/alpha/include/mouse.h
index 95a66e4..a7322b7 100644
--- a/sys/alpha/include/mouse.h
+++ b/sys/alpha/include/mouse.h
@@ -19,17 +19,36 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mouse.h,v 1.1 1994/05/17 14:05:31 jkh Exp $
+ * $Id: mouse.h,v 1.1 1994/09/09 11:27:31 dfr Exp $
*/
-struct mouseinfo {
- unsigned char status;
- char xmotion, ymotion;
-};
+#ifndef _MACHINE_MOUSE_H_
+#define _MACHINE_MOUSE_H_
+
+#include <sys/types.h>
+#include <sys/ioccom.h>
+
+/* NOTE: MOUSEIOC and MOUSEIOCREAD are now obsolete, but will stay
+ for compatibility reasons. But, remember, the MOUSEIOCREAD ioctl
+ command doesn't work and never worked before. Some day we shall
+ get rid of these... */
+#define MOUSEIOC ('M'<<8)
+#define MOUSEIOCREAD (MOUSEIOC|60)
+
+#define MOUSE_GETSTATE _IOR('M',0,mouseinfo_t)
+#define MOUSE_GETINFO _IOR('M',1,mousehw_t)
+#define MOUSE_GETMODE _IOR('M',2,mousemode_t)
+#define MOUSE_SETMODE _IOW('M',3,mousemode_t)
+
+typedef struct mouseinfo {
+ unsigned char status;
+ char xmotion;
+ char ymotion;
+} mouseinfo_t;
+/* status */
#define BUTSTATMASK 0x07 /* Any mouse button down if any bit set */
#define BUTCHNGMASK 0x38 /* Any mouse button changed if any bit set */
-
#define BUT3STAT 0x01 /* Button 3 down if set */
#define BUT2STAT 0x02 /* Button 2 down if set */
#define BUT1STAT 0x04 /* Button 1 down if set */
@@ -38,7 +57,70 @@ struct mouseinfo {
#define BUT1CHNG 0x20 /* Button 1 changed if set */
#define MOVEMENT 0x40 /* Mouse movement detected */
-/* Ioctl definitions */
+typedef struct mousehw {
+ int buttons;
+ int iftype; /* MOUSE_IF_XXX */
+ int type; /* mouse/track ball/pad... */
+ int hwid; /* I/F dependent hardware ID
+ for the PS/2 mouse, it will be PSM_XXX_ID */
+} mousehw_t;
+/* iftype */
+#define MOUSE_IF_SERIAL 0
+#define MOUSE_IF_BUS 1
+#define MOUSE_IF_INPORT 2
+#define MOUSE_IF_PS2 3
+/* type */
+#define MOUSE_UNKNOWN (-1) /* should be treated as a mouse */
+#define MOUSE_MOUSE 0
+#define MOUSE_TRACKBALL 1
+#define MOUSE_STICK 2
+#define MOUSE_PAD 3
+
+typedef struct mousemode {
+ int protocol; /* MOUSE_PROTO_XXX */
+ int rate; /* report rate (per sec), -1 if unknown */
+ int resolution; /* ppi, -1 if unknown */
+ int accelfactor; /* accelation factor (must be 1 or greater) */
+} mousemode_t;
+/* protocol */
+#define MOUSE_PROTO_MS 0 /* Microsoft Serial, 3 bytes */
+#define MOUSE_PROTO_MSC 1 /* Mouse Systems, 5 bytes */
+#define MOUSE_PROTO_LOGI 2 /* Logitech, 3 bytes */
+#define MOUSE_PROTO_MM 3 /* MM series, 3 bytes */
+#define MOUSE_PROTO_LOGIMOUSEMAN 4 /* Logitech MouseMan 3/4 bytes */
+#define MOUSE_PROTO_BUS 5 /* MS/Logitech bus mouse */
+#define MOUSE_PROTO_INPORT 6 /* MS/ATI inport mouse */
+#define MOUSE_PROTO_PS2 7 /* PS/2 mouse, 3 bytes */
+
+/* Microsoft Serial mouse data packet */
+#define MOUSE_MSS_PACKETSIZE 3
+#define MOUSE_MSS_SYNCMASK 0x40
+#define MOUSE_MSS_SYNC 0x40
+#define MOUSE_MSS_BUTTONS 0x30
+#define MOUSE_MSS_BUTTON1DOWN 0x20 /* left */
+#define MOUSE_MSS_BUTTON2DOWN 0x00 /* no middle button */
+#define MOUSE_MSS_BUTTON3DOWN 0x10 /* right */
+
+/* Mouse Systems Corp. mouse data packet */
+#define MOUSE_MSC_PACKETSIZE 5
+#define MOUSE_MSC_SYNCMASK 0xf8
+#define MOUSE_MSC_SYNC 0x80
+#define MOUSE_MSC_BUTTONS 0x07
+#define MOUSE_MSC_BUTTON1UP 0x04 /* left */
+#define MOUSE_MSC_BUTTON2UP 0x02 /* middle */
+#define MOUSE_MSC_BUTTON3UP 0x01 /* right */
+
+/* PS/2 mouse data packet */
+#define MOUSE_PS2_PACKETSIZE 3
+#define MOUSE_PS2_SYNCMASK 0x08 /* 0x0c for 2 button mouse */
+#define MOUSE_PS2_SYNC 0x08 /* 0x0c for 2 button mouse */
+#define MOUSE_PS2_BUTTONS 0x07 /* 0x03 for 2 button mouse */
+#define MOUSE_PS2_BUTTON1DOWN 0x01 /* left */
+#define MOUSE_PS2_BUTTON2DOWN 0x04 /* middle */
+#define MOUSE_PS2_BUTTON3DOWN 0x02 /* right */
+#define MOUSE_PS2_XNEG 0x10
+#define MOUSE_PS2_YNEG 0x20
+#define MOUSE_PS2_XOVERFLOW 0x40
+#define MOUSE_PS2_YOVERFLOW 0x80
-#define MOUSEIOC ('M'<<8)
-#define MOUSEIOCREAD (MOUSEIOC|60)
+#endif /* _MACHINE_MOUSE_H_ */
OpenPOWER on IntegriCloud