summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
Commit message (Collapse)AuthorAgeFilesLines
* Fixed error handling:bde1998-07-291-56/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Call isa_dmadone() whenever necessary to stop DMA and/or free bounce buffers. Undead DMA corrupted the malloc freelist fairly consistently in the following configuration: SLICE kernel, 2 floppy drives, no disk in fd0, disk in fd1. - Don't call fdc_reset() from fd_timeout(). Doing so gave an "extra" interrupt which was usually misinterpreted as being for completion of the next FDC command; the interrupt for completion of the next FDC command was then usually misinterpreted... There were further complications for interrupts latched by the soft-spl mechanism so that they were delivered after all the h/w interrupts went away. This caused at least wrong head settle delays and may be why the FreeBSD floppy driver seems to munch floppies more than most floppy drivers. The reset was unnecessary anyway in cases that didn't have the bug described next, since is was repeated a little later for the IOTIMEDOUT state. The state machine has complications to handle resets correctly, so just use it. - Don't call retrier() from fd_timeout(). The IOTIMEDOUT state needs to be processed next, and it isn't valid to set to that state if retrier() has aborted the current transfer. Doing so caused null pointer panics after the previous bug was fixed. Improved error handling: - If an i/o is aborted, arrange to reset in the state machine before doing the next i/o. New fdc flag for this. This fixes spurious warnings and lengthy busy-waiting for the next i/o. - Split STARTRECAL into RESETCOMPLETE and STARTRECAL and only check for the results from reset if we actually reset. This fixes spurious warnings for other paths to STARTRECAL. [Oops, it may break reset handling for motor-off resets.] Cleanups in fd_timeout(): - Renamed to fd_iotimeout() to make it clearer that it is only used for i/o. - Don't handle the bp == 0 case. This case can't happen for i/o. - Don't check for controller-busy. We know it must be. - Don't print anything. retrier() already prints too much for normal errors. - Fudge the state differently so that the state machine advances fdc->retry and the status is invalid (perhaps this should fudge a valid state like the one for WP). - Style fixes.
* Fixed error handling after a seek error that can't happen. When thebde1998-07-181-1/+3
| | | | | | | | | | | | | | | | controller reports a successful seek, it is very unlikely to report seeking to a cylinder other than the one requested, but we check for this, and botched the error handling for the requested_cylinder != 0 case. This error happened when the bug fixed in rev.1.52 of <sys/buf.h> caused the head of buffer queue to change to one starting on a different cylnder - the requested cylinder was found, but it wasn't what we thought we requested. The fix is simply to arrange to reset the state machine. Corruption of the buffer queue seems to only have been a problem in the floppy driver. Other drivers dequeue the head of the queue before doing physical i/o on it, so the corruption at worse broke the elevator sort order. Dequeueing breaks it anyway.
* The ioctl request arg is unsigned long, so don't attempt to pass itbde1998-07-151-2/+2
| | | | around as signed int.
* SLICE probing becomes asynchronous. It can now be triggered byjulian1998-07-131-6/+3
| | | | | | | | interupt level events. This needs a lot of cleanup, but has been working here for a month or two.. originally needed for CAM integration but that hasn't happenned yet. The probing state machines for each handler should be replaced by a more generic state-service. It's still quite messy in there..
* Don't pretend to support ix86's with 7-bit ints by using longs just tobde1998-07-111-4/+4
| | | | ensure 8-bit variables. Doing so mainly bogotified some printf formats.
* There is no such thing any more as "struct bdevsw".julian1998-07-041-8/+27
| | | | | | | | | | | | | | | | | | 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.
* Fix some more ioctls which I missed becausese they were hidden by optionsdfr1998-06-071-2/+2
| | | | which were not in LINT.
* 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.
* There is no dump routine for fd so give it an explicit NULL entryjulian1998-05-061-2/+3
| | | | in the SLICE table.
* Add dump support to the DEVFS/slice code.julian1998-05-061-3/+3
| | | | | | now we can actually catch our crashes :-) Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
* close() is no longer a SLICE method.julian1998-04-221-4/+10
| | | | | Close is simply an open with no-read and no-write once internal to SLICE (it still exports a close to the rest of the kernel)
* Add changes and code to implement a functional DEVFS.julian1998-04-191-17/+269
| | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned.
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-171-2/+2
|
* 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.
* In all such uses of struct buf: 's/b_un.b_addr/b_data/g'phk1997-12-021-5/+5
|
* Introduce a device flags value of 0x1 to always pretend a 1.44 MBjoerg1997-10-191-2/+15
| | | | | | | | | | | | | floppy drive #0, regardless of what the CMOS says. This is intended as a bandaid for those plagued with Compaq's idea to not announce the floppy drive on their `Aero' notebook. Using the device flags is not very nice (in particular since they aren't per-drive but per-controller), but still looks a lot better to me than the disgusting guesswork hack that was recently posted to -hackers. Doc update will follow shortly.
* Fix a call to timeout that wasn't properly saving it's callout handle.gibbs1997-09-231-2/+2
| | | | Submitted by: durian@plutotech.com
* aha1542.c aic6360.c cy.c fd.c ft.cgibbs1997-09-211-13/+17
| | | | | | | | | | | | 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.
* Enable the FIFO on enhanced floppy controllers. This reduces thetegge1997-09-171-1/+56
| | | | | | | | number of dma overruns/underruns for systems under heavy dma load. As a side effect, broken enhanced floppy controllers that sometimes don't detect dma overruns/underruns will give less errors. Reviewed by: j@uriah.heep.sax.de (J Wunsch)
* Make FDC_DEBUG a supported option.joerg1997-09-161-10/+21
| | | | | | | Hide the bogus FDC ``chip type'' display behind a (mostly) undocumented option, since people started to trust the bogus claim. Once we're going to handle 2.88 MB controllers, we have to redo the chip detection, by now just leave it hidden.
* Removed unused #includes.bde1997-07-201-2/+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.
* 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-222-2/+2
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-1/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-142-2/+2
| | | | | | | | 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.
* Disabled half-baked disk statistics support. It didn't actually generatebde1996-12-181-1/+7
| | | | statistics, so it just wasted scarce disk table slots and screen space.
* Fix the broken EOF handling in the floppy driver. The most obviousjoerg1996-11-021-28/+36
| | | | | | | | | appearance of this bug was the malfunctioning -M option in GNU tar (it worked only by explicitly specifying -L). Reviewed by: bde, and partially corrected accoring to his comments Candidate for 2.2, IMHO even for 2.1.6.
* Remove devconf, it never grew up to be of any use.phk1996-09-061-112/+1
|
* Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.phk1996-07-231-13/+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 :-)
* Staticized a few variables.bde1996-07-121-4/+7
| | | | Fixed warnings about unused variables.
* Typo.phk1996-05-031-2/+2
|
* Move from the old buf.b_actf to the new TAILQ(buf.b_act).phk1996-05-031-17/+12
|
* Update drivers to use isa_dma_acquire() and isa_dma_release()smpatel1996-04-081-1/+3
| | | | Reviewed by: bde
* Removed now-unused #includes of <machine/cpu.h>. They were for bootverbosebde1996-04-071-2/+1
| | | | being declared in the wrong place.
* Fixed devfs device names and numbers.bde1996-04-071-35/+71
| | | | Fixed handling of unknown CMOS types - don't attach unrecognized devices.
* changed from using dev_link() to devfs_link()scrappy1996-04-021-3/+3
|
* Fetch the (dummy) READY CHANGED condition interrupt stati thatjoerg1996-03-311-1/+8
| | | | | | happen after an FDC reset. Submitted by: bde
* Fixed group of some more disk devices.bde1996-03-291-9/+9
| | | | Fixed devfs function names.
* Switched from using devfs_add_sw() to using devfs_add_swf()scrappy1996-03-281-8/+9
| | | | Reviewed by: julian@freebsd.org
* Don't turn off the motor on active drives. The motor timeout maybde1996-02-251-1/+12
| | | | | occur while a command is in progress if the system is overloaded or was stopped at a debugger breakpoint.
* First attempt at creating devfs entries for sliced devices. Doesn'tbde1996-01-271-9/+12
| | | | | | | | | | | | | | | | | | | | quite work yet, so the heart of it is disabled. Added bdev and cdev args to dsopen(). drivers: Fixed device names, links, minor numbers and modes. wd.c: Started actually supporting devfs. diskslice.h: Added devfs tokens to structs (currently 576 of them per disk! :-(). subr_diskslice.c: Create devfs entries in dsopen() and (unsuccessfully) attempt to make them go away at the right times. DEVFS is #undefed at the start so that this shouldn't cause problems.
* Allocate DMA bounce buffers only when requested by drivers. Only thebde1996-01-271-1/+2
| | | | | | | | | | | | | | | | | | | fd and wt drivers need bounce buffers, so this normally saves 32K-1K of kernel memory. Keep track of which DMA channels are busy. isa_dmadone() must now be called when DMA has finished or been aborted. Panic for unallocated and too-small (required) bounce buffers. fd.c: There will be new warnings about isa_dmadone() not being called after DMA has been aborted. sound/dmabuf.c: isa_dmadone() needs more parameters than are available, so temporarily use a new interface isa_dmadone_nobounce() to avoid having to worry about panics for fake parameters. Untested.
* 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-8/+8
|
* clean a few DEVFS things..julian1995-12-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix a bug where you couldn't place devices in the root directory of devfs remove deprecated routines On my machine devfs now shows: julian@erf.tfs.com: julian@erf.tfs.com: ls -RF bpf0 mem ptypb spkr ttyp8 bpf1 null ptypc stderr ttyp9 bpf2 pcaudio ptypd stdin ttypa bpf3 pcaudioctl ptype stdout ttypb console pt ptypf tty ttypc cuaa0 ptyp0 random ttyd0 ttypd cuaia0 ptyp1 rsd0 ttyid0 ttype cuala0 ptyp2 rsd1 ttyld0 ttypf fd/ ptyp3 rvn ttyp0 tun0 fd0.1440 ptyp4 rworm ttyp1 urandom fd1.1200 ptyp5 scsi/ ttyp2 vn io ptyp6 sd0 ttyp3 zero kmem ptyp7 sd1 ttyp4 lkm ptyp8 snp0 ttyp5 log ptyp9 snp1 ttyp6 lpt0 ptypa snp2 ttyp7 ./fd: 0 15 21 28 34 40 47 53 6 9 1 16 22 29 35 41 48 54 60 10 17 23 3 36 42 49 55 61 11 18 24 30 37 43 5 56 62 12 19 25 31 38 44 50 57 63 13 2 26 32 39 45 51 58 7 14 20 27 33 4 46 52 59 8 ./scsi: sctarg ssc julian@erf.tfs.com: which is all devices really there except for disk slices/partitions.. (if I don't have it it's not there, which has GOT to be an improvement..) no DEVFS fixes from device maintainers yet?
* Julian forgot to make the *devsw structures static.phk1995-12-081-3/+3
|
* Pass 3 of the great devsw changesjulian1995-12-081-34/+41
| | | | | | | | | | | | | | | | | | | | | | | 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.. :)
* the second set of changes in a move towards getting devices to bejulian1995-11-281-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 */
* Mega commit for sysctl.phk1995-11-201-13/+4
| | | | | | Convert the remaining sysctl stuff to the new way of doing things. the devconf stuff is the reason for the large number of files. Cleaned up some compiler warnings while I were there.
OpenPOWER on IntegriCloud