PATCH 2.4.0.10 v2: Update hotplug

2000-11-03 Thread Jeff Garzik

Attached is a revised "hotplug update" patch, against 2.4.0-test10. 
It's looking close to submit-able now.

General change description is the same as the first patch, which can be
found at
http://boudicca.tux.org/hypermail/linux-kernel/this-week/0785.html

Changes since the first patch:
* CONFIG_HOTPLUG and CONFIG_KMOD are now totally independent.  It was an
incestuous relationship anyway.
* exec_usermodehelper and call_usermodehelper are now unconditionally
present
* new file Documentation/networking/netdevices.txt describes
/sbin/network usage, and netdevice locking
* usb supports ACTION=$verb again, for compatibility with existing
implementation
* don't use magic numbers for 'insert' value in code, use TRUE/FALSE
* ditch the sbus slot number
* use '/' separate in PCI environment variables, for consistency with
USB
* eliminate EXPORT_SYMBOL(hotplug_path), modules don't need it
* constify netdev_event_name[] array

Now, time to track down that elusive thing called sleep... :)

-- 
Jeff Garzik | Dinner is ready when
Building 1024   | the smoke alarm goes off.
MandrakeSoft|   -/usr/games/fortune

Index: linux_2_4/Documentation/00-INDEX
diff -u linux_2_4/Documentation/00-INDEX:1.1.1.1 
linux_2_4/Documentation/00-INDEX:1.1.1.1.34.1
--- linux_2_4/Documentation/00-INDEX:1.1.1.1Sun Oct 22 12:47:49 2000
+++ linux_2_4/Documentation/00-INDEXWed Nov  1 22:50:19 2000
@@ -53,6 +53,8 @@
- notes about the floppy tape device driver
 hayes-esp.txt
- info on using the Hayes ESP serial driver.
+hotplug.txt
+   - kernel hotplug support
 i386/
- directory with info about Linux on the intel ix86 architecture.
 ide.txt
Index: linux_2_4/Documentation/hotplug.txt
diff -u /dev/null linux_2_4/Documentation/hotplug.txt:1.1.2.2
--- /dev/null   Fri Nov  3 23:12:53 2000
+++ linux_2_4/Documentation/hotplug.txt Fri Nov  3 23:12:03 2000
@@ -0,0 +1,92 @@
+
+Hot-Plug Devices, the Kernel, and You!
+
+
+Introduction
+
+Kernel version 2.4.0 and later includes native support for hotpluggable
+devices.  This text documents that support.
+
+FIXME: turn this random collection of notes into a real document
+
+Supported hot-plug buses:  CardBus (in the PCI subsystem), USB.
+
+Hot-plug code is conditionally included when CONFIG_HOTPLUG is enabled
+in 'make config'.  CONFIG_HOTPLUG now requires CONFIG_KMOD, so it is
+automatically defined when CONFIG_HOTPLUG is enabled.
+
+
+/sbin/hotplug
+=
+When hotpluggable hardware devices are added or removed, /sbin/hotplug
+is executed by the kernel.  The usage of /sbin/hotplug is as follows:
+
+   /sbin/hotplug [bus] [event]
+
+[bus] - The bus on which the hotpluggable event occurred.  Supported
+bus types are:
+
+   usb - USB
+   pci - PCI-compatible hot-plug:  CardBus
+
+[event] - Type of hot-plug event
+
+   add - Device insertion
+   del - Device removal
+
+In addition to the standard arguments passed to /sbin/hotplug as
+described above, each bus has its own set of environment variables
+which are passed to the program.
+
+hotplug pci env vars
+
+HOME=/
+   Hardcoded value.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+   Hardcoded value.
+PCI_CLASS=$CLASS
+   $CLASS - PCI device class, in hexidecimal
+PCI_ID=$VENDOR/$DEVICE
+   $VENDOR - 16-bit PCI device vendor id, in hexidecimal
+   $DEVICE - 16-bit PCI device id, in hexidecimal
+PCI_SUBSYS_ID=$VENDOR/$DEVICE
+   $VENDOR - 16-bit PCI device subsystem vendor id, in hexidecimal
+   $DEVICE - 16-bit PCI device subsystem device id, in hexidecimal
+PCI_BUS_ID=$BUS/$SLOT/$FUNC
+   $BUS- PCI bus number, in decimal
+   $SLOT   - PCI device slot, decoded from devfn, in decimal
+   $FUNC   - PCI device function, decoded from devfn, in decimal
+
+
+hotplug usb env vars
+
+HOME=/
+   Hardcoded value.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+   Hardcoded value.
+DEBUG=kernel
+   Hardcoded value.  Only present if USB is in debug mode
+DEVFS=/proc/bus/usb
+   Hardcoded value.  Only present if CONFIG_USB_DEVICEFS is set.
+DEVICE=/proc/bus/usb/$BUS/$DEVICE
+   Indicates the assigned USB device node for the USB device.
+   Only present if CONFIG_USB_DEVICEFS is set.
+   $BUS- USB bus number
+   $DEVICE - USB device number
+PRODUCT=$VENDOR/$PRODUCT/$DEVICE
+   USB device identification info.
+   $VENDOR - USB vendor id, in hexadecimal
+   $PRODUCT- USB product ID, in hexadecimal
+   $DEVICE - Binary-coded decimal device number
+TYPE=$CLASS/$SUB/$PROTO
+   Only present if device class is non-zero.
+   $CLASS  - USB device class.
+   $SUB- USB device sub-class.
+   $PROTO  - USB device protocol number.
+INTERFACE=$CLASS/$SUB/$PROTO
+   Only present if device class is zero.
+   Only the first interface (interface 0) is presented.
+   $CLASS  - USB interface 0 class.
+   $SUB- USB 

