mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 21:44:06 +08:00
USB: kobil_sct: fix control requests without data stage
Fix incorrect pipe directions and remove bogus data buffer arguments from control requests without data stage. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3fff3b4343
commit
90419cfcb5
@ -215,13 +215,13 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||||||
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
|
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
|
||||||
/* Setting Baudrate, Parity and Stopbits */
|
/* Setting Baudrate, Parity and Stopbits */
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_SetBaudRateParityAndStopBits,
|
SUSBCRequest_SetBaudRateParityAndStopBits,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
SUSBCR_SBR_9600 | SUSBCR_SPASB_EvenParity |
|
SUSBCR_SBR_9600 | SUSBCR_SPASB_EvenParity |
|
||||||
SUSBCR_SPASB_1StopBit,
|
SUSBCR_SPASB_1StopBit,
|
||||||
0,
|
0,
|
||||||
transfer_buffer,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KOBIL_TIMEOUT
|
KOBIL_TIMEOUT
|
||||||
);
|
);
|
||||||
@ -229,12 +229,12 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||||||
|
|
||||||
/* reset all queues */
|
/* reset all queues */
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_Misc,
|
SUSBCRequest_Misc,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
SUSBCR_MSC_ResetAllQueues,
|
SUSBCR_MSC_ResetAllQueues,
|
||||||
0,
|
0,
|
||||||
transfer_buffer,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KOBIL_TIMEOUT
|
KOBIL_TIMEOUT
|
||||||
);
|
);
|
||||||
@ -445,12 +445,12 @@ static int kobil_tiocmset(struct tty_struct *tty,
|
|||||||
else
|
else
|
||||||
dev_dbg(dev, "%s - Clearing DTR\n", __func__);
|
dev_dbg(dev, "%s - Clearing DTR\n", __func__);
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_SetStatusLinesOrQueues,
|
SUSBCRequest_SetStatusLinesOrQueues,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
|
((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
|
||||||
0,
|
0,
|
||||||
transfer_buffer,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KOBIL_TIMEOUT);
|
KOBIL_TIMEOUT);
|
||||||
} else {
|
} else {
|
||||||
@ -459,12 +459,12 @@ static int kobil_tiocmset(struct tty_struct *tty,
|
|||||||
else
|
else
|
||||||
dev_dbg(dev, "%s - Clearing RTS\n", __func__);
|
dev_dbg(dev, "%s - Clearing RTS\n", __func__);
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_SetStatusLinesOrQueues,
|
SUSBCRequest_SetStatusLinesOrQueues,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
|
((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
|
||||||
0,
|
0,
|
||||||
transfer_buffer,
|
NULL,
|
||||||
0,
|
0,
|
||||||
KOBIL_TIMEOUT);
|
KOBIL_TIMEOUT);
|
||||||
}
|
}
|
||||||
@ -514,7 +514,7 @@ static void kobil_set_termios(struct tty_struct *tty,
|
|||||||
tty_encode_baud_rate(tty, speed, speed);
|
tty_encode_baud_rate(tty, speed, speed);
|
||||||
|
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_SetBaudRateParityAndStopBits,
|
SUSBCRequest_SetBaudRateParityAndStopBits,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
urb_val,
|
urb_val,
|
||||||
@ -546,12 +546,12 @@ static int kobil_ioctl(struct tty_struct *tty,
|
|||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
usb_rcvctrlpipe(port->serial->dev, 0),
|
usb_sndctrlpipe(port->serial->dev, 0),
|
||||||
SUSBCRequest_Misc,
|
SUSBCRequest_Misc,
|
||||||
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
|
||||||
SUSBCR_MSC_ResetAllQueues,
|
SUSBCR_MSC_ResetAllQueues,
|
||||||
0,
|
0,
|
||||||
NULL, /* transfer_buffer, */
|
NULL,
|
||||||
0,
|
0,
|
||||||
KOBIL_TIMEOUT
|
KOBIL_TIMEOUT
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user