Commit Graph

25367 Commits

Author SHA1 Message Date
dyoung
2e264f4086 Destroy a scsipi_xfer's callout before putting it back into the pool. 2009-04-07 18:10:45 +00:00
dyoung
f26cbc49c7 Destroy sc->bnx_timeout in bnx_detach(). 2009-04-07 18:07:10 +00:00
dyoung
63a5e91969 Detach brgphy(4) at shutdown. 2009-04-07 18:05:54 +00:00
dyoung
03c2f978e8 In mii_phy_detach(), destroy the NWay callout. 2009-04-07 18:05:02 +00:00
dyoung
336480339e Cosmetic: remove some dead code. 2009-04-07 18:02:04 +00:00
dyoung
29e95e3d5f Cosmetic: flag a potential problem in ata_channel_attach():
it initializes a callout that does not appear to be destroyed
anywhere. Every callout_init() should ordinarily be matched by a
callout_destroy().
2009-04-07 18:01:20 +00:00
dyoung
1fb1e79dd5 During shutdown, detach attimer at acpi. 2009-04-07 17:59:18 +00:00
dyoung
2df4d68fc5 Declare mididetach() for use by midi0 at pcppi0. 2009-04-07 17:55:55 +00:00
dyoung
6a72962b6c Cosmetic: in a debug statement, use "%s", __func__ instead of a
misspelling of the detach routine's name.
2009-04-07 17:54:58 +00:00
stacktic
ea41759011 Add Realtek ALC663 and treat like ALC662 (ok pooka@) 2009-04-07 14:47:53 +00:00
haad
ba7fcfeeb5 Use functions from disk(9) framework. Initialize disk/disklabel during
dm_device_create_ioctl, before calling dmgetdisklabel.
Use disk_busy/disk_unbusy in dmstrategy to display LVM LV's in iostat
output.
2009-04-06 22:58:10 +00:00
haad
57fb98e3bf Fix build on amd64. Patch sent by dieter roelants. 2009-04-06 22:48:26 +00:00
mkirby
ff12b9febc Add a Czech (QWERTY) keyboard layout, and teach wscons about latin 2 characters.
Original code from Lubomir Kundrak, adapted to current and cleaned up by me.

Fixes PR kern/16216

ok agc@ jdc@
2009-04-06 17:32:09 +00:00
cegger
56ce1b94f8 buildfix: include <sys/device.h> for device_t 2009-04-05 09:56:16 +00:00
cegger
b61989a8ff buildfix: include <sys/selinfo.h> for struct selinfo. 2009-04-05 08:33:04 +00:00
uwe
6a2ffc8f1b Provide pmf(9) hooks that do what dopowerhooks(9) hook does.
XXX: Do NOT call pmf_class_network_register() yet, b/c db8320.c
doesn't provide if_stop method!
2009-04-05 03:37:07 +00:00
uwe
4e37bb5a9c Register with pmf(9), tell it we don't need anything. 2009-04-05 02:29:40 +00:00
uwe
b22b1f73c6 Register with pmf(9), tell it we don't need anything. 2009-04-05 02:17:18 +00:00
uwe
fd239c627a Register with pmf(9). Thus we register with both dopowerhooks(9) and
pmf(9), but they are mutually exclusive (apm(4) vs apmdev(4)).

Express pmf(9) hooks in terms of dopowerhooks(9) hook - the reverse
would be more natural, but pmf hook signature is hidden behind
PMF_FN_ARGS/PMF_FN_CALL, so just go the least intrusive way for now.
2009-04-05 02:14:41 +00:00
uwe
2ec6410a85 Register with pmf(9), tell it we don't need anything. 2009-04-05 02:04:40 +00:00
uwe
12a9718711 Split device_t and softc. 2009-04-05 01:48:47 +00:00
uwe
fe0f5148ae Register with pmf(9), tell it we don't need anything.
btnmgr(4) is just a hub for other devices to plug into with
config_hook(9), there is no real hardware to manage.
2009-04-05 00:34:42 +00:00
ad
c6367674d6 Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)
2009-04-04 10:12:51 +00:00
ad
481ff5ace4 Fix problems with ccd:
- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.

Additionally:

- Make it MPSAFE.
- Use kmem_alloc().
2009-04-04 08:29:39 +00:00
dyoung
211e21b653 Stop dereferencing a dangling device_t pointer and crashing: skip the
drives flagged DRIVE_ATAPI in atabus_activate(,DVACT_DEACTIVATE) just as
we skip them in atabus_detach() and in atabus_childdetched().

Make atabus_detach() parallel attachment more closely by calling
config_detach() on the child chp->ata_drives[i] instead of on
chp->ch_drive[i].drv_softc.  Assert that ata_drives[i] and
ch_drive[i].drv_softc are equal, and set them both to NULL in
atabus_childdetached().
2009-04-03 21:31:08 +00:00
sborrill
5547ed1734 Switch various printfs from %ld and %d to PRIu64, etc. to be more consistent
about types (for instance uint32_t was being printed with %d).
2009-04-03 16:23:41 +00:00
uwe
30f9f983a3 Use dev/apm/files.apm for APM options in opt_apm.h.
Now both apm and apmdev files.apm can be included so you can switch
from apmdev0 to apm0 at hpcapm0 in your kernel config easily.
2009-04-03 05:01:09 +00:00
uwe
82442fe367 Treat OAPM_IOC_GETPOWER as APM_IOC_GETPOWER - from apmdev(4). 2009-04-03 04:25:40 +00:00
uwe
c03d662b39 Config glue for attaching apm at apmdevif.
Unfortunately dev/apm/files.apm and dev/hpc/apm/files.apm cannot be
included both at the same time (they define same options and config(1)
complains), so you need to comment out old code and uncomment new code
to be able to replace "apmdev0 at hpcapm0" with "apm0 at hpcapm0" in
your kernel config.
2009-04-03 04:21:51 +00:00
uwe
ea06597b80 Attachment glue to attach apm0 at hpcapm0.
Tested on Jornada 690.
2009-04-03 04:17:03 +00:00
uwe
9a25b0cb7f Switch apmdev to use apm(4) structures from dev/apm/apmvar.h.
Add batteryid argument to aa_get_powstat method implementations.
2009-04-03 04:13:17 +00:00
uwe
7cbde2c0d5 Further reduce diffs to dev/apm/apm.c.
Bring over remaining bits of logic not picked up in the first round.
Main semantic difference between the two that ramins is now basically
powerhooks vs. pmf.

Cosmetics to reduce diff noise: split apmattach into apmdevattach and
apm_attach, where the latter matches its counterpart in the real
apm.c.  Change local macros names from APMDEV* to APM*

Now that apmdev.c is demonstrably congruent to apm.c it should be
easier to switch hpc* and zaurus ports to apm.c from apmdev.c.
apmdev.c is one of the only two remaining drivers that call
dopowerhooks(9), the other one being arch/arm/xscale/pxa2x0_apm.c.

