lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55271A53.6080505@gmail.com>
Date:	Thu, 09 Apr 2015 20:33:23 -0400
From:	Frank Praznik <frank.praznik@...il.com>
To:	Pavel Machek <pavel@....cz>, Jiri Kosina <jkosina@...e.cz>
CC:	vojtech@...e.cz, mike-@...ci.rr.com, jslaby@...e.cz,
	dave@...dillows.org, colin.leitner@...il.com,
	kernel list <linux-kernel@...r.kernel.org>,
	linux-input@...r.kernel.org
Subject: Re: Turn Sony motion controller into RGB led

On 4/9/2015 17:25, Pavel Machek wrote:
> Hi!
>
> I did not yet figure out how to get sensor data from the controller,
> but it works rather well as a RGB led.

Hi Pavel,

 From what I've read, the motion controller only sends sensor data when 
connected via bluetooth.
Otherwise it should be in report 1 with the buttons and other data.

Jiri already covered many of the issues, so just a couple of comments on 
top of what he already wrote:

>   
> -static __u8 *ps3remote_fixup(struct hid_device *hdev, __u8 *rdesc,
> +static int motion_set_leds(struct hid_device *hdev, u8 r, u8 g, u8 b)
> +{
> +	int ret;
> +	struct motion_leds *buf = kzalloc(sizeof(struct motion_leds), GFP_KERNEL);

The other devices allocate this buffer up front and store it in 
output_report_dmabuf in the sony_sc struct
to avoid hitting the allocator every time an output report is sent. No 
reason why the motion controller can't
do the same.  Add an entry in sony_allocate_output_report() and it will 
be automatically freed when the
device is removed.

> +
> +	if (sizeof(struct motion_leds) != 7) {
> +		printk("Struct has bad size\n");
> +	}
> +

On the printk usage in general: the rest of the driver uses 
hid_info/hid_err to automatically format the output
string with the driver/device information when printing log messages.  
Use these instead of printk for consistency.
A lot of them should be removed anyways since they look like debugging 
leftovers.

If you can send a version without all of the unrelated underscore 
changes I'll help clean it up.  I don't own one of these controllers
though, so I can't help test the functionality.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