diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-05-21 11:56:48 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-05-31 14:56:47 +1000 |
commit | bbf82ff5c9685ced637778de93fe119935b604e5 (patch) | |
tree | aa4b9f384eacbf910d987982090a5382a9d68f1d /src/ps2comm.c | |
parent | a844197d18ea9f3849974d5e8bb4cf235fde3cf7 (diff) |
Pass the fd down into ReadInput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/ps2comm.c')
-rw-r--r-- | src/ps2comm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ps2comm.c b/src/ps2comm.c index cb22414..887a012 100644 --- a/src/ps2comm.c +++ b/src/ps2comm.c @@ -458,7 +458,8 @@ ps2_packet_ok(struct PS2SynapticsHwInfo *synhw, struct PS2CommData *comm) } static Bool -ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synhw, +ps2_synaptics_get_packet(SynapticsPrivate *priv, int fd, + struct PS2SynapticsHwInfo *synhw, struct SynapticsProtocolOperations *proto_ops, struct CommData *comm) { @@ -472,9 +473,9 @@ ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synh /* test if there is a reset sequence received */ if ((c == 0x00) && (ps2_comm_data->lastByte == 0xAA)) { - if (xf86WaitForInput(priv->fd, 50000) == 0) { + if (xf86WaitForInput(fd, 50000) == 0) { PS2DBG("Reset received\n"); - proto_ops->QueryHardware(priv, priv->fd); + proto_ops->QueryHardware(priv, fd); } else PS2DBG("faked reset received\n"); @@ -503,7 +504,7 @@ ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synh if (ps2_comm_data->outOfSync > MAX_UNSYNC_PACKETS) { ps2_comm_data->outOfSync = 0; PS2DBG("Synaptics synchronization lost too long -> reset touchpad.\n"); - proto_ops->QueryHardware(priv, priv->fd); /* including a reset */ + proto_ops->QueryHardware(priv, fd); /* including a reset */ continue; } } @@ -523,7 +524,7 @@ ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synh } Bool -PS2ReadHwStateProto(SynapticsPrivate *priv, +PS2ReadHwStateProto(SynapticsPrivate *priv, int fd, struct SynapticsProtocolOperations *proto_ops, struct CommData *comm, struct SynapticsHwState *hwRet) { @@ -544,7 +545,7 @@ PS2ReadHwStateProto(SynapticsPrivate *priv, newabs = SYN_MODEL_NEWABS(synhw); - if (!ps2_synaptics_get_packet(priv, synhw, proto_ops, comm)) + if (!ps2_synaptics_get_packet(priv, fd, synhw, proto_ops, comm)) return FALSE; /* Handle normal packets */ @@ -656,10 +657,10 @@ PS2ReadHwStateProto(SynapticsPrivate *priv, } static Bool -PS2ReadHwState(SynapticsPrivate *priv, +PS2ReadHwState(SynapticsPrivate *priv, int fd, struct CommData *comm, struct SynapticsHwState *hwRet) { - return PS2ReadHwStateProto(priv, &psaux_proto_operations, comm, hwRet); + return PS2ReadHwStateProto(priv, fd, &psaux_proto_operations, comm, hwRet); } Bool |