Ideally I would prefer for them to be interchangeable to smooth the
transition (in pmf world order *all* devices must have pmf hooks
registered), but they are attached differently - apmdev is separate
from its backend device (like hpcapm), while apm.c backends are
attachment glue, not separate devices.
2009-04-03 02:08:38 +00:00
dyoung
8f20e30696 Fix SIOCSIFFLAGS. Mark as safe to detach at shutdown. 2009-04-03 00:14:42 +00:00
dyoung
30156f20e6 Cosmetic changes, only, to clarify and to save a couple of lines: return
a constant, 0, instead of returning ret when it is always 0.  Wait to
initialize ret until we really need to.
2009-04-02 01:06:49 +00:00
dyoung
b783d8bd8c Add the WEP capability to our net80211 capability flags, since we do
sort of support hardware WEP.  Only change the WEP key index in a Tx
descriptor from 0 if the type of our transmit key is _WEP, not _TKIP:
i.e., only if we're really doing WEP crypto in the hardware.

Ignore a watchdog timeout on any Tx ring if we can collect some packets
from that ring.  Restart both the receiver and the transmitter when a
watchdog timeout occurs instead of restarting only the transmitter.
2009-04-02 00:57:20 +00:00
dyoung
726f95dae4 I find myself making a lot of changes in this code to keep it compiling
and (let us hope) working in the 21st century, so I have put it through
unifdef -D__NetBSD__ -U__FreeBSD__ so that it is less of a chore to read
and to maintain.
2009-04-02 00:39:37 +00:00
dyoung
0d1ba3e899 During shutdown, detach devices in an orderly fashion.
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
2009-04-02 00:09:32 +00:00
reinoud
42726265fe Implement MMC_TRACKINFO_DATA and MMC_TRACKINFO_AUDIO detection for cdrom and
dvdrom devices. These two compatibility codes were forgotten when those were
introduced.
2009-04-01 12:19:04 +00:00
drochner
0785c6f16e avoid tsleep also during shutdown (and in particular ACPI poweroff),
should fix PR kern/39141 by Takahiro Kambe and PR port-i386/41110
by Reinoud Zandijk
2009-03-31 17:17:47 +00:00
darran
d4dd9a671a Missed a small but important change to enable hardware VLAN support. 2009-03-31 06:58:55 +00:00
darran
0b4bf6c76b Enable the vlan code that thorpej@NetBSD.org added, and fix a bug where
the vlan tag was read from the rx descriptor after it was reinitialized
(and hence was always 0).  Hardware vlan support looks good tested
between two vmware clients.
With support from tls@NetBSD.org.
2009-03-31 04:16:57 +00:00
uwe
1cfa6cdc4e Split device_t and softc, use aprint_*, rename/reformat stuff to
minimize diffs to dev/apm/apm.c (even at the cost of uglification).

Tested on Jornada 690 (hpcsh).
2009-03-30 06:22:25 +00:00
uwe
e4d63225a1 Fix battery_state vs. battery_flags confusion.
Fill all fields of struct apm_power_info in hpcapm_get_powstat.
2009-03-30 06:17:39 +00:00
mrg
ac009d4632 drm_addmap():
- for _DRM_CONSISTENT mappings, keep the handle.
- use DRM_HANDLE_NEEDS_MASK()

drm_mapbufs():
- use DRM_HANDLE_NEEDS_MASK()

drm_mmap():
- use DRM_HANDLE_NEEDS_MASK()
- for _DRM_SCATTER_GATHER and _DRM_SHM, use vtophys() on the
  adjusted offset. XXX


this is gets radeon working on amd64 with an older PCI 9250 card.

XXX: need to excise vtophys() usage.
XXX: need to finish porting these fixes to external.
2009-03-29 19:50:17 +00:00
mrg
7216702ebd add a radeon-x1550 (works as well as other rv5xx i guess.) 2009-03-29 19:39:50 +00:00
mrg
44475ef083 include the size in a falled allocation message. 2009-03-29 19:39:10 +00:00
mrg
4d1ad63f2e XXX: for now, add the DRM_NETBSD_HANDLE2ADDR() hack in a few places.
update a debug message.
2009-03-29 19:37:25 +00:00
mrg
b9bbc2157f add a comment explaining DRM_NETBSD_ADDR2HANDLE/DRM_NETBSD_HANDLE2ADDR:
* This hack strips the top bit from amd64 addresses, which avoid
 * udv_attach() returning NULL for "negative" offset.
 * A better hack would be to encode the offset of some kernel data
 * structure..

add a new DRM_HANDLE_NEEDS_MASK macro to check whether the above need to
be applied for various mapping types (_DRM_SHM and _DRM_SCATTER_GATHER.)
2009-03-29 17:00:50 +00:00
msaitoh
60500a38d2 Add workaround for 82543GC.
We need to force speed and duplex on the MAC equal to what the PHY
speed and duplex configuration is. Fixes PR#36430.
2009-03-29 16:22:17 +00:00
tsutsui
2273829d51 Don't assume all RX packets have VLAN headers even if vlanif is configured.
Instead, always check ether_type and use appropriate offsets to adjust
the hardware RX sum value.

XXX: vlan(4) doesn't seem to use csum_data and csum_flags in mbufs anyway.
2009-03-29 07:33:52 +00:00
tsutsui
768601d6e6 Get width, height, and linebytes values from prom_getpropint(). 2009-03-29 07:24:56 +00:00
dholland
3781289e95 Merge patch from PR 12605, which tidies up allocation of transmit DMA maps.
Generalize it to also tidy up allocation of receive DMA maps. And change a
few of the symbol names involved to (1) make sure all uses have been fixed
and (2) make it clearer what's actually going on.

Previously the driver was using DMA maps off the free list without fully
allocating them, apparently in order to save two or three lines releasing
them on error paths. According to the submitter of the PR (H.Saito) this
was causing it to reuse a map already in use when under load, resulting
in panics.

I'm not sure if that ought to have been possible or if it reflected an
interrupt handling bug somewhere else, but the change is an improvement
regardless, so we'll go with it.

Compile-tested only, but I've crosschecked the diffs and all that and it's
a pretty noninvasive change.

(Is anyone actually using this driver rather than tlp?)
2009-03-29 05:26:43 +00:00
tsutsui
0ab04c94e6 Fix another botch in hwcsum changes for PR kern/40955:
8168/8111/8168B/8111B doesn't have DESCV2.

