Thomas Heijligen submitted this change.

View Change



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved
tests: Add wrappers for libusb_(attach|detach)_kernel_driver

Change-Id: Ia463824a209db65e82ccfbf320368b2ce82eb36f
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67079
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M tests/libusb_wraps.c
M tests/libusb_wraps.h
M tests/meson.build
3 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/tests/libusb_wraps.c b/tests/libusb_wraps.c
index 4e68ba7..85bb963 100644
--- a/tests/libusb_wraps.c
+++ b/tests/libusb_wraps.c
@@ -46,6 +46,18 @@
return 0;
}

+int __wrap_libusb_detach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
+{
+ LOG_ME;
+ return 0;
+}
+
+int __wrap_libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
+{
+ LOG_ME;
+ return 0;
+}
+
ssize_t __wrap_libusb_get_device_list(libusb_context *ctx, libusb_device ***list)
{
LOG_ME;
diff --git a/tests/libusb_wraps.h b/tests/libusb_wraps.h
index e42c538..f7e4daf 100644
--- a/tests/libusb_wraps.h
+++ b/tests/libusb_wraps.h
@@ -23,6 +23,8 @@
int __wrap_libusb_init(libusb_context **ctx);
int __wrap_libusb_open(libusb_device *dev, libusb_device_handle **devh);
int __wrap_libusb_set_auto_detach_kernel_driver(libusb_device_handle *devh, int enable);
+int __wrap_libusb_detach_kernel_driver(libusb_device_handle *dev_handle, int interface_number);
+int __wrap_libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int interface_number);
ssize_t __wrap_libusb_get_device_list(libusb_context *ctx, libusb_device ***list);
void __wrap_libusb_free_device_list(libusb_device **list, int unref_devices);
uint8_t __wrap_libusb_get_bus_number(libusb_device *dev);
diff --git a/tests/meson.build b/tests/meson.build
index c0e2392..2f4e33d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -84,6 +84,8 @@
'-Wl,--wrap=libusb_init',
'-Wl,--wrap=libusb_open',
'-Wl,--wrap=libusb_set_auto_detach_kernel_driver',
+ '-Wl,--wrap=libusb_detach_kernel_driver',
+ '-Wl,--wrap=libusb_attach_kernel_driver',
'-Wl,--wrap=libusb_get_device_list',
'-Wl,--wrap=libusb_free_device_list',
'-Wl,--wrap=libusb_get_bus_number',

To view, visit change 67079. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia463824a209db65e82ccfbf320368b2ce82eb36f
Gerrit-Change-Number: 67079
Gerrit-PatchSet: 4
Gerrit-Owner: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Alexander Goncharov <chat@joursoir.net>
Gerrit-MessageType: merged