summaryrefslogtreecommitdiffstats
path: root/sys/isa/fd.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-061-75/+26
| | | | | | | | | | | | | | | | | 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-281-1/+1
|
* 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-311-11/+16
| | | | | * 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
|
* Fixed reset handling for motor off resets. I first fixed this togetherbde1999-05-111-2/+3
| | | | | | | with other reset handling in rev.1.83 but broke it in rev.1.120. The breakage didn't seem to cause any problems even on the system which had problems ("extra" interrupts and botched handling thereof) before rev.1.83. It only affects multi-floppy systems anyway.
* Move the declaration of the interrupt type from the driver structuredfr1999-05-081-5/+3
| | | | to the BUS_SETUP_INTR call.
* GC unused #define id_physid id_scsiidpeter1999-05-081-7/+1
|
* Continue where Julian left off in July 1998:phk1999-05-071-2/+2
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-17/+2
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* remove b_proc from struct buf, it's (now) unused.phk1999-05-061-2/+1
| | | | Reviewed by: dillon, bde
* Disable FDC_YE - it's broken at present (breaking LINT) and awaiting somepeter1999-05-021-17/+26
| | | | | pccard fixups. Make DEVFS compile, it breaks LINT.
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-521/+618
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* Use reference counted PHOLD/PRELE rather than the P_PHYSIO flag.peter1999-04-061-3/+3
|
* Add a prioritization field to the devstat_add_entry() call so thatken1999-02-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peripheral drivers can determine where in the devstat(9) list they are inserted. This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change. This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc. The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table. Also, move the checkversion() call in vmstat(8) to a more logical place. Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here. Reviewed by: bde, obrien
* Update the pccard hooks to use a module style declaration instead.peter1999-01-191-11/+3
|
* Fixed corruption of the fd buffer queue. Once upon a time, the activebde1999-01-151-6/+13
| | | | | | | | | | buffer had to be left on the head of the queue for [bufq]disksort() to sort against. This isn't right for devices that can support multiple active i/o's, and only the fd driver did it. "Fixing" this in rev.1.36 of ufs_disksubr.c broke the fd driver in much the same way as rev.1.52 of <sys/buf.h> broke it (see rev.1.119). Bug reported and fix tested by: dt
* Pre 3.0 branch cleanup casualty #6: ftphk1998-12-271-82/+2
|
* Fixed LINT breakage in previous commit. Option FDC_YE enabled abde1998-12-141-6/+6
| | | | | syntax error. Options FDC_YE and DEVFS together enabled references to a nonexistent variable and calls of a nonexistent function.
* Add support for the YE-Data external PCMCIA floppy driver. Thisimp1998-12-121-7/+360
| | | | | | | | | | | | | | | | | floppy is used on the toshiba Libretto line of subnotebook computers. It differs from a normal floppy in that you must use PIO rather than DMA to transfer the data. To enable this, you must add options "FDC_YE" to your kernel. I don't have a machine that has a floppy and a pcmcia slot to test to make sure that this doesn't impact normal floppy units, so I've left this as an option. I have ported this to -current and made an attempt to ensure that the indentation conforms to style(9), aka the bruce filter. Reviewed by: nate, markm Submitted by: David Horwitt (dhorwitt@ucsd.edu)
* Rename one of the two devfs_link's to devfs_makelink.eivind1998-12-101-3/+3
|
OpenPOWER on IntegriCloud