/* return: -1 on error, 0 on success, 1 on disconnect. */ static int usb_hub_port_reset(struct usb_device *hub, int port, struct usb_device *dev, unsigned int delay) { int i, status; DBG_HOST_HUB("### >>> Enter hub.c file --> usb_hub_port_reset function \n"); /* Reset the port */ for (i = 0; i < HUB_RESET_TRIES; i++) { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return on disconnect or reset */ status = usb_hub_port_wait_reset(hub, port, dev, delay); if (status != -1) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return status; } dbg("port %d of hub %d not enabled, trying reset again...", port + 1, hub->devnum); delay = HUB_LONG_RESET_TIME; } err("Cannot enable port %i of hub %d, disabling port.", port + 1, hub->devnum); err("Maybe the USB cable is bad?"); return -1; }
/* return: -1 on error, 0 on success, 1 on disconnect. */ static int usb_hub_port_reset(struct usb_device *hub, int port, struct usb_device *dev, unsigned int delay) { int i, status; /* Reset the port */ for (i = 0; i < HUB_RESET_TRIES; i++) { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return on disconnect or reset */ status = usb_hub_port_wait_reset(hub, port, dev, delay); if (status != -1) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return status; } dbg("port %d of hub %d not enabled, trying reset again...", port + 1, hub->devnum); delay = HUB_LONG_RESET_TIME; } //2005-01-21 by kanki for fixing usb loop issue (temporary solution from broadcom) //err("Cannot enable port %i of hub %d, disabling port.", // port + 1, hub->devnum); //err("Maybe the USB cable is bad?"); return -1; }
static int usb_hub_port_reset(struct usb_device *hub, int port, struct usb_device *dev, unsigned int delay) { int i; /* Reset the port */ for (i = 0; i < HUB_RESET_TRIES; i++) { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return success if the port reset OK */ if (!usb_hub_port_wait_reset(hub, port, dev, delay)) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return 0; } dbg("port %d of hub %d not enabled, trying reset again...", port + 1, hub->devnum); delay = HUB_LONG_RESET_TIME; } err("Cannot enable port %i of hub %d, disabling port.", port + 1, hub->devnum); err("Maybe the USB cable is bad?"); return -1; }
/* return: -1 on error, 0 on success, 1 on disconnect. */ static int usb_hub_port_reset(struct usb_device *hub, int port, struct usb_device *dev, unsigned int delay) { int i, status; usb_enable_pci_slot1_frame(__LINE__); // Ed Lai 2005/06/25 /* Reset the port */ for (i = 0; i < HUB_RESET_TRIES; i++) { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return on disconnect or reset */ status = usb_hub_port_wait_reset(hub, port, dev, delay); if (status != -1) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return status; } dbg("port %d of hub %d not enabled, trying reset again...", port + 1, hub->devnum); delay = HUB_LONG_RESET_TIME; } err("Cannot enable port %i of hub %d, disabling port.", port + 1, hub->devnum); err("Maybe the USB cable is bad?"); return -1; }
static int usb_hub_port_reset(USB_DEV_T *hub, int port, USB_DEV_T *dev, uint32_t delay) { int i; USB_info("usb_hub_port_reset: hub:%d, port:%d dev:%x\n", hub->devnum, port + 1, (int)dev); /* Reset the port */ for(i = 0; i < HUB_RESET_TRIES; i++) /* retry loop */ { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return success if the port reset OK */ if(!usb_hub_port_wait_reset(hub, port, dev, delay)) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return 0; } USB_error("port %d of hub %d not enabled, %dth trying reset again...\n", port + 1, hub->devnum, i); delay = HUB_LONG_RESET_TIME; } USB_error("Cannot enable port %i of hub %d, disabling port.\n", port + 1, hub->devnum); USB_error("Error - Maybe the USB cable is bad?\n"); return -1; }
/* return: -1 on error, 0 on success, 1 on disconnect. */ static int usb_hub_port_reset(struct usb_device *hub, int port, struct usb_device *dev, unsigned int delay) { int i, status; /* Reset the port */ for (i = 0; i < HUB_RESET_TRIES; i++) { usb_set_port_feature(hub, port + 1, USB_PORT_FEAT_RESET); /* return on disconnect or reset */ status = usb_hub_port_wait_reset(hub, port, dev, delay); // !!TB - dd-wrt fix for USB 2.0 if (status == 0) { /* TRSTRCY = 10 ms; plus some extra */ wait_ms(10 + 40); } if (status != -1) { usb_clear_port_feature(hub, port + 1, USB_PORT_FEAT_C_RESET); return status; } dbg("port %d of hub %d not enabled, trying reset again...", port + 1, hub->devnum); delay = HUB_LONG_RESET_TIME; } err("Cannot enable port %i of hub %d, disabling port.", port + 1, hub->devnum); err("Maybe the USB cable is bad?"); return -1; }