Commit Graph

23382 Commits

Author SHA1 Message Date
ad
ab27a4b1d4 Remove code to prevent multiple open of block devices; it's no longer
needed.
2008-01-30 15:30:12 +00:00
ad
549e8ec8b9 Has this compiled recently? 2008-01-30 14:12:20 +00:00
he
0a4814ccdc Do a dummy pmf_device_register() in pcppi_attach() instead of only
in pcppi_isa_attach(), so that pcppi at acpi doesn't become an obstacle
to suspending.

Looked over by jmcneill.
2008-01-30 12:30:01 +00:00
simonb
a4c23df6ce Add a simple resume hook that just calls bce_reset(), and register
this with pmf_device_register().

Makes suspend/resume with bce happy.  Much thanks to Jared for help here.
2008-01-30 12:00:35 +00:00
simonb
fb673d9599 WextraRemove unused DPRINTF/DPRINTFN macros.
Remove NetBSD 1.6 compatibility checks (way out of date).
Be somewhat consistent (and closer to KNF) with whitespace.
Use uintN_t instead of u_intN_t.

No functional changes.
2008-01-30 11:54:08 +00:00
tron
ce82b598ec Add support for function keys F16 to F19 as present on e.g. the new
Apple aluminum keyboard.

Patch contributed by Michael Piotrowski in PR kern/37788, reviewed
by Matthias Drochner.
2008-01-29 20:54:32 +00:00
tls
16a9229cf8 Sigh. What was meant here was an ITR register value of 1500, for 2604
interrupts/sec -- not the other way around.  Caught by yamt.

When I can confirm that it won't lock the chip up on the models claimed
to be problematic, I'll probably adjust the packet timers a bit further
to see if I can get latency down under low load.  But this should be
better.
2008-01-29 20:24:41 +00:00
xtraeme
d187549ef6 Pass the same size to kmem_alloc(9) and kmem_free(9), this fixes
the kmem_poison_check panic on DEBUG kernels.
2008-01-29 19:35:05 +00:00
dyoung
534869a24d Use device_t. Add a handler for child detachment. Now I can detach
cd0 at atapibus0 without getting a panic when atapibus0 detaches,
later.
2008-01-29 17:26:57 +00:00
jmcneill
ab245e294e PCI Power Management 1.2 says that system software should wait 10ms after
transitioning a device to or from D3hot, 200us to or from D2, and no wait
for D1 transitions. Update pci_set_powerstate_int to match the spec,
rather than naively waiting 1ms after every state transition.
2008-01-28 22:48:43 +00:00
jmcneill
a0a5798f83 Change synaptics 'unusual delay' printf to aprint_debug. I'm tired of
seeing it over and over again.
2008-01-28 22:30:27 +00:00
jmcneill
1ec278b34c Don't call do_enable on synaptics resume if !sc->sc_enabled 2008-01-28 22:29:00 +00:00
jmcneill
6d105ec7c2 De-noisify resume handler. 2008-01-28 22:28:32 +00:00
jmcneill
ef5ded9b39 No need to operate in polling mode in ehci_resume. 2008-01-28 20:58:23 +00:00
jmcneill
b7cf8d358c The Thinkpad T61/x61 family powers off the USB power resource on resume
from S3 sleep. Until we get proper ACPI power resource support, simply
call \\_SB.PCI0.LPC.EC.PUBS._ON() on resume if the method exists.

