Commit Graph

11393 Commits

Author SHA1 Message Date
Julian Elischer
86a91f8b89 Use NG_NODESIZ instead of (NG_NODELEN + 1)
Noted by: jhb
2004-05-24 20:45:53 +00:00
John Baldwin
c0344cc19f Use PCI_BAR() rather than PCIR_MAPS.
Noticed by:	phk
2004-05-24 19:39:56 +00:00
John Baldwin
9930009eb6 Wrap the code to save/restore PCI config registers on suspend/resume in
#ifndef BURN_BRIDGES.

Noticed by:	phk
2004-05-24 19:39:23 +00:00
Maxime Henrion
670f5d73a0 Change a if (...) panic() to a KASSERT(). 2004-05-24 18:31:56 +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
Nate Lawson
51e2355882 Store the target handles in a separate list from normal commands. Add a
CTIO fast post routine to handle CTIO completions.

Submitted by:	mjacob
2004-05-24 07:02:25 +00:00
Paul Saab
c001ccf2a3 Add support for BCM5705K
Submitted by:	candy@kgc.co.jp
PR:		kern/67110
2004-05-24 04:46:54 +00:00
Yaroslav Tykhiy
25fbb2c38c A handler for ioctl(SIOCSIFCAP) should not alter a bit in
if_capenable unless the interface driver is actually able
to toggle the respective capability on and off.

Reviewed by:	ru
2004-05-23 21:05:08 +00:00
Yaroslav Tykhiy
a5820ecb77 According to the design of checksum offloading framework,
if_hwassist should be in accord with the IFCAP_TXCSUM bit
of if_capenable.
2004-05-23 20:22:40 +00:00
Yaroslav Tykhiy
88b404a610 Mark the VLAN_MTU capability as initially enabled since it's
hardcoded to "ON" for these interfaces.
2004-05-23 19:21:48 +00:00
Doug Rabson
7b1f628606 Don't try to copy out the result payload if there isn't one. This ioctl
interface really needs changing to split out the various async request
types.
2004-05-23 18:43:44 +00:00
Lukas Ertl
29d81b7db1 Update URL to HID spec.
Obtained from:  NetBSD
2004-05-23 17:09:07 +00:00
Lukas Ertl
b04f1772b7 Update URL to HID spec.
Obtained from:  NetBSD
2004-05-23 16:55:28 +00:00
Maxime Henrion
866a788cc2 We don't need to initialize if_output, ether_ifattach() does it
for us.
2004-05-23 16:11:53 +00:00
Doug Rabson
c0e9efacfe Initialise OHCI_CROMHDR and OHCI_BUS_OPT in fwohci_ibr to make sure that
they have the right values at the first bus reset.
2004-05-23 14:22:11 +00:00
Lukas Ertl
b113636e68 MFNetBSD 1.80; author: wiz
URL updates, from Jared Yanovich and jmc@openbsd, forwarded by the latter.

Obtained from:  NetBSD
2004-05-23 14:01:23 +00:00
Ian Dowse
eadf519a78 Replace the static "qdat" structure with a per-instance softc field
in all USB ethernet drivers. The qdat structure contains a pointer
to the interface's struct ifnet and is used to process incoming
packets, so simultaneous use of two similar devices caused crashes
and confusion.

The if_udav driver appeared in the tree since Daan's PR, so I made
similar changes to that driver too.

PR:		kern/59290
Submitted by:	Daan Vreeken <Danovitsch@Vitsch.net>
2004-05-23 12:35:25 +00:00
Lukas Ertl
5ac85402da Diff reduction to NetBSD.
MFNetBSD 1.177; author: toshii
   Use the correct wValue to get hub desriptors.
   Also, make wValue checks of root hub codes less strict.

MFNetBSD 1.178: author: martin
   Interrupt descriptors might become invalid while being processed in
   uhci_check_intr - so remember their next pointer before calling it.
   Patch provided by Matthew Orgass in PR kern/24542.

Obtained from:   NetBSD
2004-05-23 11:43:34 +00:00
Maxime Henrion
e0026a65f9 Use __FBSDID. 2004-05-23 10:57:11 +00:00
Duncan Barclay
62a9464c76 Apply fix for long timeouts on driver initialisation.
PR:		64656
Submitted by:	Jianqin Qu <jqu@its.brooklyn.cuny.edu>
Reviewed by:	dmlb
2004-05-23 08:35:07 +00:00
Maxime Henrion
eb3259747a In agp_generic_bind_memory(), grab the needed pages before acquiring
the agp mutex.  We do this because vm_page_grab() called with the
VM_ALLOC_RETRY flag can sleep.

Pointed out by:	alc
2004-05-23 00:00:10 +00:00
Nate Lawson
12957d4991 Revert the previous commit. The bus accessor macros do not check the
return value for BUS_READ_IVAR and thus don't generate the proper NULL
in cases where a device (i.e. on PCI) does not have a handle.

