summaryrefslogtreecommitdiffstats
path: root/sys/dev/rc/rc.c
Commit message (Collapse)AuthorAgeFilesLines
* Preparation commit for the tty cleanups that will follow in the nearphk2004-07-151-1/+1
| | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
* Introduce ttygone() which indicates that the hardware is detached.phk2004-07-111-72/+6
| | | | Move dtrwait logic to the generic TTY level.
* Define the tty methods as typedefs.phk2004-06-301-3/+2
| | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later).
* Pick the hotchar out of the tty structure instead of caching privatephk2004-06-261-7/+6
| | | | | | | | copies. No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary.
* Use generic support for BREAK and modem control ioctlsphk2004-06-251-87/+48
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Centralize the line discipline optimization determination in a functionphk2004-06-041-21/+4
| | | | | | | | | called ttyldoptim(). Use this function from all the relevant drivers. I belive no drivers finger linesw[] directly anymore, paving the way for locking and refcounting.
* Manual edits to change linesw[]-frobbing to ttyld_*() calls.phk2004-06-041-2/+2
|
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-5/+5
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Make the remaining serial drivers call ttyioctl() rather than callingphk2004-06-041-5/+2
| | | | the linedisc directly.
* There is no need to explicitly call the stop function. In all likelyhoodphk2004-06-011-1/+0
| | | | ->l_close() did it and ttyclose certainly will.
* Add missing <sys/module.h> includesphk2004-05-301-0/+1
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Device megapatch 4/6:phk2004-02-211-1/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 3/6:phk2004-02-211-4/+0
| | | | | | | | | | | | Add missing D_TTY flags to various drivers. Complete asserts that dev_t's passed to ttyread(), ttywrite(), ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty pointer. Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default cdevsw methods for D_TTY drivers and remove the explicit initializations in various drivers cdevsw structures.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-1/+1
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Make TTYHOG tunable.das2003-03-051-0/+2
| | | | Reviewed by: mike (mentor)
* Make nokqfilter() return the correct return value.phk2003-03-031-1/+1
| | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-14/+10
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-1/+1
|
* Move an optimization check so that it breaks out of the correct loop.jhb2003-02-261-4/+3
| | | | | Basically, as soon as we have run out of events to handle in the swi, we stop looping through all the channels in a for loop.
* Remove #include <sys/dkstat.h>phk2003-02-161-1/+0
|
* Use critical_enter/exit instead of disable/enable_intr to make thisjhb2002-11-081-18/+18
| | | | driver more portable.
* Cast si_drv2 to intptr_t instead of int to quiet warnings.jhb2002-10-251-1/+1
| | | | | Tested on: alpha Reported by: marcel (on an ia64)
* - New-bussify the rc(4) device driver.jhb2002-10-231-472/+605
| | | | | | | | | | | | - Add detach support to the driver so that you can kldunload the module. Note that currently rc_detach() fails to detach a unit if any of its child devices are open, thus a kldunload will fail if any of the tty devices are currently open. - sys/i386/isa/ic/cd180.h was moved to sys/dev/ic/cd180.h as part of this change. Requested by: rwatson Tested by: rwatson
* Be consistent about funtions being static.phk2002-10-161-2/+4
| | | | Spotte by: FlexeLint.
* Off-by-128 error in the cuam* device node numbers.rwatson2002-05-201-1/+1
|
* Bump the rc driver a little bit closer to the 21st century: userwatson2002-05-201-0/+6
| | | | | | | make_dev() to create device nodes for each of the serial port channels (ttym%d and cuam%d respectively, as borrowed from MAKEDEV). This allows the rc driver to work in 5.0. I've tested it with only one card, but will try sticking in a second card tomorrow and see what happens.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-2/+2
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-231-2/+2
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __P.alfred2002-03-201-14/+14
|
* Change the preemption code for software interrupt thread schedules andjhb2002-01-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex releases to not require flags for the cases when preemption is not allowed: The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent switching to a higher priority thread on mutex releease and swi schedule, respectively when that switch is not safe. Now that the critical section API maintains a per-thread nesting count, the kernel can easily check whether or not it should switch without relying on flags from the programmer. This fixes a few bugs in that all current callers of swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from fast interrupt handlers and the swi_sched of softclock needed this flag. Note that to ensure that swi_sched()'s in clock and fast interrupt handlers do not switch, these handlers have to be explicitly wrapped in critical_enter/exit pairs. Presently, just wrapping the handlers is sufficient, but in the future with the fully preemptive kernel, the interrupt must be EOI'd before critical_exit() is called. (critical_exit() can switch due to a deferred preemption in a fully preemptive kernel.) I've tested the changes to the interrupt code on i386 and alpha. I have not tested ia64, but the interrupt code is almost identical to the alpha code, so I expect it will work fine. PowerPC and ARM do not yet have interrupt code in the tree so they shouldn't be broken. Sparc64 is broken, but that's been ok'd by jake and tmm who will be fixing the interrupt code for sparc64 shortly. Reviewed by: peter Tested on: i386, alpha
* KSE Milestone 2julian2001-09-121-9/+9
| | | | | | | | | | | | | | 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
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-151-2/+0
|
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Extend kqueue down to the device layer.jlemon2001-02-151-2/+3
| | | | Backwards compatible approach suggested by: peter
* Catch up to the new swi API.jhb2001-02-091-7/+6
|
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Catch up to the new software interrupt code.jhb2000-10-251-3/+4
| | | | Noticed by: phk
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-251-5/+8
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Made this file compile again after move of stuff from <machine.ipl.h>bde2000-10-081-1/+2
| | | | to <sys/ipl.h>.
* Mass update of isa drivers using compatability shims to usepeter2000-05-281-2/+7
| | | | COMPAT_ISA_DRIVER() so that we can get rid of the evil isa_compat.h table.
* Remove #if NFOO > 0 (it's not required in most cases) and also where itpeter2000-01-291-3/+0
| | | | | isn't used as a result, remove #include "foo.h". Many of these drivers still use NFOO for softc struct sizing etc however.
* Introduce ttyread() and ttywrite() which do the canonical thing.phk1999-09-281-28/+2
| | | | | | 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-20/+12
| | | | | | | | | | | | | | | | | | | | | 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
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-17/+0
| | | | | | | | | | | | | | | | 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().
* Fixed null setting of `rc_started'. This was fixed for thebde1999-06-041-7/+2
| | | | | | | | | | corresponding variable `rc_wakeup_started' in rev.1.36 but broken again in rev.1.37. This bug only caused excessive polling (it gave NRC activations for each of the SWI handler and the timeout handler instead of 1 of each). Moved cdevsw attachment from the driver probe routine to the driver attach routine.
OpenPOWER on IntegriCloud