A general question about the Linux USB serial driver that has puzzled me. In drivers/usb/serial/option.c, there is a function called option_send_setup(). It sets the outgoing modem signals (DTR,RTS) with the following code:

return usb_control_msg(serial->dev,
usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, ifNum, NULL, 0, USB_CTRL_SET_TIMEOUT);

Should this not be:

return usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0),
0x22, 0x21, val, ifNum, NULL, 0, USB_CTRL_SET_TIMEOUT);

My understanding is that a usb_sndctrlpipe() results in an OUT transaction on the USB, and a usb_rcvctrlpipe() results in an IN transaction. Since this command appears to be setting parameters on the USB device, it should be using an OUT transaction, ie usb_sndctrlpipe().

What is the explanation for using usb_rcvctrlpipe() instead?