Problem reported by Arto Huusko on current-users@.
2009-03-28 22:16:08 +00:00
dyoung
858d3b857c If a sip(4) is powered down, then so is its PHY, so don't try to read
media status from the PHY.
2009-03-27 16:45:53 +00:00
dyoung
590c39d0f3 For legibility, unifdef -U__FreeBSD__ -D__NetBSD__. This compiles, but
it is not run-tested.
2009-03-27 16:15:24 +00:00
dyoung
7377de8f1d Make this build on -current. 2009-03-27 16:10:50 +00:00
tsutsui
f8fb75a405 Use bus_space(9) to access registers. SETREG() macro using bogus casts
against packed structures doesn't work on gcc4. (no character on screen)
See also:
http://mail-index.NetBSD.org/port-sparc/2003/11/11/0002.html

Should be pulled up to netbsd-4 and netbsd-5.
2009-03-27 12:25:41 +00:00
tsutsui
030266c11f Check a correct bit for ip4csum-rx. Reported privately on PR kern/40955. 2009-03-27 12:19:17 +00:00
dholland
c963cec011 Add the other three PCI ids for the nvidia MCP65 SATA controller to
the quirk table. This way they attach as ahcisata and work, instead of
attaching as viaide and failing miserably.

Fixes PR kern/37826.

XXX: There are a bunch of additional MCP67 and MCP73 PCI ids that
XXX: should probably be added also, but I don't want to do that without
XXX: further investigation and testing.
2009-03-27 06:36:49 +00:00
cegger
8c5327a270 use auto-negotiation for manual media type selection.
This should fix establishment of 10/100Mbps link on L1E.
Helpful to reduce watchdog timeout problems on L1 (age(4)) reported by Jochen Kunz.
From FreeBSD via OpenBSD.
2009-03-27 04:42:50 +00:00
dyoung
b63bf39017 It is only by chance that this gets the prop_array_t definition that it
needs, so explicitly #include <prop/proplib.h>.
2009-03-25 23:35:54 +00:00
cegger
798c21064c regen. 2009-03-25 06:51:12 +00:00
cegger
753abffbcf add some CICADA PHYs. from FreeBSD. 2009-03-25 06:49:56 +00:00
scw
ebf9670f10 Fix fallout from device_t changes - initialise sc->sc_osiop.sc_dev before
calling osiop_attach().
2009-03-23 18:59:57 +00:00
oster
e021b3e6a7 Rework/simplify the disk queuing code. A bunch of this was still
holdovers from the simulator and would never be seen/used in-kernel.
2009-03-23 18:38:54 +00:00
msaitoh
9384d3cea3 Take some code from FreeBSD and OpenBSD
-Add some known CHIPID entries.
 -Add a code for BCM5906 into bge_chipinit(). We have to do more work for
  BCM5906.
 -Fix the case of setting a flag in BGE_PCI_DMA_RW_CTL (on conventional PCI).
2009-03-22 18:54:59 +00:00
msaitoh
2abe3d4169 Make bge(4) close to FreBSD and OpenBSD.
NO FUNCTIONAL CHANGE BY THIS COMMIT.
2009-03-22 18:14:59 +00:00
msaitoh
a23f160d73 Make bge(4) close to FreBSD and OpenBSD.
NO FUNCTIONAL CHANGE BY THIS COMMIT.
2009-03-22 16:20:06 +00:00
msaitoh
a95fdaad68 eliminate PHY_1 quirk (like OpenBSD (rev. 1.110) and FreeBSD (rev. 1.44)) 2009-03-22 16:12:53 +00:00
ad
416888aeaa Fix the *third* break to this driver from sloppy device_t conversion. 2009-03-21 19:44:26 +00:00
drochner
cabe8641e7 Work around a problem with PCMCIA adapter drivers (eg for hpc*) which
attach pcmcia devices before interrupts are enabled. This is unclean
because pcmcia drivers use tsleep(9) in the attach code path but it
worked all the time and it is too late to change this on the 5.0 branch.
So just tolerate it.
Fixes a regression on hpcsh reported by Valeriy E. Ushakov.
2009-03-21 12:35:17 +00:00
tsutsui
6c00def18c Add another quirk flag which shows availability of EEPROM command register.
Now we can remove sc_rev which was intended to represent "MAC revision"
used in the Realtek driver.
2009-03-21 10:05:28 +00:00
tsutsui
78a1fca2f2 Add and use a new quirk flag to disable JUMBO MTU,
rather than checking sc_rev values.
2009-03-21 09:18:06 +00:00
tsutsui
200d1adc6c Add hardware checksum support for newer PCIe 8168/8111/8102 chips,
per device info taken from FreeBSD driver.  Tested by snj@ on 8111C.

Should closes PR kern/40955.

