diff options
Diffstat (limited to 'hw/kdrive/linux')
-rw-r--r-- | hw/kdrive/linux/evdev.c | 24 | ||||
-rw-r--r-- | hw/kdrive/linux/keyboard.c | 8 | ||||
-rw-r--r-- | hw/kdrive/linux/linux.c | 20 | ||||
-rw-r--r-- | hw/kdrive/linux/mouse.c | 48 | ||||
-rw-r--r-- | hw/kdrive/linux/ms.c | 6 | ||||
-rw-r--r-- | hw/kdrive/linux/ps2.c | 4 | ||||
-rw-r--r-- | hw/kdrive/linux/tslib.c | 8 |
7 files changed, 59 insertions, 59 deletions
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c index 096a2ddc3..485a2b557 100644 --- a/hw/kdrive/linux/evdev.c +++ b/hw/kdrive/linux/evdev.c @@ -48,7 +48,7 @@ typedef struct _kevdev { int abs[ABS_MAX + 1]; int prevabs[ABS_MAX + 1]; long key[NBITS(KEY_MAX + 1)]; - + /* supported device info */ long relbits[NBITS(REL_MAX + 1)]; long absbits[NBITS(ABS_MAX + 1)]; @@ -106,12 +106,12 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev) int a; for (a = 0; a <= ke->max_rel; a++) { - if (ISBITSET (ke->relbits, a)) + if (ISBITSET (ke->relbits, a)) { if (a == 0) KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0); else if (a == 1) - KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0); + KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0); } ke->rel[a] = 0; } @@ -131,9 +131,9 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev) ErrorF ("\n"); break; } - - if (ev->code == REL_WHEEL) { - for (i = 0; i < abs (ev->value); i++) + + if (ev->code == REL_WHEEL) { + for (i = 0; i < abs (ev->value); i++) { if (ev->value > 0) flags |= KD_BUTTON_4; @@ -150,7 +150,7 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev) KdEnqueuePointerEvent (pi, flags, 0, 0, 0); } } - + } static void @@ -164,7 +164,7 @@ EvdevPtrRead (int evdevPort, void *closure) n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event)); if (n <= 0) { - if (errno == ENODEV) + if (errno == ENODEV) DeleteInputDeviceRequest(pi->dixdev); return; } @@ -231,7 +231,7 @@ EvdevPtrInit (KdPointerInfo *pi) static Status EvdevPtrEnable (KdPointerInfo *pi) -{ +{ int fd; unsigned long ev[NBITS(EV_MAX)]; Kevdev *ke; @@ -352,7 +352,7 @@ EvdevPtrFini (KdPointerInfo *pi) /* - * Evdev keyboard functions + * Evdev keyboard functions */ static void @@ -374,7 +374,7 @@ EvdevKbdRead (int evdevPort, void *closure) n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event)); if (n <= 0) { - if (errno == ENODEV) + if (errno == ENODEV) DeleteInputDeviceRequest(ki->dixdev); return; } @@ -395,7 +395,7 @@ static Status EvdevKbdInit (KdKeyboardInfo *ki) { int fd; - + if (!ki->path) { ErrorF("Couldn't find evdev device path\n"); return BadValue; diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index 79cf59898..53d3c3a66 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -231,7 +231,7 @@ readKernelMapping(KdKeyboardInfo *ki) return; fd = LinuxConsoleFd; - + minKeyCode = NR_KEYS; maxKeyCode = 0; row = 0; @@ -241,7 +241,7 @@ readKernelMapping(KdKeyboardInfo *ki) kbe.kb_index = LNX_KEY_INDEX(i); k = ki->keySyms.map + row * ki->keySyms.mapWidth; - + for (j = 0; j < ki->keySyms.mapWidth; ++j) { unsigned short kval; @@ -463,7 +463,7 @@ readKernelMapping(KdKeyboardInfo *ki) k[j] = (kbe.kb_value & 0xFF) + 0x1008FF00; break; #endif - + default: break; } @@ -720,7 +720,7 @@ static void LinuxKeyboardDisable (KdKeyboardInfo *ki) { int fd; - + if (!ki) return; diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c index f76c2cbd9..e56ffb43c 100644 --- a/hw/kdrive/linux/linux.c +++ b/hw/kdrive/linux/linux.c @@ -79,7 +79,7 @@ LinuxInit (void) vtno = kdVirtualTerminal; else { - if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0) + if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0) { FatalError( "LinuxInit: Cannot open /dev/tty0 (%s)\n", @@ -129,8 +129,8 @@ LinuxSetSwitchMode (int mode) { struct sigaction act; struct vt_mode VT; - - if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0) + + if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0) { FatalError ("LinuxInit: VT_GETMODE failed\n"); } @@ -141,7 +141,7 @@ LinuxSetSwitchMode (int mode) sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction (SIGUSR1, &act, 0); - + VT.mode = mode; VT.relsig = SIGUSR1; VT.acqsig = SIGUSR1; @@ -152,12 +152,12 @@ LinuxSetSwitchMode (int mode) sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction (SIGUSR1, &act, 0); - + VT.mode = mode; VT.relsig = 0; VT.acqsig = 0; } - if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) + if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) { FatalError("LinuxInit: VT_SETMODE failed\n"); } @@ -237,7 +237,7 @@ LinuxEnable (void) */ LinuxApmFd = open ("/dev/apm_bios", 2); if (LinuxApmFd < 0 && errno == ENOENT) - LinuxApmFd = open ("/dev/misc/apm_bios", 2); + LinuxApmFd = open ("/dev/misc/apm_bios", 2); if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; @@ -245,7 +245,7 @@ LinuxEnable (void) RegisterBlockAndWakeupHandlers (LinuxApmBlock, LinuxApmWakeup, 0); AddEnabledDevice (LinuxApmFd); } - + /* * now get the VT */ @@ -308,8 +308,8 @@ LinuxFini (void) * Find a legal VT to switch to, either the one we started from * or the lowest active one that isn't ours */ - if (activeVT < 0 || - activeVT == vts.v_active || + if (activeVT < 0 || + activeVT == vts.v_active || !(vts.v_state & (1 << activeVT))) { for (activeVT = 1; activeVT < 16; activeVT++) diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c index 6f399b586..007263e4b 100644 --- a/hw/kdrive/linux/mouse.c +++ b/hw/kdrive/linux/mouse.c @@ -112,7 +112,7 @@ MouseFlush (Kbufio *b, char *buf, int size) CARD32 done = now + 100; int c; int n = 0; - + while ((c = MouseReadByte (b, done - now)) != -1) { if (buf) @@ -170,7 +170,7 @@ static Bool MouseWriteByte (int fd, unsigned char c, int timeout) { int ret; - + #ifdef DEBUG_BYTES ErrorF ("\tput %02x\n", c); #endif @@ -234,7 +234,7 @@ typedef struct _kmouse { int invalid;/* total invalid bytes for this protocol */ unsigned long state; /* private per protocol, init to prot->state */ } Kmouse; - + static int mouseValid (KdPointerInfo *pi, unsigned char *ev, int ne) { Kmouse *km = pi->driverPrivate; @@ -271,16 +271,16 @@ static Bool MouseReasonable (KdPointerInfo *pi, unsigned long flags, int dx, int { Kmouse *km = pi->driverPrivate; - if (km->stage == MouseWorking) + if (km->stage == MouseWorking) return TRUE; - if (dx < -50 || dx > 50) + if (dx < -50 || dx > 50) { #ifdef DEBUG ErrorF ("Large X %d\n", dx); #endif return FALSE; } - if (dy < -50 || dy > 50) + if (dy < -50 || dy > 50) { #ifdef DEBUG ErrorF ("Large Y %d\n", dy); @@ -299,7 +299,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne) int dx, dy, dz; unsigned long flags; unsigned long flagsrelease = 0; - + flags = KD_MOUSE_DELTA; if (ev[0] & 4) flags |= KD_BUTTON_2; @@ -307,7 +307,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne) flags |= KD_BUTTON_3; if (ev[0] & 1) flags |= KD_BUTTON_1; - + if (ne > 3) { dz = (int) (signed char) ev[3]; @@ -322,7 +322,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne) flagsrelease = KD_BUTTON_5; } } - + dx = ev[1]; if (ev[0] & 0x10) dx -= 256; @@ -407,14 +407,14 @@ static const KmouseProt exps2Prot = { #define PSM_4DMOUSE_ID 6 #define PSM_4DPLUS_ID 8 -static unsigned char ps2_init[] = { +static unsigned char ps2_init[] = { PSMC_ENABLE_DEV, 0, }; #define NINIT_PS2 1 -static unsigned char wheel_3button_init[] = { +static unsigned char wheel_3button_init[] = { PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 100, PSMC_SET_SAMPLING_RATE, 80, @@ -431,7 +431,7 @@ static unsigned char wheel_5button_init[] = { PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 200, PSMC_SET_SAMPLING_RATE, 80, - PSMC_SEND_DEV_ID, + PSMC_SEND_DEV_ID, 0 }; @@ -439,8 +439,8 @@ static unsigned char wheel_5button_init[] = { static unsigned char intelli_init[] = { PSMC_SET_SAMPLING_RATE, 200, - PSMC_SET_SAMPLING_RATE, 100, - PSMC_SET_SAMPLING_RATE, 80, + PSMC_SET_SAMPLING_RATE, 100, + PSMC_SET_SAMPLING_RATE, 80, 0 }; @@ -453,7 +453,7 @@ ps2SkipInit (KdPointerInfo *pi, int ninit, Bool ret_next) int c = -1; int skipping; Bool waiting; - + skipping = 0; waiting = FALSE; while (ninit || ret_next) @@ -486,7 +486,7 @@ ps2Init (KdPointerInfo *pi) int id; unsigned char *init; int ninit; - + /* Send Intellimouse initialization sequence */ MouseWriteBytes (km->iob.fd, intelli_init, strlen ((char *) intelli_init), 100); /* @@ -530,7 +530,7 @@ static Bool busParse (KdPointerInfo *pi, unsigned char *ev, int ne) Kmouse *km = pi->driverPrivate; int dx, dy; unsigned long flags; - + flags = KD_MOUSE_DELTA; dx = (signed char) ev[1]; dy = -(signed char) ev[2]; @@ -636,14 +636,14 @@ static Bool logiParse (KdPointerInfo *pi, unsigned char *ev, int ne) unsigned long flags; flags = KD_MOUSE_DELTA; - + if (ne == 3) { if (ev[0] & 0x20) flags |= KD_BUTTON_1; if (ev[0] & 0x10) flags |= KD_BUTTON_3; - + dx = (signed char)(((ev[0] & 0x03) << 6) | (ev[1] & 0x3F)); dy = (signed char)(((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F)); flags |= km->state & KD_BUTTON_2; @@ -686,7 +686,7 @@ static Bool mscParse (KdPointerInfo *pi, unsigned char *ev, int ne) unsigned long flags; flags = KD_MOUSE_DELTA; - + if (!(ev[0] & 0x4)) flags |= KD_BUTTON_1; if (!(ev[0] & 0x2)) @@ -871,7 +871,7 @@ MouseRead (int mousePort, void *closure) switch (km->stage) { case MouseBroken: -#ifdef DEBUG +#ifdef DEBUG ErrorF ("Mouse protocol %s seems OK\n", km->prot->name); #endif @@ -939,7 +939,7 @@ MouseInit (KdPointerInfo *pi) if (!pi) return BadImplementation; - + if (!pi->path || strcmp(pi->path, "auto") == 0) { for (i = 0; i < NUM_DEFAULT_MOUSE; i++) { fd = open (kdefaultMouse[i], 2); @@ -952,7 +952,7 @@ MouseInit (KdPointerInfo *pi) else { fd = open (pi->path, 2); } - + if (fd < 0) return BadMatch; @@ -1008,7 +1008,7 @@ MouseDisable (KdPointerInfo *pi) Kmouse *km; if (!pi || !pi->driverPrivate) return; - + km = pi->driverPrivate; KdUnregisterFd (pi, km->iob.fd, TRUE); } diff --git a/hw/kdrive/linux/ms.c b/hw/kdrive/linux/ms.c index 5786ed170..b6151cd90 100644 --- a/hw/kdrive/linux/ms.c +++ b/hw/kdrive/linux/ms.c @@ -83,7 +83,7 @@ MsRead (int port, void *closure) flags |= KD_BUTTON_1; if (b[0] & 0x10) flags |= KD_BUTTON_3; - + dx = (char)(((b[0] & 0x03) << 6) | (b[1] & 0x3F)); dy = (char)(((b[0] & 0x0C) << 4) | (b[2] & 0x3F)); n -= 3; @@ -103,8 +103,8 @@ MsInit (KdPointerInfo *pi) pi->path = strdup("/dev/mouse"); if (!pi->name) pi->name = strdup("Microsoft protocol mouse"); - - return Success; + + return Success; } static Status diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c index 396758481..552a3c7cb 100644 --- a/hw/kdrive/linux/ps2.c +++ b/hw/kdrive/linux/ps2.c @@ -99,7 +99,7 @@ Ps2Read (int ps2Port, void *closure) flags |= right_button; if (b[0] & 1) flags |= left_button; - + dx = b[1]; if (b[0] & 0x10) dx -= 256; @@ -146,7 +146,7 @@ static Status Ps2Enable (KdPointerInfo *pi) { int fd; - + if (!pi) return BadImplementation; diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 7cc23e637..a0b989d3a 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -9,7 +9,7 @@ * Copyright © 2002 MontaVista Software Inc. * Copyright © 2005 OpenedHand Ltd. * Copyright © 2006 Nokia Corporation - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -76,7 +76,7 @@ TsRead (int fd, void *closure) if (event.pressure) { flags = KD_BUTTON_1; - /* + /* * Here we test for the touch screen driver actually being on the * touch screen, if it is we send absolute coordinates. If not, * then we send delta's so that we can track the entire vga screen. @@ -127,7 +127,7 @@ TslibEnable (KdPointerInfo *pi) } KdRegisterFd(private->fd, TsRead, pi); - + return Success; } @@ -155,7 +155,7 @@ TslibInit (KdPointerInfo *pi) if (!pi || !pi->dixdev) return !Success; - + pi->driverPrivate = (struct TslibPrivate *) xcalloc(sizeof(struct TslibPrivate), 1); if (!pi->driverPrivate) |