diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 1b72df569916..1608aea2be2c 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -653,6 +653,9 @@ USB_ATTACH(aue) struct aue_type *t; bzero(sc, sizeof(struct aue_softc)); + + usbd_devinfo(uaa->device, 0, devinfo); + sc->aue_iface = uaa->iface; sc->aue_udev = uaa->device; sc->aue_unit = device_get_unit(self); @@ -673,7 +676,7 @@ USB_ATTACH(aue) t++; } - id = usbd_get_interface_descriptor(uaa->iface); + id = usbd_get_interface_descriptor(sc->aue_iface); usbd_devinfo(uaa->device, 0, devinfo); device_set_desc_copy(self, devinfo); @@ -980,8 +983,9 @@ aue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AUE_UNLOCK(sc); return; } - printf("aue%d: usb error on rx: %s\n", sc->aue_unit, - usbd_errstr(status)); + if (usbd_ratecheck(&sc->aue_rx_notice)) + printf("aue%d: usb error on rx: %s\n", sc->aue_unit, + usbd_errstr(status)); if (status == USBD_STALLED) usbd_clear_endpoint_stall(sc->aue_ep[AUE_ENDPT_RX]); goto done; diff --git a/sys/dev/usb/if_auereg.h b/sys/dev/usb/if_auereg.h index 77bed8e75267..59914ec33cd9 100644 --- a/sys/dev/usb/if_auereg.h +++ b/sys/dev/usb/if_auereg.h @@ -251,6 +251,7 @@ struct aue_softc { struct callout_handle aue_stat_ch; struct mtx aue_mtx; char aue_dying; + struct timeval aue_rx_notice; }; #if 0 diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index bda1af46dc73..cacf21edd438 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -708,8 +708,9 @@ cue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) CUE_UNLOCK(sc); return; } - printf("cue%d: usb error on rx: %s\n", sc->cue_unit, - usbd_errstr(status)); + if (usbd_ratecheck(&sc->cue_rx_notice)) + printf("cue%d: usb error on rx: %s\n", sc->cue_unit, + usbd_errstr(status)); if (status == USBD_STALLED) usbd_clear_endpoint_stall(sc->cue_ep[CUE_ENDPT_RX]); goto done; diff --git a/sys/dev/usb/if_cuereg.h b/sys/dev/usb/if_cuereg.h index b74ca04277d4..b8759835bb34 100644 --- a/sys/dev/usb/if_cuereg.h +++ b/sys/dev/usb/if_cuereg.h @@ -180,6 +180,7 @@ struct cue_softc { struct callout_handle cue_stat_ch; struct mtx cue_mtx; char cue_dying; + struct timeval cue_rx_notice; }; #if 0 diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index d061e04c023c..4764fe6632c7 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -671,8 +671,9 @@ Static void kue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, KUE_UNLOCK(sc); return; } - printf("kue%d: usb error on rx: %s\n", sc->kue_unit, - usbd_errstr(status)); + if (usbd_ratecheck(&sc->kue_rx_notice)) + printf("kue%d: usb error on rx: %s\n", sc->kue_unit, + usbd_errstr(status)); if (status == USBD_STALLED) usbd_clear_endpoint_stall(sc->kue_ep[KUE_ENDPT_RX]); goto done; diff --git a/sys/dev/usb/if_kuereg.h b/sys/dev/usb/if_kuereg.h index 07cdfced695a..0654ab6a08c0 100644 --- a/sys/dev/usb/if_kuereg.h +++ b/sys/dev/usb/if_kuereg.h @@ -171,6 +171,7 @@ struct kue_softc { struct kue_cdata kue_cdata; struct mtx kue_mtx; char kue_dying; + struct timeval kue_rx_notice; }; #if 0