summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Added following modes:kato1999-12-281-8/+21
| | | | | | | | | | | 5in HD 2 heads, 77 cylinders, 8 sectors/track, 1024 bytes/sector 5/3.5in DD 2 heads, 80 cylinders, 8 sectors/track, 512 bytes/sector Meanings of the rogrammer-readeble fd name were explained by Brian Fundakowski Feldman and Peter Wemm in hackers list and NOKUBI Hirotaka. Reviewed by: nyan
* Add a flag to disable FIFO probing. The code seems to have a chance ofjoerg1999-12-211-1/+3
| | | | | | | | | | | | | misdetecting FIFO capabilities, at least on my girlfriend's Thinkpad 755, the driver doesn't work using the FIFO. While i was at it, i (partially) fixed option FCC_YE since it would no longer have compiled at all under -current. I've also made an attempt to document the device driver flags value (ab-)used internally by this option. RELENG_3 candidate, but with a slightly different patch there (will go to jkh in email).
* Add a truely evil workaround (hack!) for some unfortunate BIOSpeter1999-12-061-6/+23
| | | | | | | | | | | programming practices. It seems that newer fdc chips have an alternative way of setting the transfer speed (including high speed modes for floppy tape) that doesn't use the control register (which we don't support - we use the old way only). So, they (the BIOS programmers) sometimes leave out the 0x3f6 control register from the PnP ports descriptor(!!). "Hey, it works with windows, so what's the problem?" :-( Anyway, this hack tries to compensate for that. This was discussed with dfr (who did the pnp attachment).
* Remove the 'ivars' arguement to device_add_child() andmdodd1999-12-031-1/+2
| | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr
* Tidy up a few loose ends in the fifo setup code.peter1999-11-181-20/+1
| | | | | | Don't use NFDC as an arbitary limit, it is not required and goes against using PnP fdc devices (eg: when PNPBIOS is turned on, the motherboard devices (sio, fdc, etc etc) are detected via PnP, not config(8).)
* Add code to support ISA PnP.dfr1999-11-111-43/+120
|
* Use cdevsw_add() (temporarily) to avoid DEV_DRIVER_MODULE(), since thepeter1999-11-081-1/+2
| | | | make_dev()'s that are there are not enough.
* 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
* Two more devstat_end_transaction() -> devstat_end_transaction_buf().phk1999-09-191-7/+1
|
* Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()phk1999-09-181-6/+1
|
* Removed diskerr()'s unused d_name arg and updated callers. This fixesbde1999-09-131-1/+1
| | | | | | warnings caused by the arg having the wrong type (not const enough). The arg was also wrong (a full name instead of a short one) for calls from from subr_diskmbr.c and pc98/diskslice_machdep.c.
* Changes to centralise the default blocksize behaviour.julian1999-09-091-3/+0
| | | | | | More likely to follow. Submitted by: phk@freebsd.org
* Change isa_get/set_flags() to device_get/set_flags().dfr1999-09-071-1/+1
|
* Cosmetic tweak. Collect the fdc methods together and apart from the fdpeter1999-09-031-44/+53
| | | | methods so it's a little easier to seperate the two when reading the code.
* Revert a bunch of contraversial changes by PHK. Afterjulian1999-09-031-0/+1
| | | | | | | | | | a quick think and discussion among various people some form of some of these changes will probably be recommitted. The reversion requested was requested by dg while discussions proceed. PHK has indicated that he can live with this, and it has been agreed that some form of some of these changes may return shortly after further discussion.
* Make bdev userland access work like cdev userland access unlessphk1999-08-301-1/+0
| | | | | | | | | | the highly non-recommended option ALLOW_BDEV_ACCESS is used. (bdev access is evil because you don't get write errors reported.) Kill si_bsize_best before it kills Matt :-) Use the specfs routines rather having cloned copies in devfs.
* Initialize dev->si_bsize*, the floppy driver doesn't use dsopen().phk1999-08-281-0/+3
|
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Add PHK's make_dev() into more places where DEVFS used to bejulian1999-08-271-1/+14
| | | | | | | | | hooked in directly. Alpha change checked by: Matthew Jacob <mjacob@feral.com> i4b ISDN changes checked by: Udo Schweigert <ust@cert.siemens.de> and Hellmuth Michaelis <hm@hcs.de> PC98 changes checked by: Takahashi Yoshihiro <nyan@FreeBSD.org>
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-119/+1
| | | | | | | | | | | | | | | | 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().
* Spring cleaning around strategy and disklabels/slices:phk1999-08-141-5/+4
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Revert rev 1.149. Bruce convinced me that the problem already disappearedjoerg1999-07-291-5/+1
| | | | by the fix in rev 1.120, which i wasn't immediately aware of.
* Alter the behavior of sys/kern/subr_bus.c:device_print_child()mdodd1999-07-291-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n" Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.) Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child()) The BUS_PRINT_CHILD method now returns int instead of void. Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes. - Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output. Reviewed by: dfr, peter
* Hack to work around a NULL pointer dereferencation that can be triggeredjoerg1999-07-211-1/+5
| | | | | | | | by removing a floppy that as being operated on. The spagghetti is hardly understandable at all anymore, so i can't 100 % ascertain this is really the Right Thing to do, maybe our new floppy driver maintainer, Jesus Monroy Jr can do this. :-))
* Remove cmaj and bmaj args from DEV_DRIVER_MODULE.phk1999-07-041-3/+2
|
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-2/+6
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* * Change include file locations.dfr1999-05-312-13/+18
| | | | | * Fix some misunderstandings about the return value of resource_int_value(). * Make it build on alpha (doesn't work yet...)
* This commit should be a extensive NO-OP:phk1999-05-301-8/+23
| | | | | | | | | | | | | 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.
* No support for pnp yet.dfr1999-05-301-2/+5
|
OpenPOWER on IntegriCloud