How are USB Rx interrupts periodically polled?

From: Farhan Khan <>
Date: Fri, 06 May 2022 03:52:30 UTC
Hi all,

My understanding is that you have to manually start a USB Rx interrupt 
transfer for each read rather than when data is available to read. That makes 
sense, but I am trying to understand where in the code that reading mechanism 
is done. I looked up otus(4) and urtw(4), but those drivers only run 
usbd_start_transfer(9) when the pipe is first created.

So, how is the polling of an Rx interrupt done?

Background of this question: I am looking up how OpenBSD's implementation does 
this. They the kernel call usbd_open_pipe_intr(9), which does the handler once 
every `ival` seconds. I was wondering how one would replicate that on the 
FreeBSD side. My initial idea was a scheduled task, but that does not seem to 
be how other drivers implement it.

Please advise. Thanks!

- Farhan