mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fw: [linux-usb-devel] 2.4.0-test11-pre3: Compile error in drivers/usb/usb.c
@ 2000-11-12 20:13 David Brownell
  0 siblings, 0 replies; only message in thread
From: David Brownell @ 2000-11-12 20:13 UTC (permalink / raw)
  To: linux-kernel, wollny

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

See the attached patch.

Also, for LKML readers, you may be interested in the attached
/sbin/hotplug script; it's pretty current, even if it may not
be the latest from CVS (at http://linux-usb.sourceforge.net/).

- Dave


----- Original Message -----
From: "David Brownell" <david-b@pacbell.net>
To: <linux-usb-devel@lists.sourceforge.net>
Cc: "Dunlap, Randy" <randy.dunlap@intel.com>
Sent: Sunday, 12 November, 2000 11:57 AM
Subject: Re: [linux-usb-devel] 2.4.0-tst11-pre3 fails compiling "usb.c":723: `hotplug_path'
undeclared


> OK, try this patch (AFAICT suitable for pre3++), which does
> the following:
>
>     - You can compile USB without CONFIG_HOTPLUG again.
>       (I don't know who broke that; likely it came with
>       the kernel/kmod.c cleanup.)
>
>     - Restores interface altsetting if no kernel driver
>       claims the device ... fixes a problem I noticed
>       when hotplugging a printer cable (likely the same
>       problem Stephen Gowdy has reported).
>
>     - Restores accidentally-deleted code to pass INTERFACE,
>       also needed to hotplug that printer cable.
>
>     - Deletes the fixed point BCD formatting for product
>       version code -- messy, and not needed.  (This should
>       at most affect /etc/usb/drivers/usb-storage, but
>       that'll go away anyway with a MODULE_DEVICE_TABLE.)
>
>     - Adds Documentation/usb/hotplug.txt ... half relates
>       to generic hotplug stuff, the rest is USB-specific;
>       just gives an overview to tie things together.
>
> FWIW I've tried most of the USB devices I have handy, and
> they all hotplugged OK using just "modules.usbmap" contents
> except that "keybdev" didn't load for a keyboard.  (That's
> after those two interface related fixes.)
>
> - Dave
>
>
>

[-- Attachment #2: pre3-usb-hotplug.patch --]
[-- Type: application/octet-stream, Size: 9720 bytes --]

--- linux/drivers/usb-pre3/usb.c	Sun Nov 12 07:52:36 2000
+++ linux/drivers/usb/usb.c	Sun Nov 12 10:55:16 2000
@@ -635,6 +635,9 @@
 						break;
 				}
 			}
+			/* if driver not bound, leave defaults unchanged */
+			if (private == NULL)
+				interface->act_altsetting = 0;
 		}
 		else /* "old style" driver */
 			private = driver->probe(dev, ifnum, NULL);
@@ -650,58 +653,15 @@
 }
 
 
-#if	defined(CONFIG_KMOD)
+#ifdef	CONFIG_HOTPLUG
 
 /*
  * USB hotplugging invokes what /proc/sys/kernel/hotplug says
  * (normally /sbin/hotplug) when USB devices get added or removed.
- */
-
-static int to_bcd (char *buf, __u16 *bcdValue)
-{
-	int	retval = 0;
-	char	*value = (char *) bcdValue;
-	int	temp;
-
-	/* digits are 0-9 then ":;<=>?" for devices using
-	 * non-bcd (non-standard!) values here ... */
-
-	/* No leading (or later, trailing) zeroes since scripts do
-	 * literal matches, and that's how they're doing them. */
-	if ((temp = value [1] & 0xf0) != 0) {
-		temp >>= 4;
-		temp += '0';
-		*buf++ = (char) temp;
-		retval++;
-	}
-
-	temp = value [1] & 0x0f;
-	temp += '0';
-	*buf++ = (char) temp;
-	retval++;
-
-	*buf++ = '.';
-	retval++;
-
-	temp = value [0] & 0xf0;
-	temp >>= 4;
-	temp += '0';
-	*buf++ = (char) temp;
-	retval++;
-
-	if ((temp = value [0] & 0x0f) != 0) {
-		temp += '0';
-		*buf++ = (char) temp;
-		retval++;
-	}
-	*buf++ = 0;
-
-	return retval;
-}
-
-/*
+ *
  * This invokes a user mode policy agent, typically helping to load driver
- * or other modules, configure the device, or both.
+ * or other modules, configure the device, and more.  Drivers can provide
+ * a MODULE_DEVICE_TABLE to help with module loading subtasks.
  *
  * Some synchronization is important: removes can't start processing
  * before the add-device processing completes, and vice versa.  That keeps
@@ -772,9 +732,7 @@
 	 * all the device descriptors we don't tell them about.  Or
 	 * even act as usermode drivers.
 	 *
-	 * XXX how little intelligence can we hardwire?
-	 * (a) mount point: /devfs, /dev, /proc/bus/usb etc.
-	 * (b) naming convention: bus1/device3, 001/003 etc.
+	 * FIXME reduce hardwired intelligence here
 	 */
 	envp [i++] = "DEVFS=/proc/bus/usb";
 	envp [i++] = scratch;
@@ -782,14 +740,14 @@
 		dev->bus->busnum, dev->devnum) + 1;
 #endif
 
-	/* per-device configuration hacks are often necessary */
+	/* per-device configuration hacks are common */
 	envp [i++] = scratch;
-	scratch += sprintf (scratch, "PRODUCT=%x/%x/",
+	scratch += sprintf (scratch, "PRODUCT=%x/%x/%x",
 		dev->descriptor.idVendor,
-		dev->descriptor.idProduct);
-	scratch += to_bcd (scratch, &dev->descriptor.bcdDevice) + 1;
+		dev->descriptor.idProduct,
+		dev->descriptor.bcdDevice) + 1;
 
-	/* otherwise, use a simple (so far) generic driver binding model */
+	/* class-based driver binding models */
 	envp [i++] = scratch;
 	scratch += sprintf (scratch, "TYPE=%d/%d/%d",
 			    dev->descriptor.bDeviceClass,
@@ -798,17 +756,18 @@
 	if (dev->descriptor.bDeviceClass == 0) {
 		int alt = dev->actconfig->interface [0].act_altsetting;
 
-		/* simple/common case: one config, one interface, one driver
-		 * unsimple cases:  everything else
+		/* a simple/common case: one config, one interface, one driver
+		 * with current altsetting being a reasonable setting.
+		 * everything needs a smart agent and usbdevfs; or can rely on
+		 * device-specific binding policies.
 		 */
+		envp [i++] = scratch;
 		scratch += sprintf (scratch, "INTERFACE=%d/%d/%d",
 			dev->actconfig->interface [0].altsetting [alt].bInterfaceClass,
 			dev->actconfig->interface [0].altsetting [alt].bInterfaceSubClass,
 			dev->actconfig->interface [0].altsetting [alt].bInterfaceProtocol)
 			+ 1;
 		/* INTERFACE-0, INTERFACE-1, ... ? */
-	} else {
-		/* simple/common case: generic device, handled generically */
 	}
 	envp [i++] = 0;
 	/* assert: (scratch - buf) < sizeof buf */
--- linux/Documentation.pre3/usb/hotplug.txt	Sun Nov 12 10:53:27 2000
+++ linux/Documentation/usb/hotplug.txt	Sun Nov 12 10:51:28 2000
@@ -0,0 +1,124 @@
+USB HOTPLUGGING
+
+In hotpluggable busses like USB (and Cardbus PCI), end-users plug devices
+into the bus with power on.  In most cases, users expect the devices to become
+immediately usable.  That means the system must do many things, including:
+
+    - Find a driver that can handle the device.  That may involve
+      loading a kernel module; newer drivers can use modutils to
+      publish their device (and class) support to user utilities.
+
+    - Bind a driver to that device.  That's done using the USB
+      device driver's probe() routine.
+    
+    - Tell other subsystems to configure the new device.  Print
+      queues may need to be enabled, networks brought up, disk
+      partitions mounted, and so on.  In some cases these will
+      be driver-specific actions.
+
+This involves a mix of kernel mode and user mode actions.  Making devices
+be immediately usable means that any user mode actions can't wait for an
+administrator to do them:  the kernel must trigger them, either passively
+(triggering some monitoring daemon to invoke a helper program) or
+actively (calling such a user mode helper program directly).
+
+Those triggered actions must support a system's administrative policies;
+such programs are called "policy agents" here.  Typically they involve
+shell scripts that dispatch to more familiar administration tools.
+
+
+KERNEL HOTPLUG HELPER (/sbin/hotplug)
+
+When you compile with CONFIG_HOTPLUG, you get a new kernel parameter:
+/proc/sys/kernel/hotplug, which normally holds the pathname "/sbin/hotplug".
+That parameter names a program which the kernel may invoke at various times.
+
+The /sbin/hotplug program can be invoked by any subsystem as part of its
+reaction to a configuration change, from a thread in that subsystem.
+Only one parameter is required: the name of a subsystem being notified of
+some kernel event.  That name is used as the first key for further event
+dispatch; any other argument and environment parameters are specified by
+the subsystem making that invocation.
+
+A reference implementation of a /sbin/hotplug script is available at the
+http://www.linux-usb.org website, which works USB for but also knows how to
+delegate to any /etc/hotplug/$TYPE.agent policy agent present.
+
+
+USB POLICY AGENT
+
+The USB subsystem currently invokes /sbin/hotplug when USB devices
+are added or removed from system.  The invocation is done by the kernel
+hub daemon thread [khubd], or else as part of root hub initialization
+(done by init, modprobe, kapmd, etc).  Its single command line parameter
+is the string "usb", and it passes these environment variables:
+
+    ACTION ... "add", "remove"
+    PRODUCT ... USB vendor, product, and version codes (hex)
+    TYPE ... device class codes (decimal)
+    INTERFACE ... interface 0 class codes (decimal)
+
+If "usbdevfs" is configured, DEVICE and DEVFS are also passed.  DEVICE is
+the pathname of the device, and is useful for devices with multiple and/or
+alternate interfaces that complicate driver selection.
+
+Currently available policy agent implementations can load drivers for
+modules, and can invoke driver-specific setup scripts.  The newest ones
+leverage USB modutils support.  Later agents might unload drivers.
+
+
+USB MODUTILS SUPPORT
+
+Current versions of modutils will create a "modules.usbmap" file which
+contains the entries from each driver's MODULE_DEVICE_TABLE.  Such files
+can be used by various user mode policy agents to make sure all the right
+driver modules get loaded, either at boot time or later. 
+
+See <linux/usb.h> for full information about such table entries; or look
+at existing drivers.  Each table entry describes one or more criteria to
+be used when matching a driver to a device or class of devices.
+
+A short example, for a driver that supports several specific USB devices
+and their quirks, might have a MODULE_DEVICE_TABLE like this:
+
+    static const struct usb_device_id mydriver_id_table = {
+	{ idVendor: 0x9999, idProduct 0xaaaa, driver_info: QUIRK_X },
+	{ idVendor: 0xbbbb, idProduct 0x8888, driver_info: QUIRK_Y|QUIRK_Z },
+	...
+	{ } /* end with an all-zeroes entry */
+    }
+    MODULE_DEVICE_TABLE (usb, mydriver_id_table);
+
+Most USB device drivers should pass these tables to the USB subsystem as
+well as to the module management subsystem.  Not all, though: some driver
+frameworks connect using interfaces layered over USB, and so they won't
+need such a "struct usb_driver".
+
+Drivers that connect directly to the USB subsystem should be declared
+something like this:
+
+    static struct usb_driver mydriver = {
+	name:		"mydriver",
+	id_table:	mydriver_id_table,
+	probe:		my_probe,
+	disconnect:	my_disconnect,
+
+	/*
+	if using the usb chardev framework:
+	    minor:		MY_USB_MINOR_START,
+	    fops:		my_file_ops,
+	if exposing any operations through usbdevfs:
+	    ioctl:		my_ioctl,
+	*/
+    }
+
+When the USB subsystem knows about a driver's device ID table, it's used when
+choosing drivers to probe().  The thread doing new device processing checks
+drivers' device ID entries from the MODULE_DEVICE_TABLE against interface and
+device descriptors for the device.  It will only call probe() if there is a
+match, and the third argument to probe() will be the entry that matched.
+
+If you don't provide an id_table for your driver, then your driver may get
+probed for each new device; the third parameter to probe() will be null.
+
+

[-- Attachment #3: hotplug --]
[-- Type: application/octet-stream, Size: 11500 bytes --]

#!/bin/bash
#
# This is a reference implementation for /sbin/hotplug, which works
# on most GNU/Linux systems without ANY additional software.
#
# This implementation delegates to type-specific agents, such as
# "/etc/hotplug/network.agent", where they exist.  Otherwise it
# uses built-in in support for USB and PCI hotplug events, trying
# to load a module that appears to handle this device.
#
# /proc/sys/kernel/hotplug controls the program invoked by the kernel.
# /sbin/hotplug is the default value, which you may change.  (A null
# string prevents the kernel from invoking a hotplug program.)  To make
# this functionality available, your kernel config must include HOTPLUG
# (and currently KMOD).
#
#
# HISTORY:
#
# 06-Nov-2000 Build in support for modules.{usb,pci}map; Cardbus may
#	now work, with a kernel patch.  /etc/hotplug directory hooks.
# 09-Jul-2000 Initial version; kernel USB hotplugging starts, using
#	the existing USB scripts
#

# DEBUG=yes export DEBUG
PATH=/bin:/sbin:/usr/sbin:/usr/bin

if [ -t -o ! -x /usr/bin/logger ]; then
    mesg () {
	echo "$@"
    }
else
    mesg () {
	/usr/bin/logger -t $0 "$@"
    }
fi

usage ()
{
    # Only one parameter (event type) is mandatory.
    # Everything else is type-specific.

    if [ -t ]; then
	echo "Usage: $0 type [...]"
	echo "  $0 pci [add|remove]"
	echo "  $0 usb"
	echo "Environment parameters are also type-specific."
# FIXME: list non-builtin agents (/etc/hotplug/*.agent)
    else
	mesg "illegal usage $*"
    fi
    exit 1
}

if [ "$DEBUG" != "" ]; then
    mesg "arguments ($*)"
fi


# Only one required argument:  event type type being dispatched.
# Examples:  usb, pci, isapnp, network, ieee1394, printer, disk, ... 
if [ $# -lt 1 ]; then
    usage
elif [ $1 = help -o $1 = '--help' ]; then
    usage

# Prefer to delegate event handling:
#   /sbin/hotplug FOO ..args.. ==> /etc/hotplug/FOO.agent ..args..
#
elif [ -x /etc/hotplug/$1.agent ]; then
    shift
    exec /etc/hotplug/$1.agent "$@"
fi


####################################################################
#
# Builtin agent code -- directly processes modutils (2.3.20+)
# output for MODULE_DEVICE_TABLE entries, so that you can hotplug
# after installing only this script.
#
# This requires BASH ("declare -i") and needs some version of
# AWK, typically /bin/gawk.  Most GNU/Linux distros have these,
# but some specialized ones (floppy based, etc) may not.
#
# NOTE:  The match algorithms here aren't any smarter than those
# in the kernel; they take the first match available, even if
# it's not the "best" (most specific) match.  That's NOT really
# a feature.  Agents written in "real" languages can more easily
# support sophisticated driver selection algorithms, prioritize
# (or add) administrator-specified bindings, override kernel
# defaults, and so on.
#
# FIXME: can we avoid using '<<' to parse composite variables?
# That may require a writable /tmp.

AWK=gawk
MODDIR=/lib/modules/`uname -r`

# ISAPNP_MAP=$MODDIR/modules.isapnpmap
PCI_MAP=$MODDIR/modules.pcimap
USB_MAP=$MODDIR/modules.usbmap


####################################################################
#
# Kernel USB params are:
#	
#	ACTION=%s [add or remove]
#	PRODUCT=%x/%x/%s [last string is like '1.2' ]
#	INTERFACE=%d/%d/%d
#	TYPE=%d/%d/%d
#
# And if usbdevfs is configured, also:
#
#	DEVFS=/proc/bus/usb
#	DEVICE=/proc/bus/usb/%03d/%03d
#
# If usbdevfs is mounted on /proc/bus/usb, $DEVICE is a file which
# can be read to get the device's current configuration descriptor.
#
declare -i usb_idVendor usb_idProduct usb_bcdDevice
declare -i usb_bDeviceClass usb_bDeviceSubClass usb_bDeviceProtocol
declare -i usb_bInterfaceClass usb_bInterfaceSubClass usb_bInterfaceProtocol

usb_convert_vars ()
{
    local XPROD version
    XPROD=`echo $PRODUCT | $AWK -F/ '{print "0x" $1, "0x" $2, $3 }'`
    read usb_idVendor usb_idProduct version << EOT
$XPROD
EOT

    # FIXME:  Parse this right; it's BCD ... version "1.08" breaks here
    # usb_bcdDevice=$(( ( ${version%.*} * 256 ) + ${version#*.} ))

    if [ x$TYPE != x ]; then
    IFS=/ read usb_bDeviceClass usb_bDeviceSubClass usb_bDeviceProtocol << EOT
$TYPE
EOT
    else
	# out-of-range values
	usb_bDeviceClass=1000
	usb_bDeviceSubClass=1000
	usb_bDeviceProtocol=1000
    fi

    if [ x$INTERFACE != x ]; then
    IFS=/ read usb_bInterfaceClass usb_bInterfaceSubClass usb_bInterfaceProtocol << EOT
$INTERFACE
EOT
    else
	# out-of-range values
	usb_bInterfaceClass=1000
	usb_bInterfaceSubClass=1000
	usb_bInterfaceProtocol=1000
    fi
}

declare -i USB_ANY
USB_ANY=0

# stdin is "modules.usbmap" syntax
usb_map_modules ()
{
    # convert the usb_device_id fields to integers as we read them 
    local module ignored
    declare -i idVendor idProduct bcdDevice_lo bcdDevice_hi
    declare -i bDeviceClass bDeviceSubClass bDeviceProtocol
    declare -i bInterfaceClass bInterfaceSubClass bInterfaceProtocol

    # comment line lists (current) usb_device_id field names
    read ignored

    # look at each usb_device_id entry
    while read module idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol ignored
    do
	: checkmatch $module

	: idVendor $idVendor $usb_idVendor
	if [ $idVendor -ne $USB_ANY -a $idVendor -ne $usb_idVendor ]; then
	    continue
	fi
	: idProduct $idProduct $usb_idProduct
	if [ $idProduct -ne $USB_ANY -a $idProduct -ne $usb_idProduct ]; then
	    continue
	fi

	# : bcdDevice range $bcdDevice_hi $bcdDevice_lo actual $usb_bcdDevice
	# if [ $bcdDevice_lo -ge $usb_bcdDevice ]; then
	#     continue
	# fi
	# if [ $bcdDevice_hi -ne $USB_ANY -a $bcdDevice_hi -ge $usb_bcdDevice ]; then
	#     continue
	# fi

	: bDeviceClass $bDeviceClass $usb_bDeviceClass
	if [ $bDeviceClass -ne $USB_ANY -a $bDeviceClass -ne $usb_bDeviceClass ]; then
	    continue
	fi
	: bDeviceSubClass $bDeviceSubClass $usb_bDeviceSubClass
	if [ $bDeviceSubClass -ne $USB_ANY -a $bDeviceSubClass -ne $usb_bDeviceSubClass ]; then
	    continue
	fi
	: bDeviceProtocol $bDeviceProtocol $usb_bDeviceProtocol
	if [ $bDeviceProtocol -ne $USB_ANY -a $bDeviceProtocol -ne $usb_bDeviceProtocol ]; then
	    continue
	fi

	# NOTE:  for now, this only checks the first of perhaps
	# several interfaces for this device.

	: bInterfaceClass $bInterfaceClass $usb_bInterfaceClass
	if [ $bInterfaceClass -ne $USB_ANY -a $bInterfaceClass -ne $usb_bInterfaceClass ]; then
	    continue
	fi
	: bInterfaceSubClass $bInterfaceSubClass $usb_bInterfaceSubClass
	if [ $bInterfaceSubClass -ne $USB_ANY -a $bInterfaceSubClass -ne $usb_bInterfaceSubClass ]; then
	    continue
	fi
	: bInterfaceProtocol $bInterfaceProtocol $usb_bInterfaceProtocol
	if [ $bInterfaceProtocol -ne $USB_ANY -a $bInterfaceProtocol -ne $usb_bInterfaceProtocol ]; then
	    continue
	fi

	# It was a match!
	DRIVER=$module
	: driver $DRIVER
	break;
    done
}


####################################################################
#
# Kernel Cardbus/PCI params are:
#	
#	PCI_CLASS=%X
#	PCI_ID=%X/%X
#	PCI_SLOT=%s
#	PCI_SUBSYS_ID=%X/%X
#
# If /proc is mounted, /proc/bus/pci/$PCI_SLOT is almost the name
# of the binary device descriptor file ... just change ':' to '/'.
#
declare -i pci_class
declare -i pci_id_vendor pci_id_device
declare -i pci_subid_vendor pci_subid_device

pci_convert_vars ()
{
    XID=`echo $PCI_ID | $AWK -F/ '{print "0x" $1, "0x" $2 }'`
    read pci_class pci_id_vendor pci_id_device << EOT
0x$PCI_CLASS $XID
EOT

    XID=`echo $PCI_SUBSYS_ID | $AWK -F/ '{print "0x" $1, "0x" $2 }'`
    read pci_subid_vendor pci_subid_device << EOT
$XID
EOT
}

declare -i PCI_ANY
PCI_ANY=0xffffffff

# stdin is "modules.pcimap" syntax
pci_map_modules ()
{
    # convert the usb_device_id fields to integers as we read them 
    local module ignored
    declare -i vendor device
    declare -i subvendor subdevice
    declare -i class class_mask
    declare -i class_temp

    # comment line lists (current) pci_device_id field names
    read ignored

    # look at each pci_device_id entry
    while read module vendor device subvendor subdevice class class_mask ignored
    do
	: checkmatch $module

	: vendor $vendor $pci_id_vendor
	if [ $vendor -ne $PCI_ANY -a $vendor -ne $pci_id_vendor ]; then
	    continue
	fi
	: device $device $pci_id_device
	if [ $device -ne $PCI_ANY -a $device -ne $pci_id_device ]; then
	    continue
	fi
	: sub-vendor $subvendor $pci_subid_vendor
	if [ $subvendor -ne $PCI_ANY -a $subvendor -ne $pci_subid_vendor ]; then
	    continue
	fi
	: sub-device $subdevice $pci_subid_device
	if [ $subdevice -ne $PCI_ANY -a $subdevice -ne $pci_subid_device ]; then
	    continue
	fi

	class_temp="$pci_class & $class_mask"
	if [ $class_temp -eq $class ]; then
	    DRIVER=$module
	    : driver $DRIVER
	    break;
	fi
    done
}

####################################################################
#
# usage: load_driver type filename description
#
# (always) modprobes a single driver module, and optionally
# invokes a module-specific setup script.
#
load_driver ()
{
    # find the driver using modutils output
    if [ -f $2 ]; then
	$1_convert_vars
	$1_map_modules < $2
    else
	mesg "$2 missing"
	exit 1
    fi
    if [ x$DRIVER = x ]; then
	mesg "... no driver for $3"
	exit 2
    fi

    if [ "$DEBUG" != "" ]; then
	mesg Module $DRIVER matches $3
    fi

    # maybe the driver needs loading
    if ! lsmod | grep "^$DRIVER "
    then
	if ! modprobe $DRIVER
	then
	    mesg "... can't load module $DRIVER"
	    exit 3
	fi
    fi

    # NOTE:  this assumes that driver bound to
    # this device; it'd be better to check ...

    # run any setup script
    # OR: /etc/modules.conf "post-install $DRIVER cmd ..."
    if [ -x /etc/hotplug/$1/$DRIVER ]; then
	if [ "$DEBUG" != "" ]; then
	    mesg Driver setup: $DRIVER
	fi
	exec /etc/hotplug/$1/$DRIVER
    else
	exit 0
    fi
}

####################################################################
#
# Two basic policy agents are now built in:  they try to load the
# USB or PCI driver module corresponding to newly added devices.
# They're used as backup, in case no smarter tools are available.
#
if [ $1 = usb ]; then
    # Until all kernel USB drivers get updated, you need:
    # http://www.linux-usb.org/policy.html

    if [ -f /etc/usb/policy ]; then
	exec /etc/usb/policy
    fi

    if [ x$PRODUCT = x ]; then
	mesg Bad USB invocation
	exit 1
    fi

    # no more commandline params
    case x$ACTION in
    xadd)
	load_driver usb $USB_MAP "USB product $PRODUCT"
	# won't return
	;;
    xremove)
	: USB remove, ignored
	exit 0;;
    x*|xhelp)
	usage $* ;;
    esac

elif [ $1 = pci ]; then
    # NOTE: PCI includes CardBus

    if [ x$PCI_SLOT = x ]; then
	mesg Bad PCI invocation
	exit 1
    fi

    # one more commandline param
    case $2 in
    add)
	if [ "$DEBUG" != "" -a -x /sbin/lspci ]; then
	    mesg New PCI Device: `/sbin/lspci -s $PCI_SLOT`
	fi
	load_driver pci $PCI_MAP "PCI device at slot $PCI_SLOT"
	# won't return
	;;
    remove)
	: PCI remove, ignored
	exit 0;;
    *|help)
	usage $* ;;
    esac
fi

mesg "$0: event type '$1' unsupported"
exit 1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-11-12 20:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-12 20:13 Fw: [linux-usb-devel] 2.4.0-test11-pre3: Compile error in drivers/usb/usb.c David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®