#include <linux/devfs_fs_kernel.h>
#include <linux/spinlock.h>
+//+Wilson10292003
+#undef DBG
+//Wilson10292003+
+
+//+Wilson12032003
+extern void led_status(int);
+//extern int HubFlag;
+#define LED_OFF 0
+#define LED_GREEN 1
+#define LED_RED 2
+#define LED_HUB 3
+//Wilson12032003+
+
+//+Wilson12192003
+//extern int ScsiOk;
+//Wilson12192003+
+
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
*/
static void call_policy_interface (char *verb, struct usb_device *dev, int interface)
{
- char *argv [3], **envp, *buf, *scratch;
+ //+Wilson11132003
+ //char *argv [3], **envp, *buf, *scratch;
+ char *argv[5], **envp, *buf, *scratch;
+ //Wilson11132003+
int i = 0, value;
if (!hotplug_path [0])
/* only one standardized param to hotplug command: type */
argv [0] = hotplug_path;
argv [1] = "usb";
- argv [2] = 0;
+ //argv [2] = 0; //+Wilson10282003
+ argv[2] = verb; //+Wilson10282003
+ argv[3] = 0; //+Wilson11132003
+
+ //+Wilson11072003
+ #if 01
+ if((dev->devnum == 1) || (dev->HubFlag == 1)) //+Wilson12032003
+ {
+ argv[3] = "host_hub";
+ dev->HubFlag = 0; //+Wilson12032003
+ }
+ else
+ argv[3] = 0;
+
+ argv[4] = 0;
+ #endif
+ //Wilson11072003+
/* minimal command environment */
envp [i++] = "HOME=/";
envp [i++] = 0;
/* assert: (scratch - buf) < sizeof buf */
+ //+Wilson12192003
+ #if 0
+ do {
+ if(dev->HubFlag == 1)
+ {
+ printk("HubFlag = %d ",dev->HubFlag);
+ dev->HubFlag = 0;
+ break;
+ }
+
+ if(dev->ScsiMount == 1 || dev->ScsiUmount == 1)
+ {
+ printk("ScsiMount = %d ScsiUmount = %d ",dev->ScsiMount, dev->ScsiUmount);
+ dev->ScsiMount = 0;
+ dev->ScsiUmount = 0;
+ break;
+ }
+ wait_ms(10);
+ retries--;
+ } while(retries);
+ printk(" retries = %d\n",retries);
+ #endif
+ //Wilson12192003+
+
+
/* NOTE: user mode daemons can call the agents too */
dbg ("kusbd: %s %s %d", argv [0], verb, dev->devnum);
int usb_new_device(struct usb_device *dev)
{
int err;
+ int retries = 3; //+Wilson02192004
/* USB v1.1 5.5.3 */
/* We read the first 8 bytes from the device descriptor to get to */
dev->epmaxpacketin [0] = 8;
dev->epmaxpacketout[0] = 8;
+ //call_policy("failure", dev); //+Wilson11042003
+ wait_ms(10); //+Wilson03172004, due to some flash drives failed to work
+
+ do { //+Wilson 10/16/2003
err = usb_set_address(dev);
+ retries--; //+Wilson02192004
+ } while((err<0) && retries); //+Wilson 10/16/2003
+
if (err < 0) {
err("USB device not accepting new address=%d (error=%d)",
dev->devnum, err);