Note on old 8169 chips IP hw csum must be enabled to use TCP/UDP hw csums,
but I'm not sure if these newer chips still have the same restriction.
2009-03-21 07:58:30 +00:00
drochner
44eb10764a Putting a device into the unconfigured state by an ioctl seems legitimate,
so check for a non-NULL configuration descriptor before dereferencing.
Should fix a crash reported by Nicolas Joly per PR kern/41048.
(It still doesn't look good that the ioctl which unconfigures the device
returns EIO -- either it is legitimate or it isn't -- but since this
is a pullup candidate I don't dare to change user visible behaviour.)
2009-03-20 20:47:43 +00:00
tsutsui
3c5f553e65 Try to avoid zstty hangs on higher speed:
z8530sc.c:
 Check pending interrupts in a loop until all requests are handled.
 The old comments said it would cause horrible latency to sun3x floppy etc,
 but serial ports should have higher priority than disks anyway.

z8530tty.c:
 Don't enable and disable TX interrupts on each transmit start and completion
 because it could cause possible race conditions.
 Instead, set ZSWR0_RESET_TXINT on each TIE interrupt to clear the request
 as other kbd drivers attached at zs(4).

Tested on cobalt, macppc, news68k, sparc, and sun3.
2009-03-20 16:28:57 +00:00
msaitoh
4a8c9df3c3 Examine the management mode and mark DRV_LOAD (for ICH{8,9,10},80003,
8257{1,2,3,4}).

Add some error's printf().

Make the bank detect routine into the function.
2009-03-20 07:29:15 +00:00
tsutsui
4b2a9ec9d1 Access LDPS register in re_reset() only on 8169S single chip variants.
From OpenBSD and FreeBSD drivers via PR kern/41009, and
Realtek-supplied FreeBSD driver.
2009-03-20 06:31:31 +00:00
msaitoh
8a7c1f65b7 On i82563, the em driver says that the ready bit in the MDIC register may be
incorrectly set. Insert delay(200) like the em driver. Fixes PR#41014.
2009-03-20 06:27:53 +00:00
cegger
4f9cf8aa30 Correct bungled bcopy() -> memcpy() conversion 2009-03-20 05:26:37 +00:00
tsutsui
b1063595a6 Add braces missed on RX hardware cksum support.
Fixes RX failure on 82557/82558.
2009-03-19 15:28:04 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
a1f5aecf36 buildfix: undo previous 2009-03-18 10:41:46 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
reinoud
83969672ba Fix long standing problem with CD/DVD writing with `dd'. If done this way the
device will remain in a wait-for-more-stuff-to-be-written state delaying other
SCSI calls, esp. some read-size or read-layout calls, until its told there is
no more comming.

To fix this, on last close explicitly flush the caches releasing the device
from this mode and allowing other SCSI commands to reach it.

This fixes PR 40528
2009-03-17 21:25:47 +00:00
dyoung
018696dd66 Handle child-detachment by NULL'ing the child pointer so that
auich_detach() does not subsequently dereference a dangling pointer.
2009-03-17 19:38:34 +00:00
dyoung
4a8da47938 Expand a lot of macros from sys/dev/usb/usb_port.h.
Handle child-detachment by NULL'ing the child pointer, so that
umass_detach() will not subsequently dereference the dangling
pointer.
2009-03-17 19:12:17 +00:00
dsl
98ae204731 Add some 'int' into function definitions where the K&R one didn't
specify a type.
2009-03-17 18:19:15 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +00:00
tsutsui
7a44ef30a5 Pull a fix from hme.c rev 1.73 (to #if 0'ed out part):
> Fix a bug in calculation of checksum deduction:
> - To get 16 bit one's complement value from uint32_t variable,
>   higher 16 bits should be ignored.
> - RFC 1624 describes methods to recalculate checksum field in headers,
>   i.e. one's complement of one's complement sum that could be 0x0000,
>   but we don't have to use the strategy to deduct one's complement sum
>   itself which won't be zero but should be 0xffff.
2009-03-16 12:13:04 +00:00
tsutsui
24a0836984 Fix a bug in calculation of checksum deduction:
- To get 16 bit one's complement value from uint32_t variable,
  higher 16 bits should be ignored.
- RFC 1624 describes methods to recalculate checksum field in headers,
  i.e. one's complement of one's complement sum that could be 0x0000,
  but we don't have to use the strategy to deduct one's complement sum
  itself which won't be zero but should be 0xffff.

Found on debugging mec(4) on sgimips O2.
2009-03-16 12:02:00 +00:00
cegger
05d33dc7bf ansify function definitions 2009-03-16 09:32:38 +00:00
cegger
dc56dbbd97 ansify function definitions 2009-03-15 21:23:31 +00:00
cegger
d3189d3544 ansify function definitions 2009-03-15 20:30:05 +00:00
cegger
317b4e018f ansify function definitions 2009-03-15 17:24:43 +00:00
cegger
b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
cegger
4b83748ce5 ansify function definitions 2009-03-15 15:52:12 +00:00
cegger
f7d20361b0 ansify function definitions 2009-03-15 15:40:33 +00:00
tsutsui
8d2f130b12 Tweak comments and conditionals about EXT_RFA and IPCB. 2009-03-15 14:48:11 +00:00
tsutsui
3acfa89d3b Adjust comments about sc_flags. 2009-03-15 14:18:38 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
apb
2a86bfea6b Add FSYNC_CACHE flag to the VOP_FSYNC() call for the DIOCCACHESYNC ioctl.
PR 41015.
2009-03-14 18:00:37 +00:00
apb
caccc8126b Pass DIOCCACHESYNC ioctl down to the underlying disk.
Addresses PR 41016.
2009-03-14 17:56:47 +00:00
christos
19b058b35e PR/41015: Alan Barrett: vnd driver does not implement DIOCCACHESYNC 2009-03-14 16:33:25 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl
02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
jmcneill
8cf7d77c2c Don't assume ACPI == x86, from kiyohara@kk.iij4u.or.jp 2009-03-14 13:56:41 +00:00
ad
0fa70e9b6f 'boot -z' bogons 2009-03-14 11:08:28 +00:00
jmcneill
b33d444d81 PR# kern/41008: possible simple mistake of field check in video(9)
video_set_format() requires hw->set_format to be set, not get_format,
from fukumoto@imasy.or.jp
2009-03-14 00:33:25 +00:00
jym
96f9080096 Fixes in the iwi(4) driver to better handle errors:
- bus_dmamap fixes, with checks against NULL
- move the rings' allocation code later in iwi_attach() to avoid NULL pointer
dereference if allocation fails
- avoid double free() in case of failure during attach. If an allocation fails,
do not free the ring directly, as it is handled by iwi_detach()
- only set ring->count for RX/TX rings when ring allocation is successful, or
else the for loop during detach will fail with a NULL dereference.
- call pci_intr_disestablish() if iwi_reset() fails during attach; driver is
in an incoherent state, interrupt handler should not be used.

Proposed by me on tech-net@, approved by christos@. Compiled and tested
with GENERIC and XEN3_DOM0 kernels.
2009-03-13 21:57:07 +00:00
yamt
34ccaa3db1 tprof_stop1: add an assertion. 2009-03-13 11:06:26 +00:00
bsh
01bbe49d65 Turn off interrupt disable bit in command status reg.
This is necessary to make S-ATA drives work on some motherboards with
SiS964 including my ASUS P4S800D.
2009-03-12 15:02:42 +00:00
jmcneill
143d119885 Add 'alternative memory' disk device driver. 2009-03-12 00:15:07 +00:00
yamt
0bbefb72ab fix breakage where db_regs_t != trapframe.
the problem pointed out by Martin Husemann on tech-kern@.
2009-03-11 13:48:47 +00:00
tsutsui
b057550bcf u_intNN_t -> uintNN_t 2009-03-11 13:12:41 +00:00
yamt
e1b625b4bc - adapt to MODULAR.
- some preparations to have more backends.
- add some comments.
2009-03-10 14:45:02 +00:00
msaitoh
9d35632b3f add an entry for 82567LF-3.
fix the register access for ICH10DO.
2009-03-10 03:41:50 +00:00
msaitoh
76b6d5d63e regen 2009-03-10 03:31:36 +00:00
msaitoh
9036c274a6 add i82567LF-3 LAN Controller 2009-03-10 03:30:55 +00:00
uebayasi
143d2214bf These don't need <sys/tty.h>. 2009-03-09 15:59:33 +00:00
christos
049ae3d056 Match Inter 82965PM, from Anon Ymous 2009-03-09 13:13:25 +00:00
tsutsui
567ce9e6ef Computed checksum value by the FXPF_82559_RXCSUM feature includes data
in IP headers, so we have to deduct not only IP option headers but all
IP headers.  But in TCP/UDP layer we can assume the IP header is valid
and a sum of the IP header part should be 0xffff, so we don't have to
bother to deduct it from the computed checksum.
2009-03-09 10:33:33 +00:00
ad
0458d57a95 use aprint_error 2009-03-08 15:06:56 +00:00
agc
15de39d387 Fix tyop in previous. 2009-03-08 02:07:38 +00:00
reinoud
664af01cd8 Actually lmplement striping as LVM target. OK'd by Adam. 2009-03-07 22:17:18 +00:00
tsutsui
a8ba219be8 Replace incorrect local ether_cmp() function with memcmp(9)
on checking multicast addresses, which is not so critical.
Noticed by FUKAUMI Naoki.
2009-03-07 16:46:25 +00:00
tsutsui
cf97a4b35d Add TCPv4/UDPv4 RX hardware checksum support for i82559 and later chips
which don't have EXT_RFA and IPCB support. From hme(4) driver and
FreeBSD's fxp(4). Tested on i82559.

XXX: Probably we should have a common function to parse RX packet headers
XXX: to handle a raw checksum value and share it among hme(4) and gem(4) etc.
2009-03-07 15:03:25 +00:00
mrg
9526e87d38 move a DRM_SPINUNLOCK() to where it will actually be executed. 2009-03-07 05:46:09 +00:00
dyoung
0226a0496e Don't try to write the registers of the NIC to stop it if it is
already powered down.  This change prevents PCI bus exceptions
(indicated by NMI) when, for example, I detach the whole device
tree on a Soekris net4521:

com1: detached
NMI ... going to debugger
Stopped in pid 0.1 (system) at  netbsd:sipcom_stop+0x4d:        pushl   $0
db{0}> continue
NMI ... going to debugger
Stopped in pid 0.1 (system) at  netbsd:sipcom_stop+0x149:       addl    $0x10,%e
sp
db{0}> continue
sip0: detached

(On the AMD Elan SC520, the NMI occurs at the instruction after
the write or, if the write was posted, at either that instruction
or some later one.)
2009-03-07 00:56:04 +00:00
tsutsui
ee11921a7a Add an `else' missed in rev 1.49 otherwise RX hardware checksum on hme(4)
is not activated at all. Ok'ed by christos@, tested on macppc.
2009-03-07 00:12:36 +00:00
bouyer
dbac012ecf Make it safe to call uhci_init() from a kernel thread with interrupts
enabled:
- don't enable interrupts before calling uhci_run()
- check if the controller's interrupt is enabled in uhci_intr()
The issue is that uhci_run() may tsleep(), uhci_intr1() may be called before
uhci_run() is complete and disable it because it found it halted.

Now a uhci controller can be successfully exported to a NetBSD Xen domU :)
2009-03-06 23:40:50 +00:00
hauke
f971ff9cd3 Workaround from jmcneill for a panic at shutdown.
Fixes PR kern/40947 and should be pulled up to netbsd-5.
2009-03-06 17:10:41 +00:00
haad
50b5b59cc7 Fix lvm lvrename command. There was bug in dm_dev_lookup where
dm_dev_lookup_name was called with device uuid. Remove dm_dev_t:dk_label is
it not used anymore.
2009-03-06 16:17:29 +00:00
tsutsui
19b9bc7f5d The Intel manual says that ICH and 82562 chips are compatible with 82559,
not 82550, so don't set FXPF_EXT_RFA (available only on 82550/82551)
for those variants.

