aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb2/core/usb2_hub.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2008-11-19 08:56:35 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2008-11-19 08:56:35 +0000
commit6f0e1ffd076c821819632e0371db2f38434ad02c (patch)
tree563c2e235db65a3694986a6531a444241d882b23 /sys/dev/usb2/core/usb2_hub.c
parent202f306c24ed36222906a5e70d787f8cf6c9a35f (diff)
Notes
Diffstat (limited to 'sys/dev/usb2/core/usb2_hub.c')
-rw-r--r--sys/dev/usb2/core/usb2_hub.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/usb2/core/usb2_hub.c b/sys/dev/usb2/core/usb2_hub.c
index 7cc23cc32b92..b5336a9a3476 100644
--- a/sys/dev/usb2/core/usb2_hub.c
+++ b/sys/dev/usb2/core/usb2_hub.c
@@ -72,6 +72,7 @@ struct uhub_softc {
struct usb2_device *sc_udev; /* USB device */
struct usb2_xfer *sc_xfer[2]; /* interrupt xfer */
uint8_t sc_flags;
+#define UHUB_FLAG_DID_EXPLORE 0x01
#define UHUB_FLAG_INTR_STALL 0x02
char sc_name[32];
};
@@ -511,6 +512,14 @@ uhub_explore(struct usb2_device *udev)
/* most likely the HUB is gone */
break;
}
+ if (!(sc->sc_flags & UHUB_FLAG_DID_EXPLORE)) {
+ /*
+ * Fake a connect status change so that the
+ * status gets checked initially!
+ */
+ sc->sc_st.port_change |=
+ UPS_C_CONNECT_STATUS;
+ }
if (sc->sc_st.port_change & UPS_C_PORT_ENABLED) {
err = usb2_req_clear_port_feature(
udev, &Giant, portno, UHF_C_PORT_ENABLE);
@@ -533,7 +542,8 @@ uhub_explore(struct usb2_device *udev)
DPRINTFN(0, "port error, giving up "
"port %d\n", portno);
} else {
- sc->sc_st.port_change |= UPS_C_CONNECT_STATUS;
+ sc->sc_st.port_change |=
+ UPS_C_CONNECT_STATUS;
up->restartcnt++;
}
}
@@ -560,6 +570,11 @@ uhub_explore(struct usb2_device *udev)
/* explore succeeded - reset restart counter */
up->restartcnt = 0;
}
+
+ /* initial status checked */
+ sc->sc_flags |= UHUB_FLAG_DID_EXPLORE;
+
+ /* return success */
return (USB_ERR_NORMAL_COMPLETION);
}