summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cy.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce ttyread() and ttywrite() which do the canonical thing.phk1999-09-281-19/+1
| | | | | | Use them in many tty drivers. Reviewed by: julian, bde
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* This patch clears the way for removing a number of tty relatedphk1999-09-251-26/+10
| | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-29/+7
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Really fix cy-driver-related panics when SMP is configured. Rev.1.88 onlybde1999-06-041-3/+5
| | | | | | fixed half the problem. Tested by: Michael Scott Boers <mboers@datacompusa.com>
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-7/+21
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Don't call disable_intr() when interrupts are already disabled, sincebde1999-05-281-3/+6
| | | | | | | disable_intr() does non-recursive locking in the SMP case. This should fix cy-driver-related panics when SMP is configured. Broken in: rev.1.73 (3.1 and -current)
* Suser() simplification:phk1999-04-271-4/+4
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* YAMFsio.c (1.227-1.228: set up input buffering dynamically).bde1999-02-041-116/+189
|
* Use suser() to check for super user rather than examining cr_uid directly.phk1999-01-301-2/+3
| | | | | | Use TTYDEF_SPEED rather than 9600 a couple of places. Reviewed by: bde, with a few grumbles.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-27/+27
| | | | kernel compile
* Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partiallybde1999-01-081-1/+4
| | | | unspammed them in the SMP case.
* Flush the fifos at the correct place in cyopen(). Various thingsbde1998-12-241-31/+17
| | | | | | | | | | | in cyopen() were done in a different order than in sioopen(), partly to (ab)use a side effect of comparam() and partly because I didn't understand what the reset was doing (it flushes the fifos). This turned out to be more than a cosmetic problem. Flushing the fifos quite late is good for discarding input that arrived while the line state was being initialized, and in the cy driver it also seems to reduce a problem with input that arrived long ago during the previous close (the UART loses sync too easily and for too long).
* Wait for channel commands to complete after issuing the commands.bde1998-12-191-15/+29
| | | | | | | | | | The optimisation of only waiting before issuing new commands is obviously invalid in general and it caused many errors in NIST-PCTS. I think the errors were mostly for characters sent with the wrong parity, etc., after a half complete tcsetattr(). Use microtime() instead of a magic loop count to limit the wait. The wait is a busy-wait :-( and normally takes about 500 usec.
* Flush the tx fifo in cystop(). Now ttyflush() (and thus tcflush(3))bde1998-12-171-3/+4
| | | | | | | | | | almost works properly. Unfortunately, there is no way to flush the rx fifo without resetting the channel, which also flushes the tx fifo. We avoid resetting even when both fifos need to be flushed, since resetting seems to cause the rx to lose sync if it is done while data is arriving. Reminded by: NIST-PCTS
* Fixed handling of BREAK in input. BREAK was not being converted into anbde1998-12-171-3/+7
| | | | | | escape sequence in the `-ignbrk -brkint parmrk' case. Found by: NIST-PCTS
* Oops, this should have been in the previous commit (ensure atomic updatebde1998-12-171-1/+3
| | | | of com->cor[1]).
* Implemented sending of BREAKs. This is quite complicated because thebde1998-12-171-14/+165
| | | | | | | | hardware is interrupt-driven to a fault and sending a BREAK requires mode switching. Always running in the BREAK-capable mode as in PR 8318 would double the overhead for sending \0's. Reminded by: PR 8318
* Fixed sloppy clearing of TS_BUSY. Don't clear it until the transmitterbde1998-11-281-12/+71
| | | | | | | | | is completely empty. There is an interrupt for output completion. It is painful to use, but polling method used in the corresponding fix in sio.c (rev.1.152) can't be used because there is no status bit for transmitter-empty. Now ttywait() works right. Reminded by: NIST-PCTS
* Merge from sio.c rev.1.163:bde1998-11-281-2/+2
| | | | | | | Don't call timeout() for DTR wakeup if the relevant timeout is already active. This fixes "timeout table full" panics when sufficiently many cyopen()s are interrupted while they are sleeping waiting for the timeout to expire.
* Untangled the Cyclades offsets a little. CY16_RESET and CY_CLEAR_INTRbde1998-11-231-8/+8
| | | | | | | | | were half of their physical offsets for ISA and 1/4 of their physical offsets for PCI, while all other Cyclades offsets were physical/1 for ISA and physical/2 for PCI. Logically wrong macros were used to scale CY16_RESET and CY_CLEAR_INTR to the correct physical offsets. Fixed some style bugs (mostly long lines).
* Reduce i/o overheads by not preserving the channel access register inbde1998-11-221-113/+130
| | | | | | | interrupt handlers. Instead, load and use it atomically as necessary. This reduces mode switching overhead for "polled" mode interrupt handling from 5 i/o's to 3 (per service type, per port) so that polled mode is only slightly more inefficient than "interrupt" mode.
* Initialize isa_devtab entries for interrupt handlers in individualbde1998-10-221-1/+3
| | | | | | | device drivers, not in ioconf.c. Use a different hack in isa_device.h so that a new config(8) is not required yet. pc98 parts approved by: kato
* Added D_TTY to the cdevswitch flags for all tty drivers. This is requiredbde1998-08-231-4/+5
| | | | | | | | | for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
* Fixed devfs initialization which I broke in the previous commit.bde1998-08-201-10/+10
| | | | Fixed an old name and disorder in the sio dictionary.
* Enabled dynamically sized tty input buffers (with enough bufferingbde1998-08-191-9/+10
| | | | | | | | | | | | for 1 second's worth of input) and larger tty output buffers. The interrupt-level buffers are still too small for speeds above 115200 bps (only a little too small for 230400 bps if RTS flow control is enabled). Don't call ttsetwater() explicitly in open(). It is now called for the TTYDISC l_open() and should be static. Don't attempt to register the cdevsw more than once.
* Cleaned up previous commit, mainly by moving repetitive calculationsbde1998-08-131-113/+62
| | | | | | | | | of invariants to cyattach(). Fixed minor bugs: - cyparam() returned without restoring the ipl in the error cases. This was harmless because cyparam() is always called at spltty(). - one check for "rev. J or higher" actually checked for precisely rev. J.
* Updated for not-so-new version of Cyclom-Y boards (with 60MHz clock andbde1998-08-131-39/+119
| | | | | | | swapped RTS/DTR). Merge the vendor's modification of the 2.2.6-release version into -current for reference. Will be cleaned up in next commit. Obtained from: ftp://ftp.cyclades.com/pub/cyclades/cyclom-y/freebsd/2.2.6/cyy226.tar.gz
* Register tty software interrupt handlers at run time using register_swi()bde1998-08-111-15/+11
| | | | | | | instead of at compile time using ifdefs. Use _swi_null instead of dummycamisr. CAM and dpt should call register_swi() instead of hacking on ihandlers[] directly.
* Fixed sign extension bugs awoken by changing speed_t to an unsignedbde1998-07-291-2/+4
| | | | | | | type. 19200, 1200 and other relatively uninteresting speeds were broken. Submitted by: Rob Mallory <rmallory@qualcomm.com>
* Changed %n to %r in devfs name format strings. %n has almost gone away.bde1998-07-151-7/+7
|
* 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.
* Protect against count of chars received being 0, which causes a panicdg1998-03-181-1/+3
| | | | | | otherwise. Can apparantly happen with some firmware revs. Submitted by: Kouichi Hirabayashi <kh@mogami-wire.co.jp>
* Implement the spirit but not the letter of Terrys hot-char patch.phk1998-02-131-11/+2
| | | | | | | The differences Terrys patch and this patch are: * Remove a lot of un-needed comments. * Don't put l_hotchar at the front of stuct linesw, there is no need to. * Use the #defines for the hotchar in the SLIP and PPP line disciplines
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+2
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* YAMFsio.c (always call ttwwakeup() before returning from comstart()).bde1997-12-281-1/+2
|
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+3
|
* Use ENOIOCTL instead of -1 (= ERESTART) for tty ioctls that arebde1997-12-061-3/+3
| | | | | not handled at a particular level. This fixes mainly restarting of interrupted TIOCDRAINs and TIOCSETA{W,F}s.
* Fixed chip_offsets[] which I broke in rev.1.53. The offsets aren'tbde1997-11-101-2/+2
| | | | | | | | | actually offsets, they are offsets scaled by dividing by 2^cy_align. I use different values for cy_align since the -current values are unnaturally scaled, so I need different offsets, and the wrong offsets got committed. Reported by: nnd@itfs.nsk.su (N.Dudorov)
* aha1542.c aic6360.c cy.c fd.c ft.cgibbs1997-09-211-5/+9
| | | | | | | | | | | | if_ie.c if_wl.c if_zp.c isa.c isa_device.h labpc.c mcd.c ncr5380.c scd.c seagate.c si.c sio.c tw.c ultra14f.c wcd.c wd.c: Update for changes in the callout interface. apic_vector.s icu_vector.s ipl.s ipl_funcs.c: Add CAM software/hardware interrupt support.
* Update select -> poll in drivers.peter1997-09-141-2/+2
|
* Cleaned up revs 1.36-1.40 (mainly disordered declarations, non-bogusbde1997-09-031-121/+147
| | | | indentation (it is supposed to be bogus to match sio.c), and long lines).
* General cleanup of the sub-system locking macros.fsmp1997-09-011-3/+8
| | | | | | | | Eliminated the RECURSIVE_MPINTRLOCK. clock.c and microtime use clock_lock. sio.c and cy.c use com_lock. Suggestions by: Bruce Evans <bde@zeta.org.au>
* Another round of lock pushdown.fsmp1997-08-301-33/+5
| | | | | | | | | Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel. UP kernel expects that this is enough to guarantee exclusive access to regions of code bracketed by these 2 functions. Add a simplelock to bracket clock accesses in clock.c: clock_lock. Help from: Bruce Evans <bde@zeta.org.au>
* Moved the COM_LOCK and COM_UNLOCK macros to machine/param.h.fsmp1997-08-211-10/+1
|
* Attempt to make cy.c MP-safe.fsmp1997-08-201-1/+42
| | | | | | I have no way of testing this one, first SMP/cy user please let me know... It is my belief that sio and cy are the only FAST_INTR() ISRs. If this is a bad assumption please educate me.
* Removed unused #includes.bde1997-07-201-3/+1
|
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includebde1997-03-241-2/+1
| | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
OpenPOWER on IntegriCloud