Commit Graph

3758 Commits

Author SHA1 Message Date
thorpej 4b51cecfc2 - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.
2004-08-14 15:08:04 +00:00
tsutsui d91b03bd13 Use bus_space(9) on news68k.
Update/sort the comment/ifdefs about bus_space-using ports.

XXX which should we use defined(__${MACHINE_CPU}__) or defined(${MACHINE})?
2004-08-13 12:59:20 +00:00
pooka b151590832 kill "magic" number 2004-08-13 11:25:58 +00:00
mycroft 1d167b13be amd64 also has bus_space... 2004-08-13 10:52:18 +00:00
mycroft 27b5b1440c Remove a really gratuitous 1s delay. 2004-08-13 04:36:08 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00
mycroft c369e5b81c Fix two annoying display glitches with "fast scrolling" and
WSDISPLAY_SCROLLSUPPORT.
2004-08-13 04:03:38 +00:00
thorpej ab20886f7b Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
2004-08-13 03:12:59 +00:00
thorpej 577bf67014 Move wdcstart() to ata.c and rename it to atastart(). 2004-08-13 02:16:40 +00:00
thorpej 996c3ca90e Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer(). 2004-08-13 02:10:43 +00:00
thorpej e6d61c5bc9 Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.
2004-08-12 22:39:40 +00:00
thorpej 2eaa5c6142 Move wdc_kill_pending() to ata.c and rename it ata_kill_pending(). 2004-08-12 22:33:45 +00:00
thorpej 2600c55e01 - Move wdc_xfer_pool, wdc_get_xfer(), wdc_free_xfer() to ata.c, and rename
to ata_*.
- Use a static initializer for the ata_xfer_pool.
2004-08-12 21:34:52 +00:00
thorpej 52ed169a28 Move wdc_probe_caps() to ata.c and rename it ata_probe_caps(). 2004-08-12 21:10:18 +00:00
thorpej ac7276784a Move wdc_downgrade_mode() to ata.c and rename it to ata_downgrade_mode(). 2004-08-12 21:05:09 +00:00
thorpej 9939d3c63d Move wdc_print_modes() into ata.c and rename it ata_print_modes(). 2004-08-12 20:59:27 +00:00
mycroft 849d423c4e Whoops. Swap the order of the delref() and the config_pending_decr(). 2004-08-12 14:36:46 +00:00
mycroft 6269226dde Copyright maintenance. 2004-08-12 13:39:38 +00:00
mycroft 768040dd66 Various cleanup:
* 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.
2004-08-12 13:37:40 +00:00
thorpej 9167731c79 Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE
WDC_QUEUED -> ATACMD_QUEUED
WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN
2004-08-12 05:02:50 +00:00
thorpej 3ddac9b2da Rename "struct wdc_command" to "struct ata_command". 2004-08-12 04:57:19 +00:00
mycroft d24f7ca79e Close a race condition in the datain loop. If we receive another byte between
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.
2004-08-12 03:39:11 +00:00
mycroft 6741190fbc Make datain_pio and dataout_pio function pointers in wdc_softc, which can
be overridden by the backend if desired.  Add experimental code to wdc_pcmcia
to use this in memory-mapped mode, disabled by default.
2004-08-11 18:41:46 +00:00
mycroft 04a46876e5 Add two helper functions -- wdc_datain_pio() and wdc_dataout_pio() -- which
encapsulate the logic for the various methods of transferring data.  Use these
throughout.
2004-08-11 17:49:27 +00:00
mycroft c6c0aabf57 Correct the overrun loop while I'm at it. 2004-08-11 14:28:44 +00:00
mycroft 0ef13a458b Recode the datain_pio loop. This improves performance substantially (almost
2x) with my spc@pcmcia.
2004-08-11 14:22:34 +00:00
mycroft a1d101ba64 Add a settype function.
Nuke address windows earlier in power up sequence.
2004-08-11 06:56:57 +00:00
mycroft 8605b5b9c0 Nuke the address windows earlier, before the socket is powered up. Just in
case there are remnants left behind.
2004-08-11 01:51:41 +00:00
mycroft 51be90e8ac Be more liberal in torching the old state in the disable and settype routines. 2004-08-11 01:04:40 +00:00
mycroft a23e15bcbe Rather than having a call up from the low-level driver to get the card type,
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!
2004-08-11 00:18:18 +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 96221eb572 Constify. 2004-08-10 19:12:25 +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 dc594b03f9 Be robust against the case of the child devices failing to decrement the
refcnt.
2004-08-10 02:40:51 +00:00
dyoung 2bcbb9cb72 IBSS fixes: get IBSS beacon generation right. Merge with a same-SSID,
same-channel IBSS.
2004-08-10 01:03:52 +00:00
dyoung 8abb07d1ac Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue.  Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver.  Every node in the table with ni_refcnt=0
is eligible to be garbage-collected.  The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now.  A sysctl,
net.link.ieee80211.maxnodecache, controls the maximum LRU cache
size.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match."  This keeps
net80211 from caching duplicate nodes in the table.
2004-08-10 00:57:20 +00:00
mycroft 9a46d5ed7d Do an extra read of the IIR during initialization, just to ack any pending
interrupt.
2004-08-09 16:57:14 +00:00
mycroft 4e92489373 Add detach support for spc@pcmcia, modeled after aic@pcmcia. 2004-08-09 14:07:57 +00:00
mycroft f5eacc00f9 Don't loop forever if a card went away. 2004-08-09 13:52:21 +00:00
mycroft 16ac152cca Do barriers on the ASIC space without touching the NIC space. 2004-08-09 00:26:15 +00:00
mycroft f0e2cfd7fc Eliminate most 8-bit access. Just the data in/out path remains. 2004-08-09 00:25:33 +00:00
christos 959186b32c disable the quirk on the console so that it can scroll. 2004-08-08 19:21:27 +00:00
mycroft 76344241eb Look in the correct register for the BSR detection value.
Also, do this early, before writing any registers.
2004-08-08 16:20:43 +00:00
yamt 96e7bb0952 ath_init1: return EIO rather than -1 on a failure of ath_hal_reset.
-1 isn't appropriate for if_init.
2004-08-08 13:01:03 +00:00
kent c525acb34a VT1616i support 2004-08-08 10:41:57 +00:00
kent 824fd59f6d correct the mask value for CMI9739 2004-08-08 03:52:19 +00:00
kent 6f7bcb397d recognize CMI9739 codec. 2004-08-08 03:50:56 +00:00
mycroft c5b0509d65 Clear the "card type" bit when powering up the socket, to make it more robust
for memory cards.
2004-08-07 20:11:39 +00:00
mycroft ef638869ae Copy a bug fix from spc. If the target transferred too much, we would return
a bogus residual count.
2004-08-07 20:05:25 +00:00
mycroft 0553444712 Fix a printf() format for Alpha. 2004-08-07 20:04:44 +00:00