Found by:	peadar, tjr
2004-05-22 17:19:59 +00:00
Marius Strobl
a32a374caf - Rearrange a comment to fit in 80 chars per line, like the rest of this
file.
- Remove a superfluous ';'.
2004-05-22 16:45:19 +00:00
Marius Strobl
073e8552f8 - Move OFW_NAME_MAX, used as a limit for OFW property names and device
identifiers, to openfirmio.h as OFIOCMAXNAME, so programs can use it
  for buffer sizes etc.
  Note: Although this is only a rough upper limit to make the code more
  robust and to prevent the allocation of ridiculous amounts of memory,
  the current limit of one page (8191 + '\0' in openfirm_getstr()) still
  appears a bit high. The maximum length of OFW property names is 31.
  I didn't find a maximum length for the device identifiers in the OFW
  documentation but it certainly is much smaller than 8191, too.
- Enable the OFIOCSET ioctl, i.e. move it out from under #if 0.
- Don't use openfirm_getstr() for the property value in OFIOCSET, there
  are also properties whose values aren't strings and it makes sense to
  use a different maximum length for property values than OFW_NAME_MAX/
  OFIOCMAXNAME. The maximum accepted property value is defined in
  openfirmio.h as OFIOCMAXVALUE (currently the maximum size of the value
  of the nvramrc property).
- Make OFIOCSET not return EINVAL when OF_setprop() returns a different
  length for the written value than it was told to write, this is normal
  for the text string values of the properties in the OFW /options node.
  Instead, only return EINVAL if OF_setprop() returned -1 (value could
  not be written or property could not be created). Add a comment about
  the specialty of the OFW /options node.
- Make OFIOCSET return the length of the written value returned by
  OF_setprop(), just like OF_getprop() does. Quite useful, at least for
  debugging.

Reviewed by:	tmm
2004-05-22 16:43:42 +00:00
Doug Rabson
03161bbcf6 Change u_intXX_t to uintXX_t. Change a couple of 'unsigned long's to
uint32_t where appropriate.
2004-05-22 16:14:17 +00:00
Lukas Ertl
d0834d4dc8 Add Intel PCI vendor ID. 2004-05-22 14:18:05 +00:00
Yaroslav Tykhiy
2d8c4e44b2 Don't forget to reset if_hwassist back to 0 when hardware checksumming
is being turned off, or else TCP/IP will keep assigning the job to us.

Drivers themselves should consult if_capenable, not if_hwassist--the
latter is for the TCP/IP stack.
2004-05-22 13:59:17 +00:00
Maxime Henrion
d8a821e8cf Get rid of a lockmgr consumer by making agp(4) use a standard mutex,
since it's always acquiring the lock exclusively.  This was tested
with X on an SMP box, with and without WITNESS.
2004-05-22 13:06:38 +00:00
Lukas Ertl
b2d36e0f30 Fix typos in comments.
Submitted by:   Gerhard Gonter <gonter@falbala.wu-wien.ac.at>
2004-05-22 09:29:52 +00:00
Marius Strobl
55fe3a872f Spelling and style fixes.
Obtained from:	NetBSD
2004-05-22 01:56:18 +00:00
Maxime Henrion
27d8bee2a7 Plug three lock leaks. 2004-05-22 00:44:08 +00:00
Yaroslav Tykhiy
5fe9116b72 Cosmetic:
Set capability bits in a consistent way.
Add a comment on why the VLAN_MTU stuff comes after ether_ifattach().
2004-05-21 20:34:04 +00:00
Warner Losh
c5b82061f4 Fix cutNpasto in last commit. 2004-05-21 19:47:55 +00:00
Yaroslav Tykhiy
21ce2bf290 The driver fxp(4) has reception of large frames enabled hardcodedly,
so let VLAN_MTU be marked in if_capenable from the beginning.
2004-05-21 18:11:38 +00:00
Yaroslav Tykhiy
7560265c18 Mark the capability of this driver to receive VLAN frames >1500 bytes
as initially active in if_capenable since it is always on.

Reviewed by:	simokawa
2004-05-21 17:11:34 +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
Doug Rabson
95a2495411 Fix spelling. 2004-05-21 09:12:07 +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
2a6c850c09 When attaching pccard and cardbus children, there's no need to set the
device == NULL on failure.  A warning should suffice.

# I wrote this back before I understood the unattached but loosely bound
# newbus concept...
2004-05-21 06:11:47 +00:00
Warner Losh
2a829b00f4 Now that we have the resource allocation code in current, the kludge
to try to allocate things on my parent can be taken out.  It duplicates code.

Also, add comment about why the power state stuff is here (type 2
devices don't participate in the power state save/restore due to
larger Bx issues).
2004-05-21 06:10:13 +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
MIHIRA Sanpei Yoshiro
c970d559f1 Sync to 1.178 of usbdevs 2004-05-21 01:39:38 +00:00
MIHIRA Sanpei Yoshiro
3ee4bca213 add support Kyocera AH-K3001V (cellular phone in Japan)
PR:		kern/66779
Submitted by:	Togawa Satoshi <toga@puyo.org>
MFC after:	1 week
2004-05-21 01:36:48 +00:00
Dag-Erling Smørgrav
76b108abfe Whitespace cleanup. 2004-05-20 14:49:12 +00:00