Date: Tue, 29 Mar 2022 14:10:07 -0400 From: "Farhan Khan" <farhan@farhan.codes> To: freebsd-usb@freebsd.org Subject: Why receiving USB_ERR_CANCELLED error during initial Rx transfer Message-ID: <55adbaa5-27d3-451d-9320-a1966f167498@www.fastmail.com>
next in thread | raw e-mail | index | archive | help
Hi all, I am trying to send the initial "wakeup" USB Rx interrupt packet via usbd_transfer_start(), but after running the callback with USB_ST_SETUP, I receive another callback with USB_ERR_CANCELLED as the value of usb_error_t. What might be causing the cancellation? Detailed explanation: I am opening the pipes, then immediately running usbd_transfer_start() on the Rx Interrupt with this: usbd_transfer_start(usc->usc_xfer[ATHN_RX_INTR]); The callback function runs this: case USB_ST_SETUP: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); break; The next time the callback is invoked, the USB_GET_STATE macro reports USB_ST_ERROR with the value being USB_ERR_CANCELLED. The manual page suggests that this is the result of a transfer currently happening, but I am not clear on the issue. I have both set and disabled pipe_bof on the Rx Interrupt with the same result. I borrowed the above code from the otus(4) driver. Please assist. Thanks! -- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55adbaa5-27d3-451d-9320-a1966f167498>