2. Include backwards compatibility good for the moment (eventually will
be turned off in current, but allow for a short transition period).
PR: 51333
Submited by: Scott Mitchell (1)
MFC after: 2 weeks
the slot info. This brings OLDCARD's API much closer to NEWCARD and
will allow moving more information into the kernel from pccard.conf
for common drivers (ed).
that's binary compatible for -stable. While binary compatibility doesn't
matter much in -current, it is critical for -stable. This change requires
pccardd/pccardc to be recompiled.
power x 0.
pccardc power x 0 used to disable the slot. But a suspend/resume
would reactivate the pccard. It no longer does that. Now the
disabling of the slot is sticy until it is reset with power x 1 or the
card is ejected. This seems closer to correct behavior to me.
o Process all card state changes the same using pccard_do_stat_change().
o Cleanup disabling the card so that we can preserve the state after
the change. Basically, don't set it to empty as often as we do.
o On suspend, the new state is "empty" and the laststate is "suspend"
o Document state machine with a diagram of states and edges. The
edges are labeld to tell the reader what event causes the external
state changes.
o "machdep.pccard.pcic_resume_reset" may be obsolete now. We always
call the bridge driver's resume method on resume now. Otherwise cards
won't automatically show up. If it needs to stay, I'll add it back.
softc.
o Store pointers to softc in dev_t in si_drv1.
o Change 'kludge version' to 'classic version' since things are getting less
kludgy.
o Minor code shuffling so that we probe and attach the pccard slots.
o Minor style(9) changes.
FreeBSD. This code doesn't work just yet, but does compile. We need
to start indirecting via the cinfo pointers, rather than directly
calling pcic_*. There may be other issues as well, but you gotta
start somewhere.
Obtained from: PAO3
o Attempt to disable the slot when we detect that there are problems with
it in our ISR. This should make polling mode work better for more cards,
but more work may be needed. This "disabling" sets the card interrupt
register to 0. This worked for me for lots of tests in polling mode.
o Now that I've found datasheets, fix a boatload of magic numbers in the
source to make it easier to understand.
o Use a table of names rather than a big case statement.
o Cull a few of the "unused" controller types that we map to other times
that were a vestiage of PAO code that we never merged in the same way.
o Enforce legal IRQs. You are no longer allowed to try to use IRQs that
will fail on all known ISA/PCI <-> PCMCIA bridges. The bridges do not
have pins for these illegal interrupts, and all of them are listed as
reserved and/or illegeal in the datasheets depending on which one you
look at.
o Add comments about how IBM-AT based computers and NEC PC-98 based computers
map these interrupts and which ones are valid.
o Always clear the bit that steers the management interrupt either to the
value listed in the PCIC_STAT_INT register. I've seen this bit get set
on suspend/resume and after windows boot, and it does't hurt to clear it.
NOTE: this might mean we can share this interrupt in the future.
o break out some of the probe routine the allocation of resources
into an attach routine
o Recognize PnP ids
o Allocate IRQ per card rather than per system
o Better polling reporting
o Remove unneeded include files in slot.h
o store a pseudo unit number on each device we find.
o Pass a unit number to interrupt/timeout routine and use it for polling
the hardware.
Tested on: My VAIO and with the Linksys pccard reader.
Approved by: jkh
Should have no effect, but does make things a little cleaner. I
thought this was the race that was causing problems, but it turned out
to be in pccardd waking up after the empty/insert events had happened
and being confused.
Minor cleanup:
o Remove isahd from pccard_devinfo
o remove extra from controller
o formatting nits
o use PCCARD_DEVINFO(d) rather than a bare device_get_ivars(d)
o Gut the compatibility interface, you now must attach with newbus.
o Unit numbers from pccardd are now ignored. This may change the units
assigned to a card. It now uses the first available unit.
o kill old skeleton code that is now obsolete.
o Use newbus attachment code.
o cleanup interfile dependencies some.
o kill list of devices per slot. we use the device tree for what we need.
o Remove now obsolete code.
o The ep driver (and maybe ed) may need some config file tweaks to
allow it to attach. See config files that were committed for examples
on how to do this.
Drivers to be commited shortly.
This is an interrum fix until the new pccard. ed, ep and sio will be
supported by me with this release, although others are welcome to try
to support other devices before new pccard is working.
I plan on doing minimal further work on this code base. Be careful
when upgrading, since this code is known to work on my laptop and
those of a couple others as well, but your milage may vary.
BUGS TO BE FIXED:
o system memory isn't allocated yet, it will be soon.
o No devices actually have a pccard newbus attach in the tree.
BUGS THAT MIGHT BE FIXED:
o card removal, including suspend, usually hangs the system.
Many thanks to Peter Wemm and Doug Rabson for helping me to fill in
the missing bits of New Bus understanding at FreeBSD Con '99.
pc98 case that I missed before. Attempt to get the irq for the PCIC
first from the loader env var and second from the config system. I've
been able to boot my laptop with a kernel that hardwired the irq to
10. This should allow boot -c to finally start working for pcic irq,
but I've not tested that. Add $FreeBSD$ to slot.h.
will allow newbus based drivers to have pccard attachments. Also
start printing out probe messages for pccards stating the resources
used and regularize many of the pccard printfs.
Reviewed by: Peter Wemm.
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().
however is only marginally useful until the new-style bus (pci and isa)
stuff comes onboard to give us a better shot at actually pci and isa
drivers loadable (or preloadable anyway).
* Kill individual drivers 'suspend' routines, since there's no simple/safe
way to suspend/resume a card w/out going through the complete probe
at initialization time.
* Default to using the apm_pccard_resume sysctl code, which basically
pretends the card was removed, and then re-inserted. Suspend/resume
is now 'emulated' with a fake insert/removal. (Hence we no longer
need the driver-specific suspend routines.)
follow.
* Rename/reorder all of the pccard structures, change many of the member
names to be descriptive, and follow more closely other 'bus' drivers
naming schemes.
* Rename a bunch of parameter and local variable names to be more
consistant in the code.
* Renamed the PCCARD 'crd' device to be the 'card' device
* KNF and make the code consistant where it was obvious.
* ifdef'd out some unused code
Assuming that the intr_mask[] was updated by changing the maskptrs (the
existing update_intr_masks() function will not work) this code was
written so the PCIC controller insertion/removal events will not
interrupt the card IRQ handler events.
Some possible scenarios:
+ Card is removed during IRQ handler:
- PCIC card handler is allowed to interrupt
- card removal event is called, removing the driver and data structures
* card interrupt handler continues w/out driver, data structures, and hardware
OR (the code just committed)
* card IRQ handler has no hardware to read/write to, but has code and
data to run on (XXX- Assume it completes and doesn't spin forever)
- PCIC card handler unloads the card driver
The current situation at least leaves the card interrupt handlers the
drivers and data structures to work with although the hardware can't be
guaranteed.
Reviewed by: bde
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.
Ok'd by: core
Submitted by: FreeBSD(98) development team
in place device drivers can now register power-down/power-up routines so
that we can use common routines to power-up/power-down cards for
insert/removals, suspend/resume, etc..
Reviewed by: phk
Submitted by: the 'Nomads'
This is still very green, but I have managed to get my modem working.
Lots of work still to do, but now at least we can commit it. /phk
Reviewed by: phk
Submitted by: Andrew McRae <andrew@mega.com.au>