Commit Graph

1134 Commits

Author SHA1 Message Date
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
yamt 18f717bb90 constify audio_hw_if, midi_hw_if, and radio_hw_if. 2004-10-29 12:57:15 +00:00
enami 5c26271a67 Back out part of previous. The card refered in PR/27255 needs to be
handled differently (at least the current code doesn't handle well).
2004-10-24 22:17:07 +00:00
enami 740cc023cc Rewrite the loop without using useless SIMPLEQ_FOREACH macro. 2004-10-15 21:25:04 +00:00
enami d5e42fa312 - Don't change the matching logic.
- Prepare to describe a card which has NULL CIS string.
- Factor out common code.
- Deal with malloc return value.
2004-10-15 00:48:53 +00:00
enami d10ffa8c6e Don't change the logic when simplifing code; a OR was changed to AND
and a test was removed but they shouldn't be changed.
2004-10-15 00:25:06 +00:00
christos 2634ff1b14 PR/27255: Nikos Ntarmos: PCMCIA NIC with blank CIS tuples crashes the kernel
Simplify the code for readability.
2004-10-14 00:17:12 +00:00
toshii a7d72b4250 Make this compile on arches without __BUS_SPACE_HAS_STREAM_METHODS. 2004-10-03 09:36:49 +00:00
itojun 0f8f9a1f56 deal with PCMCIA_TPCE_IO_RANGE_ADDRSIZE_NONE and
PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_NONE properly.  enami
solves kern/26726.
2004-09-17 18:42:41 +00:00
drochner 96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00
enami 872adc6ce0 No need to disable if we failed before enabling it. 2004-09-07 00:24:18 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej 2926431abf Use ANSI function decls and "static". 2004-08-19 23:30:09 +00:00
thorpej 1600c8b8cd - Add and use a CHAN_TO_WDC() macro to get the wdc_softc from an
ata_channel.
- Add and use a CHAN_TO_WDC_REGS() macro to get the wdc_regs from an
  ata_channel.
- Add and use a CHAN_TO_PCIIDE() macro to get the pciide_softc from an
  ata_channel.
- Add and use a CHAN_TO_PCHAN() macro to get the pciide_channel from an
  ata_channel.  (This one just hides a cast, and is really just for
  consistency with the others.)
2004-08-19 23:25:35 +00:00
drochner 890158d024 Allow to rescan and detach by user request, using the new autoconf
functions.
For later rescans (eg after a driver LKM was loaded) to make sense,
don't consider it an error if no driver was attached on the initial
bus scan.
Someone who understands the enable/disable/powerup/down stuff please
review this.
2004-08-18 12:01:13 +00:00
mycroft 48de8a7bff wdc_init_shadow_regs() must now be called after ch_wdc is filled in, or we get
a null pointer dereference.
2004-08-16 14:47:31 +00:00
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
mycroft e3dd5f4885 Rearrange slightly so that we don't blow up if the card disappears during the
initial enable.
2004-08-13 12:42:11 +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
mycroft 7aa8e97898 Simplify a little. Pass down the card type from pcmcia_function_enable(),
which just gets it from the config entry for the function it's enabling.
Multifunction cards are defined to be of type I/O on every function, so there
is no possibility of accidentally switching.
2004-08-12 19:59:07 +00:00
mycroft cba67af302 Remove sc_offset. It's always 0, and if we did want to use it, "that's what
bus_space_subregion() is for".
2004-08-12 19:42:03 +00:00
mycroft 7fdb60e126 delay() -> tsleep() 2004-08-12 19:32:36 +00:00
mycroft f881dcb9b2 Remove the "known bugs" section. I've fixed both of them.
Use tsleep() rather than delay().  XXX Most of these are probably unnecessary
anyway.  In particular, I believe that what xi_full_reset() does is totally
gratuitous after power-cycling the socket; it should only be necessary if we
want to use power-saving mode.
2004-08-12 18:23:50 +00:00
mycroft bc9922c5ca Now that we write the IOBASE in generic code, don't do it here. Instead,
implement the hackish/stupid test for the AX88190 by just checking whether
the IOBASE is available in the CCR.

This is unspeakably wrong, but it leaves the code doing ~the same thing it
did before.
2004-08-12 17:33:17 +00:00
mycroft 3c4f1ecaa3 If the card is being detached, do not try to write the CCR to disable the
function.
2004-08-12 17:31:06 +00:00
mycroft 438f4e5647 Always write the IOBASE/IOLIMIT registers if they're set in the CCR mask. We
can't really rely on multifunction devices having a CIS that reflects this --
e.g. some cards use a combined Ethernet+modem chip, but only actually serve
one of the functions.  (We have to assume the configuration index reflects the
bits needed to enable the function.)
2004-08-12 17:26:51 +00:00
mycroft dc63cc8d34 The AX88790 hack never made any sense. It's setting the PWRDWN bit in the CCR!
So, I'm removing it.
2004-08-12 17:13:54 +00:00
mycroft 03a381d5d5 Write the configuration option register -- possibly switching the device into
its I/O mode -- as the *last* write to the CCR.
2004-08-12 17:07:52 +00:00
mycroft 8e026e9d56 Don't call socket_settype() to enable I/O interrupts until after we've written
the CCR.
2004-08-12 17:06:49 +00:00
mycroft 1714f4f98a My previous understanding of the I/O base/limit registers was incorrect.
However, so was the old code.  Now it works correctly.  :-)
2004-08-12 16:04:20 +00:00
mycroft 0ed22a5ae1 Output a message if we fail to find anything useful in the CIS, rather than
appearing to do nothing.
2004-08-11 20:57:40 +00:00
mycroft b2e0a4015a We don't need to implement DRIVE_NOSTREAM here, 'cause we never set
WDC_CAPABILITY_NOSTREAM.
2004-08-11 20:27:42 +00:00
mycroft 6e3decbf8a "I was mistaken."
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.
2004-08-11 19:48:57 +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 c8e7b2a367 The memory mode we were trying to use before is a total loss -- we don't get
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.
2004-08-11 18:06:22 +00:00
drochner ad1c914cc3 adapt to esl_pcmcia changes 2004-08-11 16:20:05 +00:00
mycroft d54277f76c Do not ever set IOIS8. We are not running on an 8088. 2004-08-11 04:35:35 +00:00
mycroft 8f96fc7c75 Always use PCMCIA_WIDTH_AUTO rather than PCMCIA_WIDTH_IO16. This spec is
pretty clear on how this works.
2004-08-11 04:25:28 +00:00
mycroft 310c1dab88 Do the read of the MAC address before enabling the function the first time,
so we're still in memory mode.
2004-08-11 03:56:03 +00:00
mycroft faaea66252 Fix uninitialized variable warnings (which did not appear on x86). 2004-08-11 00:32:44 +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 a6bd4c05d7 GC some unneeded struct elements. 2004-08-10 23:34:32 +00:00
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 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
mycroft c2ecd3e635 Update to the new world order. While I'm here, simplify a lot. 2004-08-10 21:14:50 +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