Commit b19e3782 authored by Peter Hutterer's avatar Peter Hutterer

Purge GuestMouse support.

Guest mouse dates back to quite a while ago, hasn't been tested for ages and
the current synaptics interface guide claims the bit that we used to check
if guestmouse is available is "reserved for future use. The host should
ignore the values of reserved bits when reading the capability bits."
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 2c8ba519
......@@ -61,8 +61,6 @@ typedef struct _SynapticsSHM
int left, right, up, down; /* left/right/up/down buttons */
Bool multi[8];
Bool middle;
int guest_left, guest_mid, guest_right; /* guest device buttons */
int guest_dx, guest_dy; /* guest device movement */
} SynapticsSHM;
/*
......
......@@ -283,10 +283,6 @@ l l.
.TE
Property: "Synaptics Off"
.TP
.BI "Option \*qGuestMouseOff\*q \*q" boolean \*q
Switch on/off guest mouse (often a stick). Property: "Synaptics Guestmouse
Off"
.TP
.BI "Option \*qLockedDrags\*q \*q" boolean \*q
If off, a tap-and-drag gesture ends when you release the finger.
.
......@@ -805,10 +801,6 @@ FLOAT, 4 values, min, max, accel, trackstick.
.BI "Synaptics Off"
8 bit, valid values (0, 1, 2).
.TP 7
.BI "Synaptics Guestmouse Off"
8 bit (BOOL).
.TP 7
.BI "Synaptics Locked Drags"
8 bit (BOOL).
......@@ -932,6 +924,8 @@ The following options are no longer part of the driver configuration:
.BI "Option \*qHistorySize\*q \*q" integer \*q
.TP
.BI "Option \*qSpecialScrollAreaRight\*q \*q" boolean \*q
.TP
.BI "Option \*qGuestMouseOff\*q \*q" boolean \*q
.SH "AUTHORS"
.LP
......
......@@ -77,22 +77,6 @@ Zero means not pressed, one means pressed.
Not all touchpads have all these buttons.
.
If a button doesn't exist, the value is always reported as 0.
.TP
\fBgl,gm,gr\fR
Some touchpads have a "guest device".
.
This is typically a pointing stick located in the middle of the
keyboard.
.
Some guest devices have physical buttons, or can detect button presses
when tapping on the pointing stick.
.
Such button events are reported as "guest left", "guest middle" or
"guest right".
.TP
\fBgdx,gdy\fR
Pointer movements from the guest device are reported as relative x/y
positions, called gdx and gdy.
.RE
.TP
\fB\-l\fR
......
......@@ -155,33 +155,11 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
int left = 0, right = 0, middle = 0;
int i;
/* Handle guest packets */
hw->guest_dx = hw->guest_dy = 0;
if ((packet[0] & 0xc8) == 0x08) { /* 3-byte PS/2 packet */
x = packet[1];
if (packet[0] & 0x10)
x = x - 256;
y = packet[2];
if (packet[0] & 0x20)
y = y - 256;
hw->guest_dx = x;
hw->guest_dy = -y;
hw->guest_left = (packet[0] & 0x01) ? TRUE : FALSE;
hw->guest_right = (packet[0] & 0x02) ? TRUE : FALSE;
return;
}
x = (packet[1] & 0x7f) | ((packet[2] & 0x78) << (7-3));
y = (packet[4] & 0x7f) | ((packet[3] & 0x70) << (7-4));
z = packet[5];
if (z == 127) { /* DualPoint stick is relative, not absolute */
if (x > 383)
x = x - 768;
if (y > 255)
y = y - 512;
hw->guest_dx = x;
hw->guest_dy = -y;
hw->left = packet[3] & 1;
hw->right = (packet[3] >> 1) & 1;
return;
......
......@@ -324,7 +324,6 @@ EventReadHwState(LocalDevicePtr local,
else
hw->numFingers = 0;
*hwRet = *hw;
hw->guest_dx = hw->guest_dy = 0;
return TRUE;
}
case EV_KEY:
......@@ -378,12 +377,6 @@ EventReadHwState(LocalDevicePtr local,
case BTN_TOOL_TRIPLETAP:
comm->threeFingers = v;
break;
case BTN_A:
hw->guest_left = v;
break;
case BTN_B:
hw->guest_right = v;
break;
case BTN_TOUCH:
if (!priv->has_pressure)
hw->z = v ? para->finger_high + 1 : 0;
......@@ -406,16 +399,6 @@ EventReadHwState(LocalDevicePtr local,
break;
}
break;
case EV_REL:
switch (ev.code) {
case REL_X:
hw->guest_dx = ev.value;
break;
case REL_Y:
hw->guest_dy = ev.value;
break;
}
break;
}
}
return FALSE;
......
......@@ -64,7 +64,6 @@ Atom prop_buttonscroll = 0;
Atom prop_buttonscroll_repeat = 0;
Atom prop_buttonscroll_time = 0;
Atom prop_off = 0;
Atom prop_guestmouse = 0;
Atom prop_lockdrags = 0;
Atom prop_lockdrags_time = 0;
Atom prop_tapaction = 0;
......@@ -220,7 +219,6 @@ InitDeviceProperties(LocalDevicePtr local)
}
prop_off = InitAtom(local->dev, SYNAPTICS_PROP_OFF, 8, 1, &para->touchpad_off);
prop_guestmouse = InitAtom(local->dev, SYNAPTICS_PROP_GUESTMOUSE, 8, 1, &para->guestmouse_off);
prop_lockdrags = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 1, &para->locked_drags);
prop_lockdrags_time = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 1, &para->locked_drag_time);
......@@ -502,12 +500,6 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
return BadValue;
para->touchpad_off = off;
} else if (property == prop_guestmouse)
{
if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
para->guestmouse_off = *(BOOL*)prop->data;
} else if (property == prop_gestures)
{
BOOL *gestures;
......
......@@ -87,7 +87,6 @@ struct SynapticsHwInfo {
unsigned int capabilities; /* Capabilities */
unsigned int ext_cap; /* Extended Capabilities */
unsigned int identity; /* Identification */
Bool hasGuest; /* Has a guest mouse */
};
/*****************************************************************************
......@@ -173,61 +172,6 @@ ps2_send_cmd(int fd, byte c)
ps2_putbyte(fd, PS2_CMD_STATUS_REQUEST));
}
/*****************************************************************************
* Synaptics passthrough functions
****************************************************************************/
static Bool
ps2_getbyte_passthrough(int fd, byte *response)
{
byte ack;
int timeout_count;
#define MAX_RETRY_COUNT 30
/* Getting a response back through the passthrough could take some time.
* Spin a little for the first byte */
for (timeout_count = 0;
!ps2_getbyte(fd, &ack) && (timeout_count <= MAX_RETRY_COUNT);
timeout_count++)
;
/* Do some sanity checking */
if ((ack & 0xfc) != 0x84) {
PS2DBG(ErrorF("ps2_getbyte_passthrough: expected 0x84 and got: %02x\n",
ack & 0xfc));
return FALSE;
}
ps2_getbyte(fd, response);
ps2_getbyte(fd, &ack);
ps2_getbyte(fd, &ack);
if ((ack & 0xcc) != 0xc4) {
PS2DBG(ErrorF("ps2_getbyte_passthrough: expected 0xc4 and got: %02x\n",
ack & 0xcc));
return FALSE;
}
ps2_getbyte(fd, &ack);
ps2_getbyte(fd, &ack);
return TRUE;
}
static Bool
ps2_putbyte_passthrough(int fd, byte c)
{
byte ack;
ps2_special_cmd(fd, c);
ps2_putbyte(fd, 0xF3);
ps2_putbyte(fd, 0x28);
ps2_getbyte_passthrough(fd, &ack);
if (ack != PS2_ACK) {
PS2DBG(ErrorF("ps2_putbyte_passthrough: wrong acknowledge 0x%02x\n", ack));
return FALSE;
}
return TRUE;
}
/*****************************************************************************
* Synaptics communications functions
****************************************************************************/
......@@ -272,30 +216,6 @@ ps2_synaptics_reset(int fd)
return FALSE;
}
static Bool
ps2_synaptics_reset_passthrough(int fd)
{
byte ack;
/* send reset */
ps2_putbyte_passthrough(fd, 0xff);
ps2_getbyte_passthrough(fd, &ack);
if (ack != 0xaa) {
PS2DBG(ErrorF("ps2_synaptics_reset_passthrough: ack was %02x not 0xaa\n", ack));
return FALSE;
}
ps2_getbyte_passthrough(fd, &ack);
if (ack != 0x00) {
PS2DBG(ErrorF("ps2_synaptics_reset_passthrough: ack was %02x not 0x00\n", ack));
return FALSE;
}
/* set defaults, turn on streaming, and enable the mouse */
return (ps2_putbyte_passthrough(fd, 0xf6) &&
ps2_putbyte_passthrough(fd, 0xea) &&
ps2_putbyte_passthrough(fd, 0xf4));
}
/*
* Read the model-id bytes from the touchpad
* see also SYN_MODEL_* macros
......@@ -500,22 +420,6 @@ PS2QueryHardware(LocalDevicePtr local)
if (!ps2_synaptics_set_mode(local->fd, mode))
return FALSE;
/* Check to see if the host mouse supports a guest */
synhw->hasGuest = FALSE;
if (SYN_CAP_PASSTHROUGH(synhw)) {
synhw->hasGuest = TRUE;
/* Enable the guest mouse. Set it to relative mode, three byte
* packets */
/* Disable the host to talk to the guest */
ps2_synaptics_disable_device(local->fd);
/* Reset it, set defaults, streaming and enable it */
if (!ps2_synaptics_reset_passthrough(local->fd)) {
synhw->hasGuest = FALSE;
}
}
ps2_synaptics_enable_device(local->fd);
ps2_print_ident(synhw);
......@@ -643,25 +547,6 @@ PS2ReadHwState(LocalDevicePtr local,
if (!ps2_synaptics_get_packet(local, synhw, proto_ops, comm))
return FALSE;
/* Handle guest packets */
hw->guest_dx = hw->guest_dy = 0;
if (newabs && synhw->hasGuest) {
w = (((buf[0] & 0x30) >> 2) |
((buf[0] & 0x04) >> 1) |
((buf[3] & 0x04) >> 2));
if (w == 3) { /* If w is 3, this is a guest packet */
if (buf[4] != 0)
hw->guest_dx = buf[4] - ((buf[1] & 0x10) ? 256 : 0);
if (buf[5] != 0)
hw->guest_dy = -(buf[5] - ((buf[1] & 0x20) ? 256 : 0));
hw->guest_left = (buf[1] & 0x01) ? TRUE : FALSE;
hw->guest_mid = (buf[1] & 0x04) ? TRUE : FALSE;
hw->guest_right = (buf[1] & 0x02) ? TRUE : FALSE;
*hwRet = *hw;
return TRUE;
}
}
/* Handle normal packets */
hw->x = hw->y = hw->z = hw->numFingers = hw->fingerWidth = 0;
hw->left = hw->right = hw->up = hw->down = hw->middle = FALSE;
......
......@@ -57,7 +57,6 @@ struct SynapticsHwInfo {
unsigned int capabilities; /* Capabilities */
unsigned int ext_cap; /* Extended Capabilities */
unsigned int identity; /* Identification */
Bool hasGuest; /* Has a guest mouse */
};
/*
......@@ -158,12 +157,6 @@ PSMQueryHardware(LocalDevicePtr local)
convert_hw_info(&psm_ident, synhw);
/* Check to see if the host mouse supports a guest */
synhw->hasGuest = FALSE;
if (psm_ident.capPassthrough) {
synhw->hasGuest = TRUE;
}
ps2_print_ident(synhw);
return TRUE;
......
......@@ -517,7 +517,6 @@ static void set_default_parameters(LocalDevicePtr local)
}
pars->scroll_button_repeat = xf86SetIntOption(opts,"ScrollButtonRepeat", 100);
pars->touchpad_off = xf86SetIntOption(opts, "TouchpadOff", 0);
pars->guestmouse_off = xf86SetBoolOption(opts, "GuestMouseOff", FALSE);
pars->locked_drags = xf86SetBoolOption(opts, "LockedDrags", FALSE);
pars->locked_drag_time = xf86SetIntOption(opts, "LockedDragTimeout", 5000);
pars->tap_action[RT_TAP] = xf86SetIntOption(opts, "RTCornerButton", 0);
......@@ -1159,7 +1158,6 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
sigstate = xf86BlockSIGIO();
hw = priv->hwState;
hw.guest_dx = hw.guest_dy = 0;
hw.millis = now;
delay = HandleState(local, &hw);
......@@ -1766,12 +1764,6 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
priv->count_packet_finger = 0;
}
/* Add guest device movements */
if (!para->guestmouse_off) {
dx += hw->guest_dx;
dy += hw->guest_dy;
}
*dxP = dx;
*dyP = dy;
......@@ -2135,11 +2127,6 @@ update_shm(const LocalDevicePtr local, const struct SynapticsHwState *hw)
for (i = 0; i < 8; i++)
shm->multi[i] = hw->multi[i];
shm->middle = hw->middle;
shm->guest_left = hw->guest_left;
shm->guest_mid = hw->guest_mid;
shm->guest_right = hw->guest_right;
shm->guest_dx = hw->guest_dx;
shm->guest_dy = hw->guest_dy;
}
/* Adjust the hardware state according to the extra buttons (if the touchpad
......@@ -2191,12 +2178,6 @@ update_hw_button_state(const LocalDevicePtr local, struct SynapticsHwState *hw,
hw->up |= hw->multi[0];
hw->down |= hw->multi[1];
if (!para->guestmouse_off) {
hw->left |= hw->guest_left;
hw->middle |= hw->guest_mid;
hw->right |= hw->guest_right;
}
/* 3rd button emulation */
hw->middle |= HandleMidButtonEmulation(priv, hw, delay);
......
......@@ -138,7 +138,6 @@ typedef struct _SynapticsParameters
* 1 : Off
* 2 : Only tapping and scrolling off
*/
Bool guestmouse_off; /* Switches the guest mouse off */
Bool locked_drags; /* Enable locked drags */
int locked_drag_time; /* timeout for locked drags */
int tap_action[MAX_TAP]; /* Button to report on tap events */
......
......@@ -50,12 +50,6 @@ struct SynapticsHwState {
Bool multi[8];
Bool middle; /* Some ALPS touchpads have a middle button */
Bool guest_left; /* guest device */
Bool guest_mid;
Bool guest_right;
int guest_dx;
int guest_dy;
};
struct CommData {
......
......@@ -112,7 +112,6 @@ static struct Parameter params[] = {
{"LeftRightScrollRepeat", PT_BOOL, 0, 1, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 1},
{"ScrollButtonRepeat", PT_INT, SBR_MIN , SBR_MAX, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 0},
{"TouchpadOff", PT_INT, 0, 2, SYNAPTICS_PROP_OFF, 8, 0},
{"GuestMouseOff", PT_BOOL, 0, 1, SYNAPTICS_PROP_GUESTMOUSE, 8, 0},
{"LockedDrags", PT_BOOL, 0, 1, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 0},
{"LockedDragTimeout", PT_INT, 0, 30000, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 0},
{"RTCornerButton", PT_INT, 0, SYN_MAX_BUTTONS, SYNAPTICS_PROP_TAP_ACTION, 8, 0},
......@@ -196,12 +195,7 @@ is_equal(SynapticsSHM *s1, SynapticsSHM *s2)
(s1->right != s2->right) ||
(s1->up != s2->up) ||
(s1->down != s2->down) ||
(s1->middle != s2->middle) ||
(s1->guest_left != s2->guest_left) ||
(s1->guest_mid != s2->guest_mid) ||
(s1->guest_right != s2->guest_right) ||
(s1->guest_dx != s2->guest_dx) ||
(s1->guest_dy != s2->guest_dy))
(s1->middle != s2->middle))
return 0;
for (i = 0; i < 8; i++)
......@@ -240,15 +234,12 @@ shm_monitor(SynapticsSHM *synshm, int delay)
header = 20;
}
header--;
printf("%8.3f %4d %4d %3d %d %2d %2d %d %d %d %d %d%d%d%d%d%d%d%d "
"%2d %2d %2d %3d %3d\n",
printf("%8.3f %4d %4d %3d %d %2d %2d %d %d %d %d %d%d%d%d%d%d%d%d\n",
get_time() - t0,
cur.x, cur.y, cur.z, cur.numFingers, cur.fingerWidth,
cur.left, cur.right, cur.up, cur.down, cur.middle,
cur.multi[0], cur.multi[1], cur.multi[2], cur.multi[3],
cur.multi[4], cur.multi[5], cur.multi[6], cur.multi[7],
cur.guest_left, cur.guest_mid, cur.guest_right,
cur.guest_dx, cur.guest_dy);
cur.multi[4], cur.multi[5], cur.multi[6], cur.multi[7]);
fflush(stdout);
old = cur;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment