summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2008-10-15 12:50:40 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-10-16 01:45:23 +0200
commit5c008892a2b085668e6fd26588cee01cb48b1c4c (patch)
treee07c274715746d4cce3e24d5b67138901b941c41 /input
parentfe785852485ecaa8c162682cc4dfcb6dd22f2210 (diff)
Fix setting the master address on the sixaxis
Direction for the USB command was wrong, also disable all the report code, so sixpair can run (minus saving device records)
Diffstat (limited to 'input')
-rw-r--r--input/sixpair.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/input/sixpair.c b/input/sixpair.c
index 07fa6794..92aa5f70 100644
--- a/input/sixpair.c
+++ b/input/sixpair.c
@@ -105,7 +105,7 @@ set_master_bdaddr (libusb_device_handle *devh, int itfnum, char *host)
msg[7] = mac[5];
res = libusb_control_transfer (devh,
- LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
+ LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
0x09, 0x03f5, itfnum,
(void*) msg, sizeof(msg),
5000);
@@ -285,7 +285,7 @@ handle_device (libusb_device *dev, struct libusb_config_descriptor *cfg, int itf
retval = -1;
goto bail;
}
-
+#if 0
if (get_record_info (alt, &len, &country, &version) < 0) {
g_warning ("Can't get record info");
retval = -1;
@@ -306,7 +306,7 @@ handle_device (libusb_device *dev, struct libusb_config_descriptor *cfg, int itf
fill_req_from_usb (dev, &req, data, len, country, version);
store_info (option_master, device, &req);
-
+#endif
if (set_master_bdaddr (devh, itfnum, option_master) == FALSE) {
retval = -1;
goto bail;
@@ -317,7 +317,11 @@ handle_device (libusb_device *dev, struct libusb_config_descriptor *cfg, int itf
bail:
libusb_release_interface (devh, itfnum);
- libusb_attach_kernel_driver(devh, itfnum);
+ res = libusb_attach_kernel_driver(devh, itfnum);
+ if (res < 0) {
+ //FIXME sometimes the kernel tells us ENOENT, but succeeds anyway...
+ g_warning ("Reattaching the driver failed: %d", res);
+ }
if (devh != NULL)
libusb_close (devh);