summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
Commit message (Collapse)AuthorAgeFilesLines
* KSE Milestone 2julian2001-09-121-5/+5
| | | | | | | | | | | | | | 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
* Add ACPI attachments.msmith2001-08-301-0/+1
|
* Hrmpf. nyan's rev 1.25 commit to fdc.h crossed with my removal of it.joerg2001-07-141-0/+17
| | | | Back-integrate his (PC98) changes into fd.c.
* Yet another large non-function change.joerg2001-07-141-142/+271
| | | | | | | | | | | | | | | | | | | | . Integrate fdc.h into fd.c, with the removal of ft(4) there's no longer a reason to scatter things across two files. . Sanitize comments. Convert them into the style(9)-recommended multi-line form, make them sentences where apprpriate, etc. . Declare all functions on top, and declare them in the order they appear in the file. This order is totally chaotic, but Bruce convinced me that reordering the file wouldn't make it better either. . Kill a `possibly uninitialized' warning (only seen with -O2) in fd_read_status(). . Make the comments at return (0|1) statements in fdstate() consistent. . Nuke a ``keep the compiler happy'' dummy return at the end of fdstate(), gcc is smart enough to detect that it would never be reached anyway.
* Log when the user is turning debugging on/off.joerg2001-07-091-5/+9
| | | | | | | Also sanitize the TRACE* macros a bit so they syntactically behave like single C statements (even inside in `if' statement). Submitted by: des
* Hmpf, remove two variables that got unused by rev 1.214.joerg2001-07-091-2/+1
|
* Ouch, calculate correctly. With 300 rpm and 25 retries, it's 5 secondsjoerg2001-07-091-1/+1
| | | | till timeout.
* Remove parts of rev 1.211 again: do not delete our children iff theyjoerg2001-07-091-7/+0
| | | | | | haven't been probed successfully. It's a known bug that ISA hints processing instantiates those devices, and prematurely killing them has other unwanted side-effects.
* As des' example shows us, DMA overruns could happen in a situationjoerg2001-07-091-9/+37
| | | | | | | | where they will never succeed. Add a stop-gap measure that will at least eventually timeout the operation instead of retrying it indefinately. MFC after: 1 month
* Another large patchset from Bruce.joerg2001-07-081-158/+113
| | | | | | | | | | | | | | | Despite of a few cosmetic things like adding ``irritating silly parentheses'' around all return values, this mainly improves FDC reset handling by no longer gratuitously resetting the FDC all the time (which causes it to lose the notion of the current track) but only in case of errors, and it sanitizes the block and offset calculations in fdstrategy() and fdstate(). Some additional cleanup added by me, in particular the large switch in fdstate() now always uses return to break out, and no branch falls off the end of the switch statement anymore. Per Bruce's suggestion, removed M_NOWAIT from the malloc()s to simplify things. Submitted by: bde (mostly)
* More cleanup when detaching. Clone device entries will now bejoerg2001-07-041-17/+41
| | | | | | | | | | | | | | | | | | | | | destroyed properly (otherwise bad things would happen after a clone dev had been created, and the module was kldunloaded). Allocated children that have not successfully probed are being deleted again (otherwise fd0 and fd1 have always been allocated, even if only fd0 was acutally present, and fd1 even survived kldunloading the module). Still, kldunloading leaves remnants of the previously existing devices intact. Why doesn't it destroy all the devices? As a consequence, since dev->descr now points into no longer allocated memory, the system panics deep inside printf(9) when running devinfo(1) after kldunloading the module. Ideas sought... Also, when kldloading the module on a hints-populated isab0, this bus somehow has already created an fdc0 entry (a dummy) so the load attempt fails and will register fdc1 instead. What are those dummy entries for? Loading the module from the bootloader works, and it can be unloaded an re-loaded then later.
* Use the new-born BIO_CMD1 instead of fudging a bio_flag value for readingjoerg2001-06-291-116/+72
| | | | | | | | | | | | | | | | | the sector ID. Based on numerous comments made by Bruce, rewrite a good part of the old fdformat() function, and merge it with fdreadid() into a single unified fdmisccmd() function. Various style and a couple of more serious bugs fixed there. While i was at it, i also fixed the long-standing "TODO: don't allocate buffer on stack." in fdcioctl(), fixed a number of style bugs there, and finally implemented the FD_DEBUG ioctl command that has been advertised in <sys/fdcio.h> (formerly <machine/ioctl_fd.h>) for almost seven years now. ;-) Submitted by: bde (a lot of fixes for fdformat())
* This change slipped through hidden in a CVS conflict. Logically belongsjoerg2001-06-291-3/+3
| | | | to the previous commit (fix resource deallocation).
* First stab at fixing resource deallocation, and implementing fdc(4) asjoerg2001-06-291-10/+24
| | | | | | | | | | | a KLD. Still doesn't work well except in the PCMCIA case (now if only pccardd(8) could load and unload drivers dynamically...). Mainly, it tries to find fdc0 on the PCI bus for whatever obscure reasons, but i need someone who understands driver(9) to fix this. However, it's at least already better than before, and i'm tired of maintaining too many private changes in my tree, given the large patches bde submitted. :) Idea of a KLD triggered by: Michael Reifenberger <root@nihil.plaut.de>
* Merge in parts of a larger patchset i received from Bruce. Untestedjoerg2001-06-281-41/+38
| | | | | | | | | | | | | | | | | | | by now (except of a compile test), but i believe this to contain no actual functional changes. . Fix the copyright of the Regents i accidentally broke in rev 1.197 (although only a very small part of the original driver survived at all...). . Bump MAX_CYLINDER since some obscure formats really use more than 80 cylinders. . Correctly handle BIO_FORMAT which used to be a bitmask but is now a BIO command of its own. . Numerous stylistic fixes. Submitted by: bde
* Implement a new ioctl command for floppies: FD_READIDjoerg2001-06-261-8/+92
| | | | | Reads one sector ID field from a given track. Useful for analyzing floppies.
* Some more cosmetics: kill another couple of K&R function definitionsjoerg2001-06-261-28/+4
| | | | | that survived from old days, fix style of return type in fdcpio(), kill old Emacs hints that are no longer working that way anyway.
* Cosmetics:joerg2001-06-201-33/+3
| | | | | | | | | | . staticize out_fdc(), there's no longer an ft(4) driver sharing its use . remove in_fdc(), has been used by ft(4) last time, long since obsoleted by fd_in() . move the declaration of fd_clone() to where most of the other function declarations are . de-__P()ify fd_clone(), it's been the only _P()ed function in the entire file
* Hints overhaul:peter2001-06-121-6/+5
| | | | | | | | | - Replace some very poorly thought out API hacks that should have been fixed a long while ago. - Provide some much more flexible search functions (resource_find_*()) - Use strings for storage instead of an outgrowth of the rather inconvenient temporary ioconf table from config(). We already had a fallback to using strings before malloc/vm was running anyway.
* Cosmetics:joerg2001-06-111-16/+22
| | | | | | | | | . remove stale comments and a stale #define (from the old days of ft(4)) . make MAX_SEC_SIZE (used in isa_dmainit()) a #define . fix a typo in a string . use 0 as the blocksize in devstat_add_entry(), since the actual blocksize is unknown (devstat(9) suggests to use 0 in that case)
* Nuke the various poorly maintained copies of ioctl_fd.h. The file isjoerg2001-06-061-1/+1
| | | | | not machine-dependant, thus it has been moved out (repo-copied) into <sys/fdcio.h>.
* Make the FDC (state machine) state an enum, as opposed to an intjoerg2001-06-051-16/+0
| | | | abusing a bunch of #defines, for clarity and better debugging support.
* Move out the files from src/sys/isa/ic/ to src/sys/dev/ic/, so theyjoerg2001-06-041-1/+1
| | | | | | | | | | can be made userland-visible as <dev/ic/...>. Also, those files are not supposed to contain any bus-specific details at all, so placing them under .../isa/ has been a misnomer from the beginning. The files in src/sys/dev/ic/ have been repo-copied from their old location (this commit is a forced null commit there to record this message).
* Fix my email address. I accidentally cut'npasted the wrong (old)joerg2001-06-031-1/+1
| | | | hostname laste time.
* Don't lie to diskerr() now that it listens to us.phk2001-05-251-5/+0
|
* Implement a few more floppy ioctl commands and IO options, namely:joerg2001-05-141-23/+40
| | | | | | | | | | | | | | | | | | | | | . FD_CLRERR clears the error counter, thus re-enables kernel error printf()s, . FD_GSTAT obtains the last FDC operation state, if any, . FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy error logging, . FDOPT_NOERROR makes the kernel ignore an FDC error, thus can enable the transfer of an erroneous sector to the user application All options are being cleared on (last) close. Prime consumer of the last features will be fdread(1), to be committed shortly. (FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8) needs a major rewrite anyway.)
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalphk2001-05-061-4/+2
| | | | | | than the bioerror(). Most of this patch is generated by scripts.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-2/+4
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-2/+0
| | | | the bit-bucket.
* Harvest interrupt entropy off the floppy disk controller.markm2001-03-031-1/+2
|
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Make diskerr() always log with printf.phk2000-11-261-2/+1
|
* Untangle some resource matching loops that were getting on my nervespeter2000-10-151-3/+4
| | | | and seemed to be getting cut/pasted to places they shouldn't be.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-19/+5
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-12/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC
* Avoid a '"fd" is usurping ...' message.n_hibma2000-08-091-1/+5
| | | | | PR: 20348 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
* Fix a warning re: a potentially unused pccard helper functionpeter2000-07-281-0/+2
|
* Step down a level and issue format requests with a struct bio insteadphk2000-05-061-20/+20
| | | | of a struct buf.
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Fixed the type of some ivar access functions. Ivars have type uintptr_t,bde2000-04-301-1/+1
| | | | | | | not u_long. On i386's with 64-bit longs, returning u_longs indirectly in (more than) the space reserved for uintptr_t's tended to corrupt the previous frame pointer in the stack frame, so it was not easy to debug. The type mismatches are hidden by the bogus cast in DEVMETHOD().
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-151-70/+69
| | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-7/+7
| | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde.
* Fix floppy driver after my isadma changes.phk2000-03-251-7/+12
|
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-1/+1
| | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-201-6/+6
| | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
* Make the Y-E Data PCMCIA floppy of the Toshiba Libretto work underjoerg2000-03-181-244/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -current. It doesn't work yet as stable as the 3.x/PAO version of the driver does, however, i get occasional `FDC direction bit not set' and other weird messages, but it basically works at least. The old (defunct) #ifdef FDC_YE stuff has been eliminated completely now, PCMCIA-FDC specific functions have been implemented differently where needed. Unfortunately, due to the fact that the traditional PeeCee FDC with its funny non-contiguous register space (one register for WD1003 harddisk controllers is interleaved into the FDC register set), and Peter's subsequent changes involving two different bus space handles for normal FDCs, the changes required for the Y-E stuff are more complex than i'd love them to be. I've done my best to keep the logic for normal FDCs intact. Since the Y-E FDC seems to lose interrupts after a FDC reset sometimes, i've also replaced the timeout logic in fd_turnoff() to generate an artificial pseudo interrupt in case of a timeout while the drive has still outstanding transfers waiting. This avoids the total starvation of the driver that could be observed with highly damaged media under 3.x/PAO. This part of the patch has been revied by bde previously. I've fixed a number of occasions where previous commits have been missing the encapuslation of ISA DMA related functions inside FDC_NODMA checks. I've added one call to SET_BCDR() during preparation of the format floppy operation. Floppy formatting has been totally broken before in 3.x/PAO (garbage ID fields have been written to the medium, causing `wrong cylinder' errors upon media reading). This is just black magic, i don't have the slightes idea _why_ this needs to be but just copied over the hack that has been used by the PAO folks in the normal read/write case anyway. The entired device_busy() stuff seems to be pointless to me. In any case, i had to add device_unbusy() calls symmetrical to the device_busy() calls, otherwise the PCMCIA floppy driver could never be deactivated. (As it used to be, it caused a `mark the device busier and busier' situation.) IMHO, all block device drivers should be marked busy based on active buffers still waiting for the driver, so the device_unbusy() calls should probably go to biodone(). Only one other driver (whose name escapes me at the moment) uses device_busy() calls at all, so i question the value of all this... I think this entire `device busy' logic simply doesn't fit for PCMCIA &al. It cannot be the decision of some piece of kernel software to declare a device `busy by now, you can't remove it', when the actual physical power of removing it is the user pulling the card. The kernel simply has to cope with the removal, however busy the device might have been by the time of the removal, period. Perhaps a force flag needs to be added? Upon inserting the card a second time, i get: WARNING: "fd" is usurping "fd"'s cdevsw[] WARNING: "fd" is usurping "fd"'s bmaj I suspect this is related to the XXX comment at the call to cdevsw_add(). Does anybody know what the correct way is to cleanup this?
* Futher cleanup.. "device_print_prettyname(); printf()" -> device_printf()peter2000-01-081-54/+47
| | | | | | | | | It seems that the IDE system uses 0x3f6 for itself, which conflicts with fdc's default 0x3f0-3f7 allocation range. Sigh. Work around this. Use bus_set_resource() rather than allocating specific areas, it makes the code a little cleaner. Based on work by: dfr
* Merge most of FDC_YE into the mainline driver.imp2000-01-062-75/+31
| | | | | | | | | | | | | | | | | o Rename FDC_PCMCIA to FDC_NODMA to allow systems that don't have dma for floppies. o Remove all but two FDC_YE ifdefs. They aren't needed. o Move defines for YE_DATAPORT to fdreg.h. Not fixed: o The pccard probe/attach. However, motivated individuals can more easily add this now. This is a merge of changes I've had in my tree for a long time. These fixes were tested on my VAIO with its normal floppy. Please let me know if I broke anything. Prodded by: Peter Wemm <peter@freebsd.org>
* Make the evil broken pnpbios compensation slightly less evil.peter2000-01-051-15/+20
| | | | | | | This is the hack that compensates for when bios vendors "forget" to include the fdc control (0x3f7) port in their io port mappings. Instead of accessing ports outside of a range allocated to a handle, simply allocate the port directly. It even shows up in the probe..
* Patch up some of the evilness left over from the early newbus porting.peter2000-01-051-83/+134
| | | | | | | | | | In particular: - Don't leave resources allocated in the probe routine. Allocate them during probe and release them. Probe's job is to identify devices only. - Don't abuse the ivars pointer.. (!). Create real ivars and use the proper access system. (the bus_read_ivar method) - Don't add the children until attach() has successfully grabbed the hardware, otherwise there are potential leaks if attach fails.
OpenPOWER on IntegriCloud