summaryrefslogtreecommitdiff
path: root/sys/kern/subr_autoconf.c
AgeCommit message (Collapse)Author
2008-08-20Allow devices attaching at root (such as softraid) to be disabled in UKC.Miod Vallat
ok marco@ deraadt@
2007-11-23Since the devices that we detach may have children we cannot rely on theMark Kettenis
"previous" device still being there, so if we detach a device, we really have to start from scratch again (like the comment on this code actually says we should). Simplifies the code as a bonus. ok dlg@, deraadt@
2007-10-29get rid of the unused cond_predicate_t typedef.David Gwynne
ok miod@ deraadt@ krw@
2007-09-07Use M_ZERO in a few more places to shave bytes from the kernel.Artur Grabowski
eyeballed and ok dlg@
2007-05-30the (root) stuff is ugly, so print "at root", so it looks more likeTheo de Raadt
regular things. everyone here buys it, and i'm 90% sure miod will be ok with it
2007-05-15kill __HAVE_DEVICE_REGISTER by requiring all architectures to have aTheo de Raadt
device_register() function -- even if it does nothing. reduces the cpp-based blather different between architectures idea ok'd by miod; tested on all architectures (except a few miod will need to cleanup because he has them)
2007-05-09evcnt_attach() is no longer used; ok miodTheo de Raadt
2006-05-28Remove device id from hotplug events.Michael Knudsen
ok henning
2006-05-28more fallout from the sensors: Every single ramdisk got broken.Theo de Raadt
2006-05-28Include device id in hotplug events. This will be used by ntpd to checkMichael Knudsen
sensors on attach/detach. hotplugd changes following in a minute. ok henning.
2006-05-17cf_unit should have a value between 0 and cd_ndevs. So set cf_unit to 0 whenKenneth R Westerback
cd_ndevs is set to 0. "No kidding!" deraadt@ "Seems to make sense to me." beck@ "Seems right." miod@
2006-05-17Detach children devices in reverse order. This gives better display, andKenneth R Westerback
allows cf_unit to be decremented correctly. 'put it in' deraadt@ "i think it's good' tedu@
2006-05-14When assigning a unit number, treat running off the end of theKenneth R Westerback
cd_devs[] array the same as finding a NULL entry. Fixes inconsistant assignment of unit numbers to media slots on the Neodio 8-in-1 USB card reader donated by Manuel Pata. Previously the unit numbers would vary depending on whether it had attached an even or odd number of times. 'reads ok' marco@ ok miod@
2006-01-21Remove now unused zeroref member in cfattach structures.Miod Vallat
2006-01-13In config_detach_children(), after detaching a device, restart the deviceMiod Vallat
list walk from its parent device, as the device which was following it may have been one of its children, and thus gone as well. Found the hard way using the strict queue macros. Feedback and help toby@, ok deraadt@
2005-12-09ansi and deregister. No binary change.Jonathan Gray
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-11-23Create the init process earlier, before the root filesystem is mounted,Miod Vallat
and have it stall on a semaphore. This allows all kthread creations which could have been requested during autoconf to be processed before root is mounted as well. This causes umass devices attached to any usb with flags 1 (such as on macppc) to configure properly instead of panicing the kernel at mountroot time. From NetBSD; tested by various.
2004-08-03Fix a minor bug where indirect config crashes the kernelPer Fogelstrom
when match verbose is turend on.
2004-05-30Devices hot plugging support.Alexander Yurchenko
The hotplug pseudo-device passes device attachment and detachment events to userland. When a device attaches or detaches, the corresponding event is queued. The events can then be obtained from the queue through the read(2) call on the /dev/hotplug device file. Each event consists of event type (attach/detach), device class (DV_*) and device name (sd1 e.g.). We have hotplug pseudo-device on alpha, amd64, i386, macppc and sparc64. Since it was tested only on i386 other archs has it commented out in GENERIC until tested. The idea liked peter@ tedu@ drahn@ millert@ marco@ henning@. Ok deraadt@.
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-03string fixes; tedu okTheo de Raadt
2003-04-19Tweak previous sprintf -> snprintf fix to eliminate unnecessaryKenneth R Westerback
intermediate variable. Suggested by deraadt@. ok henning@ millert@ tdeval@
2003-03-30Use snprintf() to simplify device name construction, removing nowKenneth R Westerback
superfluous variables and the function 'number()'. ok deraadt@ and millert@
2002-10-06Remove some '#if 0' cruft.Artur Grabowski
2002-04-24Introduce a new file, machine/internal_types.h, to hold that specific archMarc Espie
type characteristics. internal_types.h will contain only settings invisible from standard C, e.g., in the __* or _[A-Z]* namespace, and be reused by files like limits.h. This allows us to shorten machine/limits.h greatly, as all the common defines are now in sys/limits.h, plus a small stub in internal_types.h. Tested on all arches as far as I know. Approved after discussion with art, millert, deraadt, and others.
2002-03-14First round of __P removal in sysTodd C. Miller
2001-09-01Add __HAVE_DEVICE_REGISTER to hp300/alpha (sparc64 already had it) andJason Wright
clean up the arch specific #ifdef's in subr_autoconf.c; from NetBSD. (tested by me on alpha/sparc64 and miod on hp300)
2001-08-31implement autoconf mechanism using device_register(); from NetBSD.Jason Wright
2000-04-09range error; < cd_ndevs, not <=Theo de Raadt
2000-04-09Added config_detach_children, config_activate_children.Constantine Sapuntzakis
Added ref counting to devices: device_ref, device_unref and a new method for devices : ca_zeroref, called when the ref count hits zero. Note that ca_zeroref may be called from interrupt context.
1999-08-08From NetBSD; new device detaching infrastructure.Niklas Hallqvist
1999-08-05From NetBSD; config_defer to defer configuration of a device until after allNiklas Hallqvist
other siblings.
1999-07-23Remove obsolete detach logic in preparation of a newer oneNiklas Hallqvist
1999-01-11panic prints a newline for you, don't do it in the panic stringTodd C. Miller
1998-05-11Formerly reuse of unit numbers of detached devices was impossible, withNiklas Hallqvist
this change starred devices will search from the first allowed unit for such devices and up for free units when attaching. This means you have to rerun config(8) before yopu compile current kernels. FYI, this is a necessity when doing PCMCIA flashcard reading, otherwise you soon run out of unit numbers. I have also added a way to detach all children of a certain device, used in a new PCMCIA framework to come, so you detach all functions on a single PCMCIA card when pulling it out. A few bugs wrt starred devices fixed in the autoconfig_verbose code too. Last and least, fixed some panic messages.
1998-02-20Please GCC 2.8's harsher view of good styleNiklas Hallqvist
1998-01-21Prevent a NULL-deref in the autoconf_verbose caseNiklas Hallqvist
1998-01-20typoNiklas Hallqvist
1998-01-20Provide a way to debug probes. set autoconf_verbose via DDB, orNiklas Hallqvist
option AUTOCONF_VERBOSE=1 in your kernel config.
1997-11-23indentMichael Shalayeff
1997-02-03hp300 needs device_register(), too.Jason Downs
1996-11-21export struct cfdata cfdata[];Michael Shalayeff
1996-10-18As alpha uses device_register, it needs its proto tooNiklas Hallqvist
1996-09-24no mknod in chrootTheo de Raadt
1996-08-15Remove unnecessary prototypeNiklas Hallqvist
1996-07-02prettyTheo de Raadt
1996-07-02-Wall & -Wstrict-prototype fixesNiklas Hallqvist
1996-06-23Added support for user modifiable kernel at boot (-c) /majaMats O Jansson
1996-06-18sick netbsd alpha hack (why not do what other ports do?)Theo de Raadt