Commit Graph

2302 Commits

Author SHA1 Message Date
haad f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
cegger ab57cc6f1b struct device * -> device_t, no functional changes intended. 2009-05-12 09:10:15 +00:00
cegger 8a46564d1d struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 08:44:19 +00:00
cegger f2bccc0a8e struct device * -> device_t, use device_private() 2009-05-05 12:07:15 +00:00
dyoung 64670508f7 Detach pcppi0 at isa0 during shutdown. 2009-04-17 20:46:37 +00:00
mlelstv 485e52e2b3 attach and detach do not mix.
Create a new detach function that calls the parent function after
dealing with the private instance counter.
2009-04-10 10:18:50 +00:00
dyoung 99084a32b0 Decrease midi_pcppi_attached when midi at pcppi detaches. 2009-04-08 00:12:27 +00:00
dyoung 1de2a73134 Make pcppi(4) detach the "speaker" from attimer(4), so that the
corresponding attimer(4) resource is not perpetually busy: now it
is possible to detach and to reattach pcppi(4).  Make attimer(4)'s
device-detachment hook return EBUSY if pcppi(4) is still attached, so
that pcppi(4) cannot end up with a dangling pointer to attimer(4).
2009-04-07 22:30:09 +00:00
dyoung 00644496f7 Fix spelling: indrect -> indirect. 2009-04-07 21:48:46 +00:00
dyoung 18789e2def Detach midi at pcppi during shutdown. Sprinkle static. 2009-04-07 18:31:12 +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
cegger df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +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
cegger 05d33dc7bf ansify function definitions 2009-03-16 09:32: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
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
ad 0fa70e9b6f 'boot -z' bogons 2009-03-14 11:08:28 +00:00
dyoung 6e3de811e0 Use the right format specifiers to print the new struct timeval. 2009-02-27 23:13:32 +00:00
bouyer 73920b4161 More printf format fixes. 2009-02-13 23:31:23 +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
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
cegger f8e41c4991 make this compile 2009-01-11 10:40:27 +00:00
mlelstv 0f2eef0070 fdcintr1 requires the mutex to be held. 2008-12-29 12:16:52 +00:00
tsutsui 3cf9bfd3aa Set all default geometry parameters (not only secpercyl and secsize)
before readdisklabel(9) on DIOCGDINFO so that we can get correct
media size via the ioctl. (usually floppy doesn't have a real disklabel)

Tested on i386 with 1.44M floppy.
2008-12-24 16:56:28 +00:00
cegger 9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
cegger ad15153381 make this compile with IYDEBUG 2008-12-17 15:41:24 +00:00
christos 9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
ad 0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung de87fe677d *** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.
2008-11-07 00:20:01 +00:00
pgoyette 72ef407c2a Consistent use of softc member name - fixes build breakage from previous. 2008-10-12 23:07:32 +00:00
pgoyette eacec974a3 Add an i2c attachment for the LM78 family of temp sensor/fan control
Tested by Martin Husemann
2008-10-12 13:17:28 +00:00
martin dab198261c Apply patch from Dave Huang in PR kern/39642: catch up on com(4)'s
device_t/softc split.
2008-09-28 15:39:40 +00:00
christos 91ca465c78 device_t changes, pmf, minor knf. 2008-08-27 05:33:47 +00:00
drochner cc29fcf8b9 constify the pcmcia/cardbus method tables 2008-06-26 12:33:17 +00:00
tsutsui 1f459d82b5 Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.
2008-06-08 12:43:51 +00:00
jmcneill ce25e3c5e1 lpt(4): register NULL pmf handler. 2008-05-31 14:07:03 +00:00
martin 5faa185ff6 Pass the com softc to comintr, not the device_t.
Fixes PR kern/38776.
2008-05-30 10:59:42 +00:00
jmcneill 21629183b8 Add pmf support. 2008-05-25 16:19:12 +00:00
plunky fcf1772a80 after the "struct disk" is finished with, it should be
destroyed with disk_destroy(9) to stave off LOCKDEBUG
panics.
2008-05-03 08:23:41 +00:00
ad 39f45b13ce - If x86, trust the nvram and elminate long probe delays.
- Update for amd64.
2008-04-30 23:02:43 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
garbled fcdfd014d7 Minor fixes to some of these files:
Add recognition for the CS4232C revision chip. (0xa2)
Make ic/ad1848.c compile with AUDIO_DEBUG
Add a needed machine/bus.h include to ic/cs4231.c
Add a few additional register defines to ic/cs4231reg.h
2008-04-28 18:49:27 +00:00
xtraeme 9f6e54935c Also attach in the IT8726F Super I/O. 2008-04-26 19:01:53 +00:00
xtraeme 27a6b8b36a Fixup the negative VINs, they were inverted and conversion was wrong. 2008-04-26 12:59:24 +00:00
xtraeme fc4443a49b Set the ENVSYS_FCHANGERFACT flag in voltage sensors, so that we
can use the 'rfact' property in /etc/envsys.conf to change the
resistor factor (in case the converted data is not correct).
2008-04-22 13:33:38 +00:00
cegger 376411d2dd device_t / softc split. From Hans Rosenfeld. 2008-04-16 09:39:01 +00:00
cegger b849cd90e5 device_t / softc split. From Hans Rosenfeld 2008-04-15 15:02:28 +00:00
tsutsui 78a1d236b6 Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
2008-04-13 04:55:52 +00:00
tsutsui 7c06c0a3e8 Split device_t/softc for MI mb86960, with misc cosmetics. 2008-04-12 06:27:01 +00:00
tsutsui bdd6dadf75 Fix a botch (inverted test) in rev 1.4. 2008-04-12 04:33:48 +00:00
cegger 09b1b08c50 make this build with FD_DEBUG 2008-04-11 19:16:44 +00:00
cegger 8a19ab6bca convert to pmf(9)
ok jmcneill
2008-04-11 13:00:47 +00:00
cegger cf417aad7e use aprint_*_dev and device_xname 2008-04-08 20:08:49 +00:00
xtraeme bea13694d3 Add the autoconf(9) detach method; useful for the LKM. 2008-04-05 18:32:14 +00:00
tsutsui d637b91d45 Split device_t/softc for more ncr5380sbc variants, with related changes. 2008-04-04 16:19:51 +00:00
xtraeme 6e993e74bb Fix fallout from previous commit. 2008-04-04 13:10:41 +00:00
tsutsui d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
xtraeme 74fc6cf06c Split device_t/softc and other related cosmetic changes. 2008-04-04 09:49:49 +00:00
xtraeme 315a851ae4 Don't forget to unmap I/O space in the error paths.
Split device_t/softc and other related cosmetic changes.
2008-04-04 09:41:40 +00:00
xtraeme 6f1c8ce653 Don't forget to unmap I/O space in the error paths. 2008-04-04 09:30:55 +00:00
xtraeme 6137f9f2a1 Don't forget to unmap the I/O space in the error paths. 2008-04-04 08:44:22 +00:00
xtraeme 1b00b10fa6 Remove an unused softc member. 2008-04-03 23:16:23 +00:00
xtraeme a68cbff5b2 Add the finsio(4) driver. This driver supports the Hardware Monitor
device in the Fintek LPC Super I/O chips, this includes the following
list:

- F71805F
- F71806F
- F71862FG
- F71872F
- F71882
- F71883F

This has been adapted from the fins(4) driver available in OpenBSD, which
only supported F71805F.

Tobias Nygren <tnn> and myself added support for the other chips; thanks go
to Tobias for testing the driver with a Fintek F71882 chip.
2008-04-03 22:46:22 +00:00
xtraeme 5cc216e9bb Add support for the SCH5307-NS and SCH5317 Super I/Os. They are
compatible with LPC47B397, only the device ID is changed.

Simplify and improve the code, and split device_t/softc.
2008-04-03 13:36:33 +00:00
dyoung d3627477d7 Certain misguided people have complained, NetBSD only runs rare or
"retro" computers, but NetBSD also runs a growing number of rare
and retro add-on cards.  With this patch, NetBSD supports the IDEC
Supervision/16, a black&white image capture board for the 16-bit
ISA bus.  Approximate date of manufacture: 1991.  Total instances
known to be in use throughout the world: one.

Coming soon; isvctl(8), the utility program for capturing 8-bit,
512x480 images at speeds of up to 6 frames per second.
2008-04-02 01:34:36 +00:00
xtraeme 92d36024a5 Fix fallout from device_t/softc split to mpu(4):
always pass the mpu_softc to mpu_intr(). Found by Takeshi Nakayama.
2008-04-01 20:44:29 +00:00
xtraeme 8530f5047d Fix fallout from device_t/softc split to mpu(4):
always pass the mpu_softc to mpu_intr(). Found by Takeshi Nakayama.
2008-04-01 13:35:39 +00:00
ad 584864fcf7 This driver's probe routine is particularly slow, so disable it if the
system is known to have no ISA expansion slots. XXX
2008-03-30 15:27:24 +00:00
ad cad7ab7809 Add isa_get_slotcount/isa_set_slotcount to get/set the number of ISA
compatible expansion slots in a system.
2008-03-30 15:24:08 +00:00
ad 75ffa7cd83 Make TCICDEBUG / TCICISADEBUG compile. 2008-03-29 17:36:45 +00:00
ad 625a7a611a Waiting 5s for the card to reset during probe is not cool! 2008-03-29 17:13:03 +00:00
mlelstv 23aa31d043 PPC systems predating prep and running the mvmeppc port
have compatible hardware.
2008-03-29 09:01:35 +00:00
drochner fd0ded75ed split device/softc for USB host controllers and the usb (control)
device,
this is hairy stuff, and I've only tested with uhci/ehci at pci,
please test the rest and report problems
2008-03-28 17:14:45 +00:00
xtraeme 0ab2da71ce Split device_t/softc for mpu(4) and its attachments, plus other
related cosmetic changes.

Reviewed by cube@.
2008-03-27 10:22:00 +00:00
xtraeme 701c2ae0a3 Split device_t/softc for joy(4) and all its attachments. Also
use device_lookup_private() and related cosmetic changes.

Reviewed by cube@.
2008-03-26 18:27:07 +00:00
matt 595211a098 split device_t/softc. Use aprint_*_dev and device_xname.
switch to device_lookup_private.
2008-03-26 17:50:32 +00:00
xtraeme 8bea7f6b6e Split device_t/softc for ug(4) and other related cosmetic changes. 2008-03-26 16:09:37 +00:00
cube 7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
cube 6b4a748e71 Fix compilation. Noted by yamt@. 2008-03-16 22:30:31 +00:00
cube bb192d4cfd Split device_t and softc for the ... wait for it ... [air quotes] MI
variant of fdc(4)/fd(4).  Other cosmetic changes as appropriate.
2008-03-16 00:58:56 +00:00
cube 4dccf0ae94 Split device_t and softc for opl(4). That should have been done along with
midi(4), because opl_softc embed a midi_softc.
Fixes PR#38242 by Onno van der Linden.
2008-03-15 23:14:38 +00:00
cube 612c30d938 Split device_t and softc for sb(4) and all its attachments. 2008-03-15 21:09:02 +00:00
cube 8bc324423f Split device_t and softc for isa(4). 2008-03-15 16:56:29 +00:00
cube a22d8d4abb Split device_t and softc for pckbc(4) and its attachments. 2008-03-15 13:23:24 +00:00
cube d293cfca1a Split device_t and softc for all attachments of vga(4). 2008-03-14 22:12:08 +00:00
cube 607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
cube cf80f73d17 Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments.  Use device_t accessors, correct types, and ANSIfy when
appropriate.
2008-03-12 14:31:11 +00:00
cube 8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
cube 0c4bbfd7c5 Fix a softc split fallout. 2008-03-05 22:46:43 +00:00
xtraeme 66149243ef struct cfdata * -> cfdata_t (for consistency). 2008-03-05 15:45:36 +00:00
xtraeme 3680f71913 Split device_t/softc in the lm(4) driver and its attachments, and
other related cosmetic changes.
2008-03-05 15:41:31 +00:00
cube df77590f4c Fix fallout from midi(4)'s softc split. 2008-03-05 10:48:48 +00:00
dyoung cee019495b The attimer (sc_timer) is not actually a child of pcppi, and pcppi
does do not hold references to any other device, so provide an
empty child-detachment method.
2008-03-04 17:11:03 +00:00
cube 926915cf40 - Split device_t and softc for pcppi(4) and attimer(4)
- Change the attimer <-> pcppi communication using device_t so that
  pcppi(4) doesn't have to know about the contents of struct attimer_softc.

XXX pcppi's childdet function is completely wrong.  This has to be
XXX revisited later.
2008-03-04 16:35:18 +00:00
cube 263facc4c0 Use CFATTACH_DECL_NEW and other related cosmetic changes. 2008-03-04 14:59:35 +00:00
xtraeme 61c10fc48e Change my email address to the netbsd one. 2008-03-04 11:31:16 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
dyoung e4f3892584 Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine.  Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev().  Use PMF_FN_ARGS, PMF_FN_PROTO.
2008-02-29 07:02:04 +00:00
dyoung f580a3a869 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:13:39 +00:00
dyoung 82d7506fef Use device_t and accessors. 2008-02-28 00:20:04 +00:00
dyoung 212fa79969 Suspend, resume, detach.
Use mutex(9) and condvar(9) instead of splbio(9)/splx(9) and
tsleep(9)/wakeup(9).

Use device_t and accessors.  Use aprint_*_dev().
2008-02-22 23:40:49 +00:00
dyoung 288f7bb3b8 Use device_t and accessors. Use aprint_*_dev().
Add method to detach child.
2008-02-22 23:26:11 +00:00
dyoung 27794e53e5 Add methods to detach lpt at isa. 2008-02-22 20:53:58 +00:00
dyoung 3d8a594471 Let the compiler decide: inline -> static, register -> . 2008-01-31 18:45:45 +00:00
dyoung 8c145c8134 Cosmetic: constify, KNF, use device_t and accessors, use
aprint_normal_dev() instead of printf("%s: ...", dv->dv_xname).
2008-01-31 18:32:51 +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
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 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 3a66b9167f Let us detach atabus* from wdc*, and wdc* from isa*.
Use device_t, device_private().
2008-01-10 07:44:07 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
dyoung 09fd56f9ec Detach attimer at acpi, attimer at isa. 2008-01-03 01:21:44 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
dyoung 80c0fcd21b Improve device detach routine. Now I can detach nsclpcsio0 and
its children.

Fix an off-by-one bug in the sensor initialization which stopped
it from completing.

Extract sensor initialization into a new subroutine.  If there is
an error while initializing sensors, do not let sc_sme dangle.
2008-01-02 10:21:08 +00:00
dyoung 66938db654 Cosmetic: fix indentation. 2008-01-02 02:25:27 +00:00
dyoung fd5d1d790d Use device_t, device_private(), aprint_error_dev(). 2007-12-31 09:12:18 +00:00
wiz 41643cbfd9 Proxy-commit for xtraeme:
Use sysmon_wdog_unregister(), not sysmon_wdog_register(), in
itesio_detach().
2007-12-31 01:53:58 +00:00
wiz 2af02278c7 Proxy-commit for xtraeme:
add dependency for itesio on sysmon_wdog.
2007-12-31 01:52:34 +00:00
xtraeme a6d89167f6 Erm, update another comment that was outdated with latest changes. 2007-12-29 06:18:35 +00:00
xtraeme 05c541c9b4 Update a comment that I wanted to correct for long time now... 2007-12-29 06:15:47 +00:00
xtraeme 7abc984e72 Added support for the Watchdog Timer built in the IT871[268] Super I/Os.
The WDT supports any value between 1 and 65535 seconds (or minutes, but
but the driver only uses seconds).
2007-12-29 06:05:06 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
xtraeme 8870106a7d Do not append the device name into the sensor's description, that's
useless and redundant.
2007-12-21 01:23:41 +00:00
dyoung f2a1e06d0a Use __arraycount(). 2007-12-20 18:45:32 +00:00
christos f54e064ee9 add null pmf handlers. 2007-12-16 19:01:35 +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
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
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
lukem ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
xtraeme 747de0248d Register to pmf(9). 2007-12-09 20:59:37 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
dyoung 550024b13d Use IFADDR_EMPTY().
(This driver should go away, comments indicate that it does not
even compile.)
2007-12-05 18:23:23 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
ad 6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad 598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
jmcneill 490542edae aprintify, on behalf of xtraeme 2007-12-01 23:40:28 +00:00
jmcneill 597a6bb9ae aprint-ify isaattach, removes a hard-to-find newline on a boot -z 2007-12-01 04:50:23 +00:00
xtraeme f517956d37 Print the error if sysmon_envsys_register() fails and add a missing
return in that case.
2007-11-22 08:15:00 +00:00
kefren 7ff1853b95 Initialize sensor's state
on behalf of xtraeme
2007-11-17 08:30:35 +00:00
xtraeme 31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
2007-11-16 08:00:11 +00:00
xtraeme 503d8b60d1 Remove a debug printf. 2007-11-15 13:23:13 +00:00
xtraeme 0c95eec1eb - Remove an extra RCS ID line.
- Update the ifdef on itesio_isavar.h to reflect the rename.
2007-11-15 13:09:07 +00:00
xtraeme b0ac365f62 Rename it(4) to itesio(4) to accomodate for the following changes:
- The driver now uses the Super I/O address port as port argument in
  the configuration file. The Environmental Controller base address is
  fetched by the Super I/O EC LDN configuration registers.

- Invalidate voltage sensors if data returned is 0xff.

- Use the Super I/O Global Configuration Registers Chip ID[12] and Device
  Revision to store/print the correct information.

- Use only the Fan Extended Tachometer registers on IT871[68]F for now;
  this gives us correct data for IT8705/IT8712F again.

Inspired by the smsc(4) driver. The UPDATING file has been updated to
reflect the rename.
2007-11-15 12:53:40 +00:00
xtraeme e11006338a Add support for the VMS logical device on nsclpcsio(4) and clean up
the code. This provides 14 voltage sensors in addition to the previous
3 temperature sensors supported in the TMS logical device.

Adapted from OpenBSD, tested by dyoung.
2007-11-09 01:09:47 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad 37a012a7c2 Use splhigh(), not disable_intr(). 2007-09-25 23:11:24 +00:00
xtraeme 57956a2b1e Fix aps(4) attachment. 2007-09-12 11:45:39 +00:00