I would like to propose to remove the repeater functionality completely from 
the synaptics touchpad driver. It is buggy in its current implementation 
and its usefulness is questionable.

According to the INSTALL file, the repeater is there only for testing. In 
fact, if a supported device is found even a configured repeater fifo is 
automatically disabled. For most users the functionality is therefore 
irrelevant and can be confusing. If I understand the workings of the 
repeater correctly, a developer could instead just read the data directly 
from an unsupported device's character special file under /dev 
or /dev/input.

With today's more dynamic device configuration possibilities via udev and 
hal it's also less likely that the synaptics driver would silently block 
another devices data, this situation being for what the repeater 
functionality seems to have been introduced in the past.

Please review the attached patch and apply if appropriate.

Best Regards,

Magnus Kessler

Remove repeater fifo from synaptics driver

Signed-off-by: Magnus Kessler <[EMAIL PROTECTED]>

diff --git a/INSTALL b/INSTALL
index d385450..47d2913 100644
--- a/INSTALL
+++ b/INSTALL
@@ -48,11 +48,9 @@ Section "InputDevice"
   Option	"MinSpeed"		"0.09"
   Option	"MaxSpeed"		"0.18"
   Option	"AccelFactor"		"0.0015"
-#  Option	"Repeater"		"/dev/ps2mouse"
 EndSection
 
 Change the Identifier to the same name as in the ServerLayout section.
-The Option "Repeater" is at the moment for testing.
 
 5. Add the "CorePointer" option to the InputDevice line at the
    ServerLayout section:
diff --git a/src/synaptics.c b/src/synaptics.c
index 7b5e6d5..148b3f6 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -498,30 +498,6 @@ static void set_default_parameters(LocalDevicePtr local)
     }
 }
 
-static void set_repeater_fifo(LocalDevicePtr local)
-{
-    SynapticsPrivate *priv = local->private;
-    pointer optList;
-    char *repeater;
-    int status;
-
-    repeater = xf86SetStrOption(local->options, "Repeater", NULL);
-    if (repeater) {
-	/* create repeater fifo */
-	status = mknod(repeater, 666, S_IFIFO);
-	if ((status != 0) && (status != EEXIST)) {
-	    xf86Msg(X_ERROR, "%s can't create repeater fifo\n", local->name);
-	} else {
-	    /* open the repeater fifo */
-	    optList = xf86NewOption("Device", repeater);
-	    if ((priv->fifofd = xf86OpenSerial(optList)) == -1) {
-		xf86Msg(X_ERROR, "%s repeater device open failed\n", local->name);
-	    }
-	}
-	free(repeater);
-    }
-}
-
 /*
  *  called by the module loader for initialization
  */
@@ -607,9 +583,6 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     priv->comm.buffer = XisbNew(local->fd, 200);
     DBG(9, XisbTrace(priv->comm.buffer, 1));
 
-    priv->fifofd = -1;
-    set_repeater_fifo(local);
-
     if (!QueryHardware(local)) {
 	xf86Msg(X_ERROR, "%s Unable to query/initialize Synaptics hardware.\n", local->name);
 	goto SetupProc_fail;
@@ -977,18 +950,6 @@ static Bool
 SynapticsGetHwState(LocalDevicePtr local, SynapticsPrivate *priv,
 		    struct SynapticsHwState *hw)
 {
-    if (priv->fifofd >= 0) {
-	/* when there is no synaptics touchpad pipe the data to the repeater fifo */
-	int count = 0;
-	int c;
-	while ((c = XisbRead(priv->comm.buffer)) >= 0) {
-	    unsigned char u = (unsigned char)c;
-	    write(priv->fifofd, &u, 1);
-	    if (++count >= 3)
-		break;
-	}
-	return FALSE;
-    }
     return priv->proto_ops->ReadHwState(local, &priv->synhw, priv->proto_ops,
 					&priv->comm, hw);
 }
@@ -2225,19 +2186,9 @@ QueryHardware(LocalDevicePtr local)
 
     if (priv->proto_ops->QueryHardware(local, &priv->synhw)) {
 	para->synhw = priv->synhw;
-	if (priv->fifofd != -1) {
-	    xf86CloseSerial(priv->fifofd);
-	    priv->fifofd = -1;
-	}
 	return TRUE;
     }
 
-    if (priv->fifofd == -1) {
-	xf86Msg(X_ERROR, "%s no synaptics touchpad detected and no repeater device\n",
-		local->name);
-	return FALSE;
-    }
-    xf86Msg(X_PROBED, "%s no synaptics touchpad, data piped to repeater fifo\n", local->name);
     priv->proto_ops->DeviceOffHook(local);
     return TRUE;
 }
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index e5202d1..cc0a29f 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -95,7 +95,6 @@ typedef struct _SynapticsPrivateRec
     OsTimerPtr timer;			/* for up/down-button repeat, tap processing, etc */
 
     struct CommData comm;
-    int fifofd;		 		/* fd for fifo */
 
     SynapticsMoveHistRec move_hist[SYNAPTICS_MOVE_HISTORY]; /* movement history */
     int hist_index;			/* Last added entry in move_hist[] */

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to