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
a41c5e05
Commit
a41c5e05
authored
Oct 04, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Implement PID effect control for UDEV lnxev devices.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f0f2fab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
4 deletions
+44
-4
bus_udev.c
dlls/winebus.sys/bus_udev.c
+44
-4
No files found.
dlls/winebus.sys/bus_udev.c
View file @
a41c5e05
...
...
@@ -812,6 +812,27 @@ static NTSTATUS lnxev_device_haptics_start(struct unix_device *iface, DWORD dura
return
STATUS_SUCCESS
;
}
static
NTSTATUS
lnxev_device_physical_effect_run
(
struct
lnxev_device
*
impl
,
BYTE
index
,
int
iterations
)
{
struct
input_event
ie
=
{
.
type
=
EV_FF
,
.
value
=
iterations
,
};
if
(
impl
->
effect_ids
[
index
]
<
0
)
return
STATUS_UNSUCCESSFUL
;
ie
.
code
=
impl
->
effect_ids
[
index
];
if
(
write
(
impl
->
base
.
device_fd
,
&
ie
,
sizeof
(
ie
))
==
-
1
)
{
WARN
(
"couldn't stop effect, write failed %d %s
\n
"
,
errno
,
strerror
(
errno
));
return
STATUS_UNSUCCESSFUL
;
}
return
STATUS_SUCCESS
;
}
static
NTSTATUS
lnxev_device_physical_device_control
(
struct
unix_device
*
iface
,
USAGE
control
)
{
struct
lnxev_device
*
impl
=
lnxev_impl_from_unix_device
(
iface
);
...
...
@@ -846,8 +867,12 @@ static NTSTATUS lnxev_device_physical_device_control(struct unix_device *iface,
return
STATUS_SUCCESS
;
}
case
PID_USAGE_DC_STOP_ALL_EFFECTS
:
FIXME
(
"stop all not implemented!
\n
"
);
return
STATUS_NOT_IMPLEMENTED
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
impl
->
effect_ids
);
++
i
)
{
if
(
impl
->
effect_ids
[
i
]
<
0
)
continue
;
lnxev_device_physical_effect_run
(
impl
,
i
,
0
);
}
return
STATUS_SUCCESS
;
case
PID_USAGE_DC_DEVICE_RESET
:
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
impl
->
effect_ids
);
++
i
)
{
...
...
@@ -871,9 +896,24 @@ static NTSTATUS lnxev_device_physical_device_control(struct unix_device *iface,
static
NTSTATUS
lnxev_device_physical_effect_control
(
struct
unix_device
*
iface
,
BYTE
index
,
USAGE
control
,
BYTE
iterations
)
{
FIXME
(
"iface %p, index %u, control %04x, iterations %u stub!
\n
"
,
iface
,
index
,
control
,
iterations
);
struct
lnxev_device
*
impl
=
lnxev_impl_from_unix_device
(
iface
);
NTSTATUS
status
;
return
STATUS_NOT_IMPLEMENTED
;
TRACE
(
"iface %p, index %u, control %04x, iterations %u.
\n
"
,
iface
,
index
,
control
,
iterations
);
switch
(
control
)
{
case
PID_USAGE_OP_EFFECT_START_SOLO
:
if
((
status
=
lnxev_device_physical_device_control
(
iface
,
PID_USAGE_DC_STOP_ALL_EFFECTS
)))
return
status
;
/* fallthrough */
case
PID_USAGE_OP_EFFECT_START
:
return
lnxev_device_physical_effect_run
(
impl
,
index
,
iterations
);
case
PID_USAGE_OP_EFFECT_STOP
:
return
lnxev_device_physical_effect_run
(
impl
,
index
,
0
);
}
return
STATUS_SUCCESS
;
}
static
const
struct
hid_device_vtbl
lnxev_device_vtbl
=
...
...
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