From: shadchin Date: Wed, 14 May 2014 18:23:22 +0000 (+0000) Subject: Remove mouse.baudrate, it is always 1200. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ca86858518d405164014b037ce252c3814ad7103;p=openbsd Remove mouse.baudrate, it is always 1200. ok miod@ --- diff --git a/usr.sbin/wsmoused/mouse_protocols.c b/usr.sbin/wsmoused/mouse_protocols.c index ab13b42f464..dd2ab1a3073 100644 --- a/usr.sbin/wsmoused/mouse_protocols.c +++ b/usr.sbin/wsmoused/mouse_protocols.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mouse_protocols.c,v 1.14 2014/05/14 18:18:01 shadchin Exp $ */ +/* $OpenBSD: mouse_protocols.c,v 1.15 2014/05/14 18:23:22 shadchin Exp $ */ /* * Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -635,16 +635,15 @@ mouse_init(void) * The baud rate selection command must be sent at the current * baud rate; try all likely settings */ - SetMouseSpeed(9600, mouse.baudrate, mousecflags[mouse.proto]); - SetMouseSpeed(4800, mouse.baudrate, mousecflags[mouse.proto]); - SetMouseSpeed(2400, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(9600, 1200, mousecflags[mouse.proto]); + SetMouseSpeed(4800, 1200, mousecflags[mouse.proto]); + SetMouseSpeed(2400, 1200, mousecflags[mouse.proto]); #if 0 - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); #endif /* select MM series data format */ write(mouse.mfd, "S", 1); - SetMouseSpeed(mouse.baudrate, mouse.baudrate, - mousecflags[P_MM]); + SetMouseSpeed(1200, 1200, mousecflags[P_MM]); /* select report rate/frequency */ if (mouse.rate <= 0) write(mouse.mfd, "O", 1); @@ -668,11 +667,11 @@ mouse_init(void) /* The command must always be sent at 1200 baud */ SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); write(mouse.mfd, "*X", 2); - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); break; case P_MMHIT: - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); /* * Initialize Hitachi PUMA Plus - Model 1212E to desired settings. @@ -722,7 +721,7 @@ mouse_init(void) break; case P_THINKING: - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); /* the PnP ID string may be sent again, discard it */ usleep(200000); i = FREAD; @@ -741,7 +740,7 @@ mouse_init(void) break; case P_MSC: - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); #if 0 if (mouse.flags & ClearDTR) { i = TIOCM_DTR; @@ -755,7 +754,7 @@ mouse_init(void) break; default: - SetMouseSpeed(1200, mouse.baudrate, mousecflags[mouse.proto]); + SetMouseSpeed(1200, 1200, mousecflags[mouse.proto]); break; } } diff --git a/usr.sbin/wsmoused/wsmoused.c b/usr.sbin/wsmoused/wsmoused.c index be3d87280c1..eeb4aaf2c7f 100644 --- a/usr.sbin/wsmoused/wsmoused.c +++ b/usr.sbin/wsmoused/wsmoused.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmoused.c,v 1.31 2014/05/14 18:18:01 shadchin Exp $ */ +/* $OpenBSD: wsmoused.c,v 1.32 2014/05/14 18:23:22 shadchin Exp $ */ /* * Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -89,7 +89,6 @@ mouse_t mouse = { .portname = NULL, .ttyname = NULL, .proto = P_UNKNOWN, - .baudrate = 1200, .rate = MOUSE_RATE_UNKNOWN, .resolution = MOUSE_RES_UNKNOWN, .mfd = -1, diff --git a/usr.sbin/wsmoused/wsmoused.h b/usr.sbin/wsmoused/wsmoused.h index b432aed7826..6391178b91c 100644 --- a/usr.sbin/wsmoused/wsmoused.h +++ b/usr.sbin/wsmoused/wsmoused.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmoused.h,v 1.10 2014/05/14 18:18:01 shadchin Exp $ */ +/* $OpenBSD: wsmoused.h,v 1.11 2014/05/14 18:23:22 shadchin Exp $ */ /* * Copyright (c) 2001 Jean-Baptiste Marchand, Julien Montagne and Jerome Verdon @@ -98,7 +98,6 @@ typedef struct mouse_s { char *portname; /* mouse device */ char *ttyname; /* wsdisplay control tty device */ int proto; /* MOUSE_PROTO_XXX */ - int baudrate; unsigned char rate; /* report rate */ unsigned int resolution; /* MOUSE_RES_XXX or a positive number */ int mfd; /* mouse file descriptor */