2003-11-14 16:54:54 +01:00
|
|
|
/*
|
2003-11-25 20:29:01 +01:00
|
|
|
* Copyright 1993-2003 by The XFree86 Project, Inc.
|
2003-11-14 16:54:54 +01:00
|
|
|
*
|
2003-11-14 17:49:22 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
2003-11-14 16:54:54 +01:00
|
|
|
*
|
2003-11-14 17:49:22 +01:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of the XFree86 Project shall
|
|
|
|
* not be used in advertising or otherwise to promote the sale, use or other
|
|
|
|
* dealings in this Software without prior written authorization from the
|
|
|
|
* XFree86 Project.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (c) 1997 Metro Link Incorporated
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of the Metro Link shall not be
|
|
|
|
* used in advertising or otherwise to promote the sale, use or other dealings
|
|
|
|
* in this Software without prior written authorization from Metro Link.
|
2003-11-14 16:54:54 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_XORG_CONFIG_H
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
2016-07-19 00:58:42 +02:00
|
|
|
#include <xserver_poll.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86Priv.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "xf86_OSlib.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static int
|
|
|
|
GetBaud(int baudrate)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
#ifdef B300
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 300)
|
|
|
|
return B300;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B1200
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 1200)
|
|
|
|
return B1200;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B2400
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 2400)
|
|
|
|
return B2400;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B4800
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 4800)
|
|
|
|
return B4800;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B9600
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 9600)
|
|
|
|
return B9600;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B19200
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 19200)
|
|
|
|
return B19200;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B38400
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 38400)
|
|
|
|
return B38400;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B57600
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 57600)
|
|
|
|
return B57600;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B115200
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 115200)
|
|
|
|
return B115200;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B230400
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 230400)
|
|
|
|
return B230400;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef B460800
|
2012-03-21 20:55:09 +01:00
|
|
|
if (baudrate == 460800)
|
|
|
|
return B460800;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86OpenSerial(XF86OptionPtr options)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
struct termios t;
|
|
|
|
int fd, i;
|
|
|
|
char *dev;
|
|
|
|
|
|
|
|
dev = xf86SetStrOption(options, "Device", NULL);
|
|
|
|
if (!dev) {
|
|
|
|
xf86Msg(X_ERROR, "xf86OpenSerial: No Device specified.\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2014-02-01 13:21:15 +01:00
|
|
|
fd = xf86CheckIntOption(options, "fd", -1);
|
|
|
|
|
|
|
|
if (fd == -1)
|
|
|
|
SYSCALL(fd = open(dev, O_RDWR | O_NONBLOCK));
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd == -1) {
|
|
|
|
xf86Msg(X_ERROR,
|
|
|
|
"xf86OpenSerial: Cannot open device %s\n\t%s.\n",
|
|
|
|
dev, strerror(errno));
|
|
|
|
free(dev);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isatty(fd)) {
|
|
|
|
/* Allow non-tty devices to be opened. */
|
|
|
|
free(dev);
|
|
|
|
return fd;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* set up default port parameters */
|
|
|
|
SYSCALL(tcgetattr(fd, &t));
|
|
|
|
t.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR
|
|
|
|
| IGNCR | ICRNL | IXON);
|
|
|
|
t.c_oflag &= ~OPOST;
|
|
|
|
t.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
|
|
|
t.c_cflag &= ~(CSIZE | PARENB);
|
|
|
|
t.c_cflag |= CS8 | CLOCAL;
|
|
|
|
|
|
|
|
cfsetispeed(&t, B9600);
|
|
|
|
cfsetospeed(&t, B9600);
|
|
|
|
t.c_cc[VMIN] = 1;
|
|
|
|
t.c_cc[VTIME] = 0;
|
|
|
|
|
|
|
|
SYSCALL(tcsetattr(fd, TCSANOW, &t));
|
|
|
|
|
|
|
|
if (xf86SetSerial(fd, options) == -1) {
|
|
|
|
SYSCALL(close(fd));
|
|
|
|
free(dev);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYSCALL(i = fcntl(fd, F_GETFL, 0));
|
|
|
|
if (i == -1) {
|
|
|
|
SYSCALL(close(fd));
|
|
|
|
free(dev);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
i &= ~O_NONBLOCK;
|
|
|
|
SYSCALL(i = fcntl(fd, F_SETFL, i));
|
|
|
|
if (i == -1) {
|
|
|
|
SYSCALL(close(fd));
|
|
|
|
free(dev);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
free(dev);
|
|
|
|
return fd;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SetSerial(int fd, XF86OptionPtr options)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
struct termios t;
|
|
|
|
int val;
|
|
|
|
const char *s;
|
|
|
|
int baud, r;
|
|
|
|
|
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
SYSCALL(tcgetattr(fd, &t));
|
|
|
|
|
|
|
|
if ((val = xf86SetIntOption(options, "BaudRate", 0))) {
|
|
|
|
if ((baud = GetBaud(val))) {
|
|
|
|
cfsetispeed(&t, baud);
|
|
|
|
cfsetospeed(&t, baud);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option BaudRate value: %d\n", val);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((val = xf86SetIntOption(options, "StopBits", 0))) {
|
|
|
|
switch (val) {
|
|
|
|
case 1:
|
|
|
|
t.c_cflag &= ~(CSTOPB);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
t.c_cflag |= CSTOPB;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option StopBits value: %d\n", val);
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((val = xf86SetIntOption(options, "DataBits", 0))) {
|
|
|
|
switch (val) {
|
|
|
|
case 5:
|
|
|
|
t.c_cflag &= ~(CSIZE);
|
|
|
|
t.c_cflag |= CS5;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
t.c_cflag &= ~(CSIZE);
|
|
|
|
t.c_cflag |= CS6;
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
t.c_cflag &= ~(CSIZE);
|
|
|
|
t.c_cflag |= CS7;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
t.c_cflag &= ~(CSIZE);
|
|
|
|
t.c_cflag |= CS8;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option DataBits value: %d\n", val);
|
|
|
|
return -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((s = xf86SetStrOption(options, "Parity", NULL))) {
|
|
|
|
if (xf86NameCmp(s, "Odd") == 0) {
|
|
|
|
t.c_cflag |= PARENB | PARODD;
|
|
|
|
}
|
|
|
|
else if (xf86NameCmp(s, "Even") == 0) {
|
|
|
|
t.c_cflag |= PARENB;
|
|
|
|
t.c_cflag &= ~(PARODD);
|
|
|
|
}
|
|
|
|
else if (xf86NameCmp(s, "None") == 0) {
|
|
|
|
t.c_cflag &= ~(PARENB);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option Parity value: %s\n", s);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((val = xf86SetIntOption(options, "Vmin", -1)) != -1) {
|
|
|
|
t.c_cc[VMIN] = val;
|
|
|
|
}
|
|
|
|
if ((val = xf86SetIntOption(options, "Vtime", -1)) != -1) {
|
|
|
|
t.c_cc[VTIME] = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((s = xf86SetStrOption(options, "FlowControl", NULL))) {
|
|
|
|
xf86MarkOptionUsedByName(options, "FlowControl");
|
|
|
|
if (xf86NameCmp(s, "Xoff") == 0) {
|
|
|
|
t.c_iflag |= IXOFF;
|
|
|
|
}
|
|
|
|
else if (xf86NameCmp(s, "Xon") == 0) {
|
|
|
|
t.c_iflag |= IXON;
|
|
|
|
}
|
|
|
|
else if (xf86NameCmp(s, "XonXoff") == 0) {
|
|
|
|
t.c_iflag |= IXON | IXOFF;
|
|
|
|
}
|
|
|
|
else if (xf86NameCmp(s, "None") == 0) {
|
|
|
|
t.c_iflag &= ~(IXON | IXOFF);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option FlowControl value: %s\n", s);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((xf86SetBoolOption(options, "ClearDTR", FALSE))) {
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef CLEARDTR_SUPPORT
|
2012-03-21 20:55:09 +01:00
|
|
|
#if defined(TIOCMBIC)
|
|
|
|
val = TIOCM_DTR;
|
|
|
|
SYSCALL(ioctl(fd, TIOCMBIC, &val));
|
|
|
|
#else
|
|
|
|
SYSCALL(ioctl(fd, TIOCCDTR, NULL));
|
|
|
|
#endif
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86Msg(X_WARNING, "Option ClearDTR not supported on this OS\n");
|
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86MarkOptionUsedByName(options, "ClearDTR");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((xf86SetBoolOption(options, "ClearRTS", FALSE))) {
|
|
|
|
xf86Msg(X_WARNING, "Option ClearRTS not supported on this OS\n");
|
|
|
|
return -1;
|
|
|
|
xf86MarkOptionUsedByName(options, "ClearRTS");
|
|
|
|
}
|
|
|
|
|
|
|
|
SYSCALL(r = tcsetattr(fd, TCSANOW, &t));
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SetSerialSpeed(int fd, int speed)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
struct termios t;
|
|
|
|
int baud, r;
|
|
|
|
|
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
SYSCALL(tcgetattr(fd, &t));
|
|
|
|
|
|
|
|
if ((baud = GetBaud(speed))) {
|
|
|
|
cfsetispeed(&t, baud);
|
|
|
|
cfsetospeed(&t, baud);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
xf86Msg(X_ERROR, "Invalid Option BaudRate value: %d\n", speed);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYSCALL(r = tcsetattr(fd, TCSANOW, &t));
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86ReadSerial(int fd, void *buf, int count)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int r;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
SYSCALL(r = read(fd, buf, count));
|
|
|
|
DebugF("ReadingSerial: 0x%x", (unsigned char) *(((unsigned char *) buf)));
|
|
|
|
for (i = 1; i < r; i++)
|
|
|
|
DebugF(", 0x%x", (unsigned char) *(((unsigned char *) buf) + i));
|
|
|
|
DebugF("\n");
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86WriteSerial(int fd, const void *buf, int count)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int r;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
DebugF("WritingSerial: 0x%x", (unsigned char) *(((unsigned char *) buf)));
|
|
|
|
for (i = 1; i < count; i++)
|
|
|
|
DebugF(", 0x%x", (unsigned char) *(((unsigned char *) buf) + i));
|
|
|
|
DebugF("\n");
|
|
|
|
SYSCALL(r = write(fd, buf, count));
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86CloseSerial(int fd)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int r;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SYSCALL(r = close(fd));
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86WaitForInput(int fd, int timeout)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int r;
|
2016-05-25 06:36:18 +02:00
|
|
|
struct pollfd poll_fd;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2016-05-25 06:36:18 +02:00
|
|
|
poll_fd.fd = fd;
|
|
|
|
poll_fd.events = POLLIN;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2017-05-26 23:27:19 +02:00
|
|
|
/* convert microseconds to milliseconds */
|
|
|
|
timeout = (timeout + 999) / 1000;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd >= 0) {
|
2016-07-19 00:58:42 +02:00
|
|
|
SYSCALL(r = xserver_poll(&poll_fd, 1, timeout));
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
|
|
|
else {
|
2016-07-19 00:58:42 +02:00
|
|
|
SYSCALL(r = xserver_poll(&poll_fd, 0, timeout));
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
2016-05-25 06:36:18 +02:00
|
|
|
xf86ErrorFVerb(9, "poll returned %d\n", r);
|
2012-03-21 20:55:09 +01:00
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86SerialSendBreak(int fd, int duration)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int r;
|
|
|
|
|
|
|
|
SYSCALL(r = tcsendbreak(fd, duration));
|
|
|
|
return r;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
xf86FlushInput(int fd)
|
|
|
|
{
|
2016-05-25 06:36:18 +02:00
|
|
|
struct pollfd poll_fd;
|
2013-04-10 08:09:01 +02:00
|
|
|
/* this needs to be big enough to flush an evdev event. */
|
|
|
|
char c[256];
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
DebugF("FlushingSerial\n");
|
|
|
|
if (tcflush(fd, TCIFLUSH) == 0)
|
|
|
|
return 0;
|
|
|
|
|
2016-05-25 06:36:18 +02:00
|
|
|
poll_fd.fd = fd;
|
|
|
|
poll_fd.events = POLLIN;
|
2016-07-19 00:58:42 +02:00
|
|
|
while (xserver_poll(&poll_fd, 1, 0) > 0) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (read(fd, &c, sizeof(c)) < 1)
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct states {
|
2012-03-21 20:55:09 +01:00
|
|
|
int xf;
|
|
|
|
int os;
|
2003-11-14 17:49:22 +01:00
|
|
|
} modemStates[] = {
|
|
|
|
#ifdef TIOCM_LE
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_LE, TIOCM_LE},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_DTR
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_DTR, TIOCM_DTR},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_RTS
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_RTS, TIOCM_RTS},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_ST
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_ST, TIOCM_ST},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_SR
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_SR, TIOCM_SR},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_CTS
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_CTS, TIOCM_CTS},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_CAR
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_CAR, TIOCM_CAR},
|
2003-11-14 17:49:22 +01:00
|
|
|
#elif defined(TIOCM_CD)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_CAR, TIOCM_CD},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_RNG
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_RNG, TIOCM_RNG},
|
2003-11-14 17:49:22 +01:00
|
|
|
#elif defined(TIOCM_RI)
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_CAR, TIOCM_RI},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
#ifdef TIOCM_DSR
|
2012-03-21 20:55:09 +01:00
|
|
|
{
|
|
|
|
XF86_M_DSR, TIOCM_DSR},
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2017-10-27 16:11:56 +02:00
|
|
|
static int numStates = ARRAY_SIZE(modemStates);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
static int
|
|
|
|
xf2osState(int state)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
|
|
|
int ret = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < numStates; i++)
|
|
|
|
if (state & modemStates[i].xf)
|
|
|
|
ret |= modemStates[i].os;
|
|
|
|
return ret;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
os2xfState(int state)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
|
|
|
int ret = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < numStates; i++)
|
|
|
|
if (state & modemStates[i].os)
|
|
|
|
ret |= modemStates[i].xf;
|
|
|
|
return ret;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
getOsStateMask(void)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < numStates; i++)
|
|
|
|
ret |= modemStates[i].os;
|
|
|
|
return ret;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int osStateMask = 0;
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
xf86SetSerialModemState(int fd, int state)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int ret;
|
|
|
|
int s;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifndef TIOCMGET
|
2012-03-21 20:55:09 +01:00
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!osStateMask)
|
|
|
|
osStateMask = getOsStateMask();
|
|
|
|
|
|
|
|
state = xf2osState(state);
|
|
|
|
SYSCALL((ret = ioctl(fd, TIOCMGET, &s)));
|
|
|
|
if (ret < 0)
|
|
|
|
return -1;
|
|
|
|
s &= ~osStateMask;
|
|
|
|
s |= state;
|
|
|
|
SYSCALL((ret = ioctl(fd, TIOCMSET, &s)));
|
|
|
|
if (ret < 0)
|
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
xf86GetSerialModemState(int fd)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int ret;
|
|
|
|
int s;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifndef TIOCMGET
|
2012-03-21 20:55:09 +01:00
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
SYSCALL((ret = ioctl(fd, TIOCMGET, &s)));
|
|
|
|
if (ret < 0)
|
|
|
|
return -1;
|
|
|
|
return os2xfState(s);
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
xf86SerialModemSetBits(int fd, int bits)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int ret;
|
|
|
|
int s;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifndef TIOCMGET
|
2012-03-21 20:55:09 +01:00
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
s = xf2osState(bits);
|
|
|
|
SYSCALL((ret = ioctl(fd, TIOCMBIS, &s)));
|
|
|
|
return ret;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
xf86SerialModemClearBits(int fd, int bits)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int ret;
|
|
|
|
int s;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (fd < 0)
|
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Don't try to set parameters for non-tty devices. */
|
|
|
|
if (!isatty(fd))
|
|
|
|
return 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#ifndef TIOCMGET
|
2012-03-21 20:55:09 +01:00
|
|
|
return -1;
|
2003-11-14 17:49:22 +01:00
|
|
|
#else
|
2012-03-21 20:55:09 +01:00
|
|
|
s = xf2osState(bits);
|
|
|
|
SYSCALL((ret = ioctl(fd, TIOCMBIC, &s)));
|
|
|
|
return ret;
|
2003-11-14 17:49:22 +01:00
|
|
|
#endif
|
|
|
|
}
|