Commit Graph

1373 Commits

Author SHA1 Message Date
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jmcneill
f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
jmcneill
9c01d5a7bc Regen for PR# 15666. 2006-09-23 15:40:16 +00:00
jmcneill
e748bee1f6 PR# 15666: EDIMAX EP-4101 PCMCIA card support (patch included) 2006-09-23 15:39:51 +00:00
jmcneill
696fb7f495 Regen for PR# 27840. 2006-09-23 13:21:29 +00:00
jmcneill
ee203eb22f PR# 27840: patch for IO DATA PCET/TX-R PCMCIA Ethernet card support 2006-09-23 13:21:01 +00:00
plunky
4f1cbddc12 update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
2006-09-10 15:45:55 +00:00
dogcow
f2d329dca0 remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
christos
2ef37e3f61 use c99 initializers 2006-09-03 04:52:14 +00:00
christos
3cd45450e8 redo with c99 initializers 2006-09-02 18:59:46 +00:00
christos
bd4bd1bf9d - comment out impossible comparison
- add missing initializer
2006-09-02 18:58:02 +00:00
christos
ce149b700c fix initializers. 2006-08-30 16:55:06 +00:00
christos
bf74b6c774 add missing initializers 2006-08-30 16:51:24 +00:00
christos
f202705964 fix incomplete initializer 2006-08-30 01:09:39 +00:00
plunky
f2c2a49a27 Make suspend/resume work properly for bt3c device.
Since state is kept inside the device that will be lost, we need to
flush all information relating to this controller from the protocol
stack.
2006-08-28 10:34:33 +00:00
christos
d3b80ef998 remove impossible conditional 2006-08-28 00:10:20 +00:00
christos
35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
scottr
aed25205e0 Regenerate with correct rcsids 2006-07-28 08:57:03 +00:00
scottr
f9be1a6de9 Add Siemens SS1021 WLAN. 2006-07-28 08:02:39 +00:00
ad
3029ac48c7 - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
2006-07-21 16:48:45 +00:00
gdamore
34537908ab Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@.  Fixes PR port-evbmips/32362.
2006-07-13 22:56:00 +00:00
peter
58224a41e7 Add power hooks for "ep* at pcmcia?".
ok christos@
2006-07-11 22:49:47 +00:00
peter
09f0de7ce4 Add power hooks for "ne* at pcmcia?".
ok christos@
2006-07-11 22:48:37 +00:00
drochner
f7c7c95eb6 make some bluetooth devices just devices, not interface attributes 2006-06-21 17:14:13 +00:00
christos
89826912b8 Add another rogue card. 2006-06-19 21:53:57 +00:00
gdamore
abf73663d1 Regen pcmciadevs. Sorry. 2006-06-19 16:44:24 +00:00
gdamore
a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
christos
7b128daa3b stack police: Introduce an opl_match function that uses malloc instead of
allocating ~2K of softc on the stack.
2006-06-09 21:55:33 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
rpaulo
e54bb9fc0c Comment out wl. 2006-04-26 16:19:52 +00:00
christos
7fad94d825 Coverity CID 1111: Fix cut'n'paste bug! 2006-04-14 17:50:27 +00:00
christos
4be84f7cdb Coverity CID 1112: If we did not get a packet, bail out early. 2006-04-14 17:46:29 +00:00
christos
af27d5132b Coverity CID 773: Add a KASSERT to appease coverity. 2006-04-14 17:42:29 +00:00
christos
4b5dc3b5a8 - wrap memspace {}, pointed out by rui.
- comment out the memspace none case, pointed out by rui.
- move declarations to the top to avoid brace mess.
2006-04-08 20:55:22 +00:00
christos
c2909c51dd Split the tuple parsing code in its own function for each kind, instead of
having a single parsing function that has more than 1000 lines of code.
2006-04-08 20:01:21 +00:00
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
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
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
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
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
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
16e317876a Minor change. 2004-08-09 22:24:37 +00:00
mycroft
125ba6ee0c Adapt to the new world order. 2004-08-09 22:02:11 +00:00
mycroft
975673d3f6 Adapt to the new world order. 2004-08-09 21:30:18 +00:00
mycroft
285bec8287 Minor code reduction. 2004-08-09 20:30:19 +00:00
mycroft
b37b3de94e Adapt to the new world order. Now all my sm cards work. 2004-08-09 20:30:08 +00:00
mycroft
36c30a2f1a Dispense with all the interrupt multiplexing code here, and assume that the
underlying implementation DTRT.  This has the side effect of causing us to
ignore the INTR and INTRACK bits in the CCR -- but this seems for the best
anyway, since they are not reliably implemented.  (I note that Linux doesn't
bother either.)
2004-08-09 20:02:36 +00:00
mycroft
7848004c46 Do the I/O mapping in the main attach routine.
Also, we don't need to bother cleaning up on a failed attach -- we keep enough
state for the detach routine to do it.
2004-08-09 19:34:00 +00:00
mycroft
bc7b11e4ff Add newlines to the messages... 2004-08-09 19:33:07 +00:00
mycroft
b7a991ceb6 Whoops, nuke an unused variable. 2004-08-09 19:09:06 +00:00
mycroft
65d47754b3 Assume that io_map/unmap and intr_establish/disestablish will not be called
with the function enabled.  If this happens, issue a warning.  (This is only
really important for multifunction cards.)

