[PATCH 3/3] winebus.sys: Remove the now unused HID haptics combined waveform report.
Rémi Bernon
rbernon at codeweavers.com
Mon Mar 14 04:29:38 CDT 2022
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/winebus.sys/hid.c | 107 +-------------------------------
dlls/winebus.sys/unix_private.h | 20 ------
2 files changed, 2 insertions(+), 125 deletions(-)
diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c
index 46336716a70..5b18da5d8ed 100644
--- a/dlls/winebus.sys/hid.c
+++ b/dlls/winebus.sys/hid.c
@@ -331,12 +331,6 @@ BOOL hid_device_add_axes(struct unix_device *iface, BYTE count, USAGE usage_page
}
#include "pshpack1.h"
-struct hid_haptics_waveform
-{
- UINT16 intensity;
- BYTE manual_trigger;
- BYTE repeat_count;
-};
struct hid_haptics_intensity
{
UINT16 rumble_intensity;
@@ -348,68 +342,7 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
{
struct hid_report_descriptor *desc = &iface->hid_report_descriptor;
const BYTE haptics_features_report = ++desc->next_report_id[HidP_Feature];
- const BYTE haptics_waveform_report = ++desc->next_report_id[HidP_Output];
const BYTE haptics_intensity_report = ++desc->next_report_id[HidP_Output];
- const BYTE waveforms_template[] =
- {
- USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS),
- USAGE(1, HID_USAGE_HAPTICS_SIMPLE_CONTROLLER),
- COLLECTION(1, Logical),
- REPORT_ID(1, haptics_features_report),
-
- USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_LIST),
- COLLECTION(1, NamedArray),
- USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|HAPTICS_WAVEFORM_RUMBLE_ORDINAL), /* HID_USAGE_HAPTICS_WAVEFORM_RUMBLE */
- USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|HAPTICS_WAVEFORM_BUZZ_ORDINAL), /* HID_USAGE_HAPTICS_WAVEFORM_BUZZ */
- REPORT_COUNT(1, 2),
- REPORT_SIZE(1, 16),
- FEATURE(1, Data|Var|Abs|Null),
- END_COLLECTION,
-
- USAGE(1, HID_USAGE_HAPTICS_DURATION_LIST),
- COLLECTION(1, NamedArray),
- USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|HAPTICS_WAVEFORM_RUMBLE_ORDINAL), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_RUMBLE) */
- USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|HAPTICS_WAVEFORM_BUZZ_ORDINAL), /* 0 (HID_USAGE_HAPTICS_WAVEFORM_BUZZ) */
- REPORT_COUNT(1, 2),
- REPORT_SIZE(1, 16),
- FEATURE(1, Data|Var|Abs|Null),
- END_COLLECTION,
-
- USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_CUTOFF_TIME),
- UNIT(2, 0x1001), /* seconds */
- UNIT_EXPONENT(1, -3), /* 10^-3 */
- LOGICAL_MINIMUM(4, 0x00000000),
- LOGICAL_MAXIMUM(4, 0x7fffffff),
- REPORT_SIZE(1, 32),
- REPORT_COUNT(1, 1),
- FEATURE(1, Data|Var|Abs),
- /* reset global items */
- UNIT(1, 0), /* None */
- UNIT_EXPONENT(1, 0),
-
- REPORT_ID(1, haptics_waveform_report),
- USAGE(1, HID_USAGE_HAPTICS_INTENSITY),
- LOGICAL_MINIMUM(4, 0x00000000),
- LOGICAL_MAXIMUM(4, 0x0000ffff),
- REPORT_SIZE(1, 16),
- REPORT_COUNT(1, 1),
- OUTPUT(1, Data|Var|Abs),
-
- USAGE(1, HID_USAGE_HAPTICS_MANUAL_TRIGGER),
- LOGICAL_MINIMUM(1, HAPTICS_WAVEFORM_NONE_ORDINAL),
- LOGICAL_MAXIMUM(1, HAPTICS_WAVEFORM_LAST_ORDINAL),
- REPORT_SIZE(1, 8),
- REPORT_COUNT(1, 1),
- OUTPUT(1, Data|Var|Abs),
-
- USAGE(1, HID_USAGE_HAPTICS_REPEAT_COUNT),
- LOGICAL_MINIMUM(1, 0),
- LOGICAL_MAXIMUM(1, 1),
- REPORT_SIZE(1, 8),
- REPORT_COUNT(1, 1),
- OUTPUT(1, Data|Var|Abs),
- END_COLLECTION,
- };
const BYTE haptics_template[] =
{
USAGE_PAGE(2, HID_USAGE_PAGE_HAPTICS),
@@ -419,6 +352,7 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
USAGE(1, HID_USAGE_HAPTICS_WAVEFORM_LIST),
COLLECTION(1, NamedArray),
+ /* ordinal 1 and 2 are reserved for implicit waveforms */
USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|3),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
@@ -427,6 +361,7 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
USAGE(1, HID_USAGE_HAPTICS_DURATION_LIST),
COLLECTION(1, NamedArray),
+ /* ordinal 1 and 2 are reserved for implicit waveforms */
USAGE(4, (HID_USAGE_PAGE_ORDINAL<<16)|3),
REPORT_SIZE(1, 16),
REPORT_COUNT(1, 1),
@@ -456,13 +391,7 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
};
iface->hid_haptics.features_report = haptics_features_report;
- iface->hid_haptics.waveform_report = haptics_waveform_report;
iface->hid_haptics.intensity_report = haptics_intensity_report;
- iface->hid_haptics.features.waveform_list[0] = HID_USAGE_HAPTICS_WAVEFORM_RUMBLE;
- iface->hid_haptics.features.waveform_list[1] = HID_USAGE_HAPTICS_WAVEFORM_BUZZ;
- iface->hid_haptics.features.duration_list[0] = 0;
- iface->hid_haptics.features.duration_list[1] = 0;
- iface->hid_haptics.features.waveform_cutoff_time_ms = 1000;
iface->hid_haptics.features.rumble.waveform = HID_USAGE_HAPTICS_WAVEFORM_RUMBLE;
iface->hid_haptics.features.rumble.duration = 0;
iface->hid_haptics.features.rumble.cutoff_time_ms = 1000;
@@ -470,9 +399,6 @@ BOOL hid_device_add_haptics(struct unix_device *iface)
iface->hid_haptics.features.buzz.duration = 0;
iface->hid_haptics.features.buzz.cutoff_time_ms = 1000;
- if (!hid_report_descriptor_append(desc, waveforms_template, sizeof(waveforms_template)))
- return FALSE;
-
if (!hid_report_descriptor_append(desc, haptics_template, sizeof(haptics_template)))
return FALSE;
if (!hid_report_descriptor_append(desc, haptics_template, sizeof(haptics_template)))
@@ -1153,34 +1079,6 @@ static void hid_device_set_output_report(struct unix_device *iface, HID_XFER_PAC
io->Status = iface->hid_vtbl->haptics_start(iface, duration_ms, report->rumble_intensity, report->buzz_intensity);
}
}
- else if (packet->reportId == haptics->waveform_report)
- {
- struct hid_haptics_waveform *report = (struct hid_haptics_waveform *)(packet->reportBuffer + 1);
- UINT16 *rumble_intensity = haptics->waveform_intensity + HAPTICS_WAVEFORM_RUMBLE_ORDINAL;
- UINT16 *buzz_intensity = haptics->waveform_intensity + HAPTICS_WAVEFORM_BUZZ_ORDINAL;
- ULONG duration_ms;
-
- io->Information = sizeof(*report) + 1;
- assert(packet->reportBufferLen == io->Information);
-
- if (report->manual_trigger == 0 || report->manual_trigger > HAPTICS_WAVEFORM_LAST_ORDINAL)
- io->Status = STATUS_INVALID_PARAMETER;
- else
- {
- if (report->manual_trigger == HAPTICS_WAVEFORM_STOP_ORDINAL)
- {
- memset(haptics->waveform_intensity, 0, sizeof(haptics->waveform_intensity));
- io->Status = iface->hid_vtbl->haptics_stop(iface);
- }
- else
- {
- haptics->waveform_intensity[report->manual_trigger] = report->intensity;
- duration_ms = haptics->features.waveform_cutoff_time_ms;
- if (!report->repeat_count) io->Status = STATUS_SUCCESS;
- else io->Status = iface->hid_vtbl->haptics_start(iface, duration_ms, *rumble_intensity, *buzz_intensity);
- }
- }
- }
else if (packet->reportId == physical->device_control_report)
{
struct pid_device_control *report = (struct pid_device_control *)(packet->reportBuffer + 1);
@@ -1387,7 +1285,6 @@ static void hid_device_set_feature_report(struct unix_device *iface, HID_XFER_PA
io->Information = sizeof(*features) + 1;
assert(packet->reportBufferLen == io->Information);
- haptics->features.waveform_cutoff_time_ms = features->waveform_cutoff_time_ms;
haptics->features.rumble.cutoff_time_ms = features->rumble.cutoff_time_ms;
haptics->features.buzz.cutoff_time_ms = features->buzz.cutoff_time_ms;
io->Status = STATUS_SUCCESS;
diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h
index 081e57dc53d..0763d084823 100644
--- a/dlls/winebus.sys/unix_private.h
+++ b/dlls/winebus.sys/unix_private.h
@@ -123,21 +123,6 @@ struct hid_report_descriptor
BYTE next_report_id[3];
};
-/* HID spec uses None / Stop names for the first two implicit waveforms,
- * where Windows SDK headers use STOP / NULL for the corresponding HID
- * usage constants. We're not actually using the usages anyway are we
- * stick to the HID spec here.
- */
-enum haptics_waveform_ordinal
-{
- HAPTICS_WAVEFORM_NONE_ORDINAL = 1, /* implicit, not included in waveform_list / duration_list */
- HAPTICS_WAVEFORM_STOP_ORDINAL = 2, /* implicit, not included in waveform_list / duration_list */
- HAPTICS_WAVEFORM_RUMBLE_ORDINAL = 3,
- HAPTICS_WAVEFORM_BUZZ_ORDINAL = 4,
- HAPTICS_WAVEFORM_FIRST_ORDINAL = HAPTICS_WAVEFORM_RUMBLE_ORDINAL,
- HAPTICS_WAVEFORM_LAST_ORDINAL = HAPTICS_WAVEFORM_BUZZ_ORDINAL,
-};
-
#include "pshpack1.h"
struct hid_haptics_feature
{
@@ -148,9 +133,6 @@ struct hid_haptics_feature
struct hid_haptics_features
{
- WORD waveform_list[HAPTICS_WAVEFORM_LAST_ORDINAL - HAPTICS_WAVEFORM_FIRST_ORDINAL + 1];
- WORD duration_list[HAPTICS_WAVEFORM_LAST_ORDINAL - HAPTICS_WAVEFORM_FIRST_ORDINAL + 1];
- UINT waveform_cutoff_time_ms;
struct hid_haptics_feature rumble;
struct hid_haptics_feature buzz;
};
@@ -159,9 +141,7 @@ struct hid_haptics_features
struct hid_haptics
{
struct hid_haptics_features features;
- UINT16 waveform_intensity[HAPTICS_WAVEFORM_LAST_ORDINAL + 1];
BYTE features_report;
- BYTE waveform_report;
BYTE intensity_report;
};
--
2.35.1
More information about the wine-devel
mailing list