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] [day] [month] [year] [list]
Message-ID: <fad05be3-0d12-4aed-bdd9-d541f8de6704@mayer-bgk.de>
Date: Sun, 5 Jan 2025 11:33:11 +0100
From: Christian Mayer <christian@...er-bgk.de>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
 Christian Mayer <git@...er-bgk.de>, linux-input@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Jiri Kosina <jikos@...nel.org>,
 Benjamin Tissoires <benjamin.tissoires@...hat.com>,
 Bastien Nocera <hadess@...ess.net>
Subject: Re: [PATCH 1/3] HID: steelseries: add SteelSeries Arctis 9 support



Am 04.01.25 um 13:45 schrieb Christophe JAILLET:
> Le 01/01/2025 à 16:11, Christian Mayer a écrit :
>> Add support for the SteelSeries Arctis 9 headset. This driver
>> will export the battery information like it already does for
>> the Arcits 1 headset.
>>
>> Signed-off-by: Christian Mayer <git@...er-bgk.de>
> 
> ...
Thanks for your feedback Christophe.
I will repost my patches with the fixes for your comments together with 
the fixes for Bastiens comment.
> 
>> -static int steelseries_headset_arctis_1_fetch_battery(struct 
>> hid_device *hdev)
>> +static int steelseries_headset_request_battery(struct hid_device *hdev,
>> +    const char *request, size_t len)
>>   {
>>       u8 *write_buf;
>>       int ret;
>>       /* Request battery information */
>> -    write_buf = kmemdup(arctis_1_battery_request, 
>> sizeof(arctis_1_battery_request), GFP_KERNEL);
>> +    write_buf = kmemdup(request, len, GFP_KERNEL);
>>       if (!write_buf)
>>           return -ENOMEM;
>> -    ret = hid_hw_raw_request(hdev, arctis_1_battery_request[0],
>> -                 write_buf, sizeof(arctis_1_battery_request),
>> +    hid_dbg(hdev, "Sending battery request report");
>> +    ret = hid_hw_raw_request(hdev, request[0],
>> +                 write_buf, len,
> 
> This could be on the same line.
> 
>>                    HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
>> -    if (ret < (int)sizeof(arctis_1_battery_request)) {
>> +    if (ret < (int)len) {
>>           hid_err(hdev, "hid_hw_raw_request() failed with %d\n", ret);
>>           ret = -ENODATA;
>>       }
> 
> ...
> 
>> +static uint8_t steelseries_headset_map_capacity(uint8_t capacity, 
>> uint8_t min_in, uint8_t max_in)
>> +{
>> +    if (capacity > max_in)
> 
>  >= ?
> 
>> +        return 100;
>> +    if (capacity < min_in)
> 
> <= ?
> 
>> +        return 0;
>> +    return (capacity - min_in) * 100 / (max_in - min_in);
>> +}
> 
> ...
> 
> CJ


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