Tested on Intel PRO/100 VM with 82562EM/EX PHY by ISHII Kimio
on current-users, and should also fix PR kern/40431.
2009-03-06 09:54:02 +00:00
msaitoh
f9ccf64b65 Fix typo(s/interupt/interrupt/) 2009-03-05 01:38:12 +00:00
tsutsui
26c579d9c4 Use FXPF_EXT_RFA flag instead of FXPF_EXT_TXCB to see IPCB capability
because EXT_RFA for RX cksum is always available with IPCB for TX cksum
but i82558 and i82559 have only EXT_TXCB without IPCB.

Tested on the following fxp cards:
fxp0 at pci0 dev 14 function 0: Intel i82557 Ethernet, rev 2
fxp0 at pci0 dev 14 function 0: i82559 Ethernet, rev 8
fxp0 at pci0 dev 14 function 0: i82550 Ethernet, rev 12
2009-03-04 10:15:08 +00:00
cegger
05d55db82b mimic fix from nfe(4):
when bus_dmamap_create fails, then the map pointer is undefined.
age_dma_free() assumes, the map pointer is NULL. Make the assumption
always true by setting the map pointer to NULL in bus_dmamap_create()
error path in order to prevent age_dma_free() to call bus_dmamap_destroy()
on an invalid map.
2009-03-03 23:28:44 +00:00
cegger
4822727b65 make multicast working.
Diff from OpenBSD's if_age.c rev. 1.2.
2009-03-03 22:26:41 +00:00
mrg
dcd94c7684 enable FXPF_EXT_RFA the same way the cardbus frontend does. 2009-03-03 06:06:40 +00:00
haad
5b244085d8 Linear target has only 2 arguments in a params string not 9. 2009-03-01 23:17:39 +00:00
haad
f8faf523ec Change comment and add description of line used to configure mirror device. 2009-03-01 23:16:51 +00:00
haad
f048f56f71 Add initial support for striping target, hardcode maximal number of stripes
to 2 for now. strategy routine must be written, for now only parsing and
support routines are available. This is work in progress code and should be
taken very carefully.
2009-03-01 23:15:56 +00:00
cegger
2352b93556 bzero -> memset per request from martin@
bcopy -> memcpy

XXX Would changing bcmp to memcpy be a functional change regarding its return value?
2009-03-01 13:44:54 +00:00
cegger
945fa6c58f when nfe_attach() fails, free all resources including
interrupt map, interrupt handler and dma maps.
Also prevent call to bus_dmamap_destroy() when bus_dmamap_create() failed.
The nfe_free_* routines assume, the map pointers are NULL but they
are actually undefined. Make the assumption true by making them NULL
in the error path of bus_dmamap_create().

All together, this fixes crashes when nfe_attach() fails.
ok martin@
2009-03-01 13:34:10 +00:00
cegger
927cfb73c8 MCP79 supports JUMBO frames.
Information from Linux driver.
Patch presented on current-users@ http://mail-index.netbsd.org/current-users/2009/02/11/msg008037.html
2009-03-01 08:29:25 +00:00
oster
b39a5d4daa Nuke a DIAGNOSTIC check that is no longer useful, even for DIAGNOSTIC. 2009-02-28 23:11:11 +00:00
oster
d7dbe2c6b8 It seems that some SCSI drivers can block while the spinlock on a given
disk queue is being held.  Work around this by dropping the lock before
bdev_strategy(), and re-grabbing the lock afterwards.  This is a
temporary measure until I get to gutting this queue locking code.

There has been some success with this in addressing PR#39993.
This patch is from Antti Kantee.  Thanks!
2009-02-28 22:02:17 +00:00
jmcneill
74dd0aeee0 Change a confusing attach message; if the embedded controller was attached
via ECDT, we would print:
  acpiec0 at acpi0 (EC, PHP0C09-0): ACPI Embedded Controller (disabled)
