Farhan Khan writes: > Hi all, > I am trying to understand a snippet of athn(9) code for the purpose of > porting to FreeBSD. I am reading the function athn_usb_htc_setup() > located in /usr/src/sys/dev/usb/if_athn_usb.c. After tracing it > through, it seems to terminate at a usbd_setup_xfer(9) call. > > Is this the equivalent of setting up which USB function will handle > which channel? This function seems similar to FreeBSD's > usbd_transfer_setup(9), which I believe does that. If so, how is that > different from athn_usb_open_pipes()? > > If not, what does athn_usb_htc_setup() do? It is not clear to me and > therefore I am having trouble making the translation.
usbd_setup_xfer() is used to setup one USB transfer. it requires that an open pipe already be provided. the "TRANSFERS" section of usbdi.9 in netbsd has more details than the above: https://man.netbsd.org/usbdi.9 it doesn't do much more than fill in the "usbd_xfer" structure for the transfer operation - does not change the status of the device in any way until the transfer is actually submitted. .mrg.
