Commit graph

5216 commits

Author SHA1 Message Date
John Baldwin 430e72ee1c Attempt to read and verify the card's status in wi_stop() before sending it
the disable command.  On some systems, writing to the card after it has
been ejected causes the machine to hang.

Reviewed by:	wpaul
2000-12-18 23:49:56 +00:00
Bill Paul 8d79969459 Add power state manipulation to the fxp driver. Some people have
claimed that their Intel NIC is comatose after a warm boot from Windoze.
This is most likely due to the card getting put in the D3 state. This
should bring it back to life.
2000-12-18 22:06:12 +00:00
Bill Paul 14a00c6c68 Use pci_get_powerstate()/pci_set_powerstate() which now exists in the
PCI code. This saves each driver from having to grovel around looking
for the right registers to twiddle.

I should eventually convert the other PCI drivers to do this; for now,
these three are ones which I know need power state handling.
2000-12-18 21:53:05 +00:00
Julian Elischer 589f6ed8ce Divorce the kernel binary ABI version number from the message
format version number. (userland programs should not need to be
recompiled when the netgraph kernel internal ABI is changed.

Also fix modules that don;t handle the fact that a caller may not supply
a return message pointer. (benign at the moment because the calling code
checks, but that will change)
2000-12-18 20:03:32 +00:00
Toshihiko ARAI d556784aa3 Linksys Fast Ethernet PCCARD cards supported by the ed driver now
require the addition of flag 0x80000 to their config line in
pccard.conf(5).  This flag is not optional.  These Linksys cards will
not be recognized without it.

Reviewed by:    imp, iwasaki
2000-12-18 15:28:53 +00:00
Cameron Grant 0f55ac6c1a kobjify.
this gives us several benefits, including:

* easier extensibility- new optional methods can be added to
  ac97/mixer/channel classes without having to fixup every driver.

* forward compatibility for drivers, provided no new mandatory methods are
  added.
2000-12-18 01:36:41 +00:00
Warner Losh 95b2cbbc17 Call ed_probe_Novel in the AX88190 case as well.
Remove stary blank line.

Submitted by:	Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
2000-12-17 18:15:15 +00:00
Poul-Henning Kamp b600010a5b Add a cloning function to vn(4) which triggers on "vn%d.ctl". Give the
.ctl devices their own cdevsw since no I/O can or should be done on them.

Vn(4) is still not entirely DEVFS friendly since it only creates vn%d
nodes.
2000-12-16 16:06:03 +00:00
Paul Richards d4dc2d4d0f Switch off some debugging code. 2000-12-16 03:29:27 +00:00
Paul Richards 3a173aeeb3 Fixup some problems with the merged code of the previous commit. 2000-12-16 01:41:14 +00:00
Paul Richards 232b06012c Newbusify.
Temporarily disable PC98 until I bring it up to date.
2000-12-16 01:33:28 +00:00
Bill Paul 163369c243 Apply some contributed patches to reduce number of tx buffer allocation
failures and add some support for WEP on Prism II chip.

Submitted by: YAMAMOTO Shigeru <shigeru@iij.ad.jp>
2000-12-15 23:34:13 +00:00
Poul-Henning Kamp e0913a2c44 Enforce disk unit numbers upper limit in cloning. 2000-12-15 16:42:38 +00:00
Takanori Watanabe 874d21b468 Fix with debugging option.
Submitted by:	haro@tk.kubota.co.jp
2000-12-15 09:18:11 +00:00
Takanori Watanabe c07572e7ad Make Embedded Controller driver interrupt driven. 2000-12-14 12:43:22 +00:00
Marcel Moolenaar 75a1da1e7a Fix include directories for crossbuilding.
aicasm is run on the build machine and therefore needs to be
compiled and linked against the headers and libraries (resp)
of the build machine. Since normally the default include
directories are search after any specified on the command
line, make sure we don't accidentally pick up machine
dependent headers from the kernel compile directory by
specifying /usr/include first.

This solves the (cross) build problem for ia64.

Approved by: gibbs
2000-12-13 23:15:12 +00:00
Seigo Tanimura 5dfa801a91 Include vm/vm_zone.h prior to vm/swap_pager.h.
Noticed by:	Michael Harnois <mdharnois@home.com>
Submitted by:	assar
2000-12-13 17:36:03 +00:00
Warner Losh 727928f866 Remove unnecessary includes found by phk's script. I've been building
these locally for ages.
2000-12-13 06:28:37 +00:00
Warner Losh 3a68d6087a Fix problem with ax88190 based cards trying to probe further after
matching the ax88190.
2000-12-13 06:27:23 +00:00
Warner Losh b76f687a7e Remove unnecessary includes found by phk's script a long time ago. 2000-12-13 06:25:22 +00:00
Warner Losh b66fd62112 Add module dependencies on CAM module.
Submitted by:	Michael Reifenberger
2000-12-13 05:46:23 +00:00
Mike Smith 70b5f189c9 Remove a redundant prototype. 2000-12-13 04:22:04 +00:00
Mike Smith 3742d6ca91 Don't try to free the now-nonexistent hdrspec field. This one snuck by
me in the previous round of patches.  Oops.
2000-12-13 02:45:03 +00:00
Warner Losh 6763347475 Add isa support:
o write isa driver routines.
o factor detach routine in sn_detach.
2000-12-13 01:47:19 +00:00
Mike Smith 84c6b37d74 Updates to match changes elsewhere in the PCI subsystem:
- Remove redundant header-type-specific support in the cardbus pcibus
   clone.  The bridges don't need this anymore.
 - Use pcib_get_bus instead of the deprecated pci_get_secondarybus.
 - Implement read/write ivar support for the pccbb, and teach it how
   to report its secondary bus number.  Save the subsidiary bus number
   as well, although we don't use it yet.
2000-12-13 01:28:00 +00:00
Mike Smith 8983cfbf27 Next round of PCI subsystem updates:
- Break out the /dev/pci driver into a separate file.
 - Kill the COMPAT_OLDPCI support.
 - Make the EISA bridge attach a bit more like the old code; explicitly
   check for the existence of eisa0/isa0 and only attach if they don't
   already exist.  Only make one bus_generic_attach() pass over the
   bridge, once both busses are attached.  Note that the stupid Intel
   bridge's class is entirely unpredictable.
 - Add prototypes and re-layout the core PCI modules in line with
   current coding standards (not a major whitespace change, just moving
   the module data to the top of the file).
 - Remove redundant type-2 bridge support from the core PCI code; the
   PCI-CardBus code does this itself internally.  Remove the now
   entirely redundant header-class-specific support, as well as the
   secondary and subordinate bus number fields.  These are bridge
   attributes now.
 - Add support for PCI Extended Capabilities.
 - Add support for PCI Power Management.  The interface currently
   allows a driver to query and set the power state of a device.
 - Add helper functions to allow drivers to enable/disable busmastering
   and the decoding of I/O and memory ranges.
 - Use PCI_SLOTMAX and PCI_FUNCMAX rather than magic numbers in some
   places.
 - Make the PCI-PCI bridge code a little more paranoid about valid
   I/O and memory decodes.
 - Add some more PCI register definitions for the command and status
   registers.  Correct another bogus definition for type-1 bridges.
2000-12-13 01:25:11 +00:00
Mike Smith 01282c87e3 Remove a couple of leftover unused variables. 2000-12-13 01:06:54 +00:00
Julian Elischer 1b3335af6a Another mismatch found by Gcc:
This is what happenss when you let the patches pile up too long without
committing them.. brain rot..
2000-12-12 23:56:16 +00:00
Julian Elischer c4e30752ba remove unused variable 2000-12-12 23:50:51 +00:00
Julian Elischer d00a91423d I always forget this file. It's netgraph, but not one of mine..... 2000-12-12 23:05:19 +00:00
John Baldwin 1639f08b45 Add a missing include of <sys/proc.h>. 2000-12-12 20:24:36 +00:00
Bill Paul 34da0ef197 Grrrrr. That last commit was supposed to be to the head, not to -stable
(even though I want the fixes in -stable anyway). I'm sure I'm going
to get flamed now for committing to -stable and -current too quickly.
*sigh*
2000-12-12 19:31:14 +00:00
Julian Elischer 859a4d166c Reviewed by: Archie@freebsd.org
This clears out my outstanding netgraph changes.
There is a netgraph change of design in the offing and this is to some
extent a superset of soem of the new functionality and some of the old
functionality that may be removed.

This code works as before, but allows some new features that I want to
work with and evaluate. It is the basis for a version of netgraph
with integral locking for SMP use.

This is running on my test machine with no new problems :-)
2000-12-12 18:52:14 +00:00
Mitsuru IWASAKI b2c9c0dab2 Catch up with the recent conversion the per-eventhandler list mutex to
a lockmgr lock.
2000-12-12 14:20:27 +00:00
Mike Smith 4fa59183f1 - We have access to our own device_t here, so use pci_read_config
rather than finding our parent pcib and using its PCI_READ_CONFIG
   method.

 - Fix the defines for the 32-bit I/O decode registers, and properly
   process the 16-bit versions.  Now we will correctly check that I/O
   resources behind the bridge are going to be decoded.

 - Bring the quirk for the Orion PCI:PCI bridge in here (since it
   seems to want to set the secondary/supplementary bus numbers).

 - Use PCI_SLOTMAX rather than a magic number.
2000-12-12 13:20:35 +00:00
Mike Smith 52daea05c5 Don't try to fix up the Orion here; the interface we use is wrong for the
new code (and about to disappear too).
2000-12-12 13:11:42 +00:00
Nick Hibma 040639a0aa make sure we tear down the devnodes for the endpoints 1 and above
when switching configuration.
2000-12-12 10:19:19 +00:00
Mike Smith fed8edf563 - Don't return early from the PCI:EISA bridge attachment, or we will lose
the ISA bus.
 - Don't expect that a PCI:ISA bridge will have a correct class value;
   if we're checking PCI IDs, only depend on these.

This should fix the loss of ISA on machines with PCI:EISA bridges like the
AS4100.
2000-12-12 03:33:02 +00:00
Hajimu UMEMOTO 39715b6a8a fix problem with vmware DAD. reported by many, tested @ IETF49 with
help from Florent Parent <Florent.Parent@viagenie.qc.ca>.

Obtained from:	KAME
2000-12-11 18:53:40 +00:00
MIHIRA Sanpei Yoshiro 23f344f985 add PNPID for PnP PCMCIA, SCM SwapBox Classic X2P.
PR:		kern/23344 (Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>)
2000-12-11 15:02:50 +00:00
Mike Smith e620c314df It looks like we can't count on these devices always having a consistent
class/subclass, so give up trying to cull the list.  Instead, complain
in the bootverbose case, but otherwise just accept that we will have to
carry this list of device IDs around.
2000-12-11 10:04:01 +00:00
Mike Smith 772922d066 The ICH2 reports itself as a PCI:ISA bridge, so don't special-case it
here.

Submitted by:	Michael Harnois <mdharnois@home.com>
2000-12-10 11:15:19 +00:00
Mike Smith fc3438d892 Cosmetic nit; separate slot/function with '.' not ':' 2000-12-09 09:37:07 +00:00
Mike Smith 2961fc5ac4 - Fix the device database parsing code so that it actually works.
- Improve the formatting for devices identified by the database.
 - Fix the pcib_route_interrupt method definition, as an old version
   snuck in here somehow 8(
 - Remove a couple of the vendor/device IDs for PCI:ISA bridges which
   correctly identify themselves.

Submitted by:	peter
2000-12-09 09:15:38 +00:00
Yoshihiro Takahashi 8297c2fc98 Fixed to support 3Com 3C569B for PC-98.
Submitted by:	"Hirokazu WATANABE" <gwna@geocities.co.jp>
2000-12-09 04:25:07 +00:00
Mike Smith bb0d0a8efc Next phase in the PCI subsystem cleanup.
- Move PCI core code to dev/pci.
 - Split bridge code out into separate modules.
 - Remove the descriptive strings from the bridge drivers.  If you
   want to know what a device is, use pciconf.  Add support for
   broadly identifying devices based on class/subclass, and for
   parsing a preloaded device identification database so that if
   you want to waste the memory, you can identify *anything* we know
   about.
 - Remove machine-dependant code from the core PCI code.  APIC interrupt
   mapping is performed by shadowing the intline register in machine-
   dependant code.
 - Bring interrupt routing support to the Alpha
   (although many platforms don't yet support routing or mapping
   interrupts entirely correctly).  This resulted in spamming
   <sys/bus.h> into more places than it really should have gone.
 - Put sys/dev on the kernel/modules include path.  This avoids
   having to change *all* the pci*.h includes.
2000-12-08 22:11:23 +00:00
David Malone 7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Bill Paul b1f3daafde Fix probe/attach a little. We don't have to call bpfattach() anymore
since ether_ifattach() does it for us. We do need to call ether_ifdetach()
instead of if_detach(). And we don't have to check for ifp->if_name
already being initialized because it never will be in FreeBSD 4.x and
above.

Reviewed by:	Warner Losh, Duncan Barclay
2000-12-08 21:35:11 +00:00
Mike Smith e0b349e634 Staticise some malloc pools
Submitted by:	phk
2000-12-08 20:48:33 +00:00
Poul-Henning Kamp 959b7375ed Staticize some malloc M_ instances. 2000-12-08 20:09:00 +00:00
Archie Cobbs 1725b22ad2 Fixes to the Aironet driver to clear up some WEP issues.
PR:		23097
Submitted by:	Doug Ambrisko <ambrisko@whistle.com>
2000-12-08 19:00:10 +00:00
Noriaki Mitsunaga e3f875caff Remove conflicts between unsinged char *s and int s.
It was possible cause of kernel panic.

Pointed Out by: phk@FreeBSD.ORG
2000-12-08 13:50:20 +00:00
Nick Hibma 64e3d839ec Remove a warning.
Reported by:	phk
2000-12-08 10:44:15 +00:00
Mike Smith 0ae554237c - Convert a lot of homebrew debugging output to use the ACPI CA debugging
infrastructure.  It's not perfect, but it's a lot better than what
   we've been using so far.  The following rules apply to this:
    o BSD component names should be capitalised
    o Layer names should be taken from the non-CA set for now.  We
      may elect to add some new BSD-specific layers later.

 - Make it possible to turn off selective debugging flags or layers
   by listing them in debug.acpi.layer or debug.acpi.level prefixed
   with !.

 - Fully implement support for avoiding nodes in the ACPI namespace.
   Nodes may be listed in the debug.acpi.avoid environment variable;
   these nodes and all their children will be ignored (although still
   scanned over) by ACPI functions which scan the namespace.  Multiple
   nodes can be specified, separated by whitespace.

 - Implement support for selectively disabling ACPI subsystem components
   via the debug.acpi.disable environment variable.  The following
   components can be disabled:
    o bus	creation/scanning of the ACPI 'bus'
    o children	attachment of children to the ACPI 'bus'
    o button	the acpi_button control-method button driver
    o ec	the acpi_ec embedded-controller driver
    o isa	acpi replacement of PnP BIOS for ISA device discovery
    o lid	the control-method lid switch driver
    o pci	pci root-bus discovery
    o processor CPU power/speed management
    o thermal	system temperature detection and control
    o timer	ACPI timecounter
   Multiple components may be disabled by specifying their name(s)
   separated by whitespace.

 - Add support for ioctl registration.  ACPI subsystem components may
   register ioctl handlers with the /dev/acpi generic ioctl handler,
   allowing us to avoid the need for a multitude of /dev/acpi* control
   devices, etc.
2000-12-08 09:16:20 +00:00
Archie Cobbs fa5e41c85d Add missing #include. 2000-12-08 00:49:37 +00:00
Bill Paul 15f43fcb0b When I converted this driver, I neglected to deal with packet alignment.
We must force payload alignment to a longword boundary to make the
alpha happy. This should stop the driver from trapping on the alpha
when the interface is ifconfig'ed (actually, when the first frame is
received).
2000-12-07 23:30:51 +00:00
Poul-Henning Kamp 7891600907 Don't use a private malloc(9) type for something this M_DEVBUFish.
Noticed long time ago by:	bde
2000-12-07 22:33:12 +00:00
Poul-Henning Kamp a3671bc8c8 Add back some now needed #include <sys/systm.h>
Fix various warnings while here anyway.
2000-12-07 22:19:06 +00:00
Alexander Langer 8c529b3777 Remove unneeded include of <pci.h>
Approved by:	groudier
2000-12-07 20:58:16 +00:00
Roger Hardiman 2c097d3332 Add Isochronus transfer mode support required by
USB WebCams, using a patch from Peter Housel.

With this change ugen, and with Peter's 'vid' program
in ports/graphics/vid, we can capture single images from USB Cameras
using the OmniVision OV511 chipset (including some models of the
Creative WebCam 3)

NetBSD merged in Peter's patch to their ugen.c file
several months ago, so this brings us back in line.

Submitted by:	Peter Housel <housel@acm.org>
		http://members.home.com/housel/
Approved by:	Nick Hibma
2000-12-07 10:28:25 +00:00
Roger Hardiman 5f41c13187 Non functional change.
Change a few indentations to tabs.
Change the functions to use ANSI sytle parameters.

This lowers the diffs between our copy of ugen.c and NetBSD's copy

Approved by:	Nick Hibma
2000-12-07 10:13:18 +00:00
Archie Cobbs 3a50ed55e2 Convert from spl -> mutex. 2000-12-07 02:09:39 +00:00
Matt Jacob 4081cc88c9 Only call ISP_UNLOCK/ISP_LOCK if isp->isp_osinfo.intsok in USEC_SLEEP.
Add a test against isp->isp_osinfo.islocked prior to trying to see
whether --isp->isp_osinfo.islocked is zero to cause us to unlock
(non-SMPLOCK case).
2000-12-05 07:41:53 +00:00
Matt Jacob bfbab17021 Replace some more printfs with isp_prt's. Use isp_prt/ISP_LOGDEBUG0
for rate setting/getting printouts.
2000-12-05 07:39:54 +00:00
Matt Jacob f7dddf8a54 Remove more printfs and use either isp_prt or device_printf. Remember
to set ISP_LOGINFO if bootverbose is set.
2000-12-05 07:38:41 +00:00
Warner Losh 05f80a57a7 Start to make code more generic so it can be used by the pccbb driver
in the future:
o Remove pcic_softc from pcic_handle and replace it with a void *
o Reduce dependence on accessing softc via a pcic_handle
Minor cleanups:
o Define a macro to count the size of an array and use it.
o Minor whitespace alignment
o make no slots found a printf not a panic.
2000-12-05 04:49:26 +00:00
Mike Smith 4d3329891c ACPI HID's aren't limited to 7 characters. Don't check the length of the
HID passed in as an argument at all; callers are typically going to be
sending us static strings anyway.

Submitted by:	Munehiro Matsuda <haro@tk.kubota.co.jp>
2000-12-05 00:19:10 +00:00
Bill Paul 031fc810ab Initialize/grab the mutex earlier in the attach phase, so that
bailing out to the fail: label where we release/destroy the mutex
will work without exploding.
2000-12-04 22:46:50 +00:00
David Malone ea8b5a9ae9 More M_ZERO patches.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	mjacob
2000-12-03 20:46:54 +00:00
Nick Sayer 305501d329 We now have the ability to assign the correct IRQ when PNP-OS is turned
on. So stop failing the attach if the IRQ is unassigned. With this
patch, I can now boot with PNP-OS YES in my BIOS no differently than
PNP-OS NO (which is a good thing since Windows hangs with PNP-OS NO).

Obtained from:	msmith
2000-12-03 17:07:19 +00:00
David Malone 087e2cb75a Use M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	mark_salyzyn@adaptec.com
2000-12-03 13:21:55 +00:00
Mike Smith b09d2ca319 - add support for crashdumps (courtesy of ps and Y!)
- standardise error reporting for commands
 - simplify the driver-to-controller bio transfer
 - add bio in/out accounting
 - correctly preserve the command ID in twe_ioctl (thanks to joel@3ware)
2000-12-03 02:11:35 +00:00
Mark Murray 84d4f509f0 Major speedup to /dev/random and the kernel thread that reseeds it.
There is no more TAILQ fifo to harvest the entropy; instead, there
is a circular buffer of constant size (changeable by macro) that
pretty dramatically improves the speed and fixes potential slowdowns-
by-locking.

Also gone are a slew of malloc(9) and free(9) calls; all harvesting
buffers are static.

All-in-all, this is a good performance improvement.

