331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
299092 |
04-May-2016 |
jhb |
Fix the acpi attachment to always start the worker thread.
The previous change to split the worker thread start out of fdc_attach() did not start the worker thread if the fdc device in the ACPI namespace did not have an _FDE method. This fixes hangs when booting with a floppy controller enabled on certain machines with ACPI.
Tested by: joel
|
299051 |
04-May-2016 |
adrian |
s/struct device */device_t/g
Submitted by: kmacy
|
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
298426 |
21-Apr-2016 |
jhb |
Adjust the fdc worker thread startup to work when APs are started earlier.
- Enable the commented out locking in fd_probe(). The worker thread should not be running yet (even after these changes), but better to be safe than sorry. - Defer starting the worker thread until after the child drives have been probed. The worker thread startup is moved into a fdc_start_worker() thread that the various front ends call at the end of attach. As a side effect this fixes a few edge cases that weren't shutting down the worker thread if attach encountered a late failure. - When executing the initial reset requested by attach in the worker thread, use DELAY() instead of a tsleep() if cold is set.
Tested by: Howard Su <howard0su@gmail.com> Sponsored by: Netflix
|
297568 |
05-Apr-2016 |
jhb |
Don't wakeup the fdc worker thread once a second when idle.
The fdc worker thread was using a one second timeout while waiting for a new bio to arrive or for the device to detach. However, the driver already does a wakeup when queueing a new bio or asking the thread to detach, so the timeout only served to waste CPU time waking up the thread once a second just so it could go right back to sleep. Use an infinite timeout instead.
Discussed with: phk Sponsored by: Netflix
|
296590 |
10-Mar-2016 |
imp |
Add raw RX-50 support. These are 400k single sided disks with 80 tracks and 10 sectors per track. More exotic RX-50 types not supported, nor is there support for de-interleaving the first two tracks where the physical sectors are 0 1 2 3 4 5 6 7 8 9, but they should be interpreted as 0 5 1 6 2 7 3 8 4 9. This is purely to read the media with dd. The FAT that's on these disks won't work with msdosfs anyway.
|
296589 |
10-Mar-2016 |
imp |
Stop assuming that bio_cmd is a bit field.
Differential Revision: https://reviews.freebsd.org/D5587
|
296137 |
27-Feb-2016 |
jhibbits |
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API.
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370
|
295790 |
19-Feb-2016 |
jhibbits |
Replace several bus_alloc_resource() calls using default arguments with bus_alloc_resource_any()
Since these calls only use default arguments, bus_alloc_resource_any() is the right call.
Differential Revision: https://reviews.freebsd.org/D5306
|
292079 |
11-Dec-2015 |
imp |
Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO building block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number.
Differential Review: https://reviews.freebsd.org/D3461
|
272129 |
25-Sep-2014 |
jhb |
Merge the PC98 fdc(4) driver into the MI driver. While here, replace the magic numbers used with NE7CMD_SPECIFY with invocations of the NE7_SPEC_x() macros.
Approved by: nyan
|
254937 |
26-Aug-2013 |
joerg |
Reimplement the FDOPT_NOERROR feature that was kicked out in r134081.
It is needed for fdread(1) in order to be able to recover from CRC errors in the data field of a floppy sector (by returning the sector data that failed CRC, rather than inventing dummy data).
When closing the device, clear all transient device options.
MFC after: 1 week
|
254809 |
24-Aug-2013 |
joerg |
Do not use "Enable Implied Seek" on enhanced floppy controllers. This breaks the "2step" feature of the driver, e.g. in order to read 360 KiB media on a 1200 KiB drive.
As the only potential advantage of implied (vs. explicit) seeks is to minimize the software effort, yet our driver always contained the logic needed for explicit seeks, simply dropping implied seeks is the best solution without introducing risks for new bugs. There is no performance penalty, reading a 1440 KiB medium takes exactly the same time with both, implied or explicit seeks.
MFC after: 1 week
|
246128 |
30-Jan-2013 |
sbz |
Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by: cognet Approved by: cognet
|
243333 |
20-Nov-2012 |
jh |
- Don't pass geom and provider names as format strings. - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev().
Reviewed by: pjd
|
228471 |
13-Dec-2011 |
ed |
Replace `inline static' by `static inline'.
If I interpret the C standard correctly, the storage specifier should be placed before the inline keyword. While at it, replace __inline by inline in the files affected.
|
227309 |
07-Nov-2011 |
ed |
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
|
223624 |
28-Jun-2011 |
kevlo |
Remove duplicate header includes
|
218909 |
21-Feb-2011 |
brucec |
Fix typos - remove duplicate "the".
PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
|
208650 |
30-May-2010 |
jkim |
Fix a regression from r200554, which broke fdc(4) attachment to acpi(4). I removed too many lines and a wrong pointer was accidentally passed down.
Tested by: Scott Allendorf (scott-allendorf at uiowa dot edu), kib MFC after: 3 days
|
200554 |
14-Dec-2009 |
jkim |
Remove _FDE quirk handling as these quirks are automatically repaired by ACPICA layer since ACPICA 20091214.
|
199104 |
09-Nov-2009 |
rdivacky |
Make isa_dma functions MPSAFE by introducing its own private lock. These functions are selfcontained (ie. they touch only isa_dma.c static variables and hardware) so a private lock is sufficient to prevent races. This changes only i386/amd64 while there are also isa_dma functions for ia64/sparc64. Sparc64 are ones empty stubs and ia64 ones are unused as ia64 does not have isa (says marcel).
This patch removes explicit locking of Giant from a few drivers (there are some that requires this but lack ones - this patch fixes this) and also removes the need for implicit locking of Giant from attach routines where it's provided by newbus.
Approved by: ed (mentor, implicit) Reviewed by: jhb, attilio (glanced by) Tested by: Giovanni Trematerra <giovanni.trematerra gmail com> IA64 clue: marcel
|
198857 |
03-Nov-2009 |
jh |
fdc(4) module unload fixes:
- Tear down the interrupt handler before killing the worker thread. - Do geom withering as GEOM event to avoid acquiring the GEOM topology lock under Giant.
PR: kern/104079 Reviewed by: joerg Approved by: trasz (mentor)
|
198520 |
27-Oct-2009 |
jh |
Don't ignore the return value of g_modevent() in fdc_modevent().
Approved by: trasz (mentor)
|
197945 |
10-Oct-2009 |
trasz |
Orphaning provider with EXDEV seems weird; perhaps the author meant ENXIO here?
|
194891 |
24-Jun-2009 |
joerg |
With the fdc control device disappearing some 5 years ago, it is no longer useful for the FD_STYPE and FD_SOPTS ioctls to insist on being issued on a writable file descriptor. Otherwise, there's no longer a chance to set the drive type or options when a read-only medium is present in the drive, as there is no way to obtain a writable fd then.
|
193530 |
05-Jun-2009 |
jkim |
Import ACPICA 20090521.
|
185235 |
23-Nov-2008 |
imp |
Eliminate an unused variable reported by coverity
Submitted by: Ganbold
|
184976 |
15-Nov-2008 |
jkim |
- Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1]. - If the flag is set and auto-select fails, assume disk is not present. - Set disk empty flag only when the floppy controller reset is needed. It fixes regression introduced in r1.311, which prevented it from ignoring errors. Now fdformat(1) and dd(1) with conv=noerror option can continue when read/write errors occur as they should. - Do not retry disk probing as it is extremely slow and pointless. - Move the disk probing code into a separate function. - Do not reset disk empty flag if write-protect check fails somehow.
PR: kern/116538[1]
|
175230 |
11-Jan-2008 |
kib |
The wakeup() line from the rev. 1.319 is wrong and reintroduces a panic race on module unload. The wakeup() is internal to kproc_exit/kthread_exit. The correct fix is to fix the msleep() in detach to sleep on fdc->fdc_thread instead of &fdc->fdc_thread.
Noted and reviewed by: jhb Pointy hat to: kib MFC after: 1 week
|
175226 |
11-Jan-2008 |
kib |
Fix unload of the fdc.ko:
Wakeup the thread doing the fdc_detach() when the fdc worker thread exits [1]. Write access to the write-protected floppy shall call device_unbusy() to pair the device_busy() in the fd_access() [2].
PR: 116537 [1], 116539 [2] MFC after: 1 week
|
172836 |
20-Oct-2007 |
julian |
Rename the kthread_xxx (e.g. kthread_create()) calls to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first.
I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
|
167083 |
27-Feb-2007 |
jhb |
Always protect the kthread flags with the lock and close a race with module unload and kthread_exit().
MFC after: 3 days
|
166934 |
23-Feb-2007 |
jhb |
Use tsleep() rather than msleep() with a NULL mtx parameter.
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many Approved by: re@
|
164033 |
06-Nov-2006 |
rwatson |
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
|
162165 |
08-Sep-2006 |
jkim |
Fix style nits. No md5 changes in .o's. ;-)
|
161714 |
29-Aug-2006 |
jkim |
Restore Digital Outpur Register (DOR) for enhanced controller after reset.
|
160283 |
12-Jul-2006 |
jkim |
Assume floppy disk is not inserted when we have exhausted retries. This significantly reduces booting time when there is broken floppy disk drive, controller, cable, BIOS, etc. When the floppy controller interface is correctly implemented, disk change signal (DSKCHG) is reflected in the Digital Input Register (DIR) at 0x3f7. However, there are many cases that the signal is unusable. Moreover, some BIOS does not reserve the port at all. In those cases, the register may not function.
|
160137 |
06-Jul-2006 |
jkim |
Enhanced floppy controllers have Data Rate Select Register (DSR) at 0x3f4. Use it to reset controller and to select data rate. According to Intel 80277AA datasheet, software reset behaves the same as DOR reset except that it is self clearing. National Semiconductor PC8477B datasheet says the same. As a side effect, we no longer use Configuration Control Register (CCR) at 0x3f7 for these controllers, which is often missing in modern hardware.
|
155956 |
23-Feb-2006 |
jhb |
- Use callout_init_mtx() to initialize toffhandle callout using the fdc's mutex. - Don't use callout_drain() to stop the toffhandle callout while holding the fdc mutex (this could deadlock) in functions called from softclock (callouts aren't allowed to do voluntary sleeps). Instead, use callout_stop(). Note that since we hold the associated mutex and are now using callout_init_mtx(), callout_stop() is just as effective as callout_drain(). (Though callout_drain() is still needed in detach to make sure softclock isn't contesting on our mutex before we destroy the mutex.) - Remove unused callout 'tohandle' from softc.
MFC after: 1 week
|
155870 |
21-Feb-2006 |
njl |
Remove unused variable.
Coverity ID: 558 Found by: Coverity Prevent
|
150003 |
11-Sep-2005 |
obrien |
Canonize the include of acpi.h.
|
149650 |
30-Aug-2005 |
rodrigc |
FDOPT_NORETRY is an option, and must be compared with fd->options, not fd->flags.
PR: kern/85481 Submitted by: Lev Levinson <llevinson at inbox dot ru> MFC after: 1 day
|
147580 |
24-Jun-2005 |
imp |
Eliminate unused argument in PCMCIA_CARD macro.
Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments.
Approved by: re (dwhite)
|
143618 |
15-Mar-2005 |
imp |
If we fail a sanity check for the resources just allocated, make sure that we free that resource. All the other resources are freed in their own routine, but since we haven't saved a pointer to this one, it is leaked. This is the failure case that lead to the sio ports that weren't working, I think.
|
143602 |
14-Mar-2005 |
imp |
Only allocate 1 port for non-zero rids. Either we'll get the proper length form the enumeration mechanism, or we're dealing with the FDCTL register, which is only 1 port long.
|
143380 |
10-Mar-2005 |
imp |
Fix a couple of problems with the probe code when used with pnpbios resources. When allocating 6 ports for a 4 port range isa code returns an error. I'm not sure yet why this is the case, but suspect it is just a non-regularity in how the resource allocation code works which should be corrected. Use 1 as the ports size in this case. However, in the hints case, we have to specify the length, so use 6 in that case. I believe that this is also acpi friendly.
Also, complain when we can't allocate FDOUT register space. Right now we silently fail when we can't. This failure is referred to above.
When there's no resource for FDCTL, go ahead and allocate one by hand. Many PNPBIOS tables don't list this resource, and our hints mechanism also doesn't cover that range. If we can't allocate it, whine, but fake up something. Before, we were always bogusly faking it and no one noticed the sham (save the original author who has now fixed his private shame).
|
142791 |
28-Feb-2005 |
phk |
Add missing ()
|
142750 |
28-Feb-2005 |
yongari |
Add missing va_end() in fdc_cmd. 0 -> NULL in arguments of fdc_sense_int().
Reminded by: joerg
|
140514 |
20-Jan-2005 |
imp |
Mask off the upper bits of the resource before using it as an index into a small array. Also, re-save the dev in attach to avoid depending on side effects of the probe.
Weird stuff Reported by: jeffr
|
140469 |
19-Jan-2005 |
imp |
MFp4: overhaul of resource allocation
Rather than have a twisty maze of special case allocations, move instead to a data driven allocation. This should be the most robust way to cope with the resource problems that the multiplicity of ways of encoding 5 registers that have the misfortune of not being a power of 2 nor contiguous.
Also, make it less impossible that pccard will work. I've not been able to get my libretto floppy working, but it now fails later than before.
phk and I had similar ideas on this during the 5.3 release cycle, but it wasn't until recently that I could test more than one allocation scenario.
MFC After: 1 month (5.4 if possible, 5.5 if not)
|
140040 |
11-Jan-2005 |
imp |
Use the standard FreeBSD license
|
138732 |
12-Dec-2004 |
phk |
Pass the file->flags down to geom ioctl handlers.
Reject certain ioctls if write permission is not indicated.
Bump geom API version.
Reported by: Ruben de Groot <mail25@bzerk.org>
|
137973 |
21-Nov-2004 |
imp |
Properly wither the geom container on detach. This will allow one to then later reload fdc and not have duplicate fd devices in dev.
# Maybe this should be moved to a convenience function.
Reviewed by: phk
|
137398 |
08-Nov-2004 |
phk |
Add the last missing bits to make this unloadable: Two wakeups and calling of the GEOM modevent from the drivers modevent so we know the order things happen.
|
137068 |
30-Oct-2004 |
nyan |
Remove a duplicate code.
|
137044 |
29-Oct-2004 |
phk |
Now that filesystems respect and understand GEOM access counts, refuse a write open of a read-only floppydisk.
|
136787 |
22-Oct-2004 |
phk |
Properly handle failure to allocate isadma bounce buffer
|
136533 |
15-Oct-2004 |
njl |
Remove unused variable. Pointy hat candidate.
|
136520 |
14-Oct-2004 |
njl |
Remove local hacks to set flags now that the device probe does this for us. Tested on every device except sio_pci and the pc98 fd.c. Perhaps something similar should be done for the "disabled" hints also.
MFC after: 2 weeks
|
136360 |
10-Oct-2004 |
peadar |
Fix off-by-one error in fd_native_types that results in a panic on boot for machines with 2.88M floppies.
Reviewed By: phk
|
136138 |
05-Oct-2004 |
imp |
Yet another case of resources: + * 9: 0x3f0-0x3f3,0x3f4-0x3f5,0x3f7
This requires only one change to support. Rather than keying on the size of the resource being 2, instead key off the end & 7 being 3. This covers the same cases that the size of 2 would catch, but also covers the new above case.
In addition, I think it is clearer to use the end in preference to the size and start for case #8 as well. Turns two tests into one, and catches no other cases.
Make minor commentary changes to deal with new case #9.
# This change is specifically minimal to allow easy MFC. A more # extensive change will go into current once I've had a chance to test # it on a lot of hardware...
|
135938 |
29-Sep-2004 |
jhb |
Only fall back to probing the floppy drives via hints if there is a failure in the actual _FDE parsing. If the failure occurs earlier such as in fdc_attach() then don't try to probe any drives.
MFC after: 3 days Reviewed by: njl Tested by: Christian Laursen xi at borderworlds dot dk
|
135788 |
25-Sep-2004 |
phk |
Use the floppy drive unit number to name the /dev entry, not the controller unit number.
Submitted by: Rostislav Krasny <rosti_bsd@yahoo.com>
|
135766 |
24-Sep-2004 |
joerg |
Few (trailing) whitespace and spelling fixes.
|
135765 |
24-Sep-2004 |
joerg |
Protect fdc->flags within the worker thread, too.
Use kthread_exit() instead of falling through the end of the worker thread's main function. Since kthread_exit() wakeup(9)s everyone sleeping on the thread handle, drop the superfluous wakeup() call.
|
135736 |
24-Sep-2004 |
phk |
Lock the flags field with the mutex.
Improve a number of comments.
|
135638 |
23-Sep-2004 |
joerg |
Implement terminating the worker thread when the driver is about to be deregistered.
Not yet tested, since by now, GEOM doesn't want us to deregister. PHK wants to fix that RSN.
|
135504 |
20-Sep-2004 |
imp |
das@ has a ACPI bios that lists 0x3f0-0x3f1, 0x3f2-0x3f3, 0x3f4-0x3f5 and 0x3f7. fdc_isa_alloc_resource() didn't work right in this case (it accessed FDOUT correctly due to an overflow of the first resource. It accesed FDSTS and FDDATA incorrectly via the second resource (which wound up accessing FDOUT and the tape register at 0x3f3) and badly for the CTL register (at location 0x3f4). This is a minimal fix that just 'eats' the first one if it covers two locations and has an offset of 0. This confusion lead the floppy driver to think there'd been a disk change, which uncovered a deadlock in the floppy/geom code which lead to a panic. These changes fix that by fixing the underlying resource problem, but doesn't address the potential deadlock issue that might still be there.
This is a minimal fix so it can more safely be merged into 5 w/o risk for known working configurations (hence the use of the ugly goto, which reduces case 8 to case 6 w/o affecting cases 1-7). A more invasive fix that will handle more ACPI resource list diversity is in the pipeline that should kill these issues once and for all, while staying within the resources that we allocate.
Tested/Reported by: das Reviewed by: njl MFC before: re->next_release_name(5.3-BETA5);
|
135392 |
17-Sep-2004 |
imp |
The long dead hand of the past has pushed forward useless bits in this driver. Trim its fingernails by removing some useless bits before fixing the 'thread not terminated on detach' problem.
o dmacnt is no longer used now that we allocate at attach time. Remove it from struct fdc_data. o ISPNP was only ever set, but never tested. It used to be used for the allocation routines to change how it allocated resources. Since that's no longer necessary, retire the flag. o ISPCMICA was only ever tested, but never set. GC it. This removes a special case in determining the drive type. The drive type is now set in fdc_pcmcia.c, so the hack isn't needed anymore. Sadly, this isn't tested with a Y-E Data pcmcia floppy drive because there are a number of other issues that preclude it from working. o Fix ifdef for reading from the rtc. I'm of the opinion that this ifdef should be moved into fdc_isa.c, but not today as ideally there'd be other fixes to the probing of children. So now we just read it on i386 ! pc98 (there's no #define for MACHINE_ARCH, just MACHINE, hence this slightly inelegant kludge) and amd64. The PC98 exclusion likely isn't meaningful since pc98 uses a different driver, but will be when merging of the pc98 floppy code into this driver is complete (this is the other reason I think this block of code belongs outside fdc.c).
All of these changes are safe to MT5.
|
135355 |
17-Sep-2004 |
njl |
Handle _FDE results of 5 bytes (vs. 5 uint32_t's). BIOS vendors find yet another way to misinterpret the spec. Also, always fall back to the hints probe on any attach failure, not just when _FDE fails.
Thanks to imp and scottl for finding this.
Tested by: rwatson (minimally) MFC after: 5 days
|
135294 |
16-Sep-2004 |
imp |
default: case shouldn't set an error yet either.
|
135293 |
16-Sep-2004 |
imp |
Reserve the DMA memory at attach time, rather than at use. While reserving it at use time is more miserly, low memory (< 16MB) evaporates quickly on many systems, so there may not be any suitable buffers available. This specifically doesn't use the newer, fancier isa_dma_init to ease merging to 5.
Reviewed by: tegge, phk
|
135288 |
16-Sep-2004 |
imp |
For the moment, treat failures to attach floppy drives as non-fatal errors for the attachment process for the floppy controller. This is a band-aide because it doesn't try any of the fallback methods when _FDE isn't long enough, but should be sufficient for people experiencing the dreaded mutex not initialized panic.
|
135238 |
14-Sep-2004 |
imp |
Use bus_setup_intr in preference to BUS_SETUP_INTR.
|
135212 |
14-Sep-2004 |
imp |
Checkpoint the fdc resource changes:
o Allow for up to 3 resource I/O ranges to be given for the floppy controller, rather than just two that are allowed for now. o Make sure that we can work with either a base address of 0x3f0 or 0x3f2. o Create new inline functions to access the YE DATA's unique BDCR register. o Update pccard attachment to add the fd device. o Do some minor style(9) polishing.
# I'm guessing that the fdc pccard attachment broke some time ago, since # there are a number of issues with it still.
|
134580 |
31-Aug-2004 |
imp |
When ISA_PNP_PROBE is called, it will return 0 when it finds a device, ENOENT when there's no PNP ID for this device node, or ENXIO when there is one, but it doesn't match.
In the nonPNP case (as most Alpha systems appear to be), we were treating the error return as an error, when it should be have ignored it. Version 1.9 properly ignored it, but the attach re-write of 1.10 introduced this logic error.
Pointy Hat to: phk (for breaking it then asking me to fix it :-) Sponsored by: The Voices in Bill Paul's Head, LLC
|
134534 |
30-Aug-2004 |
njl |
Fix _FDI drive type probing. The new fd child is not an ACPI device while the old one is. Hence we need to evaluate the old one for _FDI since it has a valid ACPI_HANDLE ivar. This is a minimal fix. Make a note that a more complete one is to make fdc support the ACPI_HANDLE ivar for its children.
This and the previous change are MT5 candidates.
|
134533 |
30-Aug-2004 |
njl |
Fix _FDE probing by using the buffer contents instead of the buffer object itself. ACPI-CA returns an ACPI_OBJECT of type Buffer rather than the buffer contents itself.
|
134389 |
27-Aug-2004 |
phk |
Hide a printf under bootverbose.
|
134113 |
21-Aug-2004 |
phk |
Attempt to make the probe for hardware more specific.
|
134085 |
20-Aug-2004 |
njl |
Remove a check that is too strict. With BIOSen that specify an IO/ctl port of 0x3f2-0x3f5,0x3f7 the ports are not 7 bytes apart. This should fix floppy probing on such systems. (We handle the case of adjusting for a start of 0x3f2 -> 0x3f0 separately, although that code should still be checked if there are still floppy problems for others.)
Tested by: Sarunas Vancevicius <vsarunas_at_eircom.net> MFC after: 3 days
|
134082 |
20-Aug-2004 |
phk |
Remove unused file.
|
134081 |
20-Aug-2004 |
phk |
Rewrite of the floppy driver to make it MPsafe & GEOM friendly:
Centralize the fdctl_wr() function by adding the offset in the resource to the softc structure.
Bugfix: Read the drive-change signal from the correct place: same place as the ctl register.
Remove the cdevsw{} related code and implement a GEOM class.
Ditch the state-engine and park a thread on each controller to service the queue.
Make the interrupt FAST & MPSAFE since it is just a simple wakeup(9) call.
Rely on a per controller mutex to protect the bioqueues. Grab GEOMs topology lock when we have to and Giant when ISADMA needs it. Since all access to the hardware is isolated in the per controller thread, the rest of the driver is lock & Giant free.
Create a per-drive queue where requests are parked while the motor spins up. When the motor is running the requests are purged to the per controller queue. This allows requests to other drives to be serviced during spin-up.
Only setup the motor-off timeout when we finish the last request on the queue and cancel it when a new request arrives. This fixes the bug in the old code where the motor turned off while we were still retrying a request.
Make the "drive-change" work reliably. Probe the drive on first opens. Probe with a recal and a seek to cyl=1 to reset the drive change line and check again to see if we have a media.
When we see the media disappear we destroy the geom provider, create a new one, and flag that autodetection should happen next time we see a media (unless a specific format is configured).
Add sysctl tunables for a lot of drive related parameters. If you spend a lot of time waiting for floppies you can grab the i82078 pdf from Intels web-page and try tuning these.
Add sysctl debug.fdc.debugflags which will enable various kinds of debugging printfs.
Add central definitions of our well known floppy formats.
Simplify datastructures for autoselection of format and call the code at the right times.
Bugfix: Remove at least one piece of code which would have made 2.88M floppies not work.
Use implied seeks on enhanced controllers.
Use multisector transfers on all controllers. Increase ISADMA bounce buffers accordingly.
Fall back to single sector when retrying. Reset retry count on every successful transaction.
Sort functions in a more sensible order and generally tidy up a fair bit here and there.
Assorted related fixes and adjustments in userland utilities.
WORKAROUNDS: Do allow r/w opens of r/o media but refuse actual write operations. This is necessary until the p4::phk_bufwork branch gets integrated (This problem relates to remounting not reopening devices, see sys/*/*/${fs}_vfsops.c for details).
Keep PC98's private copy of the old floppy driver compiling and presumably working (see below).
TODO (planned)
Move probing of drives until after interrupts/timeouts work (like for ATA/SCSI drives).
TODO (unplanned)
This driver should be made to work on PC98 as well.
Test on YE-DATA PCMCIA floppy drive.
Fix 2.88M media.
This is a MT5 candidate (depends on the bioq_takefirst() addition).
|
133727 |
14-Aug-2004 |
phk |
Remove confused comment.
|
132810 |
28-Jul-2004 |
njl |
Fix ACPI floppy enumeration for three types of divergent behavior. * Some systems have _FDE and child floppy devices, but no _FDI. This seems to be compatible with the standard. Don't error out if there is no _FDI. Instead, continue on to the next device. The normal fd probe will take care of this device. * Some systems have _FDE but no child devices in AML. For these, add a second pass that compares the results of _FDE to the presence of devices. If not present, add the missing device. * Some BIOS authors didn't read the spec. They use tape drive values for all fdc(4) devices. Since this isn't grossly incompatible with the required boolean value, use them. They also define the _FDE items as a package instead of buffer. Regenerate the buffer from the package if it is present.
Tested by: tjr, marcel
|
132285 |
17-Jul-2004 |
nyan |
Correct typo.
|
132284 |
17-Jul-2004 |
nyan |
Remove duplicate include.
|
132271 |
16-Jul-2004 |
imp |
Be consistant with probe
|
132216 |
15-Jul-2004 |
njl |
Clean up resources properly if attach fails. Always reset ISA drives on probe.
|
132215 |
15-Jul-2004 |
njl |
Re-work for fdc_acpi. Expose fdc_add_child() and move the static hints-based probe to fdc_hints_probe().
Also: * Fix some resource leaks when attach fails. * Remove the FDC_ATTACHED flag. It was supposed to prevent multiple unloads but this is not necessary.
|
132214 |
15-Jul-2004 |
njl |
Add an ACPI floppy drive attachment that probes via the _FDE and _FDI methods. It also now handles ordinary floppy drive probing for drives attached to ACPI.
Reviewed by: imp
|
132166 |
14-Jul-2004 |
njl |
Add a comment separator.
|
132139 |
14-Jul-2004 |
imp |
Remove fdc_alloc_resources, which should have happened in last commit.
|
132137 |
14-Jul-2004 |
imp |
Fix the pccard attachment to have a chance of working. Move the resource allocation into the bus front ends.
|
132081 |
13-Jul-2004 |
imp |
Set fdc_dev in attach
|
132080 |
13-Jul-2004 |
imp |
Don't depend on implicit include of machine/bus.h in sys/rman.h, but instead explicitly include it.
|
132050 |
12-Jul-2004 |
njl |
Remove unnecessary softc bzero calls.
|
132048 |
12-Jul-2004 |
njl |
Update in preparation for adding the ACPI attachment. * Add an fdtype ivar. This will be the equivalent of fd->type. * Move enabling the FIFO to the end of attach. * Unify reset code into fdc_initial_reset(). * Add fdc_write_ivar(). * Update isa and pccard attachments accordingly. * Set the flags unconditionally in probe since they may be overridden by other probe routines. Both before and now, we're depending on probe being called a final time on the winning driver so the flags we get are the ones we intended. * Use the bus accessor macros instead of defining our own. * Remove duplicate assigns of fd->type.
|
131983 |
11-Jul-2004 |
imp |
Until I'm ready to commit the better pccard probe/attach routines, effectively comment them out.
|
131767 |
07-Jul-2004 |
imp |
Break out the isa and pccard front ends from fdc. This is the first step in making this driver more attachment neutral. Others plan on adding acpi front ends.
Still need to cleanup the MI part of the driver because it isn't as bus independent as it could be.
|
131648 |
05-Jul-2004 |
phk |
Allocate the DMA channel shareable and only aquire it while the device is open. This allows certain old and rather special dual floppy controllers to work on both channels, as long as you only have one open at a time.
|
131599 |
04-Jul-2004 |
phk |
Mark our interrupt shareable and don't insist on DMA. This gets us closer to working with a secondary floppy controller on a PC.
|
130585 |
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
129787 |
27-May-2004 |
imp |
Use rman_get_start in preference to reaching into the rman structure.
|
129316 |
17-May-2004 |
imp |
Update to reflect new location in the tree. This has been repo copied from sys/isa/fd.c in preparation for specialization of attachments for different busses.
|
128632 |
25-Apr-2004 |
bde |
Fixed breakage of the formatting operation in rev.1.266. The wrong clause of an if-else statement was removed.
Reviewed by: no response from maintainer in 12 days
|
128019 |
07-Apr-2004 |
imp |
Remove advertising clause from University of California Regent's license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson.
Approved by: core, peter, alc, rwatson
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126400 |
29-Feb-2004 |
phk |
Remove unused FDNUMTOUNIT() macro
|
126232 |
25-Feb-2004 |
phk |
Make mode setting with fdcontrol(8) stick.
Recognize when configured for "auto".
|
126080 |
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
126076 |
21-Feb-2004 |
phk |
Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.
A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
|
125851 |
15-Feb-2004 |
njl |
Workaround some ACPI BIOSen which break the IO port into multiple 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
|
121403 |
23-Oct-2003 |
peter |
Look at the equipment list for amd64 as well as i386 for autodetecting floppy drives in the absence of hints.
|
121215 |
18-Oct-2003 |
phk |
Eliminate use bio_blkno.
|
120154 |
17-Sep-2003 |
phk |
Pick up softc from dev_t rathern than through newbus gymnastics.
|
120153 |
17-Sep-2003 |
phk |
Since it is static these days, there is no reason to uppercase the first letter of fdopen() to avoid nameclashing with other stuff.
|
119994 |
11-Sep-2003 |
phk |
Disable the use of cloning use in floppy and CD drivers.
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
|
119761 |
05-Sep-2003 |
phk |
Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES.
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.
|
117167 |
02-Jul-2003 |
jhb |
- Use the new resource_disabled() helper function to see if devices are 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.
|
116434 |
16-Jun-2003 |
yar |
Force media autodetection if the device has lost its parameter table. 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.
|
116432 |
16-Jun-2003 |
yar |
If in non-blocking mode, return EAGAIN instead of ENXIO on an I/O attempt. This is needed for consistency with the concept of the half-opened state of fdc(4).
PR: kern/52338
|
116408 |
15-Jun-2003 |
yar |
Always set bio_resid properly in fdstrategy(), 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
|
116407 |
15-Jun-2003 |
yar |
Check whether the floppy type pointer has been set before trying 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
|
116181 |
11-Jun-2003 |
obrien |
Use __FBSDID().
|
115485 |
31-May-2003 |
phk |
Remove unused variable.
Found by: FlexeLint
|
112946 |
01-Apr-2003 |
phk |
Use bioq_flush() to drain a bio queue with a specific error code. 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.
|
112334 |
17-Mar-2003 |
phk |
Fix a malloc() with no legal modeflag.
|
112260 |
15-Mar-2003 |
phk |
Call devstat_start_transaction_bio() instead of devstat_start_transaction()
|
112004 |
08-Mar-2003 |
phk |
Allocate the devstat structure with devstat_new_entry().
|
111815 |
03-Mar-2003 |
phk |
Gigacommit to improve device-driver source compatibility between 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)
|
109116 |
11-Jan-2003 |
joerg |
Bail out of fd_clone() if the parsed unit number doesn't match our 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*.
|
108362 |
28-Dec-2002 |
phk |
Remove calls to cdevsw_add(), they are dreprecated on this branch now.
|
106780 |
11-Nov-2002 |
mux |
Capitalize the first letter of device descriptions for consistency with the rest of the drivers.
|
104386 |
02-Oct-2002 |
phk |
Fix a probably rare and inconsequential memory leak.
Spotted by: FlexeLint
|
104211 |
30-Sep-2002 |
phk |
Add support for DIOCGMEDIASIZE and DIOCGSECTORSIZE. Remove all traces of disklabel.
Sponsored by: DARPA & NAI Labs.
|
104209 |
30-Sep-2002 |
phk |
Prefix private BIO commands with "FD" so people get a hint that they are in fact private.
Sponsored by: DARPA & NAI Labs.
|
104094 |
28-Sep-2002 |
phk |
Be consistent about "static" functions: if the function is marked static in its prototype, mark it static at the definition too.
Inspired by: FlexeLint warning #512
|
103675 |
20-Sep-2002 |
phk |
Make FreeBSD "struct disklabel" agnostic, step 311 of 723:
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.
|
103359 |
15-Sep-2002 |
phk |
Suitably shrink a comment so it applies again.
Submitted by: bde
|
103282 |
13-Sep-2002 |
phk |
Fix a bug were a struct bio was freed and certain members subsequently examined. Use biowait() instead of DIY.
|
103265 |
12-Sep-2002 |
joerg |
Pass the physical instead of the logical block number in bp->bio_pblkno. Otherwise, all formats not using 512 byte physical sectors got screwed.
|
96611 |
14-May-2002 |
joerg |
After some comments from bde, rewrite the loops to avoid turning the 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
|
96510 |
13-May-2002 |
joerg |
style(9) changes before further editing that region:
. add unnecessary parenthesis around return values . put body of an "if" statement onto a line of its own
|
96465 |
12-May-2002 |
joerg |
Hide the fd autoselection messages behind the bootverbose case so they stop bothering people on their consoles.
|
96459 |
12-May-2002 |
joerg |
Increase the PIO timeout to approximately the value it used to have 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
|
96361 |
10-May-2002 |
joerg |
Change the PIO loops from a hard counter into a loop that calls DELAY() 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
|
93689 |
02-Apr-2002 |
joerg |
When reading a UFS-style label from a floppy, don't attempt to use a "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
|
93593 |
01-Apr-2002 |
jhb |
Change the suser() API to take advantage of td_ucred as well as do a 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@
|
93238 |
26-Mar-2002 |
phk |
Push BIO_FORMAT into a local hack inside the floppy drivers where it belongs.
|
91061 |
22-Feb-2002 |
phk |
Disksort will not "munge" requests, BIO_ORDERED or not, so remove use of BIO_ORDERED.
|
88151 |
18-Dec-2001 |
joerg |
Change the test for _MACHINE_ARCH == i386 into #ifdef __i386__ since it 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.
|
88008 |
16-Dec-2001 |
nyan |
Remove PC98 code. This file is not used by PC98.
|
87992 |
15-Dec-2001 |
joerg |
Long promised major enhancement set for the floppy disk driver:
. 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.
|
83366 |
12-Sep-2001 |
julian |
KSE Milestone 2 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
|
82555 |
30-Aug-2001 |
msmith |
Add ACPI attachments.
|
79730 |
14-Jul-2001 |
joerg |
Hrmpf. nyan's rev 1.25 commit to fdc.h crossed with my removal of it. Back-integrate his (PC98) changes into fd.c.
|
79729 |
14-Jul-2001 |
joerg |
Yet another large non-function change.
. 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.
|
79491 |
09-Jul-2001 |
joerg |
Log when the user is turning debugging on/off. Also sanitize the TRACE* macros a bit so they syntactically behave like single C statements (even inside in `if' statement).
Submitted by: des
|
79490 |
09-Jul-2001 |
joerg |
Hmpf, remove two variables that got unused by rev 1.214.
|
79489 |
09-Jul-2001 |
joerg |
Ouch, calculate correctly. With 300 rpm and 25 retries, it's 5 seconds till timeout.
|
79488 |
09-Jul-2001 |
joerg |
Remove parts of rev 1.211 again: do not delete our children iff they 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.
|
79487 |
09-Jul-2001 |
joerg |
As des' example shows us, DMA overruns could happen in a situation 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
|
79431 |
08-Jul-2001 |
joerg |
Another large patchset from Bruce.
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)
|
79254 |
04-Jul-2001 |
joerg |
More cleanup when detaching. Clone device entries will now be 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.
|
78971 |
29-Jun-2001 |
joerg |
Use the new-born BIO_CMD1 instead of fudging a bio_flag value for reading 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())
|
78955 |
29-Jun-2001 |
joerg |
This change slipped through hidden in a CVS conflict. Logically belongs to the previous commit (fix resource deallocation).
|
78953 |
29-Jun-2001 |
joerg |
First stab at fixing resource deallocation, and implementing fdc(4) as 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>
|
78927 |
28-Jun-2001 |
joerg |
Merge in parts of a larger patchset i received from Bruce. Untested 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
|
78856 |
26-Jun-2001 |
joerg |
Implement a new ioctl command for floppies: FD_READID
Reads one sector ID field from a given track. Useful for analyzing floppies.
|
78854 |
26-Jun-2001 |
joerg |
Some more cosmetics: kill another couple of K&R function definitions that survived from old days, fix style of return type in fdcpio(), kill old Emacs hints that are no longer working that way anyway.
|
78514 |
20-Jun-2001 |
joerg |
Cosmetics:
. 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
|
78135 |
12-Jun-2001 |
peter |
Hints overhaul: - 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.
|
78058 |
11-Jun-2001 |
joerg |
Cosmetics:
. 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)
|
77800 |
06-Jun-2001 |
joerg |
Nuke the various poorly maintained copies of ioctl_fd.h. The file is not machine-dependant, thus it has been moved out (repo-copied) into <sys/fdcio.h>.
|
77788 |
05-Jun-2001 |
joerg |
Make the FDC (state machine) state an enum, as opposed to an int abusing a bunch of #defines, for clarity and better debugging support.
|
77726 |
04-Jun-2001 |
joerg |
Move out the files from src/sys/isa/ic/ to src/sys/dev/ic/, so they 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).
|
77663 |
03-Jun-2001 |
joerg |
Fix my email address. I accidentally cut'npasted the wrong (old) hostname laste time.
|
77167 |
25-May-2001 |
phk |
Don't lie to diskerr() now that it listens to us.
|
76588 |
14-May-2001 |
joerg |
Implement a few more floppy ioctl commands and IO options, namely:
. 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.)
|
76322 |
06-May-2001 |
phk |
Actually biofinish(struct bio *, struct devstat *, int error) is more general than the bioerror().
Most of this patch is generated by scripts.
|
76166 |
01-May-2001 |
markm |
Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 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)
|
74810 |
26-Mar-2001 |
phk |
Send the remains (such as I have located) of "block major numbers" to the bit-bucket.
|
73381 |
03-Mar-2001 |
markm |
Harvest interrupt entropy off the floppy disk controller.
|
69781 |
08-Dec-2000 |
dwmalone |
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
|
69210 |
26-Nov-2000 |
phk |
Make diskerr() always log with printf.
|
67153 |
15-Oct-2000 |
peter |
Untangle some resource matching loops that were getting on my nerves and seemed to be getting cut/pasted to places they shouldn't be.
|
65374 |
02-Sep-2000 |
phk |
Avoid the modules madness I inadvertently introduced by making the 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.
|
64880 |
20-Aug-2000 |
phk |
Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)
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
|
64453 |
09-Aug-2000 |
n_hibma |
Avoid a '"fd" is usurping ...' message.
PR: 20348 Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
|
63982 |
28-Jul-2000 |
peter |
Fix a warning re: a potentially unused pccard helper function
|
60073 |
06-May-2000 |
phk |
Step down a level and issue format requests with a struct bio instead of a struct buf.
|
60041 |
05-May-2000 |
phk |
Separate the struct bio related stuff out of <sys/buf.h> into <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
|
59783 |
30-Apr-2000 |
bde |
Fixed the type of some ivar access functions. Ivars have type uintptr_t, 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().
|
59249 |
15-Apr-2000 |
phk |
Complete the bio/buf divorce for all code below devfs::strategy
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
|
58934 |
02-Apr-2000 |
phk |
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(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.
|
58575 |
25-Mar-2000 |
phk |
Fix floppy driver after my isadma changes.
|
58349 |
20-Mar-2000 |
phk |
Rename the existing BUF_STRATEGY() to DEV_STRATEGY()
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.
|
58345 |
20-Mar-2000 |
phk |
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new 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.
|
58240 |
18-Mar-2000 |
joerg |
Make the Y-E Data PCMCIA floppy of the Toshiba Libretto work under -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?
|
55591 |
08-Jan-2000 |
peter |
Futher cleanup.. "device_print_prettyname(); printf()" -> device_printf() 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
|
55498 |
06-Jan-2000 |
imp |
Merge most of FDC_YE into the mainline driver. 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>
|
55471 |
05-Jan-2000 |
peter |
Make the evil broken pnpbios compensation slightly less evil. 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..
|
55462 |
05-Jan-2000 |
peter |
Patch up some of the evilness left over from the early newbus porting. 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.
|
55177 |
28-Dec-1999 |
kato |
Added following modes: 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
|
54939 |
21-Dec-1999 |
joerg |
Add a flag to disable FIFO probing. The code seems to have a chance of 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).
|
54195 |
06-Dec-1999 |
peter |
Add a truely evil workaround (hack!) for some unfortunate BIOS 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).
|
54073 |
03-Dec-1999 |
mdodd |
Remove the 'ivars' arguement to device_add_child() and 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
|
53328 |
18-Nov-1999 |
peter |
Tidy up a few loose ends in the fifo setup code. 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).)
|
53091 |
11-Nov-1999 |
dfr |
Add code to support ISA PnP.
|
52998 |
08-Nov-1999 |
peter |
Use cdevsw_add() (temporarily) to avoid DEV_DRIVER_MODULE(), since the make_dev()'s that are there are not enough.
|
51658 |
25-Sep-1999 |
phk |
Remove five now unused fields from struct cdevsw. They should never 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
|
51413 |
19-Sep-1999 |
phk |
Two more devstat_end_transaction() -> devstat_end_transaction_buf().
|
51376 |
18-Sep-1999 |
phk |
Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()
|
51226 |
13-Sep-1999 |
bde |
Removed diskerr()'s unused d_name arg and updated callers. This fixes 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.
|
51111 |
09-Sep-1999 |
julian |
Changes to centralise the default blocksize behaviour. More likely to follow.
Submitted by: phk@freebsd.org
|
51052 |
07-Sep-1999 |
dfr |
Change isa_get/set_flags() to device_get/set_flags().
|
50843 |
03-Sep-1999 |
peter |
Cosmetic tweak. Collect the fdc methods together and apart from the fd methods so it's a little easier to seperate the two when reading the code.
|
50830 |
03-Sep-1999 |
julian |
Revert a bunch of contraversial changes by PHK. After 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.
|
50623 |
30-Aug-1999 |
phk |
Make bdev userland access work like cdev userland access unless 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.
|
50498 |
28-Aug-1999 |
phk |
Initialize dev->si_bsize*, the floppy driver doesn't use dsopen().
|
50477 |
28-Aug-1999 |
peter |
$Id$ -> $FreeBSD$
|
50436 |
27-Aug-1999 |
julian |
Add PHK's make_dev() into more places where DEVFS used to be 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>
|
50254 |
23-Aug-1999 |
phk |
Convert DEVFS hooks in (most) drivers to make_dev().
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().
|
49771 |
14-Aug-1999 |
phk |
Spring cleaning around strategy and disklabels/slices:
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.
|
49215 |
29-Jul-1999 |
joerg |
Revert rev 1.149. Bruce convinced me that the problem already disappeared by the fix in rev 1.120, which i wasn't immediately aware of.
|
49195 |
29-Jul-1999 |
mdodd |
Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- 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
|
48959 |
21-Jul-1999 |
joerg |
Hack to work around a NULL pointer dereferencation that can be triggered 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. :-))
|
48557 |
04-Jul-1999 |
phk |
Remove cmaj and bmaj args from DEV_DRIVER_MODULE.
|
48225 |
26-Jun-1999 |
mckusick |
Convert buffer locking from using the B_BUSY and B_WANTED flags to using 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.
|
47643 |
31-May-1999 |
dfr |
* Change include file locations. * Fix some misunderstandings about the return value of resource_int_value(). * Make it build on alpha (doesn't work yet...)
|
47625 |
30-May-1999 |
phk |
This commit should be a extensive NO-OP:
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.
|
47618 |
30-May-1999 |
dfr |
No support for pnp yet.
|
46965 |
11-May-1999 |
bde |
Fixed reset handling for motor off resets. I first fixed this together 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.
|
46743 |
08-May-1999 |
dfr |
Move the declaration of the interrupt type from the driver structure to the BUS_SETUP_INTR call.
|
46716 |
08-May-1999 |
peter |
GC unused #define id_physid id_scsiid
|
46635 |
07-May-1999 |
phk |
Continue where Julian left off in July 1998:
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.)
|
46625 |
07-May-1999 |
phk |
Introduce two functions: physread() and physwrite() and use these directly in *devsw[] rather than the 46 local copies of the same functions.
(grog will do the same for vinum when he has time)
|
46580 |
06-May-1999 |
phk |
remove b_proc from struct buf, it's (now) unused.
Reviewed by: dillon, bde
|
46333 |
02-May-1999 |
peter |
Disable FDC_YE - it's broken at present (breaking LINT) and awaiting some pccard fixups. Make DEVFS compile, it breaks LINT.
|
46112 |
27-Apr-1999 |
phk |
Suser() simplification:
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.
|
45720 |
16-Apr-1999 |
peter |
Bring the 'new-bus' to the i386. This extensively changes the way the 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
|
45360 |
06-Apr-1999 |
peter |
Use reference counted PHOLD/PRELE rather than the P_PHYSIO flag.
|
43819 |
10-Feb-1999 |
ken |
Add a prioritization field to the devstat_add_entry() call so that 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
|
42820 |
19-Jan-1999 |
peter |
Update the pccard hooks to use a module style declaration instead.
|
42690 |
15-Jan-1999 |
bde |
Fixed corruption of the fd buffer queue. Once upon a time, the active 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
|
42083 |
27-Dec-1998 |
phk |
Pre 3.0 branch cleanup casualty #6: ft
|
41788 |
14-Dec-1998 |
bde |
Fixed LINT breakage in previous commit. Option FDC_YE enabled a syntax error. Options FDC_YE and DEVFS together enabled references to a nonexistent variable and calls of a nonexistent function.
|
41693 |
12-Dec-1998 |
imp |
Add support for the YE-Data external PCMCIA floppy driver. This 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)
|
41658 |
10-Dec-1998 |
eivind |
Rename one of the two devfs_link's to devfs_makelink.
|
41591 |
07-Dec-1998 |
archie |
The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static and local variables, goto labels, and functions declared but not defined.
|
41514 |
04-Dec-1998 |
archie |
Examine all occurrences of sprintf(), strcat(), and str[n]cpy() for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc.
These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer.
Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
|
40565 |
22-Oct-1998 |
bde |
Initialize isa_devtab entries for interrupt handlers in individual device drivers, not in ioconf.c. Use a different hack in isa_device.h so that a new config(8) is not required yet.
pc98 parts approved by: kato
|
39312 |
15-Sep-1998 |
gibbs |
Nuke uninitialized varible fd from retrier(). Change the devstat code to reference fdc->fd instead.
|
39228 |
15-Sep-1998 |
gibbs |
Update system to new device statistics code.
Submitted by: "Kenneth D. Merry" <ken@plutotech.com> mike@smith.net.au (Mike Smith)
|
39187 |
14-Sep-1998 |
sos |
Remove the SLICE code. This clearly needs alot more thought, and we dont need this to hunt us down in 3.0-RELEASE.
|
37945 |
29-Jul-1998 |
bde |
Fixed error handling: - 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.
|
37733 |
18-Jul-1998 |
bde |
Fixed error handling after a seek error that can't happen. When the 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.
|
37677 |
15-Jul-1998 |
bde |
The ioctl request arg is unsigned long, so don't attempt to pass it around as signed int.
|
37616 |
13-Jul-1998 |
julian |
SLICE probing becomes asynchronous. It can now be triggered by 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..
|
37554 |
11-Jul-1998 |
bde |
Don't pretend to support ix86's with 7-bit ints by using longs just to ensure 8-bit variables. Doing so mainly bogotified some printf formats.
|
37389 |
04-Jul-1998 |
julian |
There is no such thing any more as "struct bdevsw".
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.
|
36738 |
07-Jun-1998 |
dfr |
Fix some more ioctls which I missed becausese they were hidden by options which were not in LINT.
|
36735 |
07-Jun-1998 |
dfr |
This commit fixes various 64bit portability problems required for 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.
|
35815 |
06-May-1998 |
julian |
There is no dump routine for fd so give it an explicit NULL entry in the SLICE table.
|
35812 |
06-May-1998 |
julian |
Add dump support to the DEVFS/slice code. now we can actually catch our crashes :-)
Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
|
35386 |
22-Apr-1998 |
julian |
close() is no longer a SLICE method. 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)
|
35319 |
19-Apr-1998 |
julian |
Add changes and code to implement a functional DEVFS. 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.
|
35256 |
17-Apr-1998 |
des |
Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.
|
32726 |
24-Jan-1998 |
eivind |
Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.
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.
|
31493 |
02-Dec-1997 |
phk |
In all such uses of struct buf: 's/b_un.b_addr/b_data/g'
|
30574 |
19-Oct-1997 |
joerg |
Introduce a device flags value of 0x1 to always pretend a 1.44 MB 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.
|
29752 |
23-Sep-1997 |
gibbs |
Fix a call to timeout that wasn't properly saving it's callout handle.
Submitted by: durian@plutotech.com
|
29677 |
21-Sep-1997 |
gibbs |
aha1542.c aic6360.c cy.c fd.c ft.c 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.
|
29543 |
17-Sep-1997 |
tegge |
Enable the FIFO on enhanced floppy controllers. This reduces the 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)
|
29494 |
16-Sep-1997 |
joerg |
Make FDC_DEBUG a supported option.
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.
|
27555 |
20-Jul-1997 |
bde |
Removed unused #includes.
|
24203 |
24-Mar-1997 |
bde |
Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
|
24131 |
23-Mar-1997 |
bde |
Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined. Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
|
22975 |
22-Feb-1997 |
peter |
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not ready for it yet.
|
22521 |
10-Feb-1997 |
dyson |
This is the kernel Lite/2 commit. There are some requisite userland 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>
|
21673 |
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
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.
|
20647 |
18-Dec-1996 |
bde |
Disabled half-baked disk statistics support. It didn't actually generate statistics, so it just wasted scarce disk table slots and screen space.
|
19341 |
02-Nov-1996 |
joerg |
Fix the broken EOF handling in the floppy driver. The most obvious 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.
|
18084 |
06-Sep-1996 |
phk |
Remove devconf, it never grew up to be of any use.
|
17264 |
23-Jul-1996 |
phk |
Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
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 :-)
|
17122 |
12-Jul-1996 |
bde |
Staticized a few variables.
Fixed warnings about unused variables.
|
15580 |
03-May-1996 |
phk |
Typo.
|
15574 |
03-May-1996 |
phk |
Move from the old buf.b_actf to the new TAILQ(buf.b_act).
|
15148 |
08-Apr-1996 |
smpatel |
Update drivers to use isa_dma_acquire() and isa_dma_release()
Reviewed by: bde
|
15116 |
07-Apr-1996 |
bde |
Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose being declared in the wrong place.
|
15108 |
07-Apr-1996 |
bde |
Fixed devfs device names and numbers.
Fixed handling of unknown CMOS types - don't attach unrecognized devices.
|
14992 |
02-Apr-1996 |
scrappy |
changed from using dev_link() to devfs_link()
|
14955 |
31-Mar-1996 |
joerg |
Fetch the (dummy) READY CHANGED condition interrupt stati that happen after an FDC reset.
Submitted by: bde
|
14906 |
29-Mar-1996 |
bde |
Fixed group of some more disk devices.
Fixed devfs function names.
|
14873 |
28-Mar-1996 |
scrappy |
Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by: julian@freebsd.org
|
14254 |
25-Feb-1996 |
bde |
Don't turn off the motor on active drives. The motor timeout may occur while a command is in progress if the system is overloaded or was stopped at a debugger breakpoint.
|
13647 |
27-Jan-1996 |
bde |
First attempt at creating devfs entries for sliced devices. Doesn't 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.
|
13646 |
27-Jan-1996 |
bde |
Allocate DMA bounce buffers only when requested by drivers. Only the 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.
|
12736 |
10-Dec-1995 |
bde |
Replaced nxdump by nodump (if the dump function gets called, then the device must be configured, so ENXIO is a bogus errno).
Replaced zerosize by nopsize. zerosize was a temporary alias.
|
12724 |
10-Dec-1995 |
phk |
Staticize and cleanup.
|
12691 |
09-Dec-1995 |
julian |
clean a few DEVFS things.. 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?
|
12678 |
08-Dec-1995 |
phk |
Julian forgot to make the *devsw structures static.
|
12675 |
08-Dec-1995 |
julian |
Pass 3 of the great devsw changes 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.. :)
|
12502 |
28-Nov-1995 |
julian |
the second set of changes in a move towards getting devices to be 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 */
|
12429 |
20-Nov-1995 |
phk |
Mega commit for sysctl. 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.
|
12359 |
18-Nov-1995 |
bde |
Fixed (nonexistent) initialization of bp->b_pblkno. disksort() for floppies must have been random in 2.x since we reintroduced sorting on b_pblkno on 1995/03/18. Drivers still initialize b_cylin/b_resid although this is no longer used.
Removed unused, wrong function fdsize(). (Returning 0 means that the device exists and has size 0, not that the device doesn't exist. swaponvp() allows for size 0 by stupidly calling the d_psize function twice if the size isn't 0. setdumpdev() doesn't allow for it.)
Continued removing /* ARGSUSED */ from drivers.
|
12080 |
04-Nov-1995 |
bde |
Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up the misplaced extern declarations (mostly prototypes of interrupt handlers) that this exposed. The prototypes should be moved back to the driver sources when the functions are staticalized.
Added idempotency guards to <machine/conf.h>. "ioconf.h" can't be included when building LKMs so define a wart in bsd.kmod.mk to help guard against including it.
|
12071 |
04-Nov-1995 |
bde |
Moved prototypes for devswitch functions from conf.c and driver sources to <machine/conf.h>. conf.h was mechanically generated by `grep ^d_ conf.c >conf.h'. This accounts for part of its ugliness. The prototypes should be moved back to the driver sources when the functions are staticalized.
|
11872 |
28-Oct-1995 |
phk |
Remove unused functions and variables, make things static, and other cleanups.
|
11375 |
09-Oct-1995 |
joerg |
BIOS manufacturers don't seem to have a unique idea about 2.88 MB floppy drive types in the CMOS; add 0x50 as an alias for 2.88 MB.
|
11162 |
04-Oct-1995 |
joerg |
Hide the "input/output timeout" messages behind the bootverbose case. This message has been confusing innocent ft users.
It should go into 2.1 as well, it's a very simple fix.
|
10823 |
16-Sep-1995 |
bde |
Remove transitory labelling code. Labels are now handled by essentially the original 4.4lite code. Machine Specific Partitions are now handled separately.
|
10537 |
03-Sep-1995 |
julian |
devfs changes.. changes to allow devices that don't probe (e.g. /dev/mem) to create devfs entries this required giving 'configure' its own SYSINIT entry so we could duck in just before it with a DEVFS init and some device inits.. my devfs now looks like: ./misc ./misc/speaker ./misc/mem ./misc/kmem ./misc/null ./misc/zero ./misc/io ./misc/console ./misc/pcaudio ./misc/pcaudioctl ./disks ./disks/rfloppy ./disks/rfloppy/fd0.1440 ./disks/rfloppy/fd1.1200 ./disks/floppy ./disks/floppy/fd0.1440 ./disks/floppy/fd1.1200 also some sligt cleanups.. DEVFS needs a lot of work but I'm getting back to it..
|
9202 |
11-Jun-1995 |
rgrimes |
Merge RELENG_2_0_5 into HEAD
|
8876 |
30-May-1995 |
rgrimes |
Remove trailing whitespace.
|
8376 |
09-May-1995 |
rgrimes |
Fix -Wformat warnings, still need to do something about %b and pointer type args.
|
8310 |
06-May-1995 |
joerg |
Restructured the floppy tape probe.
The ``flags 1'' in the fdc line is now only needed for owners of an Insight tape (perhaps there aren't any? Mine is disfunctional). All other probes are safe wrt. to the motor-control line of floppy disk drives. Document the flag in LINT finally.
|
7945 |
20-Apr-1995 |
julian |
Reviewed by: no-one yet, but non-intrusive Submitted by: julian@tfs.com Obtained from: written from scratch
slight changes to make space for devfs.. (also conditional test code in i386/isa/fd.c)
=================================================================== RCS file: /home/ncvs/src/sys/sys/malloc.h,v retrieving revision 1.7 diff -r1.7 malloc.h 113a114,117 > #define M_DEVFSMNT 62 /* DEVFS mount structure */ > #define M_DEVFSBACK 63 /* DEVFS Back node */ > #define M_DEVFSFRONT 64 /* DEVFS Front node */ > #define M_DEVFSNODE 65 /* DEVFS node */ 184c188,192 < NULL, NULL, NULL, NULL, NULL, \ --- > "DEVFS mount", /* 62 M_DEVFSMNT */ \ > "DEVFS back", /* 63 M_DEVFSBACK */ \ > "DEVFS front", /* 64 M_DEVFSFRONT */ \ > "DEVFS node", /* 65 M_DEVFSNODE */ \ > NULL, \ Index: sys/mount.h =================================================================== RCS file: /home/ncvs/src/sys/sys/mount.h,v retrieving revision 1.16 diff -r1.16 mount.h 100c100,101 < #define MOUNT_MAXTYPE 15 --- > #define MOUNT_DEVFS 16 /* existing device Filesystem */ > #define MOUNT_MAXTYPE 16 118a120 > "devfs", /* 15 MOUNT_DEVFS */ \ Index: sys/vnode.h =================================================================== RCS file: /home/ncvs/src/sys/sys/vnode.h,v retrieving revision 1.19 diff -r1.19 vnode.h 61c61 < VT_UNION, VT_MSDOSFS --- > VT_UNION, VT_MSDOSFS, VT_DEVFS
|
7780 |
12-Apr-1995 |
wollman |
Add a class field to devconf and mst drivers. For those where it was easy, drivers were also fixed to call dev_attach() during probe rather than attach (in keeping with the new design articulated in a mail message five months ago). For a few that were really easy, correct state tracking was added as well. The `fd' driver was fixed to correctly fill in the description. The CPU identify code was fixed to attach a `cpu' device. The code was also massively reordered to fill in cpu_model with somethingremotely resembling what identifycpu() prints out. A few bytes saved by using %b to format the features list rather than lots of ifs.
|
7643 |
06-Apr-1995 |
rgrimes |
Correct recalibrate/seek code at attach time so that we do not get all the ``fdc0: ready for output in input'' messages when probing for ft devices.
Submitted by: Steve Gerakines <steve2@genesis.tiac.net>
|
7393 |
26-Mar-1995 |
rgrimes |
Terminate all probe/diagnostic/error messages correctly with a \n.
Report floppy/tape units on seperate lines as fdX:/ftX: to correct lots of ways the current scheme failed to end the output with \n.
Add controller and/or drive designator to the fron of several messages that come from this drive. [It's not fun to track down driver messages using grep over the source tree.] Reviewed by: joerg
|
7090 |
16-Mar-1995 |
bde |
Add and move declarations to fix all of the warnings from `gcc -Wimplicit' (except in netccitt, netiso and netns) and most of the warnings from `gcc -Wnested-externs'. Fix all the bugs found. There were no serious ones.
|
7042 |
12-Mar-1995 |
joerg |
Finally get rid of this bothering ``biodone: buffer already done'' warning. The buffer needs only to be `biodone()' again if the format operation timed out; otherwise fdstate() did already do the job.
|
6724 |
26-Feb-1995 |
bde |
Declare all the args of Fdopen() and fdclose().
Initialize dk_wpms[] less bogusly.
Clean up includes.
Remove some obsolete comments.
|
5962 |
27-Jan-1995 |
jkh |
Back out my previous change and disable the floppy tape controller again by default. It's hosing up my test machine's floppy pretty good.
|
5680 |
17-Jan-1995 |
jkh |
Enable floppy-tape controller by default again. Flags no longer has any special meaning.
|
5552 |
12-Jan-1995 |
joerg |
Argl!, finally found this bummer. The code testing for a write- protected drive at open() time has been *totally bogus*! The guy who submitted it didn't understand all the implications of calling set_motor(), and the `who' who included the patch into the tree did it blindly... Pleeeeze, don't commit code to this driver unless you are really going to understand what it does! This one caused me to pull out even more hears, and those who know me do know that i ain't got too many o'them. :-)
|
5512 |
11-Jan-1995 |
joerg |
Finally implement support for the `lsdev' program. The controller is now marked busy as long as it's being in non-reset state, and the drives are busy as long as at least one instance is open.
Also reformat everything to fit into 80 columns again.
Changed my mind wrt. error reporting for a write-protected drive and an open() with write intent; ENXIO has been too weird, now return EIO. Some portions of the code need to be rewritten to use tprintf() instead of simple printf()'s, so the messages will also appear on the session terminal, however.
|
5417 |
06-Jan-1995 |
joerg |
Peter's work to work around one of the most annoying bugs in the floppy driver (or in the hardware?). It turned out to be caused by spurious interrupts, right after an FDC reset.
Also major cleanup in the low-level structure, there are now functions performing error-checks for the FDC I/O.
Submitted by: (mostly) Peter Dufault <dufault@FreeBSD.org>
|
4968 |
04-Dec-1994 |
joerg |
Here is a minor patch for FreeBSD 2.0R to allow it to recognize 2.88MB floppy drives. All it does is set the type to 1.44MB if it finds the 2.88MB drive.
Submitted by: Andrew Gillham <gillham@andrews.edu>
|
4874 |
30-Nov-1994 |
jkh |
Reverse the meaning of previous change. Now floppy tape support is *disabled* unless you specifically request otherwise. Poul wanted it this way, and I guess I'm not going to argue though it may seem counter-intuitive. We can always change it back, later.
|
4861 |
29-Nov-1994 |
jkh |
Experimental change to floppy driver to NOT probe the floppy tape if flags & 0x1. Somebody should build a kernel with this and see if the floppy-tape damaged people can turn it off properly with userconfig. I can't reproduce the original problem here.
|
4618 |
18-Nov-1994 |
phk |
Extended the SEEKWAIT and RECALWAIT somewhat to avoid annoying messages.
|
4261 |
08-Nov-1994 |
ache |
Change "fdx: Floppy not writeable" to less confusing "fdx: write protected". Not writeable maybe means bad, etc.
|
4260 |
08-Nov-1994 |
jkh |
From: Lars Fredriksen <fredriks@mcs.com>
Here is a patch to fd.c that will check to make sure the floppy is not writeprotected when you try to open the device RW. Submitted by: lars
|
4088 |
02-Nov-1994 |
jkh |
Back out Joerg's latest commit. Sorry, Joerg, but this breaks the install floppies now. I'm not sure why, but things hang when it gets to the `changing root to fd0c' part. Without your latest commit, everything works fine. Maybe you can figure out what you broke after ALPHA! :)
|
4011 |
30-Oct-1994 |
joerg |
Several minor fixes to the floppy driver:
. avoid resetting the FDC every time the last motor is going off; instead, give it a 60-second period for possible later reactivation. This prevents us from needing to recalibrate the FDC too often, but still allows for an ``automagic error recovery', just in case the controller is absolutely stuck. (Simply wait for 60 seconds, and try it again.)
. made the floppy head settle time after a seek a constant that might be overridden by a config option. (Well, actually the divisor of the settle time). Pepople often reported problems with their floppies, so i need a simply mechanism that allows them to play with that value. (I personally cannot find any problem on *my* drives.)
. implement the FD_DEBUG ioctl command, in case the driver is compiled with DEBUG turned on.
. removed a bogus parameter from a printf; the remaining warnings from gcc -Wall seem to be warnings about the %b format gcc cannot understand
. rearrange Garett's code to fit better in the existing structure of #define/type/function ordering.
. make everything fit into 79 columns again.
|
3940 |
27-Oct-1994 |
jkh |
Julian Elischer's disklabel fixes.
|
3816 |
23-Oct-1994 |
wollman |
Finished device configuration database work for all ISA devices (except `ze') and all SCSI devices (except that it's not done quite the way I want). New information added includes:
- A text description of the device - A ``state''---unknown, unconfigured, idle, or busy - A generic parent device (with support in the m.i. code) - An interrupt mask type field (which will hopefully go away) so that . ``doconfig'' can be written
This requires a new version of the `lsdev' program as well (next commit).
|
3755 |
21-Oct-1994 |
joerg |
Checking for timeout at several critical calls to ``out_fdc()'' now, so i hope i've finally removed all the occasions where the driver got stuck when there's no floppy in the drive. Also attemmpting to omit the error mesage for ``recalib failed'' for the first time, since people tend to be confused about this.
|
3713 |
19-Oct-1994 |
wollman |
Add support for devconf to a large number of device drivers, and do the right thing in dev_goawayall() when kdc_goaway is null.
|
3705 |
19-Oct-1994 |
wollman |
isa.c isa_device.h: declare & define {e,}isa_{in,ex}ternalize(). fd.c: register devices and implement disk stats. wd.c: fix disk stats and call isa_externalize() as appropriate.
|
3490 |
10-Oct-1994 |
phk |
Cosmetics. Silence gcc -Wall. Much more to do here :-(
|
3105 |
25-Sep-1994 |
phk |
An ifdef almost hit where it was supposed to go. Joerg owes me a good German beer I think...
|
3096 |
25-Sep-1994 |
joerg |
Copied over the transfer speed definitions from sys/i386/isa/fdreg.h. This is needed for having the fdformat program no longer searching non-public include paths. Protect the definitions in fdreg.h against double inclusion.
|
3085 |
25-Sep-1994 |
phk |
Moved the ft.c from 1.1.5.1 over. It works on my Conner thingie. Got rid of a ton of unused vars at the same time.
|
2841 |
17-Sep-1994 |
joerg |
Fixed the problem where the floppy has incorrectly failed probing when the drive had been left on a cylinder > 67 after kernel boot. The most common case for this is booting a kernel that is located on the inner cylinders of a floppy.
Also removed all occurences of spinwait(), replaced by DELAY. Nuked a return line saying nothing, this might make Bruce happy 8^)
Submitted by: partially by Bruce Evans
|
2838 |
17-Sep-1994 |
dg |
Updated driver to the 1.1.5 version:
date: 1994/05/22 12:35:38; author: joerg; state: Exp; lines: +6 -6 First round of floppy changes. Try making `fd' more robust.
New features: . ioctl command for setting the drive type (density etc.); restricted to the super-user . ioctl for getting/seting `drive options'; currently only option is FDOPT_NORETRY: inhibit the usual retries; used when verifying a newly formatted track
Fixes: . function prototypes . made all internal functions `static' . cleaned up & corrected .h files . restructured, to make the chaotic function sequence more rational . compiled with -Wall, and cleared all warnings . introduced a mirror for the (write-only) `digital output register', to avoid the current kludge . device probing completed by seeking/recalibrating, and looking for track 0 being found . holding the controller down in reset state while it is idle (and thus saving allot of headaches) . make requests fail that are not a multiple of the (physical) sector size . removed the fixed physical sector size (512 bytes), allowing for any size the controller could handle (128/256/512/1024 bytes) . replaced some silly messages . fixed the TRACE* macro usage, debugging reports should be complete now again (debugging output is HUGE! though) . removed fd_timeout for SEEK command; seeks are always reported by the controller to succeed, since the `success' only refers to the controller's idea of success - there is no hardware line to tell about the seek end (other than the `track 0' line) . catch SENSEI's that report about a `terminated due to READY changed' status - could happen after a controller reset . converted ``hz / <something>'' divide operations to divisors that are powers of two, so gcc can optimize them into shifts . write/format operations are checked against a write-protected medium now *prior* starting the operation . error reports of `invalid command' and `wrong cylinder' will cause shortcuts in the retrier() now . fixed a bug in the retrier() causing bogus block numbers to be reported . fdformat() does care for errors now
Known Bugs: . no attempts have been made (yet) to improve the performance . sometimes, bogus ``seek/recalib failed'' messages are logged; this is still a bug in the driver, but it's not harmful since it's usually caught by the retrier()
Reviewed by: Submitted by: Obtained from:
|
2397 |
29-Aug-1994 |
ache |
Use RAW_PART=2 to trick diskerr
|
2234 |
23-Aug-1994 |
paul |
Ran ft.c through ident. Added a missing #ifdef INET wrapper in lpt.c
Main change: Removed the timeout_func_t casts from timeout calls and correctly defined the timeout routines to conform to the new format. lpt.c doesn't have this change.
Reviewed by: Submitted by:
|
2056 |
13-Aug-1994 |
wollman |
Change all #includes to follow the current Berkeley style. Some of these ``changes'' are actually not changes at all, but CVS sometimes has trouble telling the difference.
This also includes support for second-directory compiles. This is not quite complete yet, as `config' doesn't yet do the right thing. You can still make it work trivially, however, by doing the following:
rm /sys/compile mkdir /usr/obj/sys/compile ln -s M-. /sys/compile cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL ln -s /sys @ rm machine ln -s @/i386/include machine make depend make
|
1549 |
25-May-1994 |
rgrimes |
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
|
1379 |
20-Apr-1994 |
dg |
Bug fixes and performance improvements from John Dyson and myself:
1) check va before clearing the page clean flag. Not doing so was causing the vnode pager error 5 messages when paging from NFS. (pmap.c) 2) put back interrupt protection in idle_loop. Bruce didn't think it was necessary, John insists that it is (and I agree). (swtch.s) 3) various improvements to the clustering code (vm_machdep.c). It's now enabled/used by default. 4) bad disk blocks are now handled properly when doing clustered IOs. (wd.c, vm_machdep.c) 5) bogus bad block handling fixed in wd.c. 6) algorithm improvements to the pageout/pagescan daemons. It's amazing how well 4MB machines work now.
|
1250 |
08-Mar-1994 |
nate |
From: Jim Babb <babb@sedhps01.mdc.com> Subject: Re: Bugs with floppy drives Date: Tue, 8 Mar 94 9:11:54 CST
The transfer speed was only set in the retry after error, not when switching drives.
|
1233 |
02-Mar-1994 |
ache |
360 DD entry speed fixed to 250KBPS
|
1231 |
02-Mar-1994 |
alm |
floppy tape support shouldn't interfere with floppy disk driver on systems with no floppy tape drive (patch from Jim Babb).
|
1161 |
14-Feb-1994 |
nate |
From: Jim Babb <babb@sedhps01.mdc.com> Date: Mon, 14 Feb 94 15:57:14 CST
This adds a copyright to the fdc.h file and fixes a bug in re-tries during writes on a heavily loaded system.
|
1122 |
07-Feb-1994 |
alm |
Tentative fdc patches...
|
1110 |
07-Feb-1994 |
alm |
Add floppy tape driver - fd => fdc
|
890 |
21-Dec-1993 |
ache |
Use separate fields for format GAP and read/write GAP. Restore usage of read/write GAP.
|
879 |
19-Dec-1993 |
wollman |
Make everything compile with -Wtraditional. Make it easier to distribute a binary link-kit. Make all non-optional options (pagers, procfs) standard, and update LINT to reflect new symtab requirements.
NB: -Wtraditional will henceforth be forgotten. This editing pass was primarily intended to detect any constructions where the old code might have been relying on traditional C semantics or syntax. These were all fixed, and the result of fixing some of them means that -Wall is now a realistic possibility within a few weeks.
|
878 |
19-Dec-1993 |
ache |
Media table reorganization. Entries for 800 and 820 fixed. From vak@kiae.su: incorporate Joerg Wunsch formatting code correct handle timeouted operations fixed entry for 720 media
|
874 |
18-Dec-1993 |
ache |
Reorganization of format table. GAP values changed suitable for possible format code addition. Read/write GAP always 2 now. Interleave parameter added for possible format code addition. Many logical formats added. 720K physical drive added. Problems: still can't read 720..820 media in 1.44 drive.
|
870 |
16-Dec-1993 |
ache |
Added following formats (derived from MSDOS fdformat): 800K in HD 5.25in (maximum for DD diskettes) 1.44M in HD 5.25in (for easy distributions) 1.46M in HD 5.25in (maximum for 5.25) Some cosmetique changes.
|
863 |
16-Dec-1993 |
ache |
No more partition bits in floppy minor. Now minor looks like UU DDDDDD, UU - unit, DDDDDD - density. If density == 0, CMOS-detect format assumed. Fix attach code for correct work with unknown CMOS floppy types. Trick diskerr to handle new minor. 1.722M floppy in 1.44M drive popular format added.
|
855 |
13-Dec-1993 |
ache |
Add more strictly size check into Fdopen to eliminate possible end-user errors. Now: 1) on physical 1.2 can open logical 1.2, 720, 360H 2) on physical 1.44 can open logical 1.44, 720 3) on physical 360 can open logical 360 All other variants refused. C-style improved in this check, multiply if's changed to switch.
|
854 |
12-Dec-1993 |
ache |
Add 360K floppy support. More work to add 720K floppy support. Restore good old dependance of device and floppy type. Now: fd?a == 1.44 fd?b == 1.2 fd?c == 720 fd?d == 360 in HD fd?e == 360 Add more strict size check in Fdopen, not it refuse: 1) Attempt to open any type expect fd?e, if you have only 360K drive. 2) Attempt to open fd?a if you have only 1.2 drive.
|
851 |
12-Dec-1993 |
ache |
Add popular 720k floppy in HD drive floppy type. Restore check for NUMTYPES in Fdopen.
|
830 |
04-Dec-1993 |
ats |
Fixed the error that a Fdopen succeeds without a found fd controller in the system.
|
826 |
03-Dec-1993 |
alm |
Reset fdc during probe.
From: <dec@lazarus.nrtc.northrop.com> Changes between EPSILON and RELEASE of FreeBSD have again caused the kernel to not see my floppy disk drives. I don't know what happened, 'cause I don't see any changes to fd.c, but here is an old fix that I have applied to the probe routine which will solve the problem (at least for me). Since this is a rather brute-force solution - I understand if you want to ignore it...
[Upgrading to pre-Beta FreeBSD caused this on my system. -AM]
|
798 |
25-Nov-1993 |
wollman |
Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and add same (sans -Werror) to Makefile for future compilations.
|
619 |
16-Oct-1993 |
rgrimes |
Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some minor cleanup. Added $Id$ to files that did not have any version info, etc
|
499 |
23-Sep-1993 |
rgrimes |
>From: bde@kralizec.zeta.org.au (Bruce Evans) Date: Thu, 16 Sep 93 01:35:10 +1000 Julian writes:
>In fact DEVIDLE and FINDWORK ended up being basically equivalent. >the bit I wonder about, is the returning of 0.. What (other than >another request from somewhere else in the kernel) is going to start >work on the next item on the queue?
I think removing FINDWORK would make things clearer.
Nothing much is going to start work on the next item. However, it is pointless to continue processing the queue for the same unready drive. Aborting all reads and trying harder to perform all writes would be better. Julian writes.
> no, actually it should be: > fdt = fd_data[FDUNIT(minor(dev))].ft;
Fixed. From: bde@kralizec.zeta.org.au (Bruce Evans) Date: Thu, 16 Sep 93 22:56:01 +1000 The fd driver reported the wrong cylinder/head/sector numbers after an error (ST3 is only valid after a sense-drive command), and didn't report fs block numbers (diskerr was not used).
There was an old problem with writes to block fd devices. Try this:
1. write protect floppy in fd0. 2. tar cf /dev/fd0a /dev/null. Repeat a few times. Later writes tend to terminate earlier. 3. un-write protect floppy. 4. repeat step 2. The writes tend to return 0, 2048, 4096, ... and then succeed.
This was caused by a bug in vfs__bios.c. (The bug is fixed in NetBSD's vfs_bio.c.) fd.c sets bp->b_resid to nonzero after an error. vfs__bios.c was not initializing bp->b_resid. This causes some writes to terminate early (e.g., writes to block devices; see spec_write()).
Related funnies:
1. Nothing tries to write the residual bytes. 2. The wd driver sets bp->b_resid to 0 after an error, so there's no way anything else could write the residual bytes. 3. I use the block fd device for tar because the raw device seemed to have more bugs long ago, and because it ought to be able to handle buffering more transparently (I don't want to have to know the device size). But spec_write() always uses the size BLKDEV_IOSIZE == 2048 which is too small. For disks it should use the size of one track (rounded down to meet the next track boundary or the i/o size). Here it would help if the DIOCGPART ioctl worked. But DIOCGPART is not implemented for floppies, and the disk size is ignored except for partitions of type FS_BSDFFS.
Bruce
|
471 |
15-Sep-1993 |
rgrimes |
Removed $Log$ section and patch kit headers. And here is the full message for Bruces changes:
>From: bde@kralizec.zeta.org.au (Bruce Evans) >Subject: fixes for fd driver
I think I've fixed some bugs in the 0.2.4 fd driver.
1. The main cause of hangs was that there was no timeout for seeks. So attempting i/o with no floppy in the drive hung iff a seek was required.
2. Opens of unattached drives were allowed. The kernel usually paniced soon after due to a bad pointer.
3. Some timeout functions ran at splclock() instead of splbio(). This may not have mattered.
4. The state machine was left in a funny state after a timeout.
5. Some function headers were new-style.
6. I picked up some code posted the other day to implement label ioctls. Now `disklabel fd0' works. See a comment for how to modify conf.c.
|
464 |
14-Sep-1993 |
jkh |
Bruce's multifarious patches for the floppy driver (not well tested, but since what we have is crap as it is, it can't do much worse!).
|
285 |
12-Aug-1993 |
rgrimes |
Fixed poor timeout code in out_fdc. The timeout counter was not being reinitialized between while loops. Added comments about what was going on in the out_fdc routine.
out_fdc now returns if the direction bit is not set in time instead of trying to wait for MRQ to get cleared.
|
126 |
15-Jul-1993 |
dg |
Modified attach printf's so that the output is compatible with the "new" way of doing things. There still remain several drivers that need to be updated. Also added a compile-time option to pccons to switch the control and caps-lock keys (REVERSE_CAPS_CTRL) - added for my personal sanity.
|
5 |
12-Jun-1993 |
rgrimes |
This commit was generated by cvs2svn to compensate for changes in r4, which included commits to RCS files with non-trunk default branches.
|