Fixes kern/37279 by Steven M Bellovin.
2008-01-28 20:31:55 +00:00
dyoung
37b0eea62f Remove dead code and associated comments. 2008-01-28 18:18:37 +00:00
dyoung
fd68f1fdfd If something still holds a reference to our scsipi_adapter, do not
warn and complete the detachment, but return EBUSY.
2008-01-28 18:17:05 +00:00
dyoung
0974448cd1 Do not allow the system console to detach, because that will lead
to a panic.
2008-01-28 18:12:29 +00:00
macallan
671b15c8ef get rid of the shutdown hook, add suspend and resume handlers instead
XXX: ahc_suspend panics here so suspend calls ahc_shutdown and resume does
nothing.
This fixes a hangup and subsequent panic which occured when the shutdown hooks
were called and /afterwards/ the sd suspend handler tried to flush caches
through an already shut down ahc.
2008-01-28 16:08:37 +00:00
jmcneill
05b25a6836 Ensure that we don't clear the EHCI_PS_CLEAR bits by writing 1s to them
when modifying port state in ehci_suspend and ehci_resume.
2008-01-28 01:52:31 +00:00
jmcneill
e4e10d4f97 Release port ownership on detach, so devices will be routed to companion
controllers. This allows 'drvctl -d ehci0' to disable USB 2.0 mode.
2008-01-28 00:47:05 +00:00
jmcneill
515d26c53b Release ownership of EHCI to the BIOS when we suspend or detach the
device driver.
2008-01-28 00:44:17 +00:00
jmcneill
31646d87c2 Don't attempt to claim ownership from the BIOS if the OS already holds
the HC OS Owned semaphore. Unconditionally clear SMIs as long as the
USB legacy capability is present.
2008-01-27 20:09:14 +00:00
jmcneill
b6294fbf32 Add some USB EHCI Legacy Support Extended CSR bit definitions. 2008-01-27 20:06:48 +00:00
jmcneill
cdbea784c7 On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.
2008-01-27 01:57:03 +00:00
jmcneill
d66b2b71eb Fixup PCI_COMMAND_STATUS_REG on attach. 2008-01-27 01:56:02 +00:00
oster
287ee4e9a9 In a land before time, when kernel processes roamed the system, we
needed to keep track of the kernel process that opened a device in
order to close it with the right credentials.  Flash forward to today
where curlwp is now quite sufficient.
2008-01-26 20:44:37 +00:00
ad
ea9faa6742 lockstat: no longer track lockmgr() events. 2008-01-26 14:29:31 +00:00
tsutsui
6ca5886d93 Add a wakeup instruction which is taken from Realtek driver.
Untested on newer chips, but no bad side effect on my 8169S.
2008-01-26 14:24:14 +00:00
tsutsui
9e319fb40f Wakeup some newer chips from powerdown mode. From FreeBSD/Linux driver
via OpenBSD.

Tested by wiz@ in PR kern/37868.
2008-01-26 14:13:06 +00:00
xtraeme
6b037e2408 Make it print the correct version for AHCI 1.2 controllers. 2008-01-25 21:41:48 +00:00
ad
632e64ed4e lockmgr() not used here, remove ref to it. 2008-01-25 20:39:28 +00:00
jmcneill
a06bac7d44 Speed up uhub attachment considerably. Rather than powering up each port
individually then waiting for it to become stable, power them up all
at once and then delay. Don't even bother delaying if we are a root hub,
as this is handled separately in the event thread. From OpenBSD.
2008-01-25 00:29:12 +00:00
ad
7b081426cb Destroy mutex when detaching. PR kern/37819. 2008-01-24 18:50:15 +00:00
ad
703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
gson
b8e6012764 Don't enter an infinite loop in audio_read() when the sc->sc_rustream
buffer is full.  Fixes kern/34659.
2008-01-23 14:14:55 +00:00
jdc
e75a1cd5b7 Set the correct offset when using VLAN's. 2008-01-22 23:19:14 +00:00
jdc
eb6a063cb6 Also count excess or late collisions as output errors in gem_tint().
Count receive errors (as input errors) in gem_rint().
2008-01-22 09:42:06 +00:00
ichiro
2e9fa9fff0 make compile 2008-01-21 12:16:31 +00:00
ichiro
c6061e7174 change umass quirks logic in USB_MATCH()
PR/37687 from Yojiro UO
2008-01-21 12:11:21 +00:00
ichiro
817e003a02 add full support device driver for Huawei E220 wireless modem
PR/37692 from Yojiro UO
---
uhmodem: device driver for huawei 3G wireless modem

