mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 08:14:15 +08:00
Input: xpad - set proper buffer length for outgoing requests
The messages for led/rumble are exactly 3 and 8 bytes respectively. Hence set up the transfer_buffer_length accordingly. Signed-off-by: Michael Gruber <lists.mg@googlemail.com> Acked-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
da3e4c885e
commit
04021e4e40
@ -558,6 +558,7 @@ static int xpad_play_effect(struct input_dev *dev, void *data,
|
||||
xpad->odata[5] = 0x00;
|
||||
xpad->odata[6] = 0x00;
|
||||
xpad->odata[7] = 0x00;
|
||||
xpad->irq_out->transfer_buffer_length = 8;
|
||||
usb_submit_urb(xpad->irq_out, GFP_KERNEL);
|
||||
}
|
||||
|
||||
@ -594,6 +595,7 @@ static void xpad_send_led_command(struct usb_xpad *xpad, int command)
|
||||
xpad->odata[0] = 0x01;
|
||||
xpad->odata[1] = 0x03;
|
||||
xpad->odata[2] = command;
|
||||
xpad->irq_out->transfer_buffer_length = 3;
|
||||
usb_submit_urb(xpad->irq_out, GFP_KERNEL);
|
||||
mutex_unlock(&xpad->odata_mutex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user