[PATCH] XFbdev: disable probing I/O devices on serial ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

Please find inlined patch that disables probing for mouse on serial
ports if -no-serial-probe is specified in command line.

Signed-off-by: dmitry pervushin <dpervushin@xxxxxxxxx>
Index: xc/programs/Xserver/hw/tinyx/linux/mouse.c
===================================================================
--- xc.orig/programs/Xserver/hw/tinyx/linux/mouse.c
+++ xc/programs/Xserver/hw/tinyx/linux/mouse.c
@@ -82,6 +82,9 @@
 #undef DEBUG_BYTES
 #define KBUFIO_SIZE 256
 
+extern Bool noSerialProbe; /* if switched on, ttyS* devices will be never */
+ 			    /* probed for mouse                            */
+
 typedef struct _kbufio {
     int		    fd;
     unsigned char   buf[KBUFIO_SIZE];
@@ -977,6 +980,8 @@ MouseInit (void)
 	{
 	    for (i = 0; i < NUM_DEFAULT_MOUSE; i++)
 	    {
+		if (noSerialProbe && strstr(kdefaultMouse[i], "/dev/ttyS"))
+			continue;
 		fd = open (kdefaultMouse[i], 2);
 		if (fd >= 0)
 		{
Index: xc/programs/Xserver/os/utils.c
===================================================================
--- xc.orig/programs/Xserver/os/utils.c
+++ xc/programs/Xserver/os/utils.c
@@ -178,6 +178,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
 Bool CoreDump;
 Bool noTestExtensions;
 
+Bool noSerialProbe = FALSE;
 #ifdef PANORAMIX
 Bool noPanoramiXExtension = TRUE;
 Bool PanoramiXVisibilityNotifySent = FALSE;
@@ -639,6 +640,7 @@ void UseMsg(void)
     ErrorF("-dumbSched             Disable smart scheduling, enable old behavior\n");
     ErrorF("-schedInterval int     Set scheduler interval in msec\n");
 #endif
+    ErrorF("-no-serial-probe	   Disable probing of serial ports for mice\n");
 #ifdef XDMCP
     XdmcpUseMsg();
 #endif
@@ -891,6 +893,10 @@ ProcessCommandLine(int argc, char *argv[
 	    logoScreenSaver = 0;
 	}
 #endif
+	else if ( strcmp( argv[i], "-no-serial-probe") == 0)
+	{
+	    noSerialProbe = TRUE;
+	}
 	else if ( strcmp( argv[i], "-nolisten") == 0)
 	{
             if(++i < argc) {


_______________________________________________
Devel mailing list
Devel@xxxxxxxxxxx
http://XFree86.Org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [X Forum]     [XFree86]     [XFree86 Newbie]     [X.Org]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux