Commit Graph

449 Commits

Author SHA1 Message Date
John-Mark Gurney
244f64d007 relocate the power state transition statements to the
pci_set_powerstate_method function...

Reviewed by:	imp
MFC after:	1 week
2005-03-23 21:24:29 +00:00
Warner Losh
36fed96550 Use STAILQ in preference to SLIST for the resources. Insert new resources
last in the list rather than first.

This makes the resouces print in the 4.x order rather than the 5.x order
(eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x).  This
also means that the pci code will once again print the resources in BAR
ascending order.
2005-03-18 05:19:50 +00:00
Warner Losh
463ec0ac87 If bus_generic_susped returns an error, devlist is not freed. Free it.
Submitted by: Ted Unangst (using the Coverity Prevent analysis tool)
2005-03-15 22:53:31 +00:00
Warner Losh
c3c08f307c Expose pci_cfg_safe/restore for subclasses of pci to use. 2005-02-28 01:14:15 +00:00
Poul-Henning Kamp
78b7c8d68d Use dynamic major number allocation. 2005-02-27 22:11:02 +00:00
Sam Leffler
aedaf6e272 kill unused variable
Noticed by:	Coverity Prevent analysis tool
2005-02-25 23:15:48 +00:00
Warner Losh
2daa7a07ae For the I/O port case, we need to set ok to 1 if we have what looks
like a valid range.  We already do this in the memory case (although
the code there is somewhat different than the I/o case because we have
to deal with different kinds of memory).  Since most laptops don't
have non-subtractive bridges, this wasn't seen in practice.

Evidentally the Compaq R3000 hits this problem with PC Cards.

Some minor style fixes while I'm here.

Submitted by: Jung-uk Kim
2005-02-18 17:35:03 +00:00
Bernd Walter
b542a023e5 Enable interrupt routing as first choice on alpha.
The alpha default handler knows how to trigger a fallback.
2005-02-07 00:43:14 +00:00
Nate Lawson
73c58ad19d Fix typo. 2005-01-29 19:45:31 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Warner Losh
0290609953 Fix last second typos that crept in :-(. 2004-12-31 23:59:24 +00:00
Warner Losh
4ee5d2f181 Implement mimimum system software delays, per PCI PM 1.1 spec, as
suggested by Peter Edwards.  This seems to fix my fxp problems and
likely will fix his as well.  Use DELAY rather than *sleep because we
can be called from any context.
2004-12-31 20:43:46 +00:00
Warner Losh
e50dccaec1 Fix comments to match last commit, and minor reformatting... 2004-12-08 04:35:19 +00:00
Warner Losh
6f2156545c It turns out that a lot of newer systems have 'base peripherals' on
the PCI bus.  We presently have no drivers for these devices, so they
are powered down.  This is undesirable behavior since it breaks the
system when the base peripherals go away suddenly in the middle of
boot.

# if we ever get generic drivers for memory and/or base peripherals, then
# we can remove the tests here.
2004-12-08 04:16:18 +00:00
Nate Lawson
8526ed739d ACPI is not on pc98 either.
Informed by:	nyan
2004-12-03 08:44:56 +00:00
Nate Lawson
161ad64e63 Non-x86 platforms cannot use the ACPI includes. This should be fixed but
for now, only include the headers for i386, amd64, or ia64.

Pointed out by:	grehan
2004-12-03 08:13:08 +00:00
Nate Lawson
10ce62b975 Turn ACPI and PCI devices off or to a lower power state in suspend and
back on again in resume.  Override the default of D3 with the value the
BIOS specifies in _SxD, if present.  Skip serial devices (PNP05xx) since
they seem to hang when set to D3 and may require special driver support.
Also, skip non-type 0 PCI devices (i.e., bridges) since our we don't yet
save/restore their config space and that seems to be necessary.

If this gives you trouble with suspend/resume, you can disable the new
ACPI and PCI power behavior separately with these tunables & sysctls:
    debug.acpi.do_powerstate
    hw.pci.do_powerstate

Approved by:	imp (pci)
Tested by:	acpi@ (numerous)
2004-12-02 08:07:12 +00:00
Warner Losh
4ae6f4a64e Make pci_do_powerstate default to 1 now that we've done the release to
get more testing.  This should help things a little.
2004-11-10 00:41:39 +00:00
John Baldwin
d39d4a6e64 - Change the ddb paging "support" to use a variable (db_lines_per_page) to
control the number of lines per page rather than a constant.  The variable
  can be examined and changed in ddb as '$lines'.  Setting the variable to
  0 will effectively turn off paging.
- Change db_putchar() to force out pending whitespace before outputting
  newlines and carriage returns so that one can rub out content on the
  current line via '\r     \r' type strings.
- Change the simple pager to rub out the --More-- prompt explicitly when
  the routine exits.
- Add some aliases to the simple pager to make it more compatible with
  more(1): 'e' and 'j' do a single line.  'd' does half a page, and
  'f' does a full page.

MFC after:	1 month
Inspired by:	kris
2004-11-01 22:15:15 +00:00
Brian Feldman
9b4fab9ef6 Fix a spelling error in a panic string. 2004-10-14 03:05:39 +00:00
Olivier Houchard
b19d97eb9c Re-route interrupts on arm as well. 2004-09-23 22:58:43 +00:00
Warner Losh
828a0b7110 Disable native ata support for now, too much breaks 2004-07-02 13:42:36 +00:00
John Baldwin
39981fed82 Trim a few things from the dmesg output and stick them under bootverbose to
cut down on the clutter including PCI interrupt routing, MTRR, pcibios,
etc.

Discussed with:	USENIX Cabal
2004-07-01 07:46:29 +00:00
Søren Schmidt
d485c7bcf3 Update the special handling code for ATA devices to allow usage of
PCI native addressing. That means that if the HW says that using "real"
addresses instead of the hardwired legacy compat ones is allowed, we will
use them.
2004-06-29 20:25:43 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Poul-Henning Kamp
fe12f24bb0 Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
Poul-Henning Kamp
41ee9f1c69 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
Warner Losh
ef77fe1a5b Use PCI_BAR() in preference to PCI_MAPS + x * 4.
Submitted by: jhb
2004-05-24 17:41:05 +00:00
Warner Losh
7138b71d5f Do not write to those config registers that are unambiguously defined
in the various pci specifications as readonly.  vendor, subvendor,
device and subdevice are required to be loaded in hardware by some
means that isn't the system BIOS or other system software (although
some devices do have ways of accomplishing this).  class and subclass
are defined to be read-only in section 6.2.1 (v2.2).  Apart from the
status register, which we weren't touching, these are the only
read-only registers I could find in the 2.2 spec.

progif is also defined as being read-only in section 6.2.1.  However,
the PCI IDE programming document specifically states that some of the
bits are read/write.  Since we may have to restore registers before we
have a driver attached, go ahead and restore this one byte when
transitioning between D3 and D0.

The PCI spec also says that writes to reserved and unimplemented
registers must be completed normally.  It makes no statements about
writes to read-only registers, so be as conservative as possible,
while covering the exception to the rule that is documented in a
subpart of the standard.

Requested by: socttl
2004-05-24 15:52:57 +00:00
Warner Losh
c5b82061f4 Fix cutNpasto in last commit. 2004-05-21 19:47:55 +00:00
Warner Losh
d776e1167f ifdef writing to registers that the base pci standard says are
read-only on D3->D0 power state transition.  Add a define to enable
them, but include a comment to contact me if there's a problem.
2004-05-21 14:41:02 +00:00
Warner Losh
17249aab6e Compeletely rewrite the description of hw.pci.do_powerstate to sound
better.
2004-05-21 07:06:54 +00:00
Warner Losh
4c04937d5b Improve the English somewhat.
Prodded by: ru@
2004-05-21 07:03:07 +00:00
Warner Losh
cd677980a1 Ooops, forgot to commit the updated definition for hw.pci.do_powerstate
when I committed code that changed its meaning.
2004-05-21 06:43:46 +00:00
Warner Losh
b17653cf41 MFp4:
Split the baby.  For idepci devices, now both legacy mode bits need
not be set.  We can run an idepci in a split mode.  However, it only
works better than before, not works.  It works better in that when one
device is legacy and the other isn't and disabled, we now operate
correctly.

sos submitted a version of this patch.
2004-05-21 06:41:15 +00:00
Warner Losh
ae8b157fbf Move pci_do_powerstate up a level. Now it just means 'do not turn devices
off into d3 state when there's no driver for the device'.  This should
help suspend/resume in the default case.
2004-05-21 06:39:09 +00:00
Warner Losh
e5af1ba884 MFp4: o save/restore subvendor, subdevice, vendor, device, baseclass,
subclass, progif and revid.  While these are typically read
	only fields, they aren't always read-only.  progif is writable
	for ata devices, for example.  It does no harm when they are
	read only, and helps when they aren't.
2004-05-21 06:36:36 +00:00
Warner Losh
d53b25544c make the pci power state and resource code a lot less chatty. The
chattiness was left in for debugging, but now that nearly all of the
problems relating to the changes have been fixed, it is only annoying.  It
is still available via bootverbose.

Prodded by: jhb
2004-05-21 06:03:26 +00:00
Thomas Moestl
fe2c61013d Remove the EBus stopgap of r1.248; a proper fix is in place now. 2004-04-28 13:43:11 +00:00
Warner Losh
1c168bb710 Fix two typos from PR: 65694
1) In pci.c, we need to check the child device's state, not the parent
   device's state.
2) In acpi_pci.c, we have to run the power state change after the acpi
   method when the old_state is > new state, not the other way around.

Submitted by: Dmitry Remesov
PR: 65694
2004-04-26 02:11:38 +00:00
Marius Strobl
27c2013edf Add a stopgap for the EBus breakage on sparc64 since the PCI code does
resource pre-allocation. The problem is that the BARs of the EBus bridges
contain the ranges for the resources for the EBus devices beyond the bridge.
So when the EBus code tries to allocate the resource for an EBus device
it's already allocated by the PCI code.
To be removed again as soon as we have a proper solution in the EBus Code.

Reviewed by:	tmm
Approved by:	marcel (mentor)
2004-04-23 15:48:48 +00:00
Warner Losh
206995a116 ata devices in legacy are special, and we must treat them as such.
While I would have prefered to have a solution that didn't move
knowledge of this into the pci layer.  However, this is literally the
only exception that's listed in the PCI standard to the usual way of
decoding BARs.  atapci devices in legacy mode now ignore the first 4
bars and hard code the values to the legacy ide values (well, for each
of the controllers that are in legacy mode).  The 5th bar is handled
normally.

Remove the zero bar handling.  zero bars should be ignored at all
other times, and since we handle that specially, we don't need the
older workaround.
2004-04-21 20:19:56 +00:00
Søren Schmidt
470fcc93b9 Do not pre-allocate resources for BAR's on ATA MASTERDEV's thats on
the standard ATA primary and secondary addresses.

Reintroduce the size 1 ALTIO space so that we can have both ATA and
floppies back working.
2004-04-20 20:57:29 +00:00
Warner Losh
f77ad99d59 ooops. I disabled pci_enable_io_modes not pci_do_powerstate in the last
commit.  That was in error.

Noticed by: sos
2004-04-16 15:01:54 +00:00
Warner Losh
b24afb1761 make the bad bar warning less scary, and toss it behind a bootverbose.
It is harmless, but freaking people out.
2004-04-16 04:53:19 +00:00
Warner Losh
d966428737 Turn off the power stuff for a little while longer. There appears to be
something subtle wrong with it.
2004-04-16 04:50:54 +00:00
Warner Losh
b0855e456e Now that the dust has settled on the resource issues, turn on the
power parts of my patches and see what breaks.  Don't (yet) throw
the chatty messages behind a if (bootverbose).
2004-04-14 17:52:08 +00:00
Warner Losh
d9f6718ee3 Some devices have what appear to be invalid BARs. They are invalid in
the sense that any write to them reads back as a 0.  This presents a
problem to our resource allocation scheme.  If we encounter such vars,
the code now treats them as special, allowing any allocation against
them to succeed.  I've not seen anything in the standard to clearify
what host software should do when it encounters these sorts of BARs.

Also cleaned up some output while I'm here and add commmented out
bootverbose lines until I'm ready to reduce the verbosity of boot
messages.

This gets a number of south bridges and ata controllers made mostly by
VIA, AMD and nVidia working again.  Thanks to Soren Schmidt for his
help in coming up with this patch.
2004-04-13 19:31:57 +00:00
Warner Losh
e3d5128493 Add system tunable to turn off power state changes. Default to off until
we get the resource allocation stuff hammered out.

Fix and off by one error that caused unnecessary filtering of valid
BARs for only 4 bytes than ICH3 and other PCI IDE controllers have.
Andrew Gallatin submitted this, although it doesn't solve the problems
ICH3 controllers have with the new code, it does restore the former
resource list on the probe line.
2004-04-11 07:02:49 +00:00
Warner Losh
bbecd97c0b Only print state change message for real state changes. When we set a
device in D0 to D0, that's a no-op, however the messages seem to be
confusing some people.  Eventually, these messages will be parked
behind a if (bootverbose).

