summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-29 21:29:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-08 14:17:36 +1000
commit609b6728effb53006b2d0be1fac55d4ab1f269d2 (patch)
treef8b5411d24ad2fbb5a661ed959702d35b4cc79fa
parentc3ab0ae4f3f04da7018173662ede174c97710c8a (diff)
Purge SynapticsHWInfo stuff, move it into proto_data.
This was only used in PS/2, on linux only on kernel 2.4 and it clobbered up the rest. Move it to the ps2comm parts only, keep it private there. This includes adding a "proto_data" field to the SynapticsPrivate. This patch removes the -h option for synclient. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Christoph Brill <egore911@egore911.de>
-rw-r--r--include/synaptics.h12
-rw-r--r--man/synclient.man3
-rw-r--r--src/alpscomm.c4
-rw-r--r--src/eventcomm.c4
-rw-r--r--src/ps2comm.c109
-rw-r--r--src/ps2comm.h44
-rw-r--r--src/synaptics.c11
-rw-r--r--src/synapticsstr.h2
-rw-r--r--src/synproto.h4
-rw-r--r--tools/synclient.c32
10 files changed, 105 insertions, 120 deletions
diff --git a/include/synaptics.h b/include/synaptics.h
index e4a6086..4d5a3f3 100644
--- a/include/synaptics.h
+++ b/include/synaptics.h
@@ -48,15 +48,6 @@ typedef enum {
#define SYN_MAX_BUTTONS 12 /* Max number of mouse buttons */
-struct SynapticsHwInfo {
- unsigned int model_id; /* Model-ID */
- unsigned int capabilities; /* Capabilities */
- unsigned int ext_cap; /* Extended Capabilities */
- unsigned int identity; /* Identification */
- Bool hasGuest; /* Has a guest mouse */
-};
-
-
#define SHM_SYNAPTICS 23947
typedef struct _SynapticsSHM
{
@@ -72,9 +63,6 @@ typedef struct _SynapticsSHM
Bool middle;
int guest_left, guest_mid, guest_right; /* guest device buttons */
int guest_dx, guest_dy; /* guest device movement */
-
- /* Probed hardware properties */
- struct SynapticsHwInfo synhw;
} SynapticsSHM;
/*
diff --git a/man/synclient.man b/man/synclient.man
index 6b926b6..1c6d57d 100644
--- a/man/synclient.man
+++ b/man/synclient.man
@@ -95,9 +95,6 @@ Pointer movements from the guest device are reported as relative x/y
positions, called gdx and gdy.
.RE
.TP
-\fB\-h\fR
-Show detected hardware properties. Only available in SHM mode.
-.TP
\fB\-l\fR
List current user settings.
.TP
diff --git a/src/alpscomm.c b/src/alpscomm.c
index a1b6fb1..e1a059c 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -87,7 +87,7 @@ ALPS_initialize(int fd)
}
static Bool
-ALPSQueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
+ALPSQueryHardware(LocalDevicePtr local)
{
ALPS_initialize(local->fd);
return TRUE;
@@ -227,7 +227,7 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
}
static Bool
-ALPSReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
+ALPSReadHwState(LocalDevicePtr local,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 2b0bf68..70ee18c 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -227,7 +227,7 @@ event_query_axis_ranges(LocalDevicePtr local)
}
static Bool
-EventQueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
+EventQueryHardware(LocalDevicePtr local)
{
if (!event_query_is_touchpad(local->fd))
return FALSE;
@@ -254,7 +254,7 @@ SynapticsReadEvent(struct CommData *comm, struct input_event *ev)
}
static Bool
-EventReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
+EventReadHwState(LocalDevicePtr local,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
diff --git a/src/ps2comm.c b/src/ps2comm.c
index 2376028..e65e1af 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -77,6 +77,14 @@
#define DBG(a,b)
#endif
+struct SynapticsHwInfo {
+ unsigned int model_id; /* Model-ID */
+ unsigned int capabilities; /* Capabilities */
+ unsigned int ext_cap; /* Extended Capabilities */
+ unsigned int identity; /* Identification */
+ Bool hasGuest; /* Has a guest mouse */
+};
+
/*****************************************************************************
* PS/2 Utility functions.
* Many parts adapted from tpconfig.c by C. Scott Ananian
@@ -327,8 +335,8 @@ ps2_synaptics_capability(int fd, struct SynapticsHwInfo *synhw)
ps2_getbyte(fd, &cap[2])) {
synhw->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
PS2DBG(ErrorF("capabilities %06X\n", synhw->capabilities));
- if (SYN_CAP_VALID(*synhw)) {
- if (SYN_EXT_CAP_REQUESTS(*synhw)) {
+ if (SYN_CAP_VALID(synhw)) {
+ if (SYN_EXT_CAP_REQUESTS(synhw)) {
if (ps2_send_cmd(fd, SYN_QUE_EXT_CAPAB) &&
ps2_getbyte(fd, &cap[0]) &&
ps2_getbyte(fd, &cap[1]) &&
@@ -366,7 +374,7 @@ ps2_synaptics_identify(int fd, struct SynapticsHwInfo *synhw)
ps2_getbyte(fd, &id[2])) {
synhw->identity = (id[0] << 16) | (id[1] << 8) | id[2];
PS2DBG(ErrorF("ident %06X\n", synhw->identity));
- if (SYN_ID_IS_SYNAPTICS(*synhw)) {
+ if (SYN_ID_IS_SYNAPTICS(synhw)) {
PS2DBG(ErrorF("...done.\n"));
return TRUE;
}
@@ -389,9 +397,8 @@ ps2_synaptics_disable_device(int fd)
}
static Bool
-ps2_query_is_synaptics(int fd)
+ps2_query_is_synaptics(int fd, struct SynapticsHwInfo* synhw)
{
- struct SynapticsHwInfo synhw;
int i;
for (i = 0; i < 3; i++) {
@@ -401,10 +408,10 @@ ps2_query_is_synaptics(int fd)
xf86WaitForInput(fd, 20000);
xf86FlushInput(fd);
- if (ps2_synaptics_identify(fd, &synhw)) {
+ if (ps2_synaptics_identify(fd, synhw)) {
return TRUE;
} else {
- ErrorF("Query no Synaptics: %06X\n", synhw.identity);
+ ErrorF("Query no Synaptics: %06X\n", synhw->identity);
return FALSE;
}
}
@@ -412,34 +419,34 @@ ps2_query_is_synaptics(int fd)
void
ps2_print_ident(const struct SynapticsHwInfo *synhw)
{
- xf86Msg(X_PROBED, " Synaptics Touchpad, model: %d\n", SYN_ID_MODEL(*synhw));
- xf86Msg(X_PROBED, " Firmware: %d.%d\n", SYN_ID_MAJOR(*synhw),
- SYN_ID_MINOR(*synhw));
+ xf86Msg(X_PROBED, " Synaptics Touchpad, model: %d\n", SYN_ID_MODEL(synhw));
+ xf86Msg(X_PROBED, " Firmware: %d.%d\n", SYN_ID_MAJOR(synhw),
+ SYN_ID_MINOR(synhw));
- if (SYN_MODEL_ROT180(*synhw))
+ if (SYN_MODEL_ROT180(synhw))
xf86Msg(X_PROBED, " 180 degree mounted touchpad\n");
- if (SYN_MODEL_PORTRAIT(*synhw))
+ if (SYN_MODEL_PORTRAIT(synhw))
xf86Msg(X_PROBED, " portrait touchpad\n");
- xf86Msg(X_PROBED, " Sensor: %d\n", SYN_MODEL_SENSOR(*synhw));
- if (SYN_MODEL_NEWABS(*synhw))
+ xf86Msg(X_PROBED, " Sensor: %d\n", SYN_MODEL_SENSOR(synhw));
+ if (SYN_MODEL_NEWABS(synhw))
xf86Msg(X_PROBED, " new absolute packet format\n");
- if (SYN_MODEL_PEN(*synhw))
+ if (SYN_MODEL_PEN(synhw))
xf86Msg(X_PROBED, " pen detection\n");
- if (SYN_CAP_EXTENDED(*synhw)) {
+ if (SYN_CAP_EXTENDED(synhw)) {
xf86Msg(X_PROBED, " Touchpad has extended capability bits\n");
- if (SYN_CAP_MULTI_BUTTON_NO(*synhw))
+ if (SYN_CAP_MULTI_BUTTON_NO(synhw))
xf86Msg(X_PROBED, " -> %d multi buttons, i.e. besides standard buttons\n",
- (int)(SYN_CAP_MULTI_BUTTON_NO(*synhw)));
- if (SYN_CAP_MIDDLE_BUTTON(*synhw))
+ (int)(SYN_CAP_MULTI_BUTTON_NO(synhw)));
+ if (SYN_CAP_MIDDLE_BUTTON(synhw))
xf86Msg(X_PROBED, " -> middle button\n");
- if (SYN_CAP_FOUR_BUTTON(*synhw))
+ if (SYN_CAP_FOUR_BUTTON(synhw))
xf86Msg(X_PROBED, " -> four buttons\n");
- if (SYN_CAP_MULTIFINGER(*synhw))
+ if (SYN_CAP_MULTIFINGER(synhw))
xf86Msg(X_PROBED, " -> multifinger detection\n");
- if (SYN_CAP_PALMDETECT(*synhw))
+ if (SYN_CAP_PALMDETECT(synhw))
xf86Msg(X_PROBED, " -> palm detection\n");
- if (SYN_CAP_PASSTHROUGH(*synhw))
+ if (SYN_CAP_PASSTHROUGH(synhw))
xf86Msg(X_PROBED, " -> pass-through port\n");
}
}
@@ -452,12 +459,18 @@ PS2DeviceOffHook(LocalDevicePtr local)
}
static Bool
-PS2QueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
+PS2QueryHardware(LocalDevicePtr local)
{
int mode;
+ SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
+ struct SynapticsHwInfo *synhw;
+
+ if (!priv->proto_data)
+ priv->proto_data = xcalloc(1, sizeof(struct SynapticsHwInfo));
+ synhw = (struct SynapticsHwInfo*)priv->proto_data;
/* is the synaptics touchpad active? */
- if (!ps2_query_is_synaptics(local->fd))
+ if (!ps2_query_is_synaptics(local->fd, synhw))
return FALSE;
xf86Msg(X_PROBED, "%s synaptics touchpad found\n", local->name);
@@ -475,16 +488,16 @@ PS2QueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
return FALSE;
mode = SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
- if (SYN_ID_MAJOR(*synhw) >= 4)
+ if (SYN_ID_MAJOR(synhw) >= 4)
mode |= SYN_BIT_DISABLE_GESTURE;
- if (SYN_CAP_EXTENDED(*synhw))
+ if (SYN_CAP_EXTENDED(synhw))
mode |= SYN_BIT_W_MODE;
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)) {
+ if (SYN_CAP_PASSTHROUGH(synhw)) {
synhw->hasGuest = TRUE;
/* Enable the guest mouse. Set it to relative mode, three byte
@@ -512,7 +525,7 @@ static Bool
ps2_packet_ok(struct SynapticsHwInfo *synhw, struct CommData *comm)
{
unsigned char *buf = comm->protoBuf;
- int newabs = SYN_MODEL_NEWABS(*synhw);
+ int newabs = SYN_MODEL_NEWABS(synhw);
if (newabs ? ((buf[0] & 0xC0) != 0x80) : ((buf[0] & 0xC0) != 0xC0)) {
DBG(4, ErrorF("Synaptics driver lost sync at 1st byte\n"));
@@ -553,7 +566,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if ((c == 0x00) && (comm->lastByte == 0xAA)) {
if (xf86WaitForInput(local->fd, 50000) == 0) {
DBG(7, ErrorF("Reset received\n"));
- proto_ops->QueryHardware(local, synhw);
+ proto_ops->QueryHardware(local);
} else
DBG(3, ErrorF("faked reset received\n"));
}
@@ -579,7 +592,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if (comm->outOfSync > MAX_UNSYNC_PACKETS) {
comm->outOfSync = 0;
DBG(3, ErrorF("Synaptics synchronization lost too long -> reset touchpad.\n"));
- proto_ops->QueryHardware(local, synhw); /* including a reset */
+ proto_ops->QueryHardware(local); /* including a reset */
continue;
}
}
@@ -599,17 +612,29 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
}
static Bool
-PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
+PS2ReadHwState(LocalDevicePtr local,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
- int newabs = SYN_MODEL_NEWABS(*synhw);
unsigned char *buf = comm->protoBuf;
struct SynapticsHwState *hw = &(comm->hwState);
SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
SynapticsParameters *para = &priv->synpara;
+ struct SynapticsHwInfo *synhw;
+ int newabs;
int w, i;
+ synhw = (struct SynapticsHwInfo*)priv->proto_data;
+ if (!synhw)
+ {
+ xf86Msg(X_ERROR,
+ "%s: PS2ReadHwState, synhw is NULL. This is a bug.\n",
+ local->name);
+ return FALSE;
+ }
+
+ newabs = SYN_MODEL_NEWABS(synhw);
+
if (!ps2_synaptics_get_packet(local, synhw, proto_ops, comm))
return FALSE;
@@ -655,11 +680,11 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
hw->left = (buf[0] & 0x01) ? 1 : 0;
hw->right = (buf[0] & 0x02) ? 1 : 0;
- if (SYN_CAP_EXTENDED(*synhw)) {
- if (SYN_CAP_MIDDLE_BUTTON(*synhw)) {
+ if (SYN_CAP_EXTENDED(synhw)) {
+ if (SYN_CAP_MIDDLE_BUTTON(synhw)) {
hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
}
- if (SYN_CAP_FOUR_BUTTON(*synhw)) {
+ if (SYN_CAP_FOUR_BUTTON(synhw)) {
hw->up = ((buf[3] & 0x01)) ? 1 : 0;
if (hw->left)
hw->up = !hw->up;
@@ -667,9 +692,9 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if (hw->right)
hw->down = !hw->down;
}
- if (SYN_CAP_MULTI_BUTTON_NO(*synhw)) {
+ if (SYN_CAP_MULTI_BUTTON_NO(synhw)) {
if ((buf[3] & 2) ? !hw->right : hw->right) {
- switch (SYN_CAP_MULTI_BUTTON_NO(*synhw) & ~0x01) {
+ switch (SYN_CAP_MULTI_BUTTON_NO(synhw) & ~0x01) {
default:
break;
case 8:
@@ -713,13 +738,13 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
* If not, set it to 5, which corresponds to a finger of
* normal width.
*/
- if (SYN_CAP_EXTENDED(*synhw)) {
+ if (SYN_CAP_EXTENDED(synhw)) {
if ((w >= 0) && (w <= 1)) {
- w_ok = SYN_CAP_MULTIFINGER(*synhw);
+ w_ok = SYN_CAP_MULTIFINGER(synhw);
} else if (w == 2) {
- w_ok = SYN_MODEL_PEN(*synhw);
+ w_ok = SYN_MODEL_PEN(synhw);
} else if ((w >= 4) && (w <= 15)) {
- w_ok = SYN_CAP_PALMDETECT(*synhw);
+ w_ok = SYN_CAP_PALMDETECT(synhw);
}
}
if (!w_ok)
diff --git a/src/ps2comm.h b/src/ps2comm.h
index 1a62233..fec5634 100644
--- a/src/ps2comm.h
+++ b/src/ps2comm.h
@@ -56,26 +56,26 @@
#define SYN_BIT_W_MODE (1 << 0)
/* synaptics model ID bits */
-#define SYN_MODEL_ROT180(synhw) ((synhw).model_id & (1 << 23))
-#define SYN_MODEL_PORTRAIT(synhw) ((synhw).model_id & (1 << 22))
-#define SYN_MODEL_SENSOR(synhw) (((synhw).model_id >> 16) & 0x3f)
-#define SYN_MODEL_HARDWARE(synhw) (((synhw).model_id >> 9) & 0x7f)
-#define SYN_MODEL_NEWABS(synhw) ((synhw).model_id & (1 << 7))
-#define SYN_MODEL_PEN(synhw) ((synhw).model_id & (1 << 6))
-#define SYN_MODEL_SIMPLIC(synhw) ((synhw).model_id & (1 << 5))
-#define SYN_MODEL_GEOMETRY(synhw) ((synhw).model_id & 0x0f)
+#define SYN_MODEL_ROT180(synhw) ((synhw)->model_id & (1 << 23))
+#define SYN_MODEL_PORTRAIT(synhw) ((synhw)->model_id & (1 << 22))
+#define SYN_MODEL_SENSOR(synhw) (((synhw)->model_id >> 16) & 0x3f)
+#define SYN_MODEL_HARDWARE(synhw) (((synhw)->model_id >> 9) & 0x7f)
+#define SYN_MODEL_NEWABS(synhw) ((synhw)->model_id & (1 << 7))
+#define SYN_MODEL_PEN(synhw) ((synhw)->model_id & (1 << 6))
+#define SYN_MODEL_SIMPLIC(synhw) ((synhw)->model_id & (1 << 5))
+#define SYN_MODEL_GEOMETRY(synhw) ((synhw)->model_id & 0x0f)
/* synaptics capability bits */
-#define SYN_CAP_EXTENDED(synhw) ((synhw).capabilities & (1 << 23))
-#define SYN_CAP_MIDDLE_BUTTON(synhw) ((synhw).capabilities & (1 << 18))
-#define SYN_CAP_PASSTHROUGH(synhw) ((synhw).capabilities & (1 << 7))
-#define SYN_CAP_SLEEP(synhw) ((synhw).capabilities & (1 << 4))
-#define SYN_CAP_FOUR_BUTTON(synhw) ((synhw).capabilities & (1 << 3))
-#define SYN_CAP_MULTIFINGER(synhw) ((synhw).capabilities & (1 << 1))
-#define SYN_CAP_PALMDETECT(synhw) ((synhw).capabilities & (1 << 0))
-#define SYN_CAP_VALID(synhw) ((((synhw).capabilities & 0x00ff00) >> 8) == 0x47)
-#define SYN_EXT_CAP_REQUESTS(synhw) (((synhw).capabilities & 0x700000) == 0x100000)
-#define SYN_CAP_MULTI_BUTTON_NO(synhw) (((synhw).ext_cap & 0x00f000) >> 12)
+#define SYN_CAP_EXTENDED(synhw) ((synhw)->capabilities & (1 << 23))
+#define SYN_CAP_MIDDLE_BUTTON(synhw) ((synhw)->capabilities & (1 << 18))
+#define SYN_CAP_PASSTHROUGH(synhw) ((synhw)->capabilities & (1 << 7))
+#define SYN_CAP_SLEEP(synhw) ((synhw)->capabilities & (1 << 4))
+#define SYN_CAP_FOUR_BUTTON(synhw) ((synhw)->capabilities & (1 << 3))
+#define SYN_CAP_MULTIFINGER(synhw) ((synhw)->capabilities & (1 << 1))
+#define SYN_CAP_PALMDETECT(synhw) ((synhw)->capabilities & (1 << 0))
+#define SYN_CAP_VALID(synhw) ((((synhw)->capabilities & 0x00ff00) >> 8) == 0x47)
+#define SYN_EXT_CAP_REQUESTS(synhw) (((synhw)->capabilities & 0x700000) == 0x100000)
+#define SYN_CAP_MULTI_BUTTON_NO(synhw) (((synhw)->ext_cap & 0x00f000) >> 12)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
@@ -87,10 +87,10 @@
#define SYN_MODE_VALID(m) (((m) & 0xffff00) == 0x3B47)
/* synaptics identify query bits */
-#define SYN_ID_MODEL(synhw) (((synhw).identity >> 4) & 0x0f)
-#define SYN_ID_MAJOR(synhw) ((synhw).identity & 0x0f)
-#define SYN_ID_MINOR(synhw) (((synhw).identity >> 16) & 0xff)
-#define SYN_ID_IS_SYNAPTICS(synhw) ((((synhw).identity >> 8) & 0xff) == 0x47)
+#define SYN_ID_MODEL(synhw) (((synhw)->identity >> 4) & 0x0f)
+#define SYN_ID_MAJOR(synhw) ((synhw)->identity & 0x0f)
+#define SYN_ID_MINOR(synhw) (((synhw)->identity >> 16) & 0xff)
+#define SYN_ID_IS_SYNAPTICS(synhw) ((((synhw)->identity >> 8) & 0xff) == 0x47)
typedef unsigned char byte;
diff --git a/src/synaptics.c b/src/synaptics.c
index cab7ab6..421cc0a 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -639,6 +639,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
if (priv->comm.buffer)
XisbFree(priv->comm.buffer);
free_param_data(priv);
+ xfree(priv->proto_data);
xfree(priv->timer);
xfree(priv);
local->private = NULL;
@@ -656,6 +657,8 @@ static void SynapticsUnInit(InputDriverPtr drv,
SynapticsPrivate *priv = ((SynapticsPrivate *)local->private);
if (priv && priv->timer)
xfree(priv->timer);
+ if (priv && priv->proto_data)
+ xfree(priv->proto_data);
xfree(local->private);
local->private = NULL;
xf86DeleteInput(local, 0);
@@ -988,7 +991,7 @@ static Bool
SynapticsGetHwState(LocalDevicePtr local, SynapticsPrivate *priv,
struct SynapticsHwState *hw)
{
- return priv->proto_ops->ReadHwState(local, &priv->synhw, priv->proto_ops,
+ return priv->proto_ops->ReadHwState(local, priv->proto_ops,
&priv->comm, hw);
}
@@ -2212,14 +2215,10 @@ static Bool
QueryHardware(LocalDevicePtr local)
{
SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
- SynapticsSHM *shm = priv->synshm;
priv->comm.protoBufTail = 0;
- if (priv->proto_ops->QueryHardware(local, &priv->synhw)) {
- if (shm)
- shm->synhw = priv->synhw;
- } else {
+ if (!priv->proto_ops->QueryHardware(local)) {
xf86Msg(X_PROBED, "%s: no supported touchpad found\n", local->name);
if (priv->proto_ops->DeviceOffHook)
priv->proto_ops->DeviceOffHook(local);
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 945aa0d..15c0e90 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -156,10 +156,10 @@ typedef struct _SynapticsPrivateRec
SynapticsSHM *synshm; /* Current parameter settings. Will point to
shared memory if shm_config is true */
struct SynapticsProtocolOperations* proto_ops;
+ void *proto_data; /* protocol-specific data */
struct SynapticsHwState hwState;
- struct SynapticsHwInfo synhw; /* Data read from the touchpad */
Bool shm_config; /* True when shared memory area allocated */
OsTimerPtr timer; /* for up/down-button repeat, tap processing, etc */
diff --git a/src/synproto.h b/src/synproto.h
index 22763e2..f7be819 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -91,8 +91,8 @@ struct CommData;
struct SynapticsProtocolOperations {
void (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsParameters *para);
void (*DeviceOffHook)(LocalDevicePtr local);
- Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw);
- Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
+ Bool (*QueryHardware)(LocalDevicePtr local);
+ Bool (*ReadHwState)(LocalDevicePtr local,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet);
Bool (*AutoDevProbe)(LocalDevicePtr local);
diff --git a/tools/synclient.c b/tools/synclient.c
index 3ea9c50..ebba6c3 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -141,21 +141,6 @@ static struct Parameter params[] = {
{ NULL, 0, 0, 0, 0 }
};
-static void
-shm_show_hw_info(SynapticsSHM *synshm)
-{
- printf("Hardware properties:\n");
- if (synshm->synhw.model_id) {
- printf(" Model Id = %08x\n", synshm->synhw.model_id);
- printf(" Capabilities = %08x\n", synshm->synhw.capabilities);
- printf(" Identity = %08x\n", synshm->synhw.identity);
- } else {
- printf(" Can't detect hardware properties.\n");
- printf(" This is normal if you are running linux kernel 2.6.\n");
- printf(" Check the kernel log for touchpad hardware information.\n");
- }
-}
-
static double
parse_cmd(char* cmd, struct Parameter** par)
{
@@ -285,7 +270,7 @@ shm_init()
}
static void
-shm_process_commands(int dump_hw, int do_monitor, int delay)
+shm_process_commands(int do_monitor, int delay)
{
SynapticsSHM *synshm = NULL;
@@ -293,10 +278,6 @@ shm_process_commands(int dump_hw, int do_monitor, int delay)
if (!synshm)
return;
- /* Perform requested actions */
- if (dump_hw)
- shm_show_hw_info(synshm);
-
if (do_monitor)
shm_monitor(synshm, delay);
}
@@ -576,7 +557,6 @@ usage(void)
fprintf(stderr, "Usage: synclient [-s] [-m interval] [-h] [-l] [-V] [-?] [var1=value1 [var2=value2] ...]\n");
fprintf(stderr, " -m monitor changes to the touchpad state (implies -s)\n"
" interval specifies how often (in ms) to poll the touchpad state\n");
- fprintf(stderr, " -h Show detected hardware properties (implies -s)\n");
fprintf(stderr, " -l List current user settings\n");
fprintf(stderr, " -V Print synclient version string and exit\n");
fprintf(stderr, " -? Show this help message\n");
@@ -590,7 +570,6 @@ main(int argc, char *argv[])
int c;
int delay = -1;
int do_monitor = 0;
- int dump_hw = 0;
int dump_settings = 0;
int first_cmd;
@@ -605,9 +584,6 @@ main(int argc, char *argv[])
if ((delay = atoi(optarg)) < 0)
usage();
break;
- case 'h':
- dump_hw = 1;
- break;
case 'l':
dump_settings = 1;
break;
@@ -620,12 +596,12 @@ main(int argc, char *argv[])
}
first_cmd = optind;
- if (!do_monitor && !dump_hw && !dump_settings && first_cmd == argc)
+ if (!do_monitor && !dump_settings && first_cmd == argc)
usage();
/* Connect to the shared memory area */
- if (do_monitor || dump_hw)
- shm_process_commands(dump_hw, do_monitor, delay);
+ if (do_monitor)
+ shm_process_commands(do_monitor, delay);
dpy = dp_init();
if (!dpy || !(dev = dp_get_device(dpy)))