This allows me to get rid of a bunch of extra code.
2004-08-09 19:08:19 +00:00
mycroft
f65dd54152 Correct the intr_establish order here. 2004-08-09 18:51:32 +00:00
mycroft
7b96c587dc Fix the intr_establish/disestablish order here too. 2004-08-09 18:41:36 +00:00
mycroft
9092e2c97e Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits.  pcmcia_intr_disestablish() continues to do this as a stopgap.
2004-08-09 18:30:51 +00:00
mycroft
2ae40d3e4f Do our io_map()s and intr_establish()es earlier. 2004-08-09 18:11:01 +00:00
mycroft
af19b73069 Do io_map() and intr_establish() before enabling the function, always. This
prevents "stray interrupts" during attach.
2004-08-09 17:00:53 +00:00
mycroft
deca9207b3 If the function is not enabled, do not attempt to immediately update the CCR.
XXX This is a stopgap until all drivers are converted to do their io_maps and
intr_establishes before function_enable.
2004-08-09 16:59:10 +00:00
mycroft
c74553663e Add some code to deal with the interrupt mask register on early CEM cards.
Doesn't seem to work yet, but it's marginal progress.
2004-08-09 16:05:00 +00:00
mycroft
c8180f49fd Use PCMCIA_WIDTH_AUTO, not PCMCIA_WIDTH_IO16, since we (sometimes) do 8-bit
access.
2004-08-09 15:40:56 +00:00
mycroft
b03f5b32c7 Pass a valid alignment to pcmcia_io_alloc(). 2004-08-09 14:24:10 +00:00
mycroft
4e92489373 Add detach support for spc@pcmcia, modeled after aic@pcmcia. 2004-08-09 14:07:57 +00:00
mycroft
10121549dd Add a hack that makes the address register programming more reliable on my
CE2 cards.
2004-08-09 13:30:16 +00:00
mycroft
eaae9fcf2b The "savedpage" stuff is nonsense. Every place we touch the device is
protected by splnet(), so there's no reason to even try.
2004-08-09 05:11:33 +00:00
mycroft
a271b4e6ab Go online in xi_init(), not xi_full_reset(). Enable/disable receive in
xi_init()/xi_stop().
2004-08-09 04:47:40 +00:00
mycroft
0e261f0935 Fix a debugging printf(). 2004-08-09 02:10:25 +00:00
mycroft
105470da05 Do not set INTRACK ourselves. 2004-08-09 02:01:16 +00:00
mycroft
cafa5cc2d1 Implement the correct (I think) interrupt acknowledgement sequence. 2004-08-09 01:49:26 +00:00
mycroft
00a9c911e6 Multifunction fixes:
* Don't call handlers for functions that are not enabled.
* Always call the handler if the function doesn't support the STATUS register.
While I'm here, divide the CCR numbers by 2.
2004-08-09 01:32:04 +00:00