summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio
Commit message (Collapse)AuthorAgeFilesLines
* OK, that's it..julian1995-11-291-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
* the second set of changes in a move towards getting devices to bejulian1995-11-281-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | totally dynamic. this is only the devices in i386/isa I'll do more tomorrow. they're completely masked by #ifdef JREMOD at this stage... the eventual aim is that every driver will do a SYSINIT at startup BEFORE the probes, which will effectively link it into the devsw tables etc. If I'd thought about it more I'd have put that in in this set (damn) The ioconf lines generated by config will also end up in the device's own scope as well, so ioconf.c will eventually be gutted the SYSINIT call to the driver will include a phase where the driver links it's ioconf line into a chain of such. when this phase is done then the user can modify them with the boot: -c config menu if he wants, just like now.. config will put the config lines out in the .h file (e.g. in aha.h will be the addresses for the aha driver to look.) as I said this is a very small first step.. the aim of THIS set of edits is to not have to edit conf.c at all when adding a new device.. the tabe will be a simple skeleton.. when this is done, it will allow other changes to be made, all teh time still having a fully working kernel tree, but the logical outcome is the complete REMOVAL of the devsw tables. By the end of this, linked in drivers will be exactly the same as run-time loaded drivers, except they JUST HAPPEN to already be linked and present at startup.. the SYSINIT calls will be the equivalent of the "init" call made to a newly loaded driver in every respect. For this edit, each of the files has the following code inserted into it: obviously, tailored to suit.. ----------------------somewhere at the top: #ifdef JREMOD #include <sys/conf.h> #define CDEV_MAJOR 13 #define BDEV_MAJOR 4 static void sd_devsw_install(); #endif /*JREMOD */ ---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT #ifdef JREMOD sd_devsw_install(); #endif /*JREMOD*/ -----------------------at the bottom: #ifdef JREMOD struct bdevsw sd_bdevsw = { sdopen, sdclose, sdstrategy, sdioctl, /*4*/ sddump, sdsize, 0 }; struct cdevsw sd_cdevsw = { sdopen, sdclose, rawread, rawwrite, /*13*/ sdioctl, nostop, nullreset, nodevtotty,/* sd */ seltrue, nommap, sdstrategy }; static sd_devsw_installed = 0; static void sd_devsw_install() { dev_t descript; if( ! sd_devsw_installed ) { descript = makedev(CDEV_MAJOR,0); cdevsw_add(&descript,&sd_cdevsw,NULL); #if defined(BDEV_MAJOR) descript = makedev(BDEV_MAJOR,0); bdevsw_add(&descript,&sd_bdevsw,NULL); #endif /*BDEV_MAJOR*/ sd_devsw_installed = 1; } } #endif /* JREMOD */
* Restored static variable `nsio_tty' which is used only by pstat(8). Madebde1995-11-211-1/+3
| | | | | | | it `const' to inhibit compiler warnings. Added #include of <pccard/driver.h> to get prototypes. <pccard/slot.h> is still necessary for its side effect of exporting non-slot things.
* Fix compiler warnings.phk1995-11-201-21/+20
|
* Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up thebde1995-11-041-3/+2
| | | | | | | | | | misplaced extern declarations (mostly prototypes of interrupt handlers) that this exposed. The prototypes should be moved back to the driver sources when the functions are staticalized. Added idempotency guards to <machine/conf.h>. "ioconf.h" can't be included when building LKMs so define a wart in bsd.kmod.mk to help guard against including it.
* Moved prototypes for devswitch functions from conf.c and driver sourcesbde1995-11-041-11/+1
| | | | | | | to <machine/conf.h>. conf.h was mechanically generated by `grep ^d_ conf.c >conf.h'. This accounts for part of its ugliness. The prototypes should be moved back to the driver sources when the functions are staticalized.
* sio.c:bde1995-10-221-32/+15
| | | | | | | | | | | | | | | | | | | | Fix the tests for being a console by reverting to the ones that were used before the the RB_SERIAL changes. RB_SERIAL only needs to be tested in one place. The initialization of comconsole was wrong before the RB_SERIAL changes for the COMCONSOLE case. This may have been the cause of the unnecessary changes. Start eliminating #includes of <i386/i386/cons.h>. This header is supposed to be included from <machine> although it should be completely machine-independent and included from <sys>. Remove a wrong XXX comment. `comconsole' is used to test for being a console and even the tests for deciding the default termios state are necessary (the semi-reentrant i/o routines don't handle ordinary device i/o). cy.c: Sync with sio.c. The console tests are present but always fail.
* A mixed bag of changes, relating to getting the state in "lsdev" right,phk1995-10-211-2/+10
| | | | and pccard support to work sensibly. Better by far, but still not good.
* siostop() is a void function, so don't return a value.dg1995-09-241-3/+3
|
* The stuff needed to remove a pccard with a sio port on it...phk1995-09-191-10/+68
| | | | Not optimal, but pretty solid.
* Andrew McRae's pcmcia/pccard code, the kernel part.phk1995-08-241-1/+119
| | | | | | | | This is still very green, but I have managed to get my modem working. Lots of work still to do, but now at least we can commit it. /phk Reviewed by: phk Submitted by: Andrew McRae <andrew@mega.com.au>
* Disable fifos in sioclose(). Closes PR 576.bde1995-08-131-1/+9
|
* Sleep on a better address to wait for output to drain out of thebde1995-07-311-2/+3
| | | | | | | | hardware. Set the sleep-on flag for the address so there is more than a small chance that the sleep address is actually used (this used to work by timing out). Don't bother clearing the sleep-on flag after a timeout here or elsewhere since leaving it set just generates a few null calls to wakeup().
* Improve input flow control.bde1995-07-311-26/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use input buffer watermarks of TTYHOG-512 (high) and (high)*7/8 (low) instead of TTYHOG/2 (high) and TTYHOG/5 (low) to agree with some drivers. 512 is magic and some things depended on TTYHOG/2 >= TTYHOG-512 to work; now they depend on the 512 magic not changing and TTYHOG-512 being significantly larger than 0. This should be handled in ttsetwater(). Separate the decision about whether to do input flow control from doing it. ttyblock() now just starts input flow control (hardware and/or software) and there is a new function ttyunblock() to stop it. The decisions are the same except for the watermark changes and allowing for input expansion for PARMRK. When flushing input, try harder at first to send a start character if required, but give up if the first attempt fails. cy.c, rc.c, sio.c: Simplify: let ttyinput() handle input flow control if it is not being bypassed. Use ttyblock() to start flow control otherwise. rc.c: Use same input flow control test as elsewhere: test in a more efficient order and start flow control at >= highwater instead of at > highwater.
* Don't let IXOFF or ECHONL stop the setting of TS_CAN_BYPASS_L_RINT. IXOFFbde1995-07-291-7/+5
| | | | | is handled at a low level, and ECHONL only applies if ICANON is set, although tty.c sometimes bogusly applies it when ICANON isn't set.
* Always wake up writers after clearing TS_BUSY. This will soon bebde1995-07-291-7/+4
| | | | | | | | | essential when I fix excessive wakeups for output-below-low-water. In cy.c and sio.c, wake up via the driver start routine to also eliminate duplicated code involving the clearing of TS_TTSTOP. Always (except in code to be replaced soon) call driver start routine directly instead of going through ttstart().
* Obtained from: partly from ancient patches of mine via 1.1.5bde1995-07-221-10/+4
| | | | | Give names to the magic tty i/o sleep addresses and use them. This makes it easier to remember what the addresses are for and to keep them unique.
* Move the inline code for waking up writers to a new functionbde1995-07-221-15/+2
| | | | | | | | | | | ttwwakeup(). The conditions for doing the wakeup will soon become more complicated and I don't want them duplicated in all drivers. It's probably not worth making ttwwakeup() a macro or an inline function. The cost of the function call is relatively small when there is a process to wake up. There is usually a process to wake up for large writes and the system call overhead dwarfs the function call overhead for small writes.
* Obtained from: partly from ancient patches of mine via 1.1.5bde1995-07-211-11/+1
| | | | | Move static termioschars() from a couple of drivers to tty.c. Now there is only one copy of ttydefchars[].
* Fix error logging:bde1995-07-051-4/+10
| | | | | - get the timeout countdown right - report everything before turning timeouts off.
* Fight with hanging modems continued:ache1995-06-281-1/+8
| | | | | return EIO after t_timeout expired instead infinite looping in "siotx" in comparam, consuming CPU time.
* Reduce timeout frequency from `hz' to 0 if no ports are open or to 1 ifbde1995-06-251-142/+236
| | | | | | | | | | | | | | | | | | | | | no ports are active, provided there are no polled ports and no `LOSESOUTINTS' ports. Do a little more in the interrupt handler instead. This is a little less efficient if there are are many active ports but a little more efficient otherwise. Polled ports are ones with no irq specified (as before). `LOSESOUTINTS' ports are ones with 0x08 set in their config flags. Unless this flag is set, it will now take up to one second to recover from lost output interrupts, if any. Some 8250s and 16450s lose output interrupts. Improve output buffering: copy the clist buffer to 2 linear buffers if necessary and possible instead of to 1. Handle an arbitrary queue of buffers in the interrupt handler. Check for waking up sleepers after copying characters out of the clist buffer instead of before. Delay translation of TIOCM_DTR to MCR_DTR etc. so that the top level routines are more machine independent. Fix bogus device register in unused code.
* Remove trailing whitespace.rgrimes1995-05-301-12/+12
|
* Fix -Wformat warnings from LINT kernel.rgrimes1995-05-111-2/+2
|
* Add hook for pstat -tache1995-05-071-1/+3
|
* Move declarations of console functions to cons.h (they should bebde1995-04-231-12/+5
| | | | | | config(8)ed). Update other misplaced prototypes.
* Fix initializations of kdc_state for serial consoles.bde1995-04-151-33/+38
| | | | | | | Change order of RTS flow control tests so that less tests are required in the usual case. Clean up parts of previous commits. Cosmetic.
* Forgot two things in yesterday's massive devconf update:wollman1995-04-131-6/+4
| | | | | initialized class for sio don't bogusly re-initialize it in sio_registerdev()
* Move setcompat code to another place, initial/locked devicesache1995-04-131-14/+12
| | | | not supposed to work with old style ioctls
* Comment out ttcompat via COMPAT_SUNOS tooache1995-04-131-11/+15
| | | | Fix error handling initial/callout devices
* ttsetcompat is a '#ifdef COMPAT_43' feature.phk1995-04-121-1/+5
| | | | | | Dropping into the debugger when a break comes down the serial line is a >MISFEATURE (1st class)< and has been put under it's own #ifdef. This should be a magic sequence of chars instead.
* Add a class field to devconf and mst drivers.wollman1995-04-121-30/+52
| | | | | | | | | | | | For those where it was easy, drivers were also fixed to call dev_attach() during probe rather than attach (in keeping with the new design articulated in a mail message five months ago). For a few that were really easy, correct state tracking was added as well. The `fd' driver was fixed to correctly fill in the description. The CPU identify code was fixed to attach a `cpu' device. The code was also massively reordered to fill in cpu_model with somethingremotely resembling what identifycpu() prints out. A few bytes saved by using %b to format the features list rather than lots of ifs.
* Call new ttsetcompat() function for proper workingache1995-04-111-1/+9
| | | | old v7 ioctls with locking bits.
* Move unit structure member down to optimize com->state per Bruceache1995-04-041-19/+19
| | | | | suggestion. Move hotchar setting to set_bypass routine and rename it to disc_optim
* Allow serial console BREAK to DDBache1995-04-031-3/+13
| | | | Use com->unit in several places
* Back out changes related to locked bits until more elegantache1995-04-021-85/+7
| | | | solution will be found. Remove some unused variables sneaked in.
* Fix error:ache1995-04-021-7/+83
| | | | | | old type (stty) ioctls can easily bypass locking bits. It involves manual conversion from old ioctls to new ones, large piece of code duplicated from tty_compat.c
* Move SET_BYPASS macro to function per Bruce suggestion.ache1995-04-021-20/+29
| | | | | Add set_bypass() call after l_close. Move ttioctl()/set_bypass() pair under spltty() protection
* Move setting BYPASS state to macro, use it in several times,ache1995-04-011-16/+18
| | | | | | after ttioctl too, because it can change t_line. Remove (TS_CNTTB | TS_LNCH) test, it is always inherits from old tty mode and can't be reach in currently setted mode.
* Adjust TS_CAN_BYPASS_L_RINT state after l_open(), t_lineache1995-04-011-1/+3
| | | | can be changed there.
* Use new TS_CAN_BYPASS_L_RINT state to avoid complex testache1995-04-011-23/+23
| | | | | | each time. Remove unefficient loop of zeroing error chars in siopoll(), now done at interrupt level.
* Check for never opened or closed device before testingache1995-04-011-3/+6
| | | | terminal flags at interrupt level
* Fix serial error recording using new TTY_BI & TTY_OEache1995-03-291-11/+7
|
* Remove TTY_OE & TTY_BI definitions to allow translation,ache1995-03-291-3/+1
| | | | more work required and will follow
* Move discard check up and do it only for error statusache1995-03-281-23/+21
| | | | | (per Bruce suggestion). It speedup things for a little. Remove l_start optimization, call l_start always (per Bruce suggestion)
* Don't useache1995-03-281-3/+2
| | | | | | | | | | | | if (tp->t_line != 0) test when CS_ODONE, it fails for NTTYDISC, use if (linesw[tp->t_line].l_start != ttstart) instead. Reviewed by: Submitted by: Obtained from: CVS:
* Forget to add LSR_FE to discard (see prev commit)ache1995-03-281-2/+2
| | | | | | | Reviewed by: Submitted by: Obtained from: CVS:
* Several fixes to help "raw" tty mode work correctly withache1995-03-281-5/+32
| | | | | | | | | | | | | | | | | BREAK/parity/framing errors. Term "correctly" assumes POSIX spec. and 4.4 ttyinput() behaviour. 1) Discard BREAK/parity at interrupt level when apropriate IGN* is set in iflag. It helps "raw" mode works even IGN* is set. 2) Zero parity (if INPCK) and framing directly in buffer before passing it to b_to_q() in "raw" mode. Efficency: interrupt level: if no error occurse, only two "test" commands added "raw" mode: buf scan incc times for parity/framing added Reviewed by: Submitted by: Obtained from: CVS:
* Raw ttyinput test was incomplete,ache1995-03-281-2/+2
| | | | add !(IGNBRK | BRKINT | PARMRK) now.
* Fix break recording for ttyinputache1995-03-281-2/+4
|
OpenPOWER on IntegriCloud