Commit 32445605 authored by Preston Fick's avatar Preston Fick Committed by Greg Kroah-Hartman

usb: cp210x: Corrected USB request type definitions

The original request types in the cp210x driver are labled as "DEVICE_TO_HOST" and
"HOST_TO_DEVICE" but the actual bit definition corresponds to a request to the
interface. This has been corrected, and the actual definition for the device
requests have been added.
Signed-off-by: default avatarPreston Fick <preston.fick@silabs.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aadd6472
...@@ -188,8 +188,10 @@ static struct usb_serial_driver * const serial_drivers[] = { ...@@ -188,8 +188,10 @@ static struct usb_serial_driver * const serial_drivers[] = {
}; };
/* Config request types */ /* Config request types */
#define REQTYPE_HOST_TO_DEVICE 0x41 #define REQTYPE_HOST_TO_INTERFACE 0x41
#define REQTYPE_DEVICE_TO_HOST 0xc1 #define REQTYPE_INTERFACE_TO_HOST 0xc1
#define REQTYPE_HOST_TO_DEVICE 0x40
#define REQTYPE_DEVICE_TO_HOST 0xc0
/* Config request codes */ /* Config request codes */
#define CP210X_IFC_ENABLE 0x00 #define CP210X_IFC_ENABLE 0x00
...@@ -286,7 +288,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request, ...@@ -286,7 +288,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
/* Issue the request, attempting to read 'size' bytes */ /* Issue the request, attempting to read 'size' bytes */
result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
request, REQTYPE_DEVICE_TO_HOST, 0x0000, request, REQTYPE_INTERFACE_TO_HOST, 0x0000,
port_priv->bInterfaceNumber, buf, size, port_priv->bInterfaceNumber, buf, size,
USB_CTRL_GET_TIMEOUT); USB_CTRL_GET_TIMEOUT);
...@@ -340,13 +342,13 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, ...@@ -340,13 +342,13 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
if (size > 2) { if (size > 2) {
result = usb_control_msg(serial->dev, result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), usb_sndctrlpipe(serial->dev, 0),
request, REQTYPE_HOST_TO_DEVICE, 0x0000, request, REQTYPE_HOST_TO_INTERFACE, 0x0000,
port_priv->bInterfaceNumber, buf, size, port_priv->bInterfaceNumber, buf, size,
USB_CTRL_SET_TIMEOUT); USB_CTRL_SET_TIMEOUT);
} else { } else {
result = usb_control_msg(serial->dev, result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), usb_sndctrlpipe(serial->dev, 0),
request, REQTYPE_HOST_TO_DEVICE, data[0], request, REQTYPE_HOST_TO_INTERFACE, data[0],
port_priv->bInterfaceNumber, NULL, 0, port_priv->bInterfaceNumber, NULL, 0,
USB_CTRL_SET_TIMEOUT); USB_CTRL_SET_TIMEOUT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment