Commit Graph

23059 Commits

Author SHA1 Message Date
njoly
74ac36ac9c Do not try to attach spdmem if i2c adress exceed 0x57.
It must follow the reserved eeprom adresses range.
2007-12-14 13:18:43 +00:00
dogcow
5c1631600c fix KDASSERTs by defining ifp 2007-12-14 08:14:27 +00:00
dogcow
d494e60340 caddr_t -> void * 2007-12-14 08:14:26 +00:00
dogcow
df396ec4f3 remove typedef for caddr_t 2007-12-14 08:14:26 +00:00
dyoung
0aff5df9de Simplify suspend/resume using device_has_power(). 2007-12-14 03:38:19 +00:00
dyoung
8fc7c0c5ca Add a resume handler for com@isa, using Jared McNeill's suggested
code from current-users.  com@acpi, et cetera, remain to be done.
2007-12-14 03:36:54 +00:00
dyoung
c4245b0ab7 Oops, make last change compile. 2007-12-14 03:22:19 +00:00
dyoung
9a075a9c73 Comment-out calls to pci_disable_retry() and cardbus_disable_retry().
They do not seem well-justified according to anyone's understanding
of what they really do, and it seems especially inappropriate to
call them at attach- and resume-time.
2007-12-14 03:18:46 +00:00
mjf
84f60004f0 Reorder the previous commit so we remember to disestablish pci interrupts
if we fail to attach ath(4).

Thanks dyoung!
2007-12-14 02:57:22 +00:00
dyoung
552eeca6f7 Exit from ath_init() with EBUSY if the device does not have power. 2007-12-14 02:46:49 +00:00
dyoung
0c96975093 Take a step toward sharing compiled code between sip(4) and gsip(4):
get rid of SIP_DECL() and reduce #ifdef DP83820 code.  Next step
is to move a bunch of shared code to a new file (if_sipcom.c, say)
and compile it *once*.

While I am here, add suspend/resume handling to sip(4) and to
gsip(4).

Tested with the NatSemi sip(4) on the Soekris net4521.  I don't
have any gsip(4) to test with, and it seems that the few holders
of gsip(4) in the world keep them in their attic, anyway.
2007-12-14 01:55:35 +00:00
dyoung
417afa7caa Bug fix: record the new state (high/low) set by gpio_pin_write().
I don't know why we gpio(4) didn't do that before, but it seems
harmless.

Add naive power handling: when a gpio(4) instance is resumed, write
each pin's configuration flags and output state from the softc to
the hardware using gpiobus_pin_ctl() and gpiobus_pin_write().
While suspended, fail every ioctl() except for GPIOINFO with EBUSY.
2007-12-14 01:49:23 +00:00
jmcneill
e692a6c76a Introduce pmf_system_bus_resume. In the ACPI S3 resume path, use this to
separate powering up devices from restoring their state. This is required
on some machines where AcpiLeaveSleepState can fail due to an attempt to
access a powered off device.
2007-12-14 01:29:29 +00:00
mjf
003edc95d6 Fix a crash at shutdown/reboot that was caused by ath(4) registering with
pmf's network class even though the ath device may not have attached
properly.

OK jmcneill
2007-12-14 00:55:52 +00:00
uwe
0790e7df9b Complete lockmgr->mutex conversion started in 1.12. Mutex needs to be
inited with mutex_init.  Since mutex ops return void, drop (void) cast
from APM_(UN)LOCK.
2007-12-14 00:51:44 +00:00
tls
9fcd272fb5 Adjust interrupt moderation for newer chips to be saner according to the
82571 manual and Intel Application Note 450.  Previously, we were setting
RADV and TIDV/TADV values that didn't make any sense given the enormous
ITR value we were setting (well outside the range recommended by Intel
and quite possibly rejected silently by the chip as junk) and setting
RADV without setting RDTR, which is explicitly documented as having no
effect.

