summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc
Commit message (Collapse)AuthorAgeFilesLines
* Workaround some ACPI BIOSen which break the IO port into multiplenjl2004-02-151-1/+35
| | | | | | | | | | | | | resources. (Note that the correct range is 0x3f7,0x3f0-0x3f5.) Such devices will be detected as follows: fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> port 0x3f7,0x3f4-0x3f5,0x3f2-0x3f3,0x3f0-0x3f1 irq 6 drq 2 on acpi0 To do this, we find the minimum and maximum start addresses for the resources and use them as the base for the IO and control ports. Help from: jhb
* Look at the equipment list for amd64 as well as i386 for autodetectingpeter2003-10-231-2/+2
| | | | floppy drives in the absence of hints.
* Eliminate use bio_blkno.phk2003-10-181-16/+10
|
* Pick up softc from dev_t rathern than through newbus gymnastics.phk2003-09-171-11/+12
|
* Since it is static these days, there is no reason to uppercase thephk2003-09-171-4/+4
| | | | first letter of fdopen() to avoid nameclashing with other stuff.
* Disable the use of cloning use in floppy and CD drivers.phk2003-09-111-6/+6
| | | | | | | | | | This commit puts the relevant code snippets under #ifdef GONE_IN_5 (rather than #ifndef BURN_BRIDGES) thereby disabling the code now. The code wil be entirely removed before 5.2 unless we find reasons why this would be a bad idea. Approach suggested by: imp
* Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES.phk2003-09-051-3/+19
| | | | | | | | | | | For the floppy driver, use fdcontrol to manipulate density selection. For the CD drivers, the 'a' and 'c' suffix is without actual effect and any applications insisting on it can be satisfied with a symlink: ln -s /dev/cd0 /dev/cd0a Ongoing discussion may result in these pieces of code being removed before the 5-stable branch as opposed to after.
* - Use the new resource_disabled() helper function to see if devices arejhb2003-07-021-3/+2
| | | | | | | | | | | | disabled. - Change the apm driver to match the acpi driver's behavior by checking to see if the device is disabled in the identify routine instead of in the probe routine. This way if the device is disabled it is never created. Note that a few places (ips(4), Alpha SMP) used "disable" instead of "disabled" for their hint names, and these hints must be changed to "disabled". If this is a big problem, resource_disabled() can always be changed to honor both names.
* Force media autodetection if the device has lost its parameter table.yar2003-06-161-1/+7
| | | | | | | | | Previously, any normal I/O on an fdc(4) device would fail with ENXIO if the device had been opened in non-blocking mode and then closed prior to the conventional access; that would last until the floppy disk was ejected and re-inserted to raise the unit attention condition. Add a clarifying comment.
* If in non-blocking mode, return EAGAIN instead of ENXIOyar2003-06-161-1/+4
| | | | | | | on an I/O attempt. This is needed for consistency with the concept of the half-opened state of fdc(4). PR: kern/52338
* Always set bio_resid properly in fdstrategy(),yar2003-06-151-3/+2
| | | | | | | | | | as should every block device strategy routine. There was at least one evil consequence of not doing so: Some errors returned by fdstrategy() could be lost (EAGAIN, in particular.) PR: kern/52338 (in the audit-trail) Discussed with: bde
* Check whether the floppy type pointer has been set before tryingyar2003-06-151-0/+4
| | | | | | | | | | | | to access floppy parameters through it. Note: The DIOCGSECTORSIZE and DIOCGMEDIASIZE handlers withing fdioctl() couldn't be just moved to below the existing check for blocking mode because fd->ft can be non-NULL while still in non-blocking mode (fd->ft can be set with the FD_STYPE ioctl.) PR: kern/52338 No MFC: Not applicable to STABLE
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Remove unused variable.phk2003-05-311-2/+0
| | | | Found by: FlexeLint
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-011-1/+1
| | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate.
* Fix a malloc() with no legal modeflag.phk2003-03-171-1/+1
|
* Call devstat_start_transaction_bio() instead of devstat_start_transaction()phk2003-03-151-1/+1
|
* Allocate the devstat structure with devstat_new_entry().phk2003-03-081-6/+6
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+9
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Bail out of fd_clone() if the parsed unit number doesn't match ourjoerg2003-01-111-0/+3
| | | | | | | | | | expectation. This solves the problem, where in a constellation with two (or more) drives, an attempt is made to access a device name for that device using a historic partition letter, like /dev/fd1c. This is supposed to create a symlink to the master device, but previously, the link was always created to /dev/fd0, even if the request was for fd1*.
* Remove calls to cdevsw_add(), they are dreprecated on this branch now.phk2002-12-281-6/+0
|
* Capitalize the first letter of device descriptionsmux2002-11-111-2/+2
| | | | for consistency with the rest of the drivers.
* Fix a probably rare and inconsequential memory leak.phk2002-10-021-1/+3
| | | | Spotted by: FlexeLint
* Add support for DIOCGMEDIASIZE and DIOCGSECTORSIZE.phk2002-09-301-40/+9
| | | | | | Remove all traces of disklabel. Sponsored by: DARPA & NAI Labs.
* Prefix private BIO commands with "FD" so people get a hint that theyphk2002-09-301-11/+11
| | | | | | are in fact private. Sponsored by: DARPA & NAI Labs.
* Be consistent about "static" functions: if the function is markedphk2002-09-281-4/+4
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Make FreeBSD "struct disklabel" agnostic, step 311 of 723:phk2002-09-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Rename diskerr() to disk_err() for naming consistency. Drop the by now entirely useless struct disklabel argument. Add a flag argument for new-line termination. Fix a couple of printf-format-casts to %j instead of %l. Correctly print the name of all bio commands. Move the function from subr_disklabel.c to subr_disk.c, and from <sys/disklabel.h> to <sys/disk.h>. Use the new disk_err() throughout, #include <sys/disk.h> as needed. Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs. Remove unused disklabel members of softc for aac, amr and mlx, which seem to originally have been intended for diskerr() use, but which only rotted and got Copy&Pasted at least two times to many. Sponsored by: DARPA & NAI Labs.
* Suitably shrink a comment so it applies again.phk2002-09-151-5/+2
| | | | Submitted by: bde
* Fix a bug were a struct bio was freed and certain members subsequentlyphk2002-09-131-4/+3
| | | | examined. Use biowait() instead of DIY.
* Pass the physical instead of the logical block number injoerg2002-09-121-1/+1
| | | | | bp->bio_pblkno. Otherwise, all formats not using 512 byte physical sectors got screwed.
* After some comments from bde, rewrite the loops to avoid turning thejoerg2002-05-141-43/+29
| | | | | | | | | | | | | | | | | previously used "micro-optimization" (count-down loop) into a pessimization. Now the loops are written in the more natural count-up form. Also, while being there, i made the logic in out_fdc() similar to the logic in in_fdc(). The old implementation was a bit bogus anyway since it first tested the DIO bit and only afterwards the RQM bit. However, according to the description of the i82077, the DIO bit is only guaranteed to be valid once the RQM bit is set. Thus, the old implementatoin would have had the chance to misbehave on a controller that is implemented in accordance with the i82077 description (but is not bug-for-bug compatible). MFC after: 3 days
* style(9) changes before further editing that region:joerg2002-05-131-6/+7
| | | | | . add unnecessary parenthesis around return values . put body of an "if" statement onto a line of its own
* Hide the fd autoselection messages behind the bootverbose case so theyjoerg2002-05-121-3/+5
| | | | stop bothering people on their consoles.
* Increase the PIO timeout to approximately the value it used to havejoerg2002-05-122-15/+38
| | | | | | | | | | | | before rev 1.229 (~ 100 ms). According to bde, some (old) broken hardware could require it. In order to make timing more accurate than what could be achieved with a loop around DELAY(1), increase loop timing after the initial ~ 1 ms. Also, move the declaration of FDSTS_TIMEOUT out from fdreg.h into fd.c where it actually belongs to. MFC after: 2 days
* Change the PIO loops from a hard counter into a loop that calls DELAY()joerg2002-05-102-8/+26
| | | | | | | | | | | | in each cycle, with a tunable max cycle count defined in fdreg.h. This is said to fix the problem on some Compaq hardware (and perhaps on other machines using the Natsemi PC87317 chip) where the fdc(4) driver failed to operate at all. PR: kern/21397 Submitted by: Jung-uk Kim <jkim@niksun.com> MFC after: 3 days
* When reading a UFS-style label from a floppy, don't attempt to use ajoerg2002-04-021-1/+1
| | | | | | | | | "raw partition" of any kind since the floppy driver doesn't support UFS-style partitions at all. Reported by: "Crist J. Clark" <crist.clark@attbi.com> Reviewed by: bde MFC after: 3 days
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-4/+4
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Push BIO_FORMAT into a local hack inside the floppy drivers wherephk2002-03-261-0/+2
| | | | it belongs.
* Disksort will not "munge" requests, BIO_ORDERED or not, so removephk2002-02-221-4/+2
| | | | use of BIO_ORDERED.
* Change the test for _MACHINE_ARCH == i386 into #ifdef __i386__ since itjoerg2001-12-181-2/+8
| | | | | | otherwise breaks on the Alpha arch. I think this is wrong since i'd actually like to probe for a PC architecture, not for a particular CPU type. Anyway, now it's again the way it used to be.
* Remove PC98 code. This file is not used by PC98.nyan2001-12-161-17/+0
|
* Long promised major enhancement set for the floppy disk driver:joerg2001-12-152-282/+496
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . The main device node now supports automatic density selection for commonly used media densities. So you can stuff your 1.44 MB and 720 KB media into your drive and just access /dev/fd0, no questions asked. It's all that easy, isn't it? :) . Device density handling has been completely overhauled. The old way of hardwired kernel density knowledge is no longer there. Instead, the kernel now implements 16 subdevices per drive. The first subdevice uses automatic density selection, while the remaining 15 devices are freely programmable. They can be assigned an arbitrary name of the form /dev/fd[:digit]+.[:digit:]{1,4}, where the second number is meant to either implement device names that are mnemonic for their raw capacity (as it used to be), or they can alternatively be created as "anonymous" devices like fd0.1 through fd0.15, depending on the taste of the administrator. After creating a subdevice, it is initialized to the maximal native density of the respective drive type, so it needs to be customized for other densities by using fdcontrol(8). Pseudo-partition devices (fd0a through fd0h) are still supported as symlinks. . The old hack to use flags 0x1 to always assume drive 0 were there is no longer supported; this is now supposed to be done by wiring the devices down from the loader via device flags. On IA32 architectures, the first two drives are looked up in the CMOS configuration records though. On PCMCIA (i. e., the Y-E Data controller of the Toshiba Libretto), a single drive is always assumed. . Other specialities like disabling the FIFO and not probing the drive at boot-time are selected by per-controller or per-drive flags, too. . Unit attentions (media has been changed) are supposed to be detected now; density autoselection only occurs after a unit attention. (Can be turned off by a per-drive flag, this will cause each Fdopen() to perform the autoselection.) . FM floppies can be handled now (on controllers that actually support it -- not all do these days). . Fdopen() can be told to avoid density selection by setting O_NONBLOCK; this leaves the descriptor in a half-opened state where only a few ioctls are accepted. This is necessary to run fdformat on a device that uses automatic density selection (since you cannot autoselect on an unformatted medium, obviously). . Just differentiate between a plain old NE765 and the enhanced chips, but don't try more; the existing code was wrong and only misdetected the chips anyway. BUGS and TODOs: . All documentation update still needs to be done. . Formatting not-so-standard format yields unpredictable results; i have yet to figure out why this happens. "Standard" formats like 720 and 1440 KB do work, however. . rc scripts are needed to setup device nodes with nonstandard densities (like the old /dev/fdN.MMM we used to have). . Obtaining device flags from the kernel environment doesn't work yet, thus currently only drives that are present in (IA32) CMOS are really detected. Someone who knows the odds and ends about device flags is needed here, i can't figure out what i'm doing wrong. . 2.88 MB still needs to be done.
* 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.
OpenPOWER on IntegriCloud