summaryrefslogtreecommitdiffstats
path: root/hidd/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-08 16:38:47 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-05-08 16:38:47 +0000
commite10fbef05c562d175a12ab4f25ffcd12dfa871dc (patch)
treee442fff411b4169189d4658f86c7c34af284c3f7 /hidd/main.c
parentc4c2b3b842d89e0dc5b585f34ad0692156b55eb6 (diff)
Enable PS3 controller quirk
Diffstat (limited to 'hidd/main.c')
-rw-r--r--hidd/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hidd/main.c b/hidd/main.c
index f710a5a4..c1aeb37a 100644
--- a/hidd/main.c
+++ b/hidd/main.c
@@ -236,6 +236,16 @@ static int request_encryption(bdaddr_t *src, bdaddr_t *dst)
return err;
}
+static void enable_sixaxis(int csk)
+{
+ const unsigned char buf[] = {
+ 0x53 /*HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE*/,
+ 0xf4, 0x42, 0x03, 0x00, 0x00 };
+ int err;
+
+ err = write(csk, buf, sizeof(buf));
+}
+
static int create_device(int ctl, int csk, int isk, uint8_t subclass, int nosdp, int nocheck, int bootonly, int encrypt, int timeout)
{
struct hidp_connadd_req req;
@@ -324,6 +334,9 @@ create:
req.flags |= (1 << HIDP_BOOT_PROTOCOL_MODE);
}
+ if (req.vendor == 0x054c && req.product == 0x0268)
+ enable_sixaxis(csk);
+
err = ioctl(ctl, HIDPCONNADD, &req);
error: