History log of /freebsd-9.3-release/sys/dev/fdc/fdc_pccard.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 223624 28-Jun-2011 kevlo

Remove duplicate header includes


# 185235 23-Nov-2008 imp

Eliminate an unused variable reported by coverity

Submitted by: Ganbold


# 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)


# 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


# 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.


# 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).


# 132216 15-Jul-2004 njl

Clean up resources properly if attach fails. Always reset ISA drives on
probe.


# 132166 14-Jul-2004 njl

Add a comment separator.


# 132137 14-Jul-2004 imp

Fix the pccard attachment to have a chance of working.
Move the resource allocation into the bus front ends.


# 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.