Commit Graph

3741 Commits

Author SHA1 Message Date
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
mycroft 6742fd43f4 Add Alpha to the list of platforms that use bus_space (for nca@pcmcia). 2004-08-07 20:01:48 +00:00
kent 9e25bf4c82 AD1888 support.
PR kern/25949
2004-08-07 17:37:31 +00:00
mycroft 1afe1f83af Be much more robust with RID values during attach:
* If the device returns a length too short to even contain the RID number,
  flag it as not supported and return EOPNOTSUPP, rather than returning a
  length of -2 and trying to use the value anyway.
* Check the returned lengths to see if we actually got anything.
* If we get no rate list, fail the attach, so we don't just blow up later.
Allow the frontend to pass in a MAC address.
2004-08-07 17:12:44 +00:00
kent 1c7464b5ca recognize ALC655/658/850 2004-08-07 16:59:54 +00:00
tsutsui f71b2096d2 On manual transfer via TEMP register, data should be read
before asserting ACK.
2004-08-07 07:17:09 +00:00
mycroft 0ba1d7c0e4 Use bpf_mtap2(). 2004-08-06 02:31:25 +00:00
mycroft ddc97f59ca Put unadulterated dB values in the radiotap header, not the converted dBm
values.
2004-08-05 22:57:32 +00:00
jkunz 2950c906af Attach phy anyway if srom has invalid contents.
Patch sugested by Charles M. Hannum on tech-kern.
2004-08-05 09:07:45 +00:00
bouyer 1f5d4dd9dd Change wdc_kill_pending() to take a struct ata_drive_datas * as argument,
and kill only pending requests for this drive.
Implement a DRIVE_WAITDRAIN flag, which will cause the active command to
be killed once complete.
Other minor fixes.
Now it's possible to detach a ATA or ATAPI device from ioctl even when
a dd on the raw char partition is running.
2004-08-04 22:44:04 +00:00
bouyer 9b0cc941a3 Add
struct ata_xfer *active_xfer
to ata_queue. Now the active xfer isn't the head of the queue any more,
this makes a few things easier (this will also help for tagged queuing
support).
Remove the WDCF_ACTIVE flag, test active_xfer != NULL instead.
clean up wdc_free_xfer() and kill_xfer().
Clean up wdc_reset_channel(), and make it issue a ATAPI_SOFT_RESET if the
active command is ATAPI.
In wdc_atapi_get_params(), use AT_WAIT | AT_POLL for ATAPI_SOFT_RESET,
so that we'll use tsleep() instead of delay().
In wdc_atapi_start(), call wdc_dmawait() at the right place.
2004-08-04 18:24:10 +00:00
dyoung 49dce0aac4 Synchronize with the WEP code in madwifi. Konstantin KABASSANOV
verified for me that this fixes his WEP problems.  The HAL ABI for
WEP had changed.
2004-08-03 20:06:54 +00:00
drochner a7962d35bd implement device detach support 2004-08-03 18:35:21 +00:00
bouyer 73203a8277 Make it possible for (*dma_finish)() to abort quietly a DMA op. Use this
in wdc_reset_channel().
2004-08-02 22:20:54 +00:00
bouyer 495631e4d6 Clean up interraction between wdc_reset_channel and the kernel thread.
Move kill_xfer() after the reset, and stop the DMA engine if needed
(this will unload the DMA maps).
2004-08-02 22:02:35 +00:00
bouyer 011181ac3e Implement an atabus control device, and define some ATA bus control
IOCTLS. Implement ATABUSIORESET, which will reset the given ATA bus.
2004-08-01 21:40:41 +00:00
bouyer 7ffa35d1a2 Implement asynchronous channel reset.
Use this to reset the channel before doing a dump, instead of the hack in
  wdc_exec_xfer() based on C_POLL. This hack was causing problems on
  controllers with a shared queue, because we now can have C_POLL set during
  concurent channels probes (problem found and analysed on sparc64 by
  Martin Husemann).
This should even make core dumps marginally more reliable on ATA drives.
2004-07-31 21:26:42 +00:00
mrg 5f5ece3320 add several definitions useful for ICH-based speedstep.
(from linux and freebsd.)
2004-07-31 17:28:36 +00:00