Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add g_usb_device_get_created() to better detect emulated replug | Richard Hughes | 2023-02-01 | 3 | -0/+45 |
| | |||||
* | Reduce the debugging level when emulating firmware | Richard Hughes | 2023-01-27 | 4 | -4/+18 |
| | |||||
* | trivial: Export the gusb-device-event.h header | Richard Hughes | 2023-01-26 | 1 | -0/+1 |
| | |||||
* | Add g_usb_device_clear_events() for future use | Richard Hughes | 2023-01-25 | 3 | -0/+19 |
| | |||||
* | Emit remove devices with matching tags when loading contexts | Richard Hughes | 2023-01-24 | 1 | -3/+12 |
| | | | | | If a program, say fwupd, has references to existing devices it is probably not expected for the physical backing device to just vanish. | ||||
* | Add g_usb_device_get_tags() for future use | Richard Hughes | 2023-01-24 | 3 | -0/+21 |
| | |||||
* | Add g_usb_device_is_emulated() for future use | Richard Hughes | 2023-01-24 | 3 | -0/+20 |
| | |||||
* | Add g_usb_device_remove_tag() for future use | Richard Hughes | 2023-01-23 | 4 | -0/+41 |
| | |||||
* | trivial: Fix -Wdeclaration-after-statement | Richard Hughes | 2023-01-23 | 1 | -3/+2 |
| | |||||
* | Save removed devices in JSON dump only when requested | Frédéric Danis | 2023-01-19 | 2 | -4/+7 |
| | | | | | Removed devices should not be saved when trying dump events per update phase. | ||||
* | Load GUsb endpoints when loading interface | Frédéric Danis | 2023-01-19 | 1 | -0/+15 |
| | |||||
* | Fix _g_usb_interface_save without endpoints | Frédéric Danis | 2023-01-19 | 1 | -1/+1 |
| | | | | | when the g_usb_interface is created from _g_usb_device_load(), self->endpoints may not be initialized. | ||||
* | Fix g_usb_interface_finalize without endpoints | Frédéric Danis | 2023-01-11 | 1 | -1/+2 |
| | |||||
* | trivial: Be less verbose | Richard Hughes | 2022-12-09 | 1 | -3/+1 |
| | |||||
* | Work around a libusb1 bug which causes devices to appear in the list twice | Richard Hughes | 2022-12-09 | 1 | -0/+6 |
| | |||||
* | trivial: Fix up a gtk-doc comment | Richard Hughes | 2022-10-26 | 1 | -1/+1 |
| | |||||
* | Export g_usb_device_has_tag() | Richard Hughes | 2022-10-26 | 5 | -6/+23 |
| | |||||
* | Do not call the hotplug callback with the mutex held | Richard Hughes | 2022-10-17 | 1 | -6/+22 |
| | | | | | This fixes a regression introduced in 0ff5cca6 which causes a rare deadlock in fwupd. | ||||
* | Revert "Use GRecMutex to avoid a single-threaded lockup" | Richard Hughes | 2022-10-17 | 1 | -14/+5 |
| | | | | | | This reverts commit cfb40102b0985d52cbd5d9348dedd1a4cc06b10c -- it's the wrong fix as the hotplug callback is being called by two different threads; even a recursive mutex isn't going to save us there. | ||||
* | Use GRecMutex to avoid a single-threaded lockup | Richard Hughes | 2022-10-12 | 1 | -5/+14 |
| | | | | | | | | | If we call libusb_get_bos_descriptor() in the hotplug device-add handler then we eventually call libusb_handle_events_completed() which can run handle_events -- which might emit devices. Using a mutex that's safe for recursing prevents the deadlock. This fixes half the problem when getting descriptors on deeply nested USB hubs. | ||||
* | Allow loading and saving only devices with specific tags | Richard Hughes | 2022-09-13 | 3 | -0/+60 |
| | | | | | This would allow us, for example, to only load devices in bootloader or runtime phases. | ||||
* | trivial: Don't return -1 for failure for a gboolean | Richard Hughes | 2022-09-13 | 1 | -1/+1 |
| | |||||
* | trivial: Fix up clang-format issue | Richard Hughes | 2022-09-13 | 1 | -1/+1 |
| | |||||
* | Allow adding tags to the JSON device event | Richard Hughes | 2022-09-13 | 4 | -0/+76 |
| | | | | This allows us to see which phase of the emulation should be used. | ||||
* | Include the created time in the JSON event | Richard Hughes | 2022-09-13 | 1 | -0/+10 |
| | |||||
* | trivial: Remove existing devices when loading a context | Richard Hughes | 2022-09-13 | 1 | -0/+4 |
| | |||||
* | Include removed devices in the JSON dump | Richard Hughes | 2022-09-13 | 1 | -0/+13 |
| | | | | This is needed to emulate devices with bootloader modes. | ||||
* | trivial: Fix some docs warnings when compiling the tarball | Richard Hughes | 2022-09-12 | 3 | -4/+5 |
| | |||||
* | Allow emulating failed events | Richard Hughes | 2022-09-12 | 5 | -0/+80 |
| | | | | | This is required to emulate devices that just reset (without completing the current transfer) when asked to reset. | ||||
* | Do not copy event data when not-required | Richard Hughes | 2022-09-10 | 1 | -3/+48 |
| | | | | | This will prevent crashes if the caller is casting from a const buffer to a mutable buffer. | ||||
* | trivial: Be more careful with buffers in case the usb.ids file format changes | Richard Hughes | 2022-09-09 | 1 | -1/+4 |
| | |||||
* | Ignore usb.ids classes, subclasses and protocols | Richard Hughes | 2022-09-09 | 1 | -0/+4 |
| | |||||
* | Fix loading events using _g_usb_device_event_load() | Richard Hughes | 2022-09-09 | 1 | -1/+1 |
| | |||||
* | trivial: Fix two -Wunused-variable warnings | Richard Hughes | 2022-09-09 | 1 | -0/+4 |
| | |||||
* | trivial: Fix the ColorMunki self tests | Richard Hughes | 2022-09-09 | 1 | -4/+3 |
| | | | | PVS: Converting type 'gssize' to type 'gboolean' can lead to a loss of high-order bits. | ||||
* | Save device events when required | Richard Hughes | 2022-09-08 | 9 | -6/+804 |
| | | | | | | This allows us to simulate an entire context of devices, simulating responses as if the hardware is connected. This allows building rich device-specific unit tests in programs like fwupd, without having to have the hardware attached. | ||||
* | trivial: Update the ColorHug test to reflect reality | Richard Hughes | 2022-09-06 | 1 | -1/+1 |
| | |||||
* | trivial: Ignore more requests when emulating a device | Richard Hughes | 2022-09-06 | 1 | -0/+20 |
| | |||||
* | trivial: Use a unique JSON key name for the ID | Richard Hughes | 2022-09-06 | 1 | -4/+5 |
| | |||||
* | trivial: Use a boolean flag for cache control | Richard Hughes | 2022-09-06 | 1 | -2/+10 |
| | | | | There's no point keep asking the device for BOS descriptors when it has none. | ||||
* | trivial: Check the handle before getting BOS descriptors | Richard Hughes | 2022-09-06 | 1 | -0/+4 |
| | |||||
* | trivial: Fix up some docgen headers | Richard Hughes | 2022-09-06 | 2 | -25/+1 |
| | |||||
* | Skip some functionality when emulating | Richard Hughes | 2022-09-05 | 1 | -0/+12 |
| | |||||
* | Include the platform ID in the JSON file | Richard Hughes | 2022-09-05 | 1 | -0/+10 |
| | |||||
* | Serialize the GUsbDevice to and from JSON format | Richard Hughes | 2022-09-05 | 14 | -11/+640 |
| | | | | This allows us to write tests that mock up entire devices. | ||||
* | Cache the list of interfaces and descriptors | Richard Hughes | 2022-09-05 | 3 | -94/+104 |
| | | | | | This can speed up device enumeration, and also allows us to emulate the interfaces or descriptors in the future. | ||||
* | trivial: Use @self for instance data | Richard Hughes | 2022-09-05 | 10 | -482/+471 |
| | |||||
* | Use G_DECLARE_DERIVABLE_TYPE to reduce boilerplate | Richard Hughes | 2022-09-05 | 10 | -217/+190 |
| | |||||
* | trivial: Use @self for instance data | Richard Hughes | 2022-09-04 | 4 | -115/+114 |
| | |||||
* | Reformat the code using clang-format | Richard Hughes | 2022-09-04 | 27 | -1990/+1923 |
| | | | | | This frees up mental energy when reviewing patches and is something I should have done a long time ago. |