summaryrefslogtreecommitdiffstats
path: root/sys/dev/rp
Commit message (Collapse)AuthorAgeFilesLines
* These checks against BUSY aren't needed: the newbus layer does thisimp2009-09-051-8/+0
| | | | | already with the appropriate locks held... There's no need to do it here, so just delete the checks.
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-4/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* Last minute TTY API change: remove mutex argument from tty_alloc().ed2009-05-291-1/+1
| | | | | | | | | | I don't want people to override the mutex when allocating a TTY. It has to be there, to keep drivers like syscons happy. So I'm creating a tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex() should eventually be removed. The advantage of this approach, is that we can just remove a function, without breaking the regular API in the future.
* Start to convert this over to the new tty layer. These changes allowambrisko2009-04-273-188/+125
| | | | | | | | | | | | | | this driver to compile and limp along with the new layer. These changes do not deal with proper locking around access to the HW. This is only a starting point. I have not tested modem control but tip seems to work okay and I can send and receive characters which I needed for one of my -current boxes. I have not tied this driver back up to the build since I don't want people to think it is ready for prime time. If anyone else has some cycles to work on this feel free to! Also add support for a 16 port PCI interface I have at work. Glanced at by: ed
* Replace all calls to minor() with dev2unit().ed2008-09-271-1/+1
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Initialize DWBuf[3].peter2007-07-051-0/+1
| | | | Approved by: re (rwatson, blanket)
* Fix Rocketport so that it does not crash the system when a device pointerremko2007-06-261-2/+12
| | | | | | | | | | | | | | | | | | | changes for example: (From Craig Leres): tip to a rocketport line run "/etc/rc.d/devfs restart" exit tip (wait for the system to reboot) Thanks to Robert Watson for poking me to fix this. PR: kern/109152 Approved by: imp (mentor) Approved by: re (kensmith) Reviewed by: jhb Submitted by: Craig Leres <leres@ee dot lbl dot gov>
* - Make rp(4) 64-bit- and endian-clean as well as work on strict alignmentmarius2006-11-203-74/+70
| | | | | | | | | | archs. [1] - Instead of bus_space_{read,write}*(rman_get_bustag(), rman_get_bushandle()) use bus_{read,write}*() for efficiency. Reported by: Peter Losher [1] Tested on: i386, sparc64 MFC after: 2 weeks
* The UPCI 32 rp(4) card uses BAR 2 like the UPCI 80 card.jhb2006-01-251-0/+2
| | | | | Submitted by: Vitaliy Skakun vit dot ska at gmail dot com MFC after: 3 days
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-044-5/+5
|
* Fix support for multiple RocketPort cards in the same machine by includingjhb2005-11-081-1/+1
| | | | | | | the RocketPort unit number in the name of the devices. This means that unit 0 device names will change from ttyR0 .. ttyRf to ttyR00 .. ttyR0f. Reviewed by: phk
* we know it is called rpclose() so call it directly.phk2005-10-161-1/+1
|
* Eliminate two unused arguments to ttycreate().phk2005-10-161-1/+1
|
* - Use pci_get_device() and pci_get_vendor() when we only want one partjhb2005-03-251-3/+11
| | | | | | | | | of the device id. - Use BAR2 rather than BAR0 for the Rocketport UPCI 8O card. I suspect that other UPCI cards might need to use BAR2 as well. Tested by: wsk at gddsn dot org dot cn MFC after: 1 week
* Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY inimp2005-03-011-1/+1
| | | | | preference to some random negative number to allow other drivers a bite at the apple.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-064-4/+4
|
* Use tty layer generic code instead of local copy.phk2004-10-042-538/+110
| | | | | Device names {cua,tty}R%r[.init,.lock] clashes with pty(4) driver and allows for only 32 ports. This should probably be revisited.
* Use ttyalloc() instead of ttymalloc(NULL)phk2004-09-171-1/+1
|
* 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-112-17/+4
| | | | Move dtrwait logic to the generic TTY level.
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.phk2004-06-211-0/+4
|
* Prevent the rp driver from panic'ing on first access and make atgallatin2004-06-213-29/+33
| | | | | | | | | | | | | | | | | | | least the pci device unloadable - Use ttymalloc() rather than a plain malloc to allocate the rp->rp_tty ttys. This is now required due to the recent locking changes to ttys and prevents a panic due to locking an unitialized t_mtx. - Allow the pci driver to be unloaded. This involved moving the call rp_releaseresource() to the end of rp_pcireleaseresource(), since rp_pcireleaseresource() uses ctlp->dev, which is freed by rp_releaseresource(). - Allow the generic part of the driver to be unattached by providing a hook to cancel timeouts. Glanced at by: obrien
* Do the dreaded s/dev_t/struct cdev */phk2004-06-162-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Deorbit COMPAT_SUNOS.phk2004-06-111-2/+2
| | | | | We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
* 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.
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-10/+10
| | | | | | 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-10/+3
| | | | 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-302-0/+2
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-1/+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-2/+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.
* Use __FBSDID().obrien2003-08-243-5/+10
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Undo single-intance inlining which is way above the comfort limit for GCC.phk2003-07-231-3/+2
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+9
| | | | | | | | | | | | | 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)
* Remove #include <sys/dkstat.h>phk2003-02-161-1/+0
|
* Fix data corruption caused by last byte in oddly sized transfers being readtegge2002-10-201-2/+3
| | | | to wrong location in RxBuf and written from wrong location in TxBuf.
* Be consistent about functions being static.phk2002-10-163-5/+5
| | | | Spotted by: FlexeLint.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-3/+3
| | | | | | | | | | | | 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@
* Remove __P.alfred2002-03-201-5/+5
|
* #include "opt_compat.h" so that the support for old ioctls can actuallybde2002-02-151-0/+6
| | | | | | | | | | | | be compiled. Old tty ioctls are still used (possibly ifdef'ed) in at least the following programs in the src tree: atc des ee fontedit gdb gdbserver lock ntp perl5 tcsh telnet top vttest rp.c: Unremoved used variables so that the support for old ioctls actually compiles. Not tested at runtime by: bde
* Force the RxBuf and TxBuf arrays to be aligned on 16-bit boundaries togallatin2001-11-052-3/+3
| | | | | | make the driver work on alpha approved by: tanimura
* KSE Milestone 2julian2001-09-121-10/+10
| | | | | | | | | | | | | | 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
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-083-14/+8
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* 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>.
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-292-2/+0
|
OpenPOWER on IntegriCloud