Thanks-to:	msmith for the circular buffer concept-code.
2000-12-02 18:40:16 +00:00
Matt Jacob e5f2f488c5 Add USEC_SLEEP macro support. Change the location at which we define
ISP_LOCK/ISP_UNLOCK macros.
2000-12-02 18:33:29 +00:00
Matt Jacob 81babfd043 Make the Not RESPONSE in RESPONSE QUEUE message have a bit more info
(specifically, how many entries we've looked at so far). Maintain
interrupt instrumentation. Use USEC_SLEEP instead of USEC_DELAY in
a number of places (this allows us to drop locks and sleep instead
of spin). Track changes to configuration options for topology preference.
Fix botched order of printout for Channel, Target, Lun.
2000-12-02 18:08:35 +00:00
Matt Jacob 67afe757a2 Add interrupt instrumentation. Change ISP_CFG_NPORT config option to
a set of options that allows specific loop, loop-only, nport, nport-only
topology settings. Define a required macro for all platforms (USEC_SLEEP).
2000-12-02 18:06:03 +00:00
Scott Long 3cd59d7b9c Revert attach() back to the old behaviour of calling bus_generic_attach().
The new way doesn't seem to work reliably and was causing devices to not
be seen.

Approved by:	msmith
2000-12-02 01:14:14 +00:00
Poul-Henning Kamp 90e1dc9f59 Make labels mandatory for vn(4). 2000-12-01 22:27:40 +00:00
Andrew Gallatin 689634a3ea Convert the pcib_{read,write}_config args from signed to unsigned,
like the args to the config space accessors these functions replaced.

This reduces the likelyhood of overflow when the args are used in
macros on the alpha.  This prevents memory management faults when
probing the pci bus on sables, multias and nonames.

Approved by: dfr
Tested by: Bernd Walter <ticso@cicely8.cicely.de>
2000-12-01 15:27:48 +00:00
Jonathan Lemon 280a27d267 Add PCI id for the RAID LC2 controller.
Pick up correct location for the DEC version of the chip, this
got broken in a previous commit.
2000-12-01 15:26:11 +00:00
Mike Smith c434440bac AcpiOsMem primitives as required by the new ACPI CA snapshot 2000-12-01 10:19:28 +00:00
Mike Smith 042283a67b Update to work with the new ACPI CA snapshot.
- Use ACPI_PHYSICAL_ADDRESS
 - RSDT -> XSDT
 - FACP -> FADT
 - No APIC table support
 - Don't install a global EC handler; this has bad side-effects
   (it invokes _REG in *all* EC spaces in the namespace!)
 - Check for PCI bus instances already existing before adding them
2000-12-01 10:18:57 +00:00
Kazutaka YOKOTA 872dfb2dd3 - Add a hack for "psmintr: out of sync.." This is NOT a fix,
but a hack! Add `flags 0x8000' to the psm driver to enable it.
  The psm driver will try to get out of out-of-sync situation
  by disabling the mouse and immediately enable it again.

If you are seeing this out-of-sync problem because of an
incompetent(?!) KVM switch, this hack will NOT be good
for you.  However, if you are occasionally seeing the
problem because of lost mouse interrupt, this might help.
2000-12-01 05:26:24 +00:00
Kazutaka YOKOTA ed584487bd - Slightly rearrnage IntelliMouse Explorer and Logitech
MouseMan+ identification routines for efficiency.
  No functional change.
2000-12-01 05:24:30 +00:00
Warner Losh d30cc7112b Kill #define of DETACH_FORCE since it is now in card_if.m 2000-11-30 23:30:47 +00:00
Justin T. Gibbs fd121bf8af Remove an unused variable.
Properly advance to the next image while searching for the ROM image
that contains CIS data.

KNF an if statement.
2000-11-30 19:14:26 +00:00
Alfred Perlstein 82625cf321 remove unneded sys/ucred.h includes 2000-11-30 18:52:32 +00:00
Jonathan Chen d58b9dbc97 This fixes several problems with CIS as suggested by Justin Gibbs:
4) The cardbus CIS code treats the CIS_PTR as a mapping register if
   it is mentioned in the CIS.  I don't have a spec handy to understand
   why the CIS_PTR is mentioned in the CIS, but allocating a memory range
   for it is certainly bogus.  My patch ignores bar #6 to prevent the
   mapping.
   [The pccard spec says that BAR 0 and 7 (-1 and 6 in thic case since we
    did a minus one) is "reserved".  The off by 1 error has been fixed.
    also bar=5 is invalid for IO maps, so we check it.]

5) The CIS code allocated duplicate resources to those already found
   by cardbus_add_resources().  The fix is to pass in the bar computed
   from the CIS instead of the particular resource ID for that bar,
   so bus_generic_alloc_resource succeeds in finding the old resource.
   [fixed, also removed superfluous (and incorrect) writing back to the
    PCI config space.]

7) The CIS code seems to use the wrong bit to determine rather a particular
   register mapping is for I/O or memory space.  From looking at the
   two cards I have, it seems TPL_BAR_REG_AS should be 0x10 instead
   of 0x08.  Otherwise, all registers that should be I/O mapped gain
   a second mapping in memory space.
   [Oops, the spec does say 0x10..., fixed]

Submitted by: Justin Gibbs
2000-11-29 19:38:25 +00:00
Jonathan Chen 49f158ccc8 Oops, broke CIS reading from ROM on my last commit.
This should fix it.
2000-11-29 16:08:01 +00:00
Mike Smith ee435af1ae Remove some over- 2000-11-28 20:51:04 +00:00
Mike Smith b60f56f73b MFS:
Fix amr_map_command so that 40LD-specific commands get the scatter-gather
   list count in the right place.  I don't understand why AMI did it like
   this, but now the AMI MegaManager can talk to the newer (1600 and later)
   controllers.

   Remove an unused variable.

   Include <machine/clock.h> when necessary.

   Tweak some debugging levels to make things more intelligible.
2000-11-28 19:28:22 +00:00
Jonathan Chen c3342a3d99 Oops, broke newcard because I forgot to commit this in my last round of changes to pccbb.c 2000-11-28 15:50:13 +00:00
Matthew N. Dodd 1581afb38d Reduce code duplication by using the GET_RESOURCE_LIST bus method and related
generic resource_list management functions.

I'll deal with the EISA bits later.

Not objected to by:	 new-bus
2000-11-28 07:12:12 +00:00
Greg Lehey e19bc84f20 Don't include system-specific header files for userland program.
Discovered by default by: alfred
2000-11-28 06:38:53 +00:00
Matthew N. Dodd 9b11c7ba44 Avoid hardcoding the 'rid' and 'type' of the MEM/IOPORT resource.
Store the 'rid' and 'type' in the softc and use them in mlx.c:mlx_free().

EISA and MCA front ends will require this.

Approved by:	 msmith
2000-11-28 06:17:32 +00:00
Jonathan Chen c669d6a002 1) When mucking with mapping registers, it is best to *not* have
io or memory space access enabled.  This patch defers the setting
   of these bits until after all of the mapping registers are probed.
   It might be even better to defer this until a particular mapping
   is activated and to disable that type of access when a new
   register is activated.

2) The PCI spec is very explicit about how mapping registers and
   the expansion ROM mapping register should be probed.  This patch
   makes cardbus_add_map() follow the spec.

3) The PCI spec allows a device to use the same address decoder for
   expansion ROM access as is used for memory mapped register access.
   This patch carefully enables and disables ROM access along with
   resource (de)activiation.

This doesn't include the prefetching detection stuff (maybe later when code is written to actually turn on prefetching).  It also does not use the PCI definitions (yet, I'll try to put this in all at once later)

Submitted by: Justin T. Gibbs
2000-11-28 00:52:40 +00:00
Jonathan Chen 7bec1dd5e1 overhaul cis functions to read cis tuple by tuple (instead of all at once).
Also fix incorrect parsing of BAR.
2000-11-28 00:08:18 +00:00
Jonathan Chen af82f62d2f A bunch of newcard/cardbus changes that's been sitting in my tree for a while:
- Make pccbb/cardbus kld loadable and unloadable.
- Make pccbb/cardbus use the power interface from pccard instead of inventing its own.
- some other minor fixes
2000-11-28 00:05:20 +00:00
Jonathan Chen a8e5d9ac32 Patch to use M_ZERO
Submitted by: David Malone
2000-11-27 23:55:19 +00:00
Poul-Henning Kamp cb7e609a3c Make diskerr() always log with printf. 2000-11-26 19:29:15 +00:00