Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Chromium OS EC devices #249

Merged
merged 8 commits into from
Jun 16, 2024
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ preload_lib = shared_library('umockdev-preload',
'src/ioctl_tree.c'],
c_args: ['-fvisibility=default'],
version: '0.0.0',
dependencies: [dl, pthread],
dependencies: [dl, glib, pthread],
martinpitt marked this conversation as resolved.
Show resolved Hide resolved
install: true)

#
Expand Down
6 changes: 2 additions & 4 deletions src/ioctl_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <stdint.h>
#include <assert.h>
#include <errno.h>
#include <glib.h>
#include <linux/ioctl.h>
#include <linux/usbdevice_fs.h>
#include <linux/input.h>
Expand All @@ -32,9 +33,6 @@
#include "cros_ec.h"
#include "ioctl_tree.h"

#define TRUE 1
#define FALSE 0

#define UNUSED __attribute__ ((unused))


Expand Down Expand Up @@ -910,7 +908,7 @@ cros_ec_ioctl_get_data_size(IOCTL_REQUEST_TYPE _id, const void *data)
{
const struct cros_ec_command_v2 *s_cmd = (struct cros_ec_command_v2 *)data;

return sizeof(struct cros_ec_command_v2) + s_cmd->insize;
return sizeof(struct cros_ec_command_v2) + GUINT32_FROM_LE(s_cmd->insize);
martinpitt marked this conversation as resolved.
Show resolved Hide resolved
}

ioctl_type ioctl_db[] = {
Expand Down