* Clean up the socket state earlier in the attach process -- not relying on
the socket attachment to do it.
* Get rid of PCIC_LASTSTATE_HALF. It's pointless.
* In pcic_wait_ready(), also check for the card vanishing, like in pccbb.
* Assert #RESET before powering up the card, not after. (I think it was
actually okay because the value was left as 0 from a previous disable or
the initial socket attach, but...
* If the card fails to come ready, don't bother reinstating windows or
anything -- just power it down.
* Like the i82365 code, add a "delay" function that uses tsleep() to wait, and
use this in the socket enable/disable paths. This gets rid of the annoying
system pauses during card insertion and removal. (There are still some
issues related to this in various drivers -- notably big delay()s in wi and
xi.)
* Move the power-change delay out of pccbb_power() and into the PCMCIA backend
code -- specifically, once in the disable path and once in the enable path.
We were being pretty schizo about this before. Make these use tsleep().
(Note: This should be safe because card insertion/removal is handled by a
kernel process, not in an interrupt handler. It works for me with
DIAGNOSTIC.)
* If we get a "bad Vcc" error, attempt to force the socket to power off, and
return an error. If we don't do this, we will get "bad Vcc" errors forever
and never be able to use another card without rebooting, which is dumb.
XXX I haven't been able to test this very well, because it doesn't fail for
me in the first place. :-)
* Clean up the socket mappings earlier in the enable path.
* Try to be consistent about clearing PWRCTL (which contains OE) before turning
off power.
reading the FIFO status and reading the interrupt status, we could end up
leaving it in the FIFO. Force another round through the loop after reading the
interrupt status until the FIFO reads empty again.
Also, there is no point in having the extra loop to wait for the transfer
command to the controller to be acknowledged, because the transfer loop handles
that just fine -- and getting rid of it fixes another race condition.
The memory window is not actually activate in I/O card configurations. It was
transparently falling back to 16-bit I/O mode.
Implement "memory card" mode correctly, with polling.
any interrupts, and therefore wedge on any access. However, there is another
memory mode that gives us a memory-mapped data register, which we can use.
Also set the new "DATA1K" flag to tell the wdc backend that we have a large
data area to read from -- this can be used with the region methods.
instead have a call down from the PCMCIA mid-layer to set it. Use this from
pcmcia_function_enable(). (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)
Now it is safe to hold the socket enabled during attach, so do that. Only
one enable/disable cycle to attach a card now!
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.
In a couple of cases, just remove the state machine, because it wasn't
really necessary.