linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xpad - Set buffer length for outgoing requests
@ 2008-04-08 11:05 Michael Gruber
  2008-04-11 15:34 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Gruber @ 2008-04-08 11:05 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input

From: Michael Gruber <lists.mg@googlemail.com>

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>

---

Hi, my Xbox360 Controller will not work at all unless this is set up correctly.
I am new to linux kernel programming and would appreciate any kinds of comments.

 drivers/input/joystick/xpad.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/input/joystick/xpad.c	2008-04-05 15:18:37.000000000 +0200
+++ b/drivers/input/joystick/xpad.c	2008-04-05 15:18:25.000000000 +0200
@@ -558,6 +558,7 @@ static int xpad_play_effect(struct input
 		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
 		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);
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xpad - Set buffer length for outgoing requests
  2008-04-08 11:05 [PATCH] xpad - Set buffer length for outgoing requests Michael Gruber
@ 2008-04-11 15:34 ` Dmitry Torokhov
  2008-04-12  6:14   ` Anssi Hannula
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2008-04-11 15:34 UTC (permalink / raw)
  To: Michael Gruber, anssi.hannula; +Cc: linux-input

Hi Michael,

On Tue, Apr 08, 2008 at 01:05:27PM +0200, Michael Gruber wrote:
> From: Michael Gruber <lists.mg@googlemail.com>
> 
> 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>
> 

Thank you for the patch, it seems reasonable. Anssi, any objections?

> ---
> 
> Hi, my Xbox360 Controller will not work at all unless this is set up correctly.
> I am new to linux kernel programming and would appreciate any kinds of comments.
> 
>  drivers/input/joystick/xpad.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/drivers/input/joystick/xpad.c	2008-04-05 15:18:37.000000000 +0200
> +++ b/drivers/input/joystick/xpad.c	2008-04-05 15:18:25.000000000 +0200
> @@ -558,6 +558,7 @@ static int xpad_play_effect(struct input
>  		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
>  		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);
>  	}

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xpad - Set buffer length for outgoing requests
  2008-04-11 15:34 ` Dmitry Torokhov
@ 2008-04-12  6:14   ` Anssi Hannula
  2008-04-15  5:39     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Anssi Hannula @ 2008-04-12  6:14 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Michael Gruber, linux-input

Dmitry Torokhov wrote:
> Hi Michael,
> 
> On Tue, Apr 08, 2008 at 01:05:27PM +0200, Michael Gruber wrote:
>> From: Michael Gruber <lists.mg@googlemail.com>
>>
>> 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>
>>
> 
> Thank you for the patch, it seems reasonable. Anssi, any objections?

Seems ok, though I'm not a urb expert.

Acked-by: Anssi Hannula <anssi.hannula@gmail.com>

>> ---
>>
>> Hi, my Xbox360 Controller will not work at all unless this is set up correctly.
>> I am new to linux kernel programming and would appreciate any kinds of comments.
>>
>>  drivers/input/joystick/xpad.c |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> --- a/drivers/input/joystick/xpad.c	2008-04-05 15:18:37.000000000 +0200
>> +++ b/drivers/input/joystick/xpad.c	2008-04-05 15:18:25.000000000 +0200
>> @@ -558,6 +558,7 @@ static int xpad_play_effect(struct input
>>  		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
>>  		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);
>>  	}
> 


-- 
Anssi Hannula

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xpad - Set buffer length for outgoing requests
  2008-04-12  6:14   ` Anssi Hannula
@ 2008-04-15  5:39     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2008-04-15  5:39 UTC (permalink / raw)
  To: Anssi Hannula; +Cc: Michael Gruber, linux-input

On Sat, Apr 12, 2008 at 09:14:28AM +0300, Anssi Hannula wrote:
> Dmitry Torokhov wrote:
> > Hi Michael,
> > 
> > On Tue, Apr 08, 2008 at 01:05:27PM +0200, Michael Gruber wrote:
> >> From: Michael Gruber <lists.mg@googlemail.com>
> >>
> >> 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>
> >>
> > 
> > Thank you for the patch, it seems reasonable. Anssi, any objections?
> 
> Seems ok, though I'm not a urb expert.
> 
> Acked-by: Anssi Hannula <anssi.hannula@gmail.com>
> 

We do the similar manipulations in other drivers...

Applied, thank you Michael.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-15  5:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 11:05 [PATCH] xpad - Set buffer length for outgoing requests Michael Gruber
2008-04-11 15:34 ` Dmitry Torokhov
2008-04-12  6:14   ` Anssi Hannula
2008-04-15  5:39     ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).