summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Tweak the way we determine if an interface needs to have its name translated.des2001-10-201-22/+57
| | | | | | | | Add some missing break statements in the socket ioctl switch. Check the return value from copyin() / copyout(). Fix some disorderings and misindentations. Support a couple more socket ioctls. Add missing break statements.
* Fix Alpha related brokenness. We used to have a MD linux_ioctl.hmarcel2001-10-191-6/+30
| | | | | | | | | | | | | | | | | 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.
* Add support for the "device private" ioctls soon to be used by the an driver.des2001-10-191-16/+63
| | | | | | Also slightly change the name translation policy - only rename interfaces that have the IFF_BROADCAST flag set. This is not perfect, but is closer to how Linux names network interfaces.
* Try to make Linux socket ioctls work. Up until now they've only *pretended*des2001-10-151-50/+281
| | | | | | | | | | | | | | to work, but haven't really due to subtle differences in structs etc. This is still not perfect (some ioctls are still known not to work, while others haven't been tested at all), but it's enough to get Debian's ifconfig to produce relatively sane output. More work will be needed to get all ioctls (or at least a reasonable subset) working, and to support the Cisco Aironet config tool mentioned in the PR. PR: 26546 Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
* Fix off by one error introduced by the use of the ifnet_byindex()marcel2001-09-141-1/+1
| | | | | | | | macro. The commit log clearly states that the index given to the macro is one higher than previously used to index the array. This wasn't represented in the code and resulted in kernel page faults. Reported by: Andrew Atrens <atrens@nortelnetworks.com>
* KSE Milestone 2julian2001-09-121-139/+139
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-1/+1
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-161-34/+45
| | | | | | Also clean up debugging output in a slightly more uniform fashion. The default behavior remains the same (all debugging output is turned on)
* Don't auto-generate the syscalls.marcel2000-12-031-4/+0
|
* Revert auto-generation. The Alpha port is broken.marcel2000-11-101-0/+4
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-091-4/+0
| | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions.
* zap a stray include that snuck in with rev 1.56gallatin2000-11-021-1/+0
| | | | Submitted by: Clive Lin <clive@CirX.ORG>
* fix linux_termio and linux_termios structs on alpha. alpha differencesgallatin2000-11-011-7/+7
| | | | | are in the termios struct (probably because linux wants to be compatible with the osf/1 termios struct), not the termio struct.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-1/+18
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* Initiate deorbit burn sequence for <machine/console.h>.phk2000-10-081-2/+2
| | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed.
* Update include directives.marcel2000-08-221-5/+5
|
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Fix some style bugs. The long line is in a chunk of code that'snsayer2000-03-131-4/+4
| | | | | | being rewritten, though. Submitted by: bde
* Implement Linux BLKGETSIZE ioctl, and open the door to implementingnsayer2000-03-091-0/+23
| | | | | | other BLK.* ioctls should the desire arize. Approved by: jkh (via dufault)
* Avoid passing an uninitialized structure member to the realnsayer2000-02-011-0/+1
| | | | | | | READSUBCHANNEL ioctl. This makes vmware work with SCSI CDROM drives. Approved by: jkh
* Implement pluggable ioctl handlers.marcel1999-12-041-1077/+1293
| | | | | | | | | | | | | | | | | | | | | | | | Other modules can register and unregister ioctl handlers to extend the ioctls known by the Linuxulator. A recent application is the vmware port. The Linuxulator itself uses the new interface to register its handlers as well. Handlers for the following types of ioctls have been defined: cdrom console (=keyboard and VT handling) socket sound termio All ioctl related defines and declarations have been moved to a new file (linux_ioctl.h), except for the pluggable ioctl handler interface definition. While there, cleanup linux.h some more. linux.h and linux_ioctl.[ch] have been made to conform to style(9) as much as possible. Inspired and reviewed by: Vladimir N. Silyaev
* add linuxulator wrapper for SNDCTL_DSP_GETODELAYalfred1999-11-291-0/+4
|
* Swap IOC_OUT and IOC_IN for the SETDIR macro. The linux ioctl read andjhay1999-10-061-1/+1
| | | | | | write bits are swapped. Reviewed by: luoqi, marcel
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-191-21/+19
| | | | | | | | | | | | | | | | | far-reaching in fd-land, so you'll want to consult the code for changes. The biggest change is that now, you don't use fp->f_ops->fo_foo(fp, bar) but instead fo_foo(fp, bar), which increments and decrements the fp refcount upon entry and exit. Two new calls, fhold() and fdrop(), are provided. Each does what it seems like it should, and if fdrop() brings the refcount to zero, the fd is freed as well. Thanks to peter ("to hell with it, it looks ok to me.") for his review. Thanks to msmith for keeping me from putting locks everywhere :) Reviewed by: peter
* <machine/soundcard.h> -> <sys/soundcard.h>, since it's an exported APIpeter1999-09-041-1/+1
| | | | that's arch neutral and OSS API and Linux API compatable.
* Implement the OSS_GETVERSION ioctl. The version returned can be changed throughmarcel1999-08-281-0/+8
| | | | | | | the sysctl variable `compat.linux.oss_version'. PR: 12917 Originator: Dean Lombardo <dlombardo@excite.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix a bug in debug-printfs of struct linux_termios fields, where I forgot tomarcel1999-08-171-5/+5
| | | | | | | change the format specifier after changing the definition of the structure. Submitted by: billf Commented on by: bde
* Fix LINUX_TIOC{S|G}SERIAL implementation. Both do not copy data in or outmarcel1999-08-141-25/+21
| | | | | | | | | of kernel space. Remove the ioctl supporting functions, and move the actual code to the switch-statement. Now everybody can clearly see that the implementation is really poor. Also fix a typo in LINUX_TIOCGETD. The underlying function was given command TIOCSETD instead op TIOCGETD...
* Fix the LINUX_TCSET{A|AW|AF} and LINUX_TCSET{S|SW|SF} ioctls. These all suffermarcel1999-08-141-7/+28
| | | | | from the same bug in that the argument is not first copied from user space before it is used. This is part 2 (of 2) of the termios fixes.
* Fix a couple of termio/termios conversion bugs/typos/dupos/brainos and othermarcel1999-08-141-18/+23
| | | | | | | | | | | | | | | | | | | | | | changes. This is part 1 of the complete termios ioctl fixes. o change type of c_{i|o|c|l}flag in struct termios from unsigned long to unsigned int. The type now matches the Linux definitions. o replaced constants by the corresponding defines in sptab[] for clarity. Since there's no define for 135 baud, its mapping has been dropped. function bsd_to_linux_termios: o Fix typo IXON -> IXANY. o Remove bogus assignment to c_cc[LINUX_VSWTC]. function linux_to_bsd_termios: o Fix dupo LINUX_IXON -> LINUX_IXANY. o Add LINUX_CREAD mapping. o Fix typo IEXTEN -> LINUX_IEXTEN. function linux_to_bsd_termio: o Small optimization: Don't preset the complete c_cc array when we next assign to the first LINUX_NCC entries.
* Implementation of the CDROMSUBCHNL ioctl.marcel1999-08-131-1/+65
|
* Implementation of TCXONC.marcel1999-07-171-1/+32
| | | | Reviewed by: bde
* Implement VT_RELDISP ioctlmarcel1999-07-081-1/+6
| | | | Submitted by: Kazutaka Yokota <yokota@FreeBSD.org>
* Trivial implementation of TIOCM{S|G}ET and TIOCMBI{S|C} ioctls. No needmarcel1999-07-061-1/+17
| | | | to convert the arguments.
* Fix a couple of warnings and some bitrot in comments.peter1999-05-091-1/+3
|
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-2/+3
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* - Handle mixer read ioctls correctly. They have the same group, number andluoqi1999-04-291-18/+149
| | | | | argument size as their write counterparts and were handled as write ioctls. - Emulate some cdrom ioctls.
* MF22: Bring in some linux sound ioctl support which I committed to 2.2jkh1998-11-121-1/+61
| | | | | | | for PR 7792 but did not bring forward. Submitted by: Avatar Liang <avatar@www.mmlab.cse.yzu.edu.tw> PR: 8656
* Add several missing ioctl handlers. One needed by Sybase, the othersjfieber1998-09-301-1/+21
| | | | found while looking for the one.
* Argh! *Now* the correct 3.0 fix is committed.jkh1998-08-311-7/+7
|
* Whoops! Stamp out a 2.2-ism that snuck between branches here.jkh1998-08-311-2/+2
|
* Initial support for using linux X servers under emulation - to use anjkh1998-08-311-4/+36
| | | | | | | | | | | | | | | | XFree86 server, users need to create the following links in their /compat/linux/dev directory (assuming kernel configured with 4 VTs). lrwxrwxrwx 1 root wheel 7 Aug 30 22:59 tty0 -> console lrwxrwxrwx 1 root wheel 5 Aug 30 22:45 tty1 -> ttyv0 lrwxrwxrwx 1 root wheel 5 Aug 30 22:45 tty2 -> ttyv1 lrwxrwxrwx 1 root wheel 5 Aug 30 22:45 tty3 -> ttyv2 lrwxrwxrwx 1 root wheel 5 Aug 30 22:45 tty4 -> ttyv3 VT switching is still not yet supported. Attempting to switch VT currently will cause Xserver bus error. Submitted by: Chain Lee <chain@110.net>
* Fixed print format errors.bde1998-07-291-13/+11
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* As described by the submitter:msmith1997-12-151-1/+54
| | | | | | | | | | | These patches enables us to play quake2 . Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE. Support linux virtual terminal operations: OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE. Submitted by: Amancio Hasty <hasty@rah.star-gate.com>
* Added support for linux sound ioctls:ahasty1997-11-171-2/+18
| | | | | | | | | LINUX_SNDCTL_DSP_GETOPTR LINUX_SNDCTL_DSP_GETIPTR LINUX_SNDCTL_DSP_SETTRIGGER LINUX_SNDCTL_DSP_GETCAPS With this rev level the linux realaudio player 5 and xquake should work.
OpenPOWER on IntegriCloud