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
e4105a71
Commit
e4105a71
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: Pass USAGE_AND_PAGE to hid_device_begin_report_descriptor.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9d2c868d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
28 deletions
+32
-28
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+4
-2
bus_udev.c
dlls/winebus.sys/bus_udev.c
+20
-19
hid.c
dlls/winebus.sys/hid.c
+3
-4
unix_private.h
dlls/winebus.sys/unix_private.h
+1
-1
unixlib.c
dlls/winebus.sys/unixlib.c
+4
-2
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
e4105a71
...
...
@@ -229,6 +229,7 @@ static BOOL descriptor_add_haptic(struct sdl_device *impl)
static
NTSTATUS
build_joystick_report_descriptor
(
struct
unix_device
*
iface
)
{
const
USAGE_AND_PAGE
device_usage
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_JOYSTICK
};
static
const
USAGE_AND_PAGE
absolute_usages
[]
=
{
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_X
},
...
...
@@ -275,7 +276,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface)
hat_count
=
pSDL_JoystickNumHats
(
impl
->
sdl_joystick
);
button_count
=
pSDL_JoystickNumButtons
(
impl
->
sdl_joystick
);
if
(
!
hid_device_begin_report_descriptor
(
iface
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_JOYSTICK
))
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
...
...
@@ -321,6 +322,7 @@ static NTSTATUS build_joystick_report_descriptor(struct unix_device *iface)
static
NTSTATUS
build_controller_report_descriptor
(
struct
unix_device
*
iface
)
{
const
USAGE_AND_PAGE
device_usage
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_GAMEPAD
};
static
const
USAGE
left_axis_usages
[]
=
{
HID_USAGE_GENERIC_X
,
HID_USAGE_GENERIC_Y
};
static
const
USAGE
right_axis_usages
[]
=
{
HID_USAGE_GENERIC_RX
,
HID_USAGE_GENERIC_RY
};
static
const
USAGE
trigger_axis_usages
[]
=
{
HID_USAGE_GENERIC_Z
,
HID_USAGE_GENERIC_RZ
};
...
...
@@ -328,7 +330,7 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface)
ULONG
i
,
button_count
=
SDL_CONTROLLER_BUTTON_MAX
-
1
;
C_ASSERT
(
SDL_CONTROLLER_AXIS_MAX
==
6
);
if
(
!
hid_device_begin_report_descriptor
(
iface
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_GAMEPAD
))
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
...
...
dlls/winebus.sys/bus_udev.c
View file @
e4105a71
...
...
@@ -555,16 +555,16 @@ static struct base_device *find_device_from_syspath(const char *path)
#define test_bit(arr,bit) (((BYTE*)(arr))[(bit)>>3]&(1<<((bit)&7)))
static
const
BYTE
*
what_am_I
(
struct
udev_device
*
dev
)
static
const
USAGE_AND_PAGE
*
what_am_I
(
struct
udev_device
*
dev
,
int
fd
)
{
static
const
BYTE
Unknown
[
2
]
=
{
HID_USAGE_PAGE_GENERIC
,
0
};
static
const
BYTE
Mouse
[
2
]
=
{
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_MOUSE
};
static
const
BYTE
Keyboard
[
2
]
=
{
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYBOARD
};
static
const
BYTE
Gamepad
[
2
]
=
{
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_GAMEPAD
};
static
const
BYTE
Keypad
[
2
]
=
{
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYPAD
};
static
const
BYTE
Tablet
[
2
]
=
{
HID_USAGE_PAGE_DIGITIZER
,
HID_USAGE_DIGITIZER_PEN
};
static
const
BYTE
Touchscreen
[
2
]
=
{
HID_USAGE_PAGE_DIGITIZER
,
HID_USAGE_DIGITIZER_TOUCH_SCREEN
};
static
const
BYTE
Touchpad
[
2
]
=
{
HID_USAGE_PAGE_DIGITIZER
,
HID_USAGE_DIGITIZER_TOUCH_PAD
};
static
const
USAGE_AND_PAGE
Unknown
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
0
};
static
const
USAGE_AND_PAGE
Mouse
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_MOUSE
};
static
const
USAGE_AND_PAGE
Keyboard
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_KEYBOARD
};
static
const
USAGE_AND_PAGE
Gamepad
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_GAMEPAD
};
static
const
USAGE_AND_PAGE
Keypad
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_KEYPAD
};
static
const
USAGE_AND_PAGE
Tablet
=
{.
UsagePage
=
HID_USAGE_PAGE_DIGITIZER
,
.
Usage
=
HID_USAGE_DIGITIZER_PEN
};
static
const
USAGE_AND_PAGE
Touchscreen
=
{.
UsagePage
=
HID_USAGE_PAGE_DIGITIZER
,
.
Usage
=
HID_USAGE_DIGITIZER_TOUCH_SCREEN
};
static
const
USAGE_AND_PAGE
Touchpad
=
{.
UsagePage
=
HID_USAGE_PAGE_DIGITIZER
,
.
Usage
=
HID_USAGE_DIGITIZER_TOUCH_PAD
};
struct
udev_device
*
parent
=
dev
;
...
...
@@ -572,23 +572,24 @@ static const BYTE* what_am_I(struct udev_device *dev)
while
(
parent
)
{
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_MOUSE"
))
return
Mouse
;
return
&
Mouse
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_KEYBOARD"
))
return
Keyboard
;
return
&
Keyboard
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_JOYSTICK"
))
return
Gamepad
;
return
&
Gamepad
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_KEY"
))
return
Keypad
;
return
&
Keypad
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_TOUCHPAD"
))
return
Touchpad
;
return
&
Touchpad
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_TOUCHSCREEN"
))
return
Touchscreen
;
return
&
Touchscreen
;
else
if
(
udev_device_get_property_value
(
parent
,
"ID_INPUT_TABLET"
))
return
Tablet
;
return
&
Tablet
;
parent
=
udev_device_get_parent_with_subsystem_devtype
(
parent
,
"input"
,
NULL
);
}
return
Unknown
;
return
&
Unknown
;
}
static
INT
count_buttons
(
int
device_fd
,
BYTE
*
map
)
...
...
@@ -642,8 +643,8 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d
USHORT
count
=
0
;
USAGE
usages
[
16
];
INT
i
,
button_count
,
abs_count
,
rel_count
,
hat_count
;
const
BYTE
*
device_usage
=
what_am_I
(
dev
);
struct
lnxev_device
*
impl
=
lnxev_impl_from_unix_device
(
iface
);
const
USAGE_AND_PAGE
device_usage
=
*
what_am_I
(
dev
,
impl
->
base
.
device_fd
);
if
(
ioctl
(
impl
->
base
.
device_fd
,
EVIOCGBIT
(
EV_REL
,
sizeof
(
relbits
)),
relbits
)
==
-
1
)
{
...
...
@@ -661,7 +662,7 @@ static NTSTATUS build_report_descriptor(struct unix_device *iface, struct udev_d
memset
(
ffbits
,
0
,
sizeof
(
ffbits
));
}
if
(
!
hid_device_begin_report_descriptor
(
iface
,
device_usage
[
0
],
device_usage
[
1
]
))
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_begin_input_report
(
iface
))
...
...
dlls/winebus.sys/hid.c
View file @
e4105a71
...
...
@@ -74,15 +74,14 @@ 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
,
USAGE
usage_page
,
USAGE
usage
)
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
;
const
BYTE
template
[]
=
{
USAGE_PAGE
(
2
,
usage_p
age
),
USAGE
(
2
,
u
sage
),
USAGE_PAGE
(
2
,
device_usage
->
UsageP
age
),
USAGE
(
2
,
device_usage
->
U
sage
),
COLLECTION
(
1
,
Application
),
USAGE
(
1
,
0
),
};
memset
(
desc
,
0
,
sizeof
(
*
desc
));
...
...
dlls/winebus.sys/unix_private.h
View file @
e4105a71
...
...
@@ -242,7 +242,7 @@ extern BOOL bus_event_queue_input_report(struct list *queue, struct unix_device
BYTE
*
report
,
USHORT
length
)
DECLSPEC_HIDDEN
;
extern
BOOL
bus_event_queue_pop
(
struct
list
*
queue
,
struct
bus_event
*
event
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_device_begin_report_descriptor
(
struct
unix_device
*
iface
,
USAGE
usage_page
,
USAGE
usage
)
DECLSPEC_HIDDEN
;
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
;
...
...
dlls/winebus.sys/unixlib.c
View file @
e4105a71
...
...
@@ -87,7 +87,8 @@ static void mouse_destroy(struct unix_device *iface)
static
NTSTATUS
mouse_start
(
struct
unix_device
*
iface
)
{
if
(
!
hid_device_begin_report_descriptor
(
iface
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_MOUSE
))
const
USAGE_AND_PAGE
device_usage
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_MOUSE
};
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_add_buttons
(
iface
,
HID_USAGE_PAGE_BUTTON
,
1
,
3
))
return
STATUS_NO_MEMORY
;
...
...
@@ -176,7 +177,8 @@ static void keyboard_destroy(struct unix_device *iface)
static
NTSTATUS
keyboard_start
(
struct
unix_device
*
iface
)
{
if
(
!
hid_device_begin_report_descriptor
(
iface
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYBOARD
))
const
USAGE_AND_PAGE
device_usage
=
{.
UsagePage
=
HID_USAGE_PAGE_GENERIC
,
.
Usage
=
HID_USAGE_GENERIC_KEYBOARD
};
if
(
!
hid_device_begin_report_descriptor
(
iface
,
&
device_usage
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_device_add_buttons
(
iface
,
HID_USAGE_PAGE_KEYBOARD
,
0
,
101
))
return
STATUS_NO_MEMORY
;
...
...
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