* what it is?

A device driver for huawei 3G wireless modem, E220 and its valiations.

The devices are very simuler to ubsa device, but they need special care
to use as modem device.
This patch introduce "uhmodem (USB Huawei modem)" for the devices.
A uhmodem device has two com devices and one USB mass strage device.
The driver enable to use all of them.

* dmesg:
uhmodem0 at uhub0 port 1 configuration 1 interface 0
uhmodem0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
uhmodem0: mass storage only mode, reattach to enable modem
uhmodem0: at uhub0 port 1 (addr 2) disconnected
uhmodem0 detached
uhmodem0 at uhub0 port 1 configuration 1 interface 0
uhmodem0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
ucom0 at uhmodem0 portno 0: modem
ucom1 at uhmodem0 portno 1: monitor
umass0 at uhub0 port 1 configuration 1 interface 2
umass0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
cd0 at scsibus0 target 0 lun 0: <HUAWEI, Mass Storage, 2.31> cdrom removable
2008-01-21 11:36:46 +00:00
dyoung
654775cc67 Remove an unnecessary check that yields a spurious EINVAL during
initialization.
2008-01-21 11:32:12 +00:00
joerg
3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
jdc
19c14b9042 Fix Apple gigabit gem interfaces by restoring some of the code from r1.67,
with some minor alterations to make Sun fibre cards work too.
Tested by aymeric@ and macallan@.
Fixes PR kern/37809.
2008-01-20 15:12:33 +00:00
jmmv
7660ca07d8 Now that the driver goes through the mii_ifmedia_change indirection
instead of directly calling the pcn_79c970_mediachange function, we
must initialize sc->sc_mii.mii_ifp so that this last function is
passed a valid parameter.

Fixes a panic in pcn_79c970_mediachange that arose immediately when
trying to use this interface due to a NULL pointer dereference.
Hi dyoung@!
2008-01-20 11:28:12 +00:00
msaitoh
fae0af7902 mii_physubr.c::mii_phy_reset() has gphyter and nsphyter specific delay(500).
This delay cause 500us loops under splnet() per linkdown port per mii_tick.
It causes periodically drop packets. It's not acceptable for other devices.