# I don't think this will fix any real bugs...
2004-04-09 20:41:18 +00:00
Warner Losh
cd8b53ed2d Omnibus PCI commit:
o Save and restore bars for suspend/resume as well as for D3->D0
	  transitions.
	o preallocate resources that the PCI devices use to avoid resource
	  conflicts
	o lazy allocation of resources not allocated by the BIOS.
	o set unattached drivers to state D3.  Set power state to D0
	  before probe/attach.  Right now there's two special cases
	  for this (display and memory devices) that need work in other
	  areas of the tree.

Please report any bugs to me.
2004-04-09 15:44:34 +00:00
Warner Losh
f36cfd49ad Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 20:46:16 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Warner Losh
70be398070 It appears that the changes in the resources allocated is causing much
pain and suffering.  Attempt to back it out by removing the 'if the
requested range is larger than the window, clip to the window' code.
This is a band-aide until the issues are better understood and the
issues with the lazy allocation patches are resolved.
2004-01-17 21:54:04 +00:00
Warner Losh
e4b59fc500 Add support for subtractive decoding bridges. These bridges pass all
signals to addresses to the child busses.  Typically, ProgIf of 1
means a subtractive bridge.  However, Intel has a whole lot of ones
with a ProgIf of 80 that are also subtractive.  We cope with these
bridges too.  This eliminates hw.pci.allow_unsupported_io_range
because that had almost the same effect as these patches (almost means
'buggy').  Remove the bogus checks for ISA bus locations: these cycles
aren't special and are only passed by transparent bridges.

We allow any range to succeed.  If the range is a superset of the
range that's decoded, trim the resource to that range.  Otherwise,
pass the range unchanged.  This will change the location that PC Card
and CardBus cards are attached.  This might bogusly cause some
overlapping allocation that wasn't present before, but the overlapping
fixes need to be in the pci level.

There's also a few formatting changes here.
2004-01-11 06:52:31 +00:00
Warner Losh
28c30c8315 MF-p4/diff reduction:
Eliminate trailing blank line in this file.
2004-01-11 00:18:03 +00:00
Warner Losh
f54a290f54 Minor whitespace changes to conform better to stlye(9) and reduce diffs
with uncommitted changes I have in p4.
2003-12-24 02:01:22 +00:00
Peter Wemm
0d2a298904 Initial landing of SMP support for FreeBSD/amd64.
- This is heavily derived from John Baldwin's apic/pci cleanup on i386.
- I have completely rewritten or drastically cleaned up some other parts.
  (in particular, bootstrap)
- This is still a WIP.  It seems that there are some highly bogus bioses
  on nVidia nForce3-150 boards.  I can't stress how broken these boards
  are.  I have a workaround in mind, but right now the Asus SK8N is broken.
  The Gigabyte K8NPro (nVidia based) is also mind-numbingly hosed.
- Most of my testing has been with SCHED_ULE.  SCHED_4BSD works.
- the apic and acpi components are 'standard'.
- If you have an nVidia nForce3-150 board, you are stuck with 'device
  atpic' in addition, because they somehow managed to forget to connect the
  8254 timer to the apic, even though its in the same silicon!  ARGH!
  This directly violates the ACPI spec.
2003-11-17 08:58:16 +00:00
John Baldwin
4311d1d368 Enable PCI interrupt routing for i386 SMP kernels. 2003-11-03 22:06:35 +00:00
Doug Rabson
aec21b56e8 Make the cardbus driver a derived class of the pci driver. In theory, this
should allow many of the pci methods to be re-staticised.
2003-11-01 12:45:03 +00:00
Mike Silbersack
184dcdc7c8 Change all SYSCTLS which are readonly and have a related TUNABLE
from CTLFLAG_RD to CTLFLAG_RDTUN so that sysctl(8) can provide
more useful error messages.
2003-10-21 18:28:36 +00:00
Stefan Eßer
66f314b5f2 The code that was meant to test alignment of the register offset
parameter in the read and write case dereferenced an unitialized
pointer and can't possibly ever have catched an actual invalid
argument.

This was apparently true for the read/write and getconf cases. The
latter does not even receive the paramter that is to be verified.

