driver(9)
Patrick Welche <[email protected]> Sat, 28 Mar 2026 11:09:47 +0000
| Newsgroups | gmane.os.netbsd.current |
|---|---|
| Message-ID | <[email protected]> |
According to driver(9), the interface to driver “foo” is defined with:
CFATTACH_DECL_NEW(foo, /* driver name */
which appeared in
Author: joerg <[email protected]>
Date: Mon Sep 24 18:47:56 2007 +0000
Introduce CFATTACH_DECL_NEW and CFATTACH_DECL2_NEW for drivers that
don't expect struct device as first field of softc. device_private uses
a new field of struct device to give the softc address and that field is
either set the struct device for old-style devices or a separate
allocation by config_devalloc. Both macros are intended as temporary
bandaid until all drivers are converted and will be removed later.
yet the next paragraph still mentions CFATTACH_DECL and declares sc_dev.
Apply the following (which leaves an odd struct foo_softc declaration)?
--- a/share/man/man9/driver.9
+++ b/share/man/man9/driver.9
@@ -75,7 +75,7 @@ For each device instance controlled by the driver, the
autoconfiguration framework allocates a block of memory to record
device-instance-specific driver variables.
The size of this memory block is specified by the second argument in the
-.Em CFATTACH_DECL
+.Em CFATTACH_DECL_NEW
macro.
The memory block is referred to as the driver's
.Em softc
@@ -96,7 +96,6 @@ structure for driver
is defined with:
.Bd -literal
struct foo_softc {
- device_t sc_dev; /* generic device info */
/* device-specific state */
};
.Ed
Cheers,
Patrick