A considerable performance improvement is achieved for TCP and UDP at
gigabit speed.  I need to revisit this to deal with the timer ticks
being 4X as long when the chip's in 100mbit mode, and to set values
for the older chips' interrupt timers that are more like what the
appnote recommends.  This should help for 82543 and newer, though.
2007-12-14 00:23:49 +00:00
garbled
41918d8024 Move the elink probe code from files.isa to the common conf/files so that
MCA without isa can compile.  fix by cube.
2007-12-13 21:23:48 +00:00
degroote
aaf41b42d1 Remove the shutdown hook (pmf takes care about it already), as suggested by joerg@ 2007-12-13 19:58:42 +00:00
jmcneill
61d17f24ea Make this compile again. 2007-12-13 16:53:28 +00:00
xtraeme
fcad73742f Check return value of pmf_device_register(), pointed out by joerg.
Looks like the pmf(9) manpage declared it as void and not bool...
2007-12-13 15:36:29 +00:00
joerg
1c47f4bb86 Switch to console on suspend and shutdown, switch back to where the
system was before on resume. This is the second attempt and got more
complicated due to the async nature of VT_ACTIVE. After the initial
switch, check that we ended up on the first screen and if not, wait for
the switch to happen.
2007-12-13 15:14:48 +00:00
jmcneill
2399e8e84e Restore the native mode PCI conf register on select chipsets on resume,
in case it was lost when power was removed.
2007-12-13 15:11:31 +00:00
joerg
5141501598 Stop the key pressed timeout on suspend to avoid virtually hanging keys,
e.g. when calling sysctl -w machdep.sleep_state=3 manually.
2007-12-13 14:49:42 +00:00
joerg
af42580f29 Don't count poll(2) and select(2) as device activity. Don't activate the
device on write(2) if it is suspended and was not idle.
2007-12-13 14:40:36 +00:00
jmcneill
67153124ea When resuming the audio device, call audiosetinfo with the last known good
parameters. Fixes an issue with suspending the audio device while playback
is paused.
2007-12-13 14:02:53 +00:00
dyoung
3ccfb020a3 Back out previous my previous change, it stops device resumption
entirely.
2007-12-13 09:17:43 +00:00
dyoung
4e2f6cc949 Do not reinitialize the NIC while it is suspended. 2007-12-13 09:04:39 +00:00
jmcneill
645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
jmcneill
faa68cee64 Rename acpiec_gpe_state_maschine -> acpiec_gpe_state_machine 2007-12-12 12:57:48 +00:00
smb
472e153a90 Add power management hooks 2007-12-12 03:54:27 +00:00
jmcneill
c44d13d630 No longer required after jmcneill-pm merge. 2007-12-11 23:07:30 +00:00
lukem
456279df8f use __KERNEL_RCSID() 2007-12-11 12:29:11 +00:00
lukem
961afe5035 use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:16:34 +00:00
lukem
30bbbed8a0 remove borken/unnecessary __RCSID 2007-12-11 12:16:14 +00:00
lukem
b55306727c use __KERNEL_RCSID() 2007-12-11 12:09:21 +00:00
lukem
ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
lukem
e3899b9e67 NetBSD RCSID love 2007-12-11 11:48:40 +00:00
lukem
38398f2570 use __KERNEL_RCSID() 2007-12-11 11:38:15 +00:00
lukem
388339aa58 use __KERNEL_RCSID() 2007-12-11 11:25:46 +00:00
lukem
afb2a5863e use __KERNEL_RCSID() 2007-12-11 11:17:30 +00:00
martin
6cdfaa0c8f As a stopgap fix: disable a pci_conf_ access at offset 0x82 on archs
that would mind ;-) IMHO this access violates the PCI spec, so this
should be solved differently.
2007-12-11 11:11:22 +00:00
lukem
3290dbb81a use __KERNEL_RCSID() 2007-12-11 05:38:12 +00:00
jmcneill
8eeb638b73 Register with pmf 2007-12-11 03:45:57 +00:00
jmcneill
f2fa8d82cf Make this compile again. 2007-12-11 02:02:31 +00:00
oster
7f102f3ada Use CFATTACH_DECL_NEW instead of CFATTACH_DECL... ICB wisdom
is that this will fix the config_devalloc panic.
2007-12-11 01:54:46 +00:00
jmcneill
eded1e0324 Disable the wd_suspend power handler on the proper branch, workaround for
kern/37508
2007-12-11 01:52:18 +00:00
martin
f40133bd10 const'ify ad1848 devmap. 2007-12-11 00:21:51 +00:00
martin
2ce2127701 When collecting mixer values while suspending, initialize the number
of channels from the mixer device info. Fixes PR kern/37512.
OK: jmcneill
2007-12-11 00:08:14 +00:00
xtraeme
0cd3ab0981 Register to the pmf(9) framework and fix an error path. 2007-12-10 23:25:59 +00:00
reinoud
3a44e8ad9d Add missing \n and remove surplus . 2007-12-10 22:56:29 +00:00