The embedded controller isn't actually disabled, but instead this driver
instance, so change the message to read:
  acpiec0 at acpi0 (EC, PHP0C09-0): using acpiecdt0
2009-02-28 19:40:23 +00:00
schwarz
8167178188 correct entry for Lucent 0x5802 into 2-port USB Host Controller 2009-02-28 17:55:46 +00:00
jmcneill
4ca035a32b Add proper Realtek ALC268 support. While we're here, fix a comment in
the ALC262 quirk section. Tested by Sean Davis on an Acer Aspire One.
2009-02-28 17:12:13 +00:00
msaitoh
95deb7702d Fix the multicast hash bug on ICH9's wm.
Now we can catch ff02::9 on ICH9's wm.
2009-02-28 15:06:43 +00:00
tsutsui
13a1c5a155 Return EIO rather than getting an infinite loop in the nullcons read function
so that getty(8) against nullcons console fails properly.

Problem on Cobalt Qube2700 reported by Wolfgang Solfrank on port-cobalt.
2009-02-28 00:40:47 +00:00
dyoung
6e3de811e0 Use the right format specifiers to print the new struct timeval. 2009-02-27 23:13:32 +00:00
sborrill
7d02030263 Add support for 82574L (as found on Desktop CT adaptor) based on 82573 support. 2009-02-27 13:17:01 +00:00
mjf
c49f4c3690 Regen. 2009-02-26 19:17:01 +00:00
mjf
c1c5918fbb Add Initio INIC-1622 SATA Controller. 2009-02-26 19:13:38 +00:00
jmcneill
079289a3e6 PR# port-i386/40143: Viewing an mpeg transport stream with mplayer causes crash
Not directly related to the PR but this bug was discovered while testing.

In azalia_stream_halt, invalidate the intr ptr to prevent a race condition
where azalia_stream_intr can jump off into lala land during stream shutdown.
2009-02-25 15:46:34 +00:00
jmcneill
72141a1696 Turn "bogus parameters" aprint_error into aprint_debug, and change the
message to say that the framebuffer was not configured by the firmware.
2009-02-23 23:45:56 +00:00
jdc
7262e977ee Mimic cgsix memory corruption fix (bwtwo and cgthree wscons code is
based on cgsix).  Original commit message:

  Include wsdisplay.h directly in the header to avoid different sizes
  of cgsix_softc depending on proper previous includes by the includer
  due to #ifdef NWSDISPLAY. Thanks to kmem poison check and DEBUG kernels.
2009-02-23 22:44:27 +00:00
cegger
6ec3b632d5 when attach routine fails, also free DMA memory and interrupt mapping.
Diff from OpenBSD's if_age.c rev. 1.2.
ok cube@
2009-02-23 13:39:41 +00:00
cegger
b6d8a5c8fc remove unused age_if_flags softc member 2009-02-23 07:33:58 +00:00
jmcneill
34c593f760 * Realtek ALC885: Use generic_mixer_autoinit/init_widget
* generic_mixer_create_virtual: if the front l/r DAC doesn't have a volume
  capability, enumerate all peer widgets and search for a volume mixer
  there.
