Commit Graph

1078 Commits

Author SHA1 Message Date
mycroft
99e8c8ddca Copyright maintenance. 2004-08-10 18:45:25 +00:00
mycroft
0515828a46 Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
2004-08-10 18:43:49 +00:00
mycroft
adbea3511a Enhance pcmcia_product_lookup():
* Remove the "expected function" value.  This was just causing problems with
  multifunction cards.  Differentiating the functions is better done by
  checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings.  This necessitated changing the calling
  pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
2004-08-10 18:39:08 +00:00
mycroft
f185d2861f Remove some CIS strings that we don't actually want to match on -- in some
cases they contain minor revision numbers, and one was even someone's MAC
address!
2004-08-10 18:00:15 +00:00
mycroft
e489df60f6 Take a shot at updating this to the new world order. Hopefully someone will
test it for me...
2004-08-10 16:43:47 +00:00
mycroft
d11fb31edb More careful about cleaning up pointers. 2004-08-10 16:04:16 +00:00
mycroft
70ca4b2fa7 Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
2004-08-10 15:29:56 +00:00
mycroft
90f47f6065 Better fix for the previous. 2004-08-10 08:57:50 +00:00
mycroft
8ccc950011 Copyright maintenance. 2004-08-10 08:56:08 +00:00
mycroft
51376df968 Fix a reference count problem I introduced here. 2004-08-10 08:29:27 +00:00
mycroft
03515f2f84 Update to the new world order.
XXX Note: This eliminates some register writes that were done in the "init"
routine during attach.  If these are necessary, they need to do done somewhere
else, quite possibly the enable routine.
2004-08-10 07:04:19 +00:00
mycroft
aebf4d4a6e Update to the new world order. 2004-08-10 07:03:14 +00:00
mycroft
26df0f0126 Fix a printf(). 2004-08-10 06:23:50 +00:00
mycroft
6d1b8921aa Copyright maintenance. 2004-08-10 06:10:38 +00:00
mycroft
6c47211011 Update to the new world order. 2004-08-10 06:08:58 +00:00
mycroft
ac82590655 Remove some useless code. 2004-08-10 06:05:40 +00:00
mycroft
d55195e28b Update to the new world order.
"While I'm here..."
All that grotesque code allegedly for the 88190 and 88790 is actually just
mapping the CCR and writing to it.  So, enable the device normally and use
pcmcia_ccr_{read,write}() rather than doing this crap ourselves.
2004-08-10 05:24:56 +00:00
mycroft
1234bb195c Update to the new world order. 2004-08-10 05:23:04 +00:00
mycroft
9e12fe4182 Minor change to a printf(). 2004-08-10 05:22:33 +00:00
mycroft
1641421432 Move the location of a printf() I added. 2004-08-10 05:21:59 +00:00
mycroft
1a0a3e5f59 Update to the new world order. 2004-08-10 03:54:37 +00:00
mycroft
baa0e65038 Make the enable state machine during attach more robust. 2004-08-10 03:54:26 +00:00
mycroft
dae3551db2 Regen. 2004-08-10 03:03:29 +00:00
mycroft
a866720a7e Remove a very silly hack WRT the Digital vendor ID. 2004-08-10 03:03:11 +00:00
mycroft
71e7860bbf GC the "quirk" code. 2004-08-10 03:00:29 +00:00
mycroft
f96037f43b Use pcmcia_function_{configure,unconfigure}().
XXX Memory mapped mode seems to be flaky with my CF cards, so I have
disabled it for now.
2004-08-10 02:56:42 +00:00
mycroft
7f6dd84dc4 Use pcmcia_function_{configure,unconfigure}(). 2004-08-10 02:54:19 +00:00
mycroft
2137977a97 Be robust against child devices failing to handle the socket refcnt properly --
force it to 0 when a card is detached, possibly disabling the socket in the
process.

Add several new functions:
* pcmcia_config_alloc(pf, cfe)
  Tries to allocate all the I/O and memory spaces in a config entry.
* pcmcia_config_free(pf)
  Frees all the I/O and memory spaces for the active configuration.
* pcmcia_config_map(pf)
  Maps all the allocated I/O and memory spaces for the active configuration.
