linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Gruber" <lists.mg@googlemail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org
Subject: [PATCH] xpad - Set buffer length for outgoing requests
Date: Tue, 8 Apr 2008 13:05:27 +0200	[thread overview]
Message-ID: <74d457500804080405x50098dcfi6dfe965da2a962ef@mail.gmail.com> (raw)

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);
 	}

             reply	other threads:[~2008-04-08 11:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-08 11:05 Michael Gruber [this message]
2008-04-11 15:34 ` [PATCH] xpad - Set buffer length for outgoing requests Dmitry Torokhov
2008-04-12  6:14   ` Anssi Hannula
2008-04-15  5:39     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74d457500804080405x50098dcfi6dfe965da2a962ef@mail.gmail.com \
    --to=lists.mg@googlemail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).