PATCH 2.4.0.10 v2: Update hotplug

2000-11-03 Thread Jeff Garzik

Attached is a revised "hotplug update" patch, against 2.4.0-test10. 
It's looking close to submit-able now.

General change description is the same as the first patch, which can be
found at
http://boudicca.tux.org/hypermail/linux-kernel/this-week/0785.html

Changes since the first patch:
* CONFIG_HOTPLUG and CONFIG_KMOD are now totally independent.  It was an
incestuous relationship anyway.
* exec_usermodehelper and call_usermodehelper are now unconditionally
present
* new file Documentation/networking/netdevices.txt describes
/sbin/network usage, and netdevice locking
* usb supports ACTION=$verb again, for compatibility with existing
implementation
* don't use magic numbers for 'insert' value in code, use TRUE/FALSE
* ditch the sbus slot number
* use '/' separate in PCI environment variables, for consistency with
USB
* eliminate EXPORT_SYMBOL(hotplug_path), modules don't need it
* constify netdev_event_name[] array

Now, time to track down that elusive thing called sleep... :)

-- 
Jeff Garzik | Dinner is ready when
Building 1024   | the smoke alarm goes off.
MandrakeSoft|   -/usr/games/fortune

Index: linux_2_4/Documentation/00-INDEX
diff -u linux_2_4/Documentation/00-INDEX:1.1.1.1 
linux_2_4/Documentation/00-INDEX:1.1.1.1.34.1
--- linux_2_4/Documentation/00-INDEX:1.1.1.1Sun Oct 22 12:47:49 2000
+++ linux_2_4/Documentation/00-INDEXWed Nov  1 22:50:19 2000
@@ -53,6 +53,8 @@
- notes about the floppy tape device driver
 hayes-esp.txt
- info on using the Hayes ESP serial driver.
+hotplug.txt
+   - kernel hotplug support
 i386/
- directory with info about Linux on the intel ix86 architecture.
 ide.txt
Index: linux_2_4/Documentation/hotplug.txt
diff -u /dev/null linux_2_4/Documentation/hotplug.txt:1.1.2.2
--- /dev/null   Fri Nov  3 23:12:53 2000
+++ linux_2_4/Documentation/hotplug.txt Fri Nov  3 23:12:03 2000
@@ -0,0 +1,92 @@
+
+Hot-Plug Devices, the Kernel, and You!
+
+
+Introduction
+
+Kernel version 2.4.0 and later includes native support for hotpluggable
+devices.  This text documents that support.
+
+FIXME: turn this random collection of notes into a real document
+
+Supported hot-plug buses:  CardBus (in the PCI subsystem), USB.
+
+Hot-plug code is conditionally included when CONFIG_HOTPLUG is enabled
+in 'make config'.  CONFIG_HOTPLUG now requires CONFIG_KMOD, so it is
+automatically defined when CONFIG_HOTPLUG is enabled.
+
+
+/sbin/hotplug
+=
+When hotpluggable hardware devices are added or removed, /sbin/hotplug
+is executed by the kernel.  The usage of /sbin/hotplug is as follows:
+
+   /sbin/hotplug [bus] [event]
+
+[bus] - The bus on which the hotpluggable event occurred.  Supported
+bus types are:
+
+   usb - USB
+   pci - PCI-compatible hot-plug:  CardBus
+
+[event] - Type of hot-plug event
+
+   add - Device insertion
+   del - Device removal
+
+In addition to the standard arguments passed to /sbin/hotplug as
+described above, each bus has its own set of environment variables
+which are passed to the program.
+
+hotplug pci env vars
+
+HOME=/
+   Hardcoded value.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+   Hardcoded value.
+PCI_CLASS=$CLASS
+   $CLASS - PCI device class, in hexidecimal
+PCI_ID=$VENDOR/$DEVICE
+   $VENDOR - 16-bit PCI device vendor id, in hexidecimal
+   $DEVICE - 16-bit PCI device id, in hexidecimal
+PCI_SUBSYS_ID=$VENDOR/$DEVICE
+   $VENDOR - 16-bit PCI device subsystem vendor id, in hexidecimal
+   $DEVICE - 16-bit PCI device subsystem device id, in hexidecimal
+PCI_BUS_ID=$BUS/$SLOT/$FUNC
+   $BUS- PCI bus number, in decimal
+   $SLOT   - PCI device slot, decoded from devfn, in decimal
+   $FUNC   - PCI device function, decoded from devfn, in decimal
+
+
+hotplug usb env vars
+
+HOME=/
+   Hardcoded value.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+   Hardcoded value.
+DEBUG=kernel
+   Hardcoded value.  Only present if USB is in debug mode
+DEVFS=/proc/bus/usb
+   Hardcoded value.  Only present if CONFIG_USB_DEVICEFS is set.
+DEVICE=/proc/bus/usb/$BUS/$DEVICE
+   Indicates the assigned USB device node for the USB device.
+   Only present if CONFIG_USB_DEVICEFS is set.
+   $BUS- USB bus number
+   $DEVICE - USB device number
+PRODUCT=$VENDOR/$PRODUCT/$DEVICE
+   USB device identification info.
+   $VENDOR - USB vendor id, in hexadecimal
+   $PRODUCT- USB product ID, in hexadecimal
+   $DEVICE - Binary-coded decimal device number
+TYPE=$CLASS/$SUB/$PROTO
+   Only present if device class is non-zero.
+   $CLASS  - USB device class.
+   $SUB- USB device sub-class.
+   $PROTO  - USB device protocol number.
+INTERFACE=$CLASS/$SUB/$PROTO
+   Only present if device class is zero.
+   Only the first interface (interface 0) is presented.
+   $CLASS  - USB interface 0 class.
+   $SUB- USB