Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1200e9d4
Commit
1200e9d4
authored
Mar 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Use a physical collection for the HID input report.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e4105a71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
19 deletions
+29
-19
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+2
-2
bus_udev.c
dlls/winebus.sys/bus_udev.c
+1
-1
hid.c
dlls/winebus.sys/hid.c
+25
-15
unix_private.h
dlls/winebus.sys/unix_private.h
+1
-1
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
1200e9d4
...
...
@@ -279,7 +279,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface)
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
if
(
!
hid_device_begin_input_report
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
for
(
i
=
0
;
i
<
axis_count
;
i
++
)
...
...
@@ -333,7 +333,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface)
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
if
(
!
hid_device_begin_input_report
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_add_axes
(
iface
,
2
,
HID_USAGE_PAGE_GENERIC
,
left_axis_usages
,
...
...
dlls/winebus.sys/bus_udev.c
View file @
1200e9d4
...
...
@@ -665,7 +665,7 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
if
(
!
hid_device_begin_input_report
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
abs_count
=
0
;
...
...
dlls/winebus.sys/hid.c
View file @
1200e9d4
...
...
@@ -74,23 +74,21 @@ static BOOL hid_report_descriptor_append_usage(struct hid_report_descriptor *des
return
hid_report_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
}
BOOL
hid_device_begin_report_descriptor
(
struct
unix_device
*
iface
,
const
USAGE_AND_PAGE
*
device_usag
e
)
static
BOOL
hid_device_begin_collection
(
struct
hid_report_descriptor
*
desc
,
const
USAGE_AND_PAGE
*
usage
,
BYTE
typ
e
)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
const
BYTE
template
[]
=
{
USAGE_PAGE
(
2
,
device_
usage
->
UsagePage
),
USAGE
(
2
,
device_
usage
->
Usage
),
COLLECTION
(
1
,
Application
),
USAGE_PAGE
(
2
,
usage
->
UsagePage
),
USAGE
(
2
,
usage
->
Usage
),
COLLECTION
(
1
,
type
),
};
memset
(
desc
,
0
,
sizeof
(
*
desc
));
return
hid_report_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
}
BOOL
hid_device_end_report_descriptor
(
struct
unix_device
*
iface
)
static
BOOL
hid_device_end_collection
(
struct
hid_report_descriptor
*
desc
)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
static
const
BYTE
template
[]
=
{
END_COLLECTION
,
...
...
@@ -99,15 +97,27 @@ BOOL hid_device_end_report_descriptor(struct unix_device *iface)
return
hid_report_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
}
BOOL
hid_device_begin_input_report
(
struct
unix_device
*
iface
)
BOOL
hid_device_begin_report_descriptor
(
struct
unix_device
*
iface
,
const
USAGE_AND_PAGE
*
device_usage
)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
memset
(
desc
,
0
,
sizeof
(
*
desc
));
return
hid_device_begin_collection
(
desc
,
device_usage
,
Application
);
}
BOOL
hid_device_end_report_descriptor
(
struct
unix_device
*
iface
)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
return
hid_device_end_collection
(
desc
);
}
BOOL
hid_device_begin_input_report
(
struct
unix_device
*
iface
,
const
USAGE_AND_PAGE
*
physical_usage
)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
struct
hid_device_state
*
state
=
&
iface
->
hid_device_state
;
const
BYTE
report_id
=
++
desc
->
next_report_id
[
HidP_Input
];
const
BYTE
template
[]
=
{
COLLECTION
(
1
,
Report
),
REPORT_ID
(
1
,
report_id
),
REPORT_ID
(
1
,
report_id
),
};
if
(
state
->
report_len
)
...
...
@@ -118,6 +128,10 @@ BOOL hid_device_begin_input_report(struct unix_device *iface)
state
->
id
=
report_id
;
state
->
bit_size
+=
8
;
if
(
!
hid_device_begin_collection
(
desc
,
physical_usage
,
Physical
))
return
FALSE
;
return
hid_report_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
}
...
...
@@ -125,10 +139,6 @@ BOOL hid_device_end_input_report(struct unix_device *iface)
{
struct
hid_report_descriptor
*
desc
=
&
iface
->
hid_report_descriptor
;
struct
hid_device_state
*
state
=
&
iface
->
hid_device_state
;
static
const
BYTE
template
[]
=
{
END_COLLECTION
,
};
state
->
report_len
=
(
state
->
bit_size
+
7
)
/
8
;
if
(
!
(
state
->
report_buf
=
calloc
(
1
,
state
->
report_len
)))
return
FALSE
;
...
...
@@ -136,7 +146,7 @@ BOOL hid_device_end_input_report(struct unix_device *iface)
state
->
report_buf
[
0
]
=
state
->
id
;
state
->
last_report_buf
[
0
]
=
state
->
id
;
return
hid_
report_descriptor_append
(
desc
,
template
,
sizeof
(
template
)
);
return
hid_
device_end_collection
(
desc
);
}
static
BOOL
hid_device_add_button_count
(
struct
unix_device
*
iface
,
BYTE
count
)
...
...
dlls/winebus.sys/unix_private.h
View file @
1200e9d4
...
...
@@ -245,7 +245,7 @@ extern BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event) DEC
extern
BOOL
hid_device_begin_report_descriptor
(
struct
unix_device
*
iface
,
const
USAGE_AND_PAGE
*
device_usage
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_end_report_descriptor
(
struct
unix_device
*
iface
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_begin_input_report
(
struct
unix_device
*
iface
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_begin_input_report
(
struct
unix_device
*
iface
,
const
USAGE_AND_PAGE
*
physical_usage
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_end_input_report
(
struct
unix_device
*
iface
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_add_buttons
(
struct
unix_device
*
iface
,
USAGE
usage_page
,
USAGE
usage_min
,
USAGE
usage_max
)
DECLSPEC_HIDDEN
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment