Commit Graph

1238 Commits

Author SHA1 Message Date
rpaulo abddbf01be Back out rev 1.42 and 1.43. It's been causing much more hassle than it should
and I don't feel like continue arguing about it.
2006-04-08 15:59:59 +00:00
rpaulo 2fdcdded0b Add misssing }. Sorry for breaking the build. 2006-04-06 22:35:47 +00:00
rpaulo ed268c60d0 In pcmcia_parse_cis_tuple(), refactor the memspace section introducing
a switch statement and fixing CID 566.
2006-04-06 18:06:43 +00:00
thorpej 78ffd948be Replace device_locators() with device_locator(), and use it. 2006-03-29 06:00:46 +00:00
bouyer ff4b8c4e53 As we are going to sleep here, we need to use
config_pending_incr()/config_pending_decr() so that disks are probed
before trying to mount root, if the card is plugged in at boot time.
Should fix kern/33137 by KIYOHARA Takashi.
2006-03-26 15:34:19 +00:00
thorpej 6e53f1366a Use device_parent(). 2006-03-25 23:14:58 +00:00
christos 6883d3cdd3 Regen 2006-03-23 02:15:05 +00:00
christos c40c4c462e PR/33133: Dave J. Barnes: Belkin F5D5020 Ethernet PCMCIA card not recognised 2006-03-23 02:14:42 +00:00
gdamore 39b794a41d When unmapping and remapping, the mem handle and mem tags can change. Do
not assume that they will remain the same.
2006-02-23 03:20:53 +00:00
gdamore 3ca20d0b44 Add new ihandle member to pcmcia_io_handle, similar to pcmcia_mem_handle's
mhandle structure.  This is for opaque use by pcmcia chipsets.
2006-02-23 03:18:42 +00:00
thorpej 3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
christos 8918ce44a0 Default to 2 drives for products not listed. 2006-01-22 00:08:38 +00:00
bouyer bf1a4d2af5 properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
  for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
2006-01-16 20:30:18 +00:00
christos e35d1933fb Add SanDisk pcmcia memory card adapter. Works like an IDE drive.
XXX: Linux driver has a hack not to probe the slave drive. We just
create a phantom drive:

    wdc0 at pcmcia0 function 0: <             , Memory Card Adapter II, V1.00>
    wdc0: i/o mapped mode
    atabus2 at wdc0 channel 0
    wd1 at atabus2 drive 0: <Memory Card Adapter II>
    wd1: drive supports 1-sector PIO transfers, LBA addressing
    wd1: 241 MB, 965 cyl, 16 head, 32 sec, 512 bytes/sect x 494080 sectors
    wd2 at atabus2 drive 1: <>
    wd2: drive supports 1-sector PIO transfers, chs addressing
    wd2: 0, 0 cyl, 0 head, 0 sec, 512 bytes/sect x 0 sectors
    wd2: 32-bit data port
    wd2: disk label read failed
    wd2: disk label read failed
2006-01-11 13:34:33 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
tsutsui fe35cfd50c Regen from pcmciadevs rev 1.213:
> Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
> If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
> never matches the device.
2005-11-07 16:39:16 +00:00
tsutsui cf09fb3893 Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
never matches the device.
2005-11-07 16:37:28 +00:00
jdc 0dbca227cf Change memoff to bus_size_t (like all other PCMCIA devices).
Now compiles on sparc too.
2005-10-06 20:54:31 +00:00
christos ac3f544e6d fix compilation with debugging on. 2005-09-08 18:41:50 +00:00
drochner 49a3609892 kill some more simple submatch() functions, use config_stdsubmatch() 2005-08-26 11:20:33 +00:00
drochner 49126e9efe use XXXCF_NLOCS constants instead of magic numbers 2005-08-26 11:01:42 +00:00
drochner e6a178f21f kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

This is handled by config_stdsubmatch() now.
2005-08-25 22:33:18 +00:00
drochner fa3cb84d62 replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
2005-08-25 18:35:38 +00:00
christos aef258e0aa PR/30995: Wada Keiji: pcmcia interface can't use ne2000 compatible card
Call pcmcia_socket_settype sooner. I removed the later call, so the submitter
should test the final code before I close the PR.
2005-08-15 18:58:24 +00:00
christos d39684a368 make the isdn drivers compile again with -Wconst, -Wshadow 2005-07-09 02:05:09 +00:00
dyoung 674e9b926b Identify Alvarion Ltd. BreezeNET PC-DS.11b. Addresses kern/30231. 2005-07-06 07:16:00 +00:00
dyoung b01131baed Regen. 2005-07-06 07:06:29 +00:00
dyoung b34605c1a7 Add Alvarion (vendor) and Alvarion Ltd. BreezeNET PC-DS.11b (product).
From PR kern/30231.
2005-07-06 07:05:25 +00:00
martin 5d90a83160 constify 2005-07-01 15:05:07 +00:00
dyoung 9063402978 Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
2005-06-22 06:14:51 +00:00
bouyer 3d0edb52b9 When the PCMCIA socket is powered up, the driver waits for the PCMCIA
controller to be ready, but the drive attached to it may not be ready yet.
Add a half a second delay before calling wdcattach(), to let the drive
have its electronic ready to properly respond to the register tests done
in wdcprobe1(). Delay based on experiments done by John Refling with
various devices as part of the audit-trail of kern/25659; complete
the fix for kern/25659.
2005-06-19 18:19:19 +00:00
itohy 8202086879 cc1: warnings being treated as errors
../../../../dev/pcmcia/if_wi_pcmcia.c: In function `wi_pcmcia_write_firm':
../../../../dev/pcmcia/if_wi_pcmcia.c:511: warning: cast discards qualifiers from pointer target type
../../../../dev/pcmcia/if_wi_pcmcia.c:512: warning: cast discards qualifiers from pointer target type
2005-06-10 14:08:06 +00:00
drochner 31924c84cd cast-qual fallout 2005-05-31 19:20:37 +00:00
christos 097e6576ea - add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
2005-05-30 04:28:49 +00:00
martin 7d47b99684 Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
2005-05-07 17:02:47 +00:00
martin 82e51b8933 Regen. 2005-05-07 17:01:11 +00:00
martin 714292a59f Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
2005-05-07 16:59:11 +00:00
jmcneill adf922e656 Update my email address (the one listed hasn't been active in years). 2005-03-24 22:31:58 +00:00
martin 71cce6ecd0 Add support for Proxim RangeLAN-DS 8430;
from Gabriel Forté, via Julien Rampon on tech-net
2005-03-23 12:00:22 +00:00
martin 8e03193d1b Regen (Proxim RangeLAN-DS 8430 added) 2005-03-23 11:59:38 +00:00
martin a16552ce02 From Gabriel Forté, via Julien Rampon in mail to tech-net:
add Proxim RangeLAN-DS 8430
2005-03-23 11:58:56 +00:00
christos d1ff4d2389 Regen 2005-03-19 22:00:27 +00:00
christos 5412502bb7 PR/29482: Kirk Strauser: Add support for Microsoft MN-520 PCMCIA WLAN card 2005-03-19 21:59:56 +00:00
matt 153ebc7689 Just like wdc.c, if the bus_space implementation doesn't support stream
method, make them equivalent to the non-stream methods.
2005-03-11 16:17:57 +00:00
perry c576ebdacb regen 2005-02-27 15:29:37 +00:00
perry e25e66db2d don't leave spaces at the end of stripped RCS Ids 2005-02-27 15:29:09 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
thorpej d8474fd414 Eliminate the use of M_HASFCS. 2005-01-30 19:30:16 +00:00
imp babfd80c55 Update to using new INTERSIL names, plus a couple generic entries from FreeBSD 2005-01-21 20:27:03 +00:00
imp fcc7589129 Replace NETGEAR_2 with INTERSIL to reflect who actually owns the ID. Add some IDs from FreeBSD 2005-01-21 20:26:09 +00:00
kent 93293b9ec7 ansify and KNF 2005-01-15 15:19:51 +00:00
kent 23b5d91433 merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
  - remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels.  Conversion information
is conveyed by stream_filter_list_t.
  - change the type of sample_rate: u_long -> u_int
  - add `validbits,' which represents the valid data size in
precision bits.  It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
 - add two parameters to set_params()
	stream_filter_list_t *pfil, stream_filter_list *rfil
   A HW driver should set filter recipes for requested formats
 - constify audio_params parameters of trigger_output() and
trigger_input().  They represent audio formats for the hardware.
 - make open() and close() optional
 - add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
 to round_blocksize()

* sw_code is replaced with stream_filter_t.
  stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
  converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
 - audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
 - audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
 - audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
 - ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-10 22:01:36 +00:00
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