summaryrefslogtreecommitdiffstats
path: root/usr.sbin/moused/moused.c
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1998-11-20 11:17:59 +0000
committeryokota <yokota@FreeBSD.org>1998-11-20 11:17:59 +0000
commitde32e43436213d1a3c72b982fe785b220558c330 (patch)
tree5f7ba68dc5583653eb6936edf122ca4a039117d6 /usr.sbin/moused/moused.c
parent548096d203be1e26a276ec25da212554ed6bf0eb (diff)
downloadFreeBSD-src-de32e43436213d1a3c72b982fe785b220558c330.zip
FreeBSD-src-de32e43436213d1a3c72b982fe785b220558c330.tar.gz
- Reorganized a `if-else' close a bit for clarity. Purely cosmetic
change. No functional difference.
Diffstat (limited to 'usr.sbin/moused/moused.c')
-rw-r--r--usr.sbin/moused/moused.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c
index 2717fc0..c56855a 100644
--- a/usr.sbin/moused/moused.c
+++ b/usr.sbin/moused/moused.c
@@ -1870,7 +1870,7 @@ pnpwakeup1(void)
* The PnP COM device spec. dictates that the mouse must set DSR
* in response to DTR (by hardware or by software) and that if DSR is
* not asserted, the host computer should think that there is no device
- * at this serial port. But there are some mice just don't do that...
+ * at this serial port. But some mice just don't do that...
*/
ioctl(rodent.mfd, TIOCMGET, &i);
debug("modem status 0%o", i);
@@ -1900,29 +1900,29 @@ pnpwakeup1(void)
if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
debug("pnpwakeup1(): valid response in first phase.");
return TRUE;
- } else {
+ }
- /* port setup, 2nd phase (2.1.5) */
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
- ioctl(rodent.mfd, TIOCMBIC, &i);
- usleep(240000);
+ /* port setup, 2nd phase (2.1.5) */
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 0, RTS = 0 */
+ ioctl(rodent.mfd, TIOCMBIC, &i);
+ usleep(240000);
- /* wait for respose, 2nd phase (2.1.6) */
- i = FREAD;
- ioctl(rodent.mfd, TIOCFLUSH, &i);
- i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
- ioctl(rodent.mfd, TIOCMBIS, &i);
+ /* wait for respose, 2nd phase (2.1.6) */
+ i = FREAD;
+ ioctl(rodent.mfd, TIOCFLUSH, &i);
+ i = TIOCM_DTR | TIOCM_RTS; /* DTR = 1, RTS = 1 */
+ ioctl(rodent.mfd, TIOCMBIS, &i);
- /* try to read something */
- FD_ZERO(&fds);
- FD_SET(rodent.mfd, &fds);
- timeout.tv_sec = 0;
- timeout.tv_usec = 240000;
- if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
- debug("pnpwakeup1(): valid response in second phase.");
- return TRUE;
- }
+ /* try to read something */
+ FD_ZERO(&fds);
+ FD_SET(rodent.mfd, &fds);
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 240000;
+ if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) > 0) {
+ debug("pnpwakeup1(): valid response in second phase.");
+ return TRUE;
}
+
return FALSE;
}
@@ -1936,7 +1936,7 @@ pnpwakeup2(void)
/*
* This is a simplified procedure; it simply toggles RTS.
*/
- debug("PnP COM device rev 0.9 probe...");
+ debug("alternate probe...");
ioctl(rodent.mfd, TIOCMGET, &i);
i |= TIOCM_DTR; /* DTR = 1 */
@@ -1961,6 +1961,7 @@ pnpwakeup2(void)
debug("pnpwakeup2(): valid response.");
return TRUE;
}
+
return FALSE;
}
OpenPOWER on IntegriCloud