summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/matcd/matcd.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Trying to set BAD144 handling on a CD is sufficiently "Dont Do Thatphk1999-09-201-3/+0
| | | | then" that we don't need to give the ioctl special treatment.
* Changes to centralise the default blocksize behaviour.julian1999-09-091-4/+2
| | | | | | More likely to follow. Submitted by: phk@freebsd.org
* remove some out-of-scope DEVFS references..julian1999-09-031-1/+1
| | | | (don't worry greg.. cosmetic only)
* Set si_bsize_phys and si_bsize_max in all legacy CD drivers.phk1999-09-011-0/+2
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-37/+6
| | | | | | | | | | | | | | | | 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().
* Delete stray static prototype.peter1999-07-031-2/+1
|
* Simplify cdevsw registration.phk1999-05-311-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+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.
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-9/+2
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
* Fix 3-byte buffer overflow.eivind1998-12-131-3/+3
| | | | | Also, while I'm here, fix up some more after those that haven't noticed #endif isn't a comment introducer.
* The ioctl request arg is unsigned log, so don't attempt to pass itbde1998-07-151-6/+5
| | | | | | around as signed int. Fixed printf format error for ioctl request arg hidden in ifdefed code.
* There is no such thing any more as "struct bdevsw".julian1998-07-041-11/+19
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
* Added used include of <i386/isa/isa_device.h> - don't depend onbde1998-06-171-1/+3
| | | | pollution in <sys/conf.h>
* 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.
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+3
| | | | | | | | 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.
* In all such uses of struct buf: 's/b_un.b_addr/b_data/g'phk1997-12-021-2/+2
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-3/+1
| | | | Found by: -Wunused
* Update for changes in the callout interface.gibbs1997-09-211-5/+5
|
* Removed unused #includes.bde1997-07-201-3/+2
| | | | Updated an #include to 4.4Lite style (missed one).
* Add the D_DISK flag to the cdevsw structs of various CD-ROM drivers.joerg1997-05-101-2/+2
|
* This mega-commit brings the following:joerg1997-05-041-2/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . It makes cd9660 root f/s working again. . It makes CD9660 a new-style option. . It adds support to mount an ISO9660 multi-session CD-ROM as the root filesystem (the last session actually, but that's what is expected behaviour). Sigh. The CDIOREADTOCENTRYS did a copyout() of its own, and thus has been unusable for me for this work. Too bad it didn't simply stuff the max 100 entries into the struct ioc_read_toc_entry, but relied on a user supplied data buffer instead. :-( I now had to reinvent the wheel, and created a CDIOREADTOCENTRY ioctl command that can be used in a kernel context. While doing this, i noticed the following bogosities in existing CD-ROM drivers: wcd: This driver is likely to be totally bogus when someone tries two succeeding CDIOREADTOCENTRYS (or now CDIOREADTOCENTRY) commands with requesting MSF format, since it apparently operates on an internal table. scd: This driver apparently returns just a single TOC entry only for the CDIOREADTOCENTRYS command. I have only been able to test the CDIOREADTOCENTRY command with the cd(4) driver. I hereby request the respective maintainers of the other CD-ROM drivers to verify my code for their driver. When it comes to merging this CD-ROM multisession stuff into RELENG_2_2 i will only consider drivers where i've got a confirmation that it actually works.
* Fixed the type of a timeout function and removed casts that hid thebde1997-04-201-2/+7
| | | | | | type mismatches. There was no problem in practice (at least on 386's). The timeout args still get bogusly cast from int to `void *' via caddr_t and back to int.
* 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.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Remove devconf, it never grew up to be of any use.phk1996-09-061-33/+1
|
* Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.phk1996-07-231-15/+3
| | | | | | | | | Saves about 280 butes of source per driver, 56 bytes in object size and another 56 bytes moves from data to bss. No functional change intended nor expected. GENERIC should be about one k smaller now :-)
* Fixed existence, minor numbers, group and permissions for devfs devicesbde1996-06-081-20/+29
| | | | | (locked devices weren't created; minor numbers didn't depend on the unit number; group operator was games; permissions 0640 was 0600).
* Forget that TAILQ's must be init'ed.phk1996-05-031-1/+2
|
* Move from the old buf.b_actf to the new TAILQ(buf.b_act).phk1996-05-031-331/+192
| | | | Also remove a ton of weird comments and a couple of no-use options.
* Switched from using devfs_add_sw() to using devfs_add_swf()scrappy1996-03-281-23/+18
| | | | Reviewed by: julian@freebsd.org
* Replaced nxdump by nodump (if the dump function gets called, then thebde1995-12-101-2/+2
| | | | | | device must be configured, so ENXIO is a bogus errno). Replaced zerosize by nopsize. zerosize was a temporary alias.
* Staticize and cleanup.phk1995-12-101-6/+9
|
* Pass 3 of the great devsw changesjulian1995-12-081-36/+79
| | | | | | | | | | | | | | | | | | | | | | | most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
* If you're going to mechanically replicate something in 50 filesjulian1995-11-291-1/+1
| | | | it's best to not have a (compiles cleanly) typo in it! (sigh)
* OK, that's it..julian1995-11-291-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | totally dynamic. (the first was about 7 weeeks ago) 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 */
* Moved prototypes for devswitch functions from conf.c and driver sourcesbde1995-11-041-10/+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.
* Bring in version 1(26) - considerably less memory usage (and may bring usjkh1995-10-251-14/+24
| | | | | down to 4MB bootability again). Submitted by: Frank Durda IV <uhclem@fw.ast.com>
* o Support for CDIOCPREVENT and CDIOCALLOW ioctls that xcdplayerjkh1995-09-281-50/+132
| | | | | | | | | | | | | | | | | | | | | | | | | were making and were no-brainers. However, the xcdplayer eject button didn't work because xcdplayer gave up and didn't bother to try the EJECT ioctl anyway when CDIOCALLOW was not available. This all works now. o A change so that xcdplayer gets TOC entry data for the lead-out area on the disc. Xcdplayer can now play the last track on a CD, which it would not do in earlier versions (but no one reported). Cdplayer gets the TOC data differently and it works in old and new versions. o Eliminated a race condition that caused the driver to sleep forever on very slow and heavily loaded systems on rare occasions when the system was doing lots of audio-related ioctls to the drive. o Fixed a problem where a locked drive could be unlocked by accessing one of the non-locking devs. Door locking now follows the documented rules. o Made all wait channel strings unique to matcd. Submitted by: Frank Durda IV <uhclem%nemesis@fw.ast.com>
* Fix benign type mismatches in devsw functions. 82 out of 299 devswbde1995-09-081-6/+6
| | | | functions were wrong.
* Release summary: (detailed descriptions in Edit History in matcd.c)jkh1995-07-111-53/+142
| | | | | | | | | | | | | | | | | | | | | | | | Adds support for non-Sound Blaster host adapters, including those distributed by Reveal, Lasermate, IBM, Media Vision, Crystal and others. The driver automatically senses the correct adapter type and you can have both in the system at the same time. (This change should eliminate a few complaints.) Corrected bit-masking problem that prevented use on SB Vibra-16 boards. Declared some internal data and functions static that should have been that way all along. Documentation changes reflect the new hardware support and change the appearance version to 2.0.5 (was 2.1). Nice and tidy. :-) Beta testers have verified functionality on SB16, Vibra-16, Media Vision and Reveal adapters. -Wall still shows no warnings. Frank Durda IV uhclem%nemesis@fw.ast.com Submitted by: Frank Durda IV <uhclem%nemesis@fw.ast.com>
* Merge RELENG_2_0_5 into HEADrgrimes1995-06-111-3/+15
|
* Remove trailing whitespace.rgrimes1995-05-301-35/+35
|
* This is the new submission of the matcd driver. In addition to thejkh1995-04-091-0/+2557
new driver code, there are diffs to several other existing files on the system and a man page. This version of matcd implements the rest of the key ioctls related to playing audio CDs and reading table of contents information from any type of disc. This update also corrects several problems detected since the original version 1(10) was released. These include: 1. Jordons report on the kernel -c string problem. 2. A problem with the driver being confused by other types of devices located at addresses it probes. 3. An old CD TOC wouldn't always be cleared after a disc change. 4. Cleaned up code so -Wall yields no warnings on 2.0 and later. 5. A problem with drive getting out of sync with the driver when changing between CD-Data and CD-DA. There have only been two reports from the field relating to problems so either the first release isn't really being used or doesn't have many problems. If there are any problems with this submission, please let me know. Submitted by: Frank Durda IV <uhclem%nemesis@fw.ast.com>
OpenPOWER on IntegriCloud