NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/48571: config(1) ioconf is insufficient for pseudo-devices

>Number:         48571
>Category:       bin
>Synopsis:       config(1) ioconf is insufficient for pseudo-devices
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 18:00:00 +0000 2014
>Originator:     Paul Goyette
>Release:        NetBSD 6.99.28
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at |
| Kernel Developer |                          | pgoyette at  |
System: NetBSD 6.99.28 NetBSD 6.99.28 (WHOOPPEE (shared) 
2013-12-14 23:34:52) #13: Sat Dec 14 16:05:43 PST 2013
Architecture: x86_64
Machine: amd64
The (undocumented) ioconf statement for config(1) generates structs that
are not useable for calling config_{init,fini}_component().

The generated cfattach structure contains only one entry (of two NULL
pointers) to indicate end-of-list.  We need an additional entry that
points the device's cfattach <device>_ca as generated by CFATTACH_DECL*. 
Also, the generated ioconf.c file should include an extern declaration
for the <device>_ca structure.

Additionally, the generated file contains an empty cfdata list, with only
a single NULL entry to terminate the list.  But the first entry of this
list gets passsed by config_init_component() to config_devalloc() and is
dereferenced in order to pass the driver's name to config_cfdriver_lookup().
This results in a panic.

When used for a "real" device, both of these structures are created to
be directly useable by config_{init,fini}_component().

It would be really nice if we could use ioconf structures and calls to
config_{init,fini}_component to standardize device driver modules, even
for pseudo-devices.



Home | Main Index | Thread Index | Old Index