Commit Graph

72525 Commits

Author SHA1 Message Date
mycroft 76ad292990 Move the socket reference counting into pcmcia_socket_{enable,disable}(), and
use that where needed.
2004-08-10 23:34:06 +00:00
mycroft 32dee96c25 Hold a reference between atabus_attach() and atabusconfig() to avoid an extra
enable/disable cycle.  Now my CF card attaches a bit faster.

XXX This code is split strangely between files.
2004-08-10 23:09:38 +00:00
mycroft 8c50dac2a1 Rather than the silly state machine, set whatever higher-level reference
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.
2004-08-10 22:49:12 +00:00
dyoung 90691ca787 Cosmetic: remove extraneous blank line. 2004-08-10 21:58:31 +00:00
mycroft c2ecd3e635 Update to the new world order. While I'm here, simplify a lot. 2004-08-10 21:14:50 +00:00
mycroft 0a960e80ec +cs@pcmcia 2004-08-10 20:50:11 +00:00
mycroft 8355db5e7a Update to the new world order. 2004-08-10 20:47:17 +00:00
mycroft ab96663a2a Use the right function for disabling after attach. 2004-08-10 20:25:03 +00:00
mycroft 22d0dd0aab Whoops. This goes with the esl_pcmcia.c commit. 2004-08-10 19:55:20 +00:00
mycroft 2f2f7913ed This code was pretty far from even compiling before. It also doesn't implement
detach support.  However, update other parts of it.
2004-08-10 19:54:30 +00:00
mycroft a2606a74af Update to the new world order.
XXX This driver's backend should really be merged with ess.
2004-08-10 19:47:11 +00:00
mycroft 43a768d1a7 Remove an extra printf(). 2004-08-10 19:23:21 +00:00
mycroft 8534032c92 Constify. 2004-08-10 19:20:20 +00:00
mycroft bf4a3f1523 Whoops, look at both the ID numbers and the CIS strings in each pcmcia_product.
It's dumb that drivers depend on this, but...
2004-08-10 19:15:08 +00:00
mycroft 96221eb572 Constify. 2004-08-10 19:12:25 +00:00
mycroft 1e7c425a39 Replace another home-grown matching function. 2004-08-10 19:08:37 +00:00
drochner 5a11f34433 The amd64 address space layout is different.
We can't assume that kernel addresses are below
VM_MAX_KERNEL_ADDRESS.
2004-08-10 18:57:09 +00:00
mycroft 3a3d934204 Regen. 2004-08-10 18:45:36 +00:00
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 f1b2ffd886 Hold a reference to the adapter until scsibus_config() has been called. This
avoids an extra enable/disable cycle on removable controllers (i.e. PCMCIA).
2004-08-10 15:46:44 +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
skrll adf5c92842 Include <sys/cdefs.h> once. 2004-08-10 07:35:53 +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 4160a45384 For the c400, set 5380 compatibility mode on every pass through the reset
routine.  The PCMCIA attachment, at least, needs this.
2004-08-10 07:00:30 +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 dc594b03f9 Be robust against the case of the child devices failing to decrement the
refcnt.
2004-08-10 02:40:51 +00:00