2009-02-23 02:34:57 +00:00
cube
102a4f0ad3 I smell rotting code. (Give a chance to the user to at least set the flags
of the interface, if not use it because it otherwise doesn't work.)
2009-02-23 00:05:44 +00:00
pgoyette
7bcb9558e0 1. Reorganize code into memory-type-specific routines instead of multiple
monstrous if-then-else-if constructs.
2. Display module capacity in GB if it is at least 1GB.
3. Indicate if a memory module is "registered".
4. For DDR3, indicate if a temp-sensor is present.

Inspired by similar changes in OpenBSD's spdmem(4).
2009-02-22 17:28:50 +00:00
nakayama
c99ea852e4 - fix copyout size in CLOCKCTL_O?ADJTIME.
- add missing break in CLOCKCTL_NTP_ADJTIME.
2009-02-22 13:06:58 +00:00
christos
d43c4580f1 s/long/intptr_t/ 2009-02-21 17:24:47 +00:00
martin
ff1d9de353 Include wsdisplay.h directly in the header to avoid different sizes
of cgsix_softc depending on proper previous includes by the includer
due to #ifdef NWSDISPLAY. Thanks to kmem poison check and DEBUG kernels.
2009-02-20 22:55:26 +00:00
haad
e654dd3da2 Call dm_target_busy only on properly autoloaded module. 2009-02-20 11:14:11 +00:00
haad
9629be83bf Release tables before we drop reference on device, now creating device with
nonexistent target fails and not ends with deadlock.
2009-02-20 11:12:30 +00:00
dogcow
f2437436f6 sparc complains "cast to pointer from integer of different size"; cast the
int to (void *)(long).
2009-02-20 08:04:15 +00:00
mrg
ce8a6e2599 - remove FXPF_IPCB flag. it should always/only be used with the code
conditional on FXPF_EXT_TXCB, so, replace all uses with that
- for the pci frontend, reestablish some flags lost the the prior
  changes and simplify one of the cases

this fixes PR 40677 and may fix PR 40431.
2009-02-20 05:49:34 +00:00
jmcneill
90c7459808 If the bus glue provides an ioctl handler, don't return before we have a
chance to perform generic handling in the WSDISPLAYIO_SMODE case.

ok macallan
2009-02-20 00:08:00 +00:00
haad
d624725a46 In NetBSD our target modules are called with prefix dm_target_. Add this
prefix to target module name when loading module, lvm2tools uses linux
target names e.g. zero not dm_target_zero.
2009-02-19 23:20:27 +00:00
haad
17599f37f3 Add support for autoloading of device-mapper targets modules. Add
dm_target_autoload function which tries to load target module. Fix two
deadlocks in dm_table_load_ioctl error path(I forgot to call dm_dev_unbusy).
2009-02-19 23:07:32 +00:00
sborrill
d297edd948 Regen 2009-02-19 17:26:21 +00:00
sborrill
73ab5cd89f Add Intel i82574L 1000baseT Ethernet as used in Pro/1000 CT Desktop adapter 2009-02-19 17:25:46 +00:00
markd
e985093766 Add missing break. 2009-02-19 05:58:37 +00:00
jmcneill
a53ec2987d remove vesabios and vesafb 2009-02-19 00:55:48 +00:00
jmcneill
dc02b079e4 Remove vesafb-specific hacks. 2009-02-19 00:39:25 +00:00
mrg
f5e9e80946 simply the previous as suggested by enami:
- don't check args->tp, just let copyin() fail.
2009-02-18 17:57:11 +00:00
yamt
74ccc189c4 wsevent_copyout_events50: fix a bogus panic. 2009-02-18 13:20:02 +00:00
hira
b225d4fb77 - Rename filename of license.
- Correct filename in license (add missing prefix).
2009-02-18 10:51:17 +00:00
mrg
6e512790b1 clock_settime1() expects the struct timespec * to be in kernel space.
make it so.

fixes crashes seen on sparc64 systems with clockctl.
2009-02-18 05:17:56 +00:00
snj
3c510e6b43 s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202. 2009-02-18 04:17:44 +00:00
jmcneill
f11a7f3f4f Revision 1.25 was unintentionally reverted in the previous commit, bring
it back.
2009-02-18 00:27:21 +00:00
jmcneill
60c3292c48 Use aprint_* 2009-02-17 20:35:35 +00:00
jmcneill
3bc515352f Use kmem_alloc instead of malloc for shadowfb 2009-02-17 17:01:41 +00:00
jmcneill
c315121ad0 Cut the amount of spam from acpi devices in roughly half by printing
resources on the same line as autoconf messages. Things like:
  pcppi1 at acpi0 (SPKR, PNP0800)
  pcppi1: io 0x61
become:
  pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
2009-02-17 12:46:01 +00:00
jmcneill
3c220ee07d Use aprint_debug 2009-02-17 12:30:31 +00:00
jmcneill
28f60a7907 Print the physical address if available instead of a virtual address. 2009-02-17 02:41:11 +00:00
jmcneill
d994f000f0 Add clear-screen and cursor-row properties to allow genfb to persist
screen state from the MD console driver.
2009-02-17 02:19:33 +00:00
jmcneill
e04f5ff1b4 Provide callbacks so MD code can explicitly prevent genfb from matching;
works around vga/genfb deathmatches.
2009-02-16 22:24:40 +00:00
mlelstv
c94f3d9355 Don't release CCB twice. Found by code inspection. 2009-02-16 18:05:19 +00:00
cegger
0df426b492 make this compile w/o VLAN 2009-02-16 09:38:41 +00:00
cegger
add29455bf fix media priorities:
IEEE 802.3 Annex 28B.3 specifies the following relative
priorities of the technologies supported by
802.3 Selector Field value:

1000BASE-T full duplex
1000BASE-T
100BASE-T2 full duplex
100BASE-TX full duplex
100BASE-T2
100BASE-T4
100BASE-TX
10BASE-T full duplex
10BAST-T

Our drivers give 100BASE-T4 a higher priority than
100BASE-TX full duplex.
Fix this. This patch is based on changes in FreeBSD and OpenBSD.

Patch presented on tech-kern and tech-net:
http://mail-index.netbsd.org/tech-kern/2009/02/15/msg004397.html
http://mail-index.netbsd.org/tech-net/2009/02/15/msg001064.html

got no comments, no objections.
2009-02-16 08:00:42 +00:00
jmcneill
b16648eaeb Only pull in genfb.h if _KERNEL_OPT is defined. Reported by Kurt Schreiner 2009-02-15 20:21:24 +00:00
jmcneill
2fa3d3184a Use genfb_borrow; drm works with genfb now. 2009-02-15 18:42:20 +00:00
jmcneill
ec798a6e6c Introduce genfb_ops genfb_borrow callback to allow the bus frontend to
lend mappings to drm.
2009-02-15 18:41:49 +00:00
jmcneill
a71612a2f8 Provide a stub genfb_cnattach for md code to call to give a hint to the
bus driver's match function to return a higher confidence (so it can
beat out vga(4), for example). genfb needs-flag so md code can determine
if the genfb driver is present.
2009-02-14 20:33:58 +00:00
perry
88e7f0dcf4 convert to ANSI function prototypes 2009-02-14 20:32:29 +00:00
jakllsch
78a7904557 Add USB_VENDOR_CYBERPOWER/USB_PRODUCT_CYBERPOWER_UPS to the HID blacklist.
This will allow Network UPS Tools to communicate with these UPSes via ugen(4).
2009-02-14 17:13:01 +00:00
jakllsch
5a819467a1 regen. 2009-02-14 17:03:33 +00:00
jakllsch
2c011568c9 Add CyberPower Systems, Inc. vendor ID, as well as one of their product IDs,
which is used in two (or more) models of UPS devices.
2009-02-14 17:01:23 +00:00
bjh21
a0263b80b8 I've just discovered config_found_ia(), which means that wskbd(4) and
wsmouse(4) can attach directly at arckbd(4) and I can dispose of the
ugly arcwsmouse(4) and arcwskbd(4) interpositions.  Do that, and purge
them from the documentation as well.
2009-02-14 10:20:55 +00:00
bouyer
73920b4161 More printf format fixes. 2009-02-13 23:31:23 +00:00
apb
0cc72e51ac Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
2009-02-13 22:41:00 +00:00
bouyer
e83cf7c074 Fix bus_addr_t/bus_size_t confusion 2009-02-13 22:39:37 +00:00
bouyer
1b21577543 Fix printf format after bus_size_t change 2009-02-13 22:39:10 +00:00
bouyer
651c78e5dd Make sure PCI_COMMAND_MASTER_ENABLE is set in PCI_COMMAND_STATUS_REG. 2009-02-13 21:12:14 +00:00
bouyer
b48bdec72e make iwi_alloc_tx_ring() prototype match function declaration (shows up when
bus_addr_t != bus_size_t). Fix cast for 64bit paddr_t on i386.
2009-02-13 21:11:47 +00:00
pgoyette
c46760325c Fix dmesg output:
Old:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMIpiixpm0: polling

New:
piixpm0 at pci0 dev 20 function 0
piixpm0: ATI Technologies SB600/SB700/SB800 SMBus Controller (rev. 0x13)
piixpm0: interrupting at SMI, polling

Cosmetic change only, no functional changes intended.
2009-02-13 19:19:52 +00:00
abs
82eae5f5e8 avoid long/unsigned long printf warning on some platforms 2009-02-13 01:38:32 +00:00
cegger
1ff2d41bea pretty print atphy's supported medias in dmesg. 2009-02-12 13:38:49 +00:00
bouyer
c54134b00b When an error is reported on a write, data may have been transfered
to the device's cache anyway and so cmdh_prdbc reports a completed
transfer. If we use it to update ata_bio->bcount this has 2 conseqences:
- the automatic LBA48 workaround doesn't qick in because bcount is used
  to compute the last sector of the transfer (wd(4) part of kern/40569)
- wd(4) will report a B_ERROR buffer with a b_resid of 0, which panics
  a DIAGNOSTIC kernel
Fix by ignoring cmdh_prdbc if we had a write with errors, and in this case
leave ata_bio->bcount at its initial value.

While there use NOERROR instead of 0 for ata_bio->error (cosmetic).

