Commit Graph

5144 Commits

Author SHA1 Message Date
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