Lines 130-136
Link Here
|
130 |
int sc_disable_port_power; |
130 |
int sc_disable_port_power; |
131 |
#endif |
131 |
#endif |
132 |
uint8_t sc_usb_port_errors; /* error counter */ |
132 |
uint8_t sc_usb_port_errors; /* error counter */ |
|
|
133 |
uint8_t sc_usb_port_reset_errors; /* error counter to throttle "device vanished" log messages */ |
133 |
#define UHUB_USB_PORT_ERRORS_MAX 4 |
134 |
#define UHUB_USB_PORT_ERRORS_MAX 4 |
|
|
135 |
#define UHUB_USB_PORT_RESET_ERRORS_MAX 1 /* "device vanished" message is logged repeatedly on timeout (1 second) */ |
136 |
/* so this max of 1 makes it 1 message per second if error occurs */ |
134 |
uint8_t sc_flags; |
137 |
uint8_t sc_flags; |
135 |
#define UHUB_FLAG_DID_EXPLORE 0x01 |
138 |
#define UHUB_FLAG_DID_EXPLORE 0x01 |
136 |
}; |
139 |
}; |
Lines 750-757
Link Here
|
750 |
if ((sc->sc_st.port_change & UPS_C_CONNECT_STATUS) || |
753 |
if ((sc->sc_st.port_change & UPS_C_CONNECT_STATUS) || |
751 |
(!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { |
754 |
(!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { |
752 |
if (timeout) { |
755 |
if (timeout) { |
753 |
DPRINTFN(0, "giving up port reset " |
756 |
if(sc->sc_usb_port_reset_errors < UHUB_USB_PORT_RESET_ERRORS_MAX) |
754 |
"- device vanished\n"); |
757 |
{ |
|
|
758 |
DPRINTFN(0, "giving up port reset " |
759 |
"- device vanished\n"); |
760 |
} |
761 |
++sc->sc_usb_port_reset_errors; |
755 |
goto error; |
762 |
goto error; |
756 |
} |
763 |
} |
757 |
timeout = 1; |
764 |
timeout = 1; |