thanks to Matthias Scheler for tests.
2009-02-12 11:44:11 +00:00
cegger
92e9ddc630 flow-control support for MCP65 chip.
XXX other chips may also have flow-control, but only on MCP65 tested.
ok cube@
2009-02-12 10:33:23 +00:00
cegger
150dcfcbbb Yukon chips support flow-control. Tested on Yukon Lite chip.
ok cube@
2009-02-12 10:22:30 +00:00
rumble
0e95582ed1 WD33C93 has only two registers, which often times aren't mapped to adjacent
bus space locations. Map them individually, instead.
2009-02-12 06:24:45 +00:00
rumble
4ef2271e2d If sc_dmamode is set to SBIC_CTL_NO_DMA, then actually don't do DMA. Now
PIO mode actually works.
2009-02-12 06:20:58 +00:00
oster
f17e8d67c4 If we see a RF_RECON_WRITE_ERROR event we know a write has finished and
we need to account for that.  Failure to do so means we can end up
waiting forever for writes we think are outstanding, but which have
already completed.

Addresses the RAIDframe part of PR#40569.  Thanks to Matthias Scheler
for reporting the issue and verifying the fix.
2009-02-11 23:54:10 +00:00
cegger
e6e201ff78 revert changes in rgephy_reset() done in rev. 1.25.
Should fix PR 40586
2009-02-11 23:01:07 +00:00
cegger
a4f75ff6c2 age_dma_free: set smb pointers to NULL for consistency
age_stop: call mii_down()
ok cube@
2009-02-11 16:15:59 +00:00
cegger
cdc8049f5c Attach atphy(4) on ATTANSIC oui.
ok cube@
2009-02-11 14:44:25 +00:00
cegger
276d5496f2 regen. 2009-02-11 14:42:52 +00:00
cegger
807b74b329 add ATTANSIC and their L1/L2 PHYs
ok cube@
2009-02-11 14:41:56 +00:00
markd
90459b5b45 Add some more ICH9 SATA controller variants. 2009-02-11 06:39:43 +00:00
markd
7bb4356373 regen 2009-02-11 06:36:21 +00:00
markd
10f2846ed4 Add more ICH9 SATA controller variants 2009-02-11 06:35:16 +00:00
tron
c15efe169f Backout LBA 48 quick entries which were added to fix one aspect of
PR kern/40569 because of objections by Manual Bouyer.
2009-02-10 19:45:22 +00:00
drochner
c4dd0bbb21 In usb_reserve_allocm(), return an error immediately if the requested
size is impossible to allocate, otherwise we might get a diagnostic
panic in subr_extent.c.
Being here, fix an off-by-one in setup.
2009-02-10 17:00:06 +00:00
jmorse
6e5c689d54 Fix uvideo_stream_init uninitialized variable / bad argument, leading to panic when opening video stream. 2009-02-09 23:28:50 +00:00
tron
56c9d6aa78 Add two more entries to the quirk table for hard disks which need the
LBA 48 work around. The first entry will watch the Seagate ST3160815AS
(and similar models), the second one HP's OEM version of the same drive.

This avoids the RAID rebuild problems described in PR kern/40569.
2009-02-09 22:34:23 +00:00
pgoyette
704a9b346c Previous check for ADM1027 caused a kernel panic, since the read routine
can be called _before_ we've identified the chip.  Ensure that sc_chip
is initialized to NULL before chip is identified, and if it is NULL or
ADM1027, use the less-efficient send_byte/receive_byte.

While here, don't attempt to release the i2c bus if we failed to acquire
it.  This would cause a panic on a LOCKDEBUG kernel.

Thanks to Nicholas Joly for pointing out both of these bugs.
2009-02-09 20:27:21 +00:00
nonaka
9d853f68dd fix comment. 2009-02-09 12:11:16 +00:00
uwe
c795b4c2a9 G/c duplicate definition of WSCONS_EVENT_ASCII. 2009-02-08 22:58:56 +00:00
pgoyette
66a822fbe7 The ADM1027 chip doesn't support i2c read_byte protocol, so in this
case we use send_byte followed by receive_byte.
2009-02-08 17:48:02 +00:00
pgoyette
d94df08c58 Use pre-scripted i2c protocols rather than re-inventing our own. No
functional change intended.

While here, change some indentation to use tabs vs spaces.
2009-02-08 14:34:40 +00:00
oster
2240ff3c50 Nuke #define MAXNSTRIPES which is no longer useful. 2009-02-07 20:41:30 +00:00
oster
ce32c4d01e Be consistent with wd.c and don't complain loudly if the underlying
device doesn't support flushing the cache.  Fixes an issue (reported
privately) where ST39120A drives are not capable of flushing the
cache, and RAIDFrame was incessantly complaining.
2009-02-07 20:36:49 +00:00
jakllsch
1db353a59c regen. 2009-02-06 19:40:31 +00:00
jakllsch
3b951f1af8 Add TI PCIxx12-series product IDs. 2009-02-06 19:36:35 +00:00
jym
92ae85d18e Changes to MEMORY_RBFLAGS option:
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)

See also http://mail-index.netbsd.org/tech-kern/2008/12/25/msg003924.html

Reviewed by abs@ in private mail.
2009-02-06 18:50:26 +00:00
drochner
37d6396041 -in the wdc@pcmcia driver, don't try to powerup/down while cold or
shutting down -- this is only supposed to happen from the pcmcia
 kernel thread while the system is running
-in wd_shutdown, call ata_addref first, so that the adapter is either
 active or we know that it isn't
This fixes a hang on shutdown-p reported by Dennis den Brok per
PR kern/40531. Verified by by Dennis and me.
(reported against 5.0-Beta, so this is a pullup candidate)
2009-02-06 13:43:11 +00:00
dyoung
613d59f38b Define some bitfields that come from a reference driver. 2009-02-06 02:02:26 +00:00
dyoung
aab95b778e Disable and acknowledge Function Events, and stop installing a
handler for them.

Don't override the latency timer set for us by the CardBus code.

Add a bit of debug code for the Function Event Registers, #if 0'd
out for now.

Cosmetic: remove gratuitous parenthesization of return statements.
Change the indentation of the struct atw_pci_softc definition.
Use a more meaningful variable name, et cetera.
2009-02-06 02:00:50 +00:00
dyoung
c11e37cd3d Disable and acknowledge Function Events, and stop installing a
handler for them.
2009-02-06 01:55:19 +00:00
dyoung
e7aed4b441 When the power status changes, always note the change and wake the
socket events thread.  Sometimes we would not note the power-status
change if the socket also indicated a change in card status.
2009-02-06 01:15:53 +00:00
dyoung
1121b32c97 If the bus_dmamap_load_mbuf() status was non-zero, then the DMA
map is undefined, so do not try to unload it.
2009-02-05 23:56:57 +00:00
dyoung
4bb08aca8c Initialize ec_mii, and re-use more ethernet common code for media
handling.

Replace an anonymous constant by PCI_COMMAND_INTERRUPT_DISABLE.

These changes have been compile-tested, only.
2009-02-05 21:40:46 +00:00