Move gphyter and nsphyter specific delay(500) into the drivers from
mii_physubr.c.
2008-01-20 07:58:19 +00:00
dyoung
da15c1a71e Let ether_ioctl() handle default SIOCSIFMEDIA/SIOCGIFMEDIA actions. 2008-01-19 22:23:35 +00:00
dyoung
5e35e05775 In wdcdetach(), if config_detach() fails, get out early. 2008-01-19 22:22:14 +00:00
dyoung
f049e8f385 Remove unused sc_media #define. 2008-01-19 22:20:42 +00:00
dyoung
df18183c3c There is really no use for switch when there is no case labels
except for the default, so remove the enclosing switch and the
default label.
2008-01-19 22:20:10 +00:00
dyoung
b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
dyoung
ad45c434e8 Use the common code for ethernet media handling. Compiles on i386. 2008-01-19 20:25:44 +00:00
aymeric
8a162df73e recognize (again) the Intrepid 2 gem adapter in the Powerbook5,8 2008-01-19 15:56:52 +00:00
simonb
741ec49962 Use M_80211_NODE as malloc type for a 80211 node as rest of net80211
code does, instead of M_DEVBUF.  Fixes panics if KMEMSTATS are enabled.
Also use M_ZERO instead of memset on malloc()'s results.
2008-01-19 03:45:08 +00:00
ad
096996ec09 Noisy printf 2008-01-18 16:22:50 +00:00
joerg
4ef3261d7c Add power management support. Untested due to lack of feedback. 2008-01-18 01:33:40 +00:00
jmcneill
8761d09319 Don't be so aggressive in polling the EC when cold, port-i386/37790. 2008-01-18 01:03:24 +00:00
jmcneill
91a074d893 If we are in polling mode, do not try to spin forever in the state machine
waiting for a read or write to complete. Workaround an issue on my VAIO,
but we really need to figure out why it is failing in the first place.
2008-01-18 00:33:54 +00:00
jklos
740cd1ea87 More Chelsio 10 gigabit driver files to complete the ones checked in
yesterday.
2008-01-17 15:54:35 +00:00
jklos
0123f42896 10 gigabit Chelsio cards now compile and work, although not very well yet. 2008-01-17 06:03:21 +00:00
jmcneill
f4e9b2430e Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64. 2008-01-16 13:08:54 +00:00
is
257a88e757 Move from workqueue to an explicit kthread for setting the multicast
filter, as suggested by cube@. Actual code review by cube@.
This way, a backport of the fix to netbsd-4 is possible.
2008-01-16 12:33:54 +00:00
christos
9d6619f2e6 Remove ricoh hack; FreeBSD does not seem to do it, and it was a remnant from
the branch. Things should work properly now.
2008-01-15 21:55:24 +00:00
jmcneill
cdd511a2fb For WSDISPLAY_GINFO, depth should be sc->bits_per_pixel, not
sc->color_depth. While we're here, implement WSDISPLAYIO_LINEBYTES.
2008-01-15 02:00:49 +00:00
drochner
69ac8d9d9e fix some PCI config space offsets to be 32-bit aligned, the code
did already do the right bit shifting
2008-01-15 00:27:58 +00:00
drochner
98da2f9c50 fix some unaligned PCI config space accesses in suspend/resume functions 2008-01-15 00:24:47 +00:00
drochner
84c211c56c On suspend/resume, just detach/attach the X server (or whatever might
be using the "syncops" protocol) rather than doing a full switch
to virtual screen 1. The latter doesn't have the expected result if
the X server is running on screen 1, and is too much policy for inside
the kernel anyway.
Introduce a mutex+condvar to synchronize these operations, to replace
the spltty()/tsleep(). (for now only used by the new functions,
should be extended to the normal vt switching code)
2008-01-14 21:38:50 +00:00
martin
e91d982a78 Make sure pci config space access only happens on 32bit aligned addresses. 2008-01-14 21:33:04 +00:00
drochner
8644062c1c restructure things a bit so that proclist_mutex is held between the
p_find() and the psignal() which is its purpose after all
2008-01-14 21:17:00 +00:00
xtraeme
7e8220d319 Fix the BARs on nForce 430, which failed to attach. Reported by
atsushi fukumoto in PR kern/37756.
2008-01-14 20:30:10 +00:00
tsutsui
e88df705a1 Use htole32() to write parameters to DMA descriptors for big endian machines.
Tested on Pegasos by mrg@ on port-ofppc.
2008-01-14 06:32:10 +00:00
dyoung
b6c0385fe0 Use device_t, device_private(). 2008-01-14 06:12:13 +00:00
dyoung
132fca675f In pccbbdetach(), panic if interrupt handlers are still registered
after detaching children.

Use PCI_CB_MEMBASE0, PCI_CB_MEMLIMIT0, PCI_CB_IOBASE0, PCI_CB_IOLIMIT0
instead of magic numbers.
2008-01-14 03:01:41 +00:00
cube
55f21981d9 workqueue(9) has the non-evident limitation that the caller cannot reuse
the same struct work before workqueue(9) has internally started to work on
the task.

So to make sure that doesn't happen, provide a semaphore not to run the
workqueue multiple times.  It might be clearer just skip using workqueue(9)
and use a thread for about everything, but oh well, I leave that to
someone else.

