summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2001-10-19 08:18:31 +0000
committermarcel <marcel@FreeBSD.org>2001-10-19 08:18:31 +0000
commitcde63d9d91871bb8092bf245f7da47d201194bf2 (patch)
tree8fa2c5154215ce7d27ad45a299be106bec1aca76 /sys/compat/linux/linux_ioctl.c
parent1b131bca2f74efdc3627f5ad1fce812c67b57975 (diff)
downloadFreeBSD-src-cde63d9d91871bb8092bf245f7da47d201194bf2.zip
FreeBSD-src-cde63d9d91871bb8092bf245f7da47d201194bf2.tar.gz
Fix Alpha related brokenness. We used to have a MD linux_ioctl.h
that appeared to be very different from the MI version. These differences were mostly bogus and caused by copying octal definitions and write them as hexadecimal values without doing any base conversion (ie 010 was copied to 0x10). After filtering out these differences, any remaining (real) incompatibilities have been merged into the MI header file to make them more visible. While here, fix the termios <-> termio conversion WRT to the c_cc field for Alpha. The termios values do not match the termio values and thus prevents us from copying. By eliminating the Alpha MD copy of linux_ioctl.h we also fixed the recent build breakage caused by putting new bits in the MI header and not in the MD header.
Diffstat (limited to 'sys/compat/linux/linux_ioctl.c')
-rw-r--r--sys/compat/linux/linux_ioctl.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index e81448d..1164063 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -55,11 +55,7 @@
#include <machine/../linux/linux.h>
#include <machine/../linux/linux_proto.h>
-#ifdef __alpha__
-#include <machine/../linux/linux_ioctl.h>
-#else
#include <compat/linux/linux_ioctl.h>
-#endif
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_util.h>
@@ -497,7 +493,20 @@ bsd_to_linux_termio(struct termios *bios, struct linux_termio *lio)
lio->c_cflag = lios.c_cflag;
lio->c_lflag = lios.c_lflag;
lio->c_line = lios.c_line;
+#ifdef __alpha__
+ lio->c_cc[LINUX__VINTR] = lios.c_cc[LINUX_VINTR];
+ lio->c_cc[LINUX__VQUIT] = lios.c_cc[LINUX_VQUIT];
+ lio->c_cc[LINUX__VERASE] = lios.c_cc[LINUX_VERASE];
+ lio->c_cc[LINUX__VKILL] = lios.c_cc[LINUX_VKILL];
+ lio->c_cc[LINUX__VEOF] =
+ lios.c_cc[(lios.c_lflag & ICANON) ? LINUX_VEOF : LINUX_VMIN];
+ lio->c_cc[LINUX__VEOL] =
+ lios.c_cc[(lios.c_lflag & ICANON) ? LINUX_VEOL : LINUX_VTIME];
+ lio->c_cc[LINUX__VEOL2] = lios.c_cc[LINUX_VEOL2];
+ lio->c_cc[LINUX__VSWTC] = lios.c_cc[LINUX_VSWTC];
+#else
memcpy(lio->c_cc, lios.c_cc, LINUX_NCC);
+#endif
}
static void
@@ -510,9 +519,24 @@ linux_to_bsd_termio(struct linux_termio *lio, struct termios *bios)
lios.c_oflag = lio->c_oflag;
lios.c_cflag = lio->c_cflag;
lios.c_lflag = lio->c_lflag;
+#ifdef __alpha__
+ for (i=0; i<LINUX_NCCS; i++)
+ lios.c_cc[i] = LINUX_POSIX_VDISABLE;
+ lios.c_cc[LINUX_VINTR] = lio->c_cc[LINUX__VINTR];
+ lios.c_cc[LINUX_VQUIT] = lio->c_cc[LINUX__VQUIT];
+ lios.c_cc[LINUX_VERASE] = lio->c_cc[LINUX__VERASE];
+ lios.c_cc[LINUX_VKILL] = lio->c_cc[LINUX__VKILL];
+ lios.c_cc[LINUX_VEOL2] = lio->c_cc[LINUX__VEOL2];
+ lios.c_cc[LINUX_VSWTC] = lio->c_cc[LINUX__VSWTC];
+ lios.c_cc[(lio->c_lflag & ICANON) ? LINUX_VEOF : LINUX_VMIN] =
+ lio->c_cc[LINUX__VEOF];
+ lios.c_cc[(lio->c_lflag & ICANON) ? LINUX_VEOL : LINUX_VTIME] =
+ lio->c_cc[LINUX__VEOL];
+#else
for (i=LINUX_NCC; i<LINUX_NCCS; i++)
lios.c_cc[i] = LINUX_POSIX_VDISABLE;
memcpy(lios.c_cc, lio->c_cc, LINUX_NCC);
+#endif
linux_to_bsd_termios(&lios, bios);
}
@@ -1344,7 +1368,7 @@ linux_ifname(struct ifnet *ifp, char *name, size_t size)
* bsdname and lxname need to be least IFNAMSIZ bytes long, but
* can point to the same buffer.
*/
-
+#if 0
static struct ifnet *
ifname_bsd_to_linux(const char *bsdname, char *lxname)
{
@@ -1370,6 +1394,7 @@ ifname_bsd_to_linux(const char *bsdname, char *lxname)
return (ifp);
}
+#endif
/*
* Translate a Linux interface name to a FreeBSD interface name,
@@ -1377,7 +1402,6 @@ ifname_bsd_to_linux(const char *bsdname, char *lxname)
* bsdname and lxname need to be least IFNAMSIZ bytes long, but
* can point to the same buffer.
*/
-
static struct ifnet *
ifname_linux_to_bsd(const char *lxname, char *bsdname)
{
OpenPOWER on IntegriCloud