* pcmcia_config_unmap(pf)
  Unmaps all the allocated I/O and memory spaces for the active configuration.

And two higher-level functions:
* pcmcia_function_configure(pf, validator)
  Tries to find a CIS config entry that it can allocate the spaces for.  Each
  entry is verified by calling the "validator" function -- which can also do
  card- and driver-specific fixups.  If successful, the regions are all mapped.
* pcmcia_function_unconfigure(pf)
  Equivalent to calling both pcmcia_config_unmap() and pcmcia_config_free().

Most drivers are expected to use the latter two functions, which will greatly
reduce the amount of crufty code.
2004-08-10 02:50:52 +00:00
mycroft
16e317876a Minor change. 2004-08-09 22:24:37 +00:00
mycroft
125ba6ee0c Adapt to the new world order. 2004-08-09 22:02:11 +00:00
mycroft
975673d3f6 Adapt to the new world order. 2004-08-09 21:30:18 +00:00
mycroft
285bec8287 Minor code reduction. 2004-08-09 20:30:19 +00:00
mycroft
b37b3de94e Adapt to the new world order. Now all my sm cards work. 2004-08-09 20:30:08 +00:00
mycroft
36c30a2f1a Dispense with all the interrupt multiplexing code here, and assume that the
underlying implementation DTRT.  This has the side effect of causing us to
ignore the INTR and INTRACK bits in the CCR -- but this seems for the best
anyway, since they are not reliably implemented.  (I note that Linux doesn't
bother either.)
2004-08-09 20:02:36 +00:00
mycroft
7848004c46 Do the I/O mapping in the main attach routine.
Also, we don't need to bother cleaning up on a failed attach -- we keep enough
state for the detach routine to do it.
2004-08-09 19:34:00 +00:00
mycroft
bc7b11e4ff Add newlines to the messages... 2004-08-09 19:33:07 +00:00
mycroft
b7a991ceb6 Whoops, nuke an unused variable. 2004-08-09 19:09:06 +00:00
mycroft
65d47754b3 Assume that io_map/unmap and intr_establish/disestablish will not be called
with the function enabled.  If this happens, issue a warning.  (This is only
really important for multifunction cards.)

This allows me to get rid of a bunch of extra code.
2004-08-09 19:08:19 +00:00
mycroft
f65dd54152 Correct the intr_establish order here. 2004-08-09 18:51:32 +00:00
mycroft
7b96c587dc Fix the intr_establish/disestablish order here too. 2004-08-09 18:41:36 +00:00
mycroft
9092e2c97e Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits.  pcmcia_intr_disestablish() continues to do this as a stopgap.
2004-08-09 18:30:51 +00:00
mycroft
2ae40d3e4f Do our io_map()s and intr_establish()es earlier. 2004-08-09 18:11:01 +00:00
mycroft
af19b73069 Do io_map() and intr_establish() before enabling the function, always. This
prevents "stray interrupts" during attach.
2004-08-09 17:00:53 +00:00
mycroft
deca9207b3 If the function is not enabled, do not attempt to immediately update the CCR.
XXX This is a stopgap until all drivers are converted to do their io_maps and
intr_establishes before function_enable.
2004-08-09 16:59:10 +00:00
mycroft
c74553663e Add some code to deal with the interrupt mask register on early CEM cards.
Doesn't seem to work yet, but it's marginal progress.
2004-08-09 16:05:00 +00:00
mycroft
c8180f49fd Use PCMCIA_WIDTH_AUTO, not PCMCIA_WIDTH_IO16, since we (sometimes) do 8-bit
access.
2004-08-09 15:40:56 +00:00
mycroft
b03f5b32c7 Pass a valid alignment to pcmcia_io_alloc(). 2004-08-09 14:24:10 +00:00
mycroft
4e92489373 Add detach support for spc@pcmcia, modeled after aic@pcmcia. 2004-08-09 14:07:57 +00:00
mycroft
10121549dd Add a hack that makes the address register programming more reliable on my
CE2 cards.
2004-08-09 13:30:16 +00:00
mycroft
eaae9fcf2b The "savedpage" stuff is nonsense. Every place we touch the device is
protected by splnet(), so there's no reason to even try.
2004-08-09 05:11:33 +00:00