Now is@ can yank his USB-to-Ethernet adapter while the interface is up.
2008-01-12 22:32:51 +00:00
tnn
103f966e33 regen (add ServeRAID 6/7) 2008-01-11 20:49:14 +00:00
tnn
2abb4192af Add ServeRAID 6/7 2008-01-11 20:47:21 +00:00
ragge
1d93d6da72 Add entry to match the "Intel® PRO/1000 PT Quad Port Server Adapter". 2008-01-11 13:04:39 +00:00
ragge
9360a7471b Regen 2008-01-11 12:01:20 +00:00
ragge
5f5a2ae52a Add Intel quad 1000baseT copper PCI express card. 2008-01-11 11:31:25 +00:00
tsutsui
fba7c262a8 Move todr_attach(9) calls from each MD attachment to MI intersil7170_attach(). 2008-01-10 16:04:57 +00:00
tsutsui
05517e38f5 - move todr_attach(9) calls from each MD attachment to MI mk48txx_attach()
- don't clear todr_setwen in mk48txx_attach() since it might be set by
  MD attachments
2008-01-10 15:31:26 +00:00
tsutsui
db09bcc34f Move todr_attach(9) calls from each MD attachment to MI mc146818_attach(). 2008-01-10 15:17:39 +00:00
tsutsui
6dfc7d1b78 - use aprint_normal(9)
- use __func__ to print function names
2008-01-10 14:52:32 +00:00
tsutsui
57e50507c9 Use aprint_normal(9). 2008-01-10 14:51:49 +00:00
tsutsui
af18f23ec2 - use aprint_normal(9)
- use __arraycount()
- use __func__ to print a function name
2008-01-10 14:51:17 +00:00
dyoung
bf192f5d8d In pcppi_detach(), s/pmf_device_register/pmf_device_deregister/.
Why that never blew up when I tested, I will never know.  Thanks
wiz@ for catching my mistake.
2008-01-10 08:55:31 +00:00
dyoung
b0b0d490fb Straggler: change generic ifmedia_X names to lmc_ifmedia_X. 2008-01-10 08:50:52 +00:00
dyoung
636e434283 Support pcppi(4) detachment.
Use device_t, device_private().  Get rid of a struct device * cast.
2008-01-10 07:58:39 +00:00
dyoung
d3a283186c Use device_t. 2008-01-10 07:49:04 +00:00
dyoung
92e5e1c722 Oops, remove some debug statements that slipped in there. 2008-01-10 07:48:22 +00:00
dyoung
3a66b9167f Let us detach atabus* from wdc*, and wdc* from isa*.
Use device_t, device_private().
2008-01-10 07:44:07 +00:00
dyoung
1415c1d7aa Use device_t, device_xname(), device_private(). Add atabus_childdetached()
to clean up pointers to detached children.
2008-01-10 07:41:20 +00:00
dyoung
c329a611cb Add a helper routine for ethernet drivers, mii_ifmedia_change().
Remove an mii_softc from its mii_data in mii_phy_detach(), not in
mii_detach(), so that we do not leave dangling pointers to a PHY
in an mii_data.
2008-01-10 07:29:41 +00:00
dyoung
49df706f87 Re-use ether_mediachange(), ether_mediastatus(). Stop using
shutdownhook_establish(9).
2008-01-10 07:25:33 +00:00
uwe
829ba69fd1 Don't bury &sc->sc_dev idiom inside arglist of aprint_error_dev(), use
explicit device_t self variable instead to make future conversion easier.
2008-01-09 22:29:20 +00:00
uwe
9ea46456ee Autoconf allocates softc with M_ZERO, so there's no need to explicitly
init missing todr methods to NULL.
2008-01-09 22:20:40 +00:00
uwe
1825805f68 Use todr_{get,set}time_ymdhms methods and let MI code in kern_todr.c
do conversion and checks.
2008-01-09 22:09:22 +00:00
degroote
b69cd173f5 Make sure BBP is ready before writing to it
From DragonflyBSD
2008-01-09 20:21:23 +00:00
degroote
94aebeb732 Add some sysctl to retrieve the radio state (and the debug level).
While here, fixe the return value in case where radio is off (suggested by
joerg@).
2008-01-09 20:15:40 +00:00
uwe
b2fb3432e4 rtc_offset is handled by kern_todr.c, so nuke it here.
Pointed out by joerg@
2008-01-09 18:29:37 +00:00