I'm surprised that this did not cause kernel panics, but it seems
that the uninitialized local variable happens to contain data that
may be used as a pointer to memory that satisfies the test condition.

Make the code work as intended by moving the test inside the switch
case where the pointer has been properly initialized.

Since the read and write case shared just about all code (except
for the single call to PCIB_READ_CONFIG resp. PCIB_WRITE_CONFIG) I
have merged both cases.

Noticed by:	trhodes@FreeBSD.org (Tom Rhodes)
2003-10-11 22:20:34 +00:00
Mitsuru IWASAKI
526b5e659d Add pci_resume() to reestablish interrupt routing after
suspend/resume.
Especially after hibernation, interrupt routing went back to initial
status on some machines.
2003-09-17 08:32:44 +00:00
Scott Long
ec40a9f9d0 Teach the PCI code to parse MSI extended capabilities. Re-arrange the
pcicfg struct a bit to hold extcap structures instead of structure members.
2003-09-14 19:30:00 +00:00
Scott Long
3c358d0ca0 Expand the extended capabilities list and add definitions for MSI. 2003-09-14 14:42:26 +00:00
Scott Long
cadbc399ea Remove most of the magic constants from the extcap parsing code. 2003-09-14 06:23:19 +00:00
John Baldwin
b66752c4a1 Bring back PCIR_HEADERTYPE as an alias for PCIR_HDRTYPE under BURN_BRIDGES
for backwards compat.  The old name will be gone in 6.0, but will be
around in 5.x.  This will help unbreak 3rd party code, e.g. the nvidia
DRM module.
2003-09-03 17:48:22 +00:00
John Baldwin
ab551d918c Replace another instance of PCIR_MAPS with PCIR_BAR(x).
Reminded by:	dfr
2003-09-03 15:24:31 +00:00
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
John Baldwin
56802c46e2 - Deprecate PCIR_MAPS under BURN_BRIDGES (meaning it will be gone in 6.0)
and replace it with the more intuitive name PCIR_BARS.
- Add a PCIR_BAR(x) macro that returns the config space register offset of
  the 32-bit BAR x.

MFC after:	3 days
2003-09-02 17:11:27 +00:00
Doug Rabson
d37a68d05a Don't try to enable io or memory access for non-standard resource
addresses. This stops resource allocations for e.g. amdpm failing - this
has its own special ways of enabling access.
2003-09-01 15:01:49 +00:00
John Baldwin
729d7ffbcf - Rename PCIx_HEADERTYPE* to PCIx_HDRTYPE* so the constants aren't so long.
- Add a new PCIM_HDRTYPE constant for the field in PCIR_HDRTYPE that holds
  the header type.
- Replace several magic numbers with appropriate constants for the header
  type register and a couple of PCI_FUNCMAX.
- Merge to amd64 the fix to the i386 bridge code to skip devices with
  unknown header types.

Requested by:	imp (1, 2)
2003-08-28 21:22:25 +00:00
John Baldwin
86889ca086 Add constants for capability IDs and header types.
Submitted by:	Samy Al Bahra <samy@kerneled.com>
2003-08-28 20:59:31 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
38d8c9940b Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 06:42:59 +00:00
Warner Losh
b0cb115fb7 Prefer the uintXX_t to the u_intXX_t names. 2003-08-22 03:11:53 +00:00
Warner Losh
8d50cc0e3e Define PCI_MAXHDRTYPE to be 2. We know about header types 0, 1 and 2.
Update the MI device scanning code to use PCI_MAXHDRTYPE rather than
the hard coded 2.
2003-08-01 21:45:56 +00:00
John Baldwin
3f2a1b0656 Update the 'ps', 'show pci', and 'show ktr' ddb commands to use the new
pager callout instead of homerolling their own paging facility.
2003-07-31 17:29:42 +00:00
John Baldwin
c37faf267c - Make the isab devclass global to allow for multiple ISA bridge drivers.
- Factor out code common to all ISA bridge drivers attach methods into a
  isab_attach() function.
- Rename the PCI-ISA bridge driver's attach function to pci_isab_attach()
  and have it call isab_attach().
2003-07-08 18:56:58 +00:00
Thomas Moestl
3920999db7 Add a new PCI interface method, assign_interrupt, to determine the
interrupt to be used for a device. This is intended solely for internal
use of PCI bus implementations, and exists so that PCI bus drivers
implementing special interrupt assignment methods which require
additional work at the bus level to work right can be easily derived
from the generic driver (or any other one) without resorting to hacks.

It will be used in the sparc64 ofw_pcibus driver, which will be
committed shortly.

Make use of this method in the generic implementation, and add it to
the method table of bus drivers derived from the PCI one.

Reviewed by:	imp, -hackers
2003-07-01 14:08:33 +00:00
Thomas Moestl
036c2cfbfa Allow to write the intpin ivar using the pci_set_intpin() accessor. There
are some Sun PCI devices around which bogusly set intpin to 0, although
they use the intline mechanism; this allows the device driver to correct
that.

Reviewed by:	imp
2003-07-01 13:54:10 +00:00
John-Mark Gurney
e3f932de5a prevent the number of patterns from exceeding the number of pci devices.
Submitted by:	rwatson
2003-06-23 03:17:03 +00:00
John-Mark Gurney
d08239c1f7 cleanup /dev/pci code some:
read permision only required for listing, read/write required for
		read/write to registers
	fix a possible memory leak
	clean up error handling a bit

Reviewed by:	silence
2003-06-23 02:11:16 +00:00
Yoshihiro Takahashi
403579314a Re-enabled PCI irq routing on pc98. 2003-06-22 06:09:14 +00:00
John-Mark Gurney
e3ee6a27a9 use a REG macro that was already defined.
Reorder how the pci probing in handled.  before adding devices, check to
see if the slot is a multi-function device to see if we should probe all
the functions.

Original idea by:	imp
2003-06-22 02:26:17 +00:00
John Baldwin
bd77aaf980 When we re-route a PCI interrupt, write the new IRQ value into the intline
register.

Reviewed by:	imp
2003-06-09 18:08:46 +00:00
Yoshihiro Takahashi
82cdd526b1 Don't route PCI irq on pc98. 2003-06-08 11:18:35 +00:00
John Baldwin
1beb381637 - Adjust the comment about re-routing PCI interrupts to be less
ia64-specific.
- When trying to re-route interrupts, don't change cfg->intline if the
  re-route fails by returning an invalid vector.  This fixes machines
  without any way of routing interrupts such as older PC's without a
  $PIR table.

We do not currently write the new intline value back to the hardware, but
we should.  That will likely be added in a later commit.
2003-06-07 15:00:19 +00:00
John Baldwin
ba90ccc69a Batton down the hatches!!!
Always route PCI interrupts on i386 UP machines.  I was planning to enable
this for i386 anyways once SMP support is done.  Having this enabled fixes
problems on many people's laptops.

Requested by:	imp
2003-06-04 21:10:15 +00:00
Poul-Henning Kamp
60db3b9e60 Remove unused variable(s).
Remove break after return;

Found by:       FlexeLint
2003-05-31 20:34:36 +00:00
Bernd Walter
cdc95e1bb8 Calculate routed interrupts using the slot number from the device and
not that of the bridge.

Approved by:	re (jhb)
2003-05-22 17:45:26 +00:00
Dag-Erling Smørgrav
bd9155712b Add constants for USB programming interfaces. These are already defined
(with other names) in the USB driver sources, but I felt that pcireg.h
should have a complete list - at least of classes and interfaces that we
know about and use.
2003-04-23 15:51:36 +00:00
Matthew N. Dodd
c047e5b1a9 Return status for PCI methods '{enable,disable}_{io,busmaster}'.
Reviewed by:	imp
2003-04-16 03:15:08 +00:00
Warner Losh
7f2af527b0 When the driver allocates memory or I/O ports, enable that bit in the
command config register.  At the present, this represents a nop
because these bits should have been set earlier in the process.  In
the future, we'll only set these bits when the driver requests the
resource, not when the bus code detects the resource.

Reviewed by: mdodd
2003-04-15 19:38:18 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Stefan Eßer
1fa4dd2f14 Make /dev/pci use MAJOR_AUTO. 2003-03-01 08:57:16 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Warner Losh
2c422e4625 Include class designation in pnpinfo for generic driver loading 2003-02-18 03:25:57 +00:00
Warner Losh
5794c59372 Move the pnp and location info into the common pci bus. Make all known
pci busses implement this.

Also minor comment smithing in cardbus.  Fix copyright to this year
with my name on it since I've been doing a lot to this file.

Reviewed by: jhb
2003-02-17 21:20:35 +00:00