Commit Graph

9 Commits

Author SHA1 Message Date
Harald Welte fca15ebf99 osmo_libusb: Fix NULL check in osmo_usb_removed_cb()
Thread 1 "simtrace2-tool" received signal SIGSEGV, Segmentation fault.
0x00007ffff73dd2a0 in llist_del (entry=0x0) at ../include/osmocom/core/linuxlist.h:130
130             __llist_del(entry->prev, entry->next);
(gdb) bt

Change-Id: I2b7ab8dddd69453826053663dd5589a941c2e47d
2022-01-25 16:23:45 +01:00
Oliver Smith 04bfb7165b treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-12-14 12:44:03 +01:00
Harald Welte 3edd70c1f1 usb: Add osmo_libusb_find_open_claim() all-in-one API
This function offers the highest level of API among all libosmousb
helper functions. It is intended as a one-stop shop for everything
related to grabbing an interface.

Change-Id: I748ded6cc7b73a73625588bd7a34a017a905b6bf
2020-05-12 05:43:21 +00:00
Vadim Yanitskiy 775a6b0ddd osmo_libusb: check return value of osmo_fd_register()
Most likely, we should not assert() here, but let's at least log
an error message in case if osmo_fd_register() fails.

Change-Id: Ia20755ec12ee9fb0eba8322551642a96e68e1570
Related: CID#206572
2020-02-09 04:27:50 +07:00
Harald Welte e51cbe4cc7 osmo_libusb: Check return of libusb_get_string_descriptor_ascii()
Change-Id: Ifc0133737627a8277635f8f3662b3f6e922be149
Closes: CID#207713
2020-01-18 21:50:47 +01:00
Harald Welte c45787bf5c usb: Add osmo_libusb_find_matching_dev_{path,serial}
Thise two helper functions allow the user application to find
a unique match among the existing USB devices, using either a user-
provided iSerial string, or a user-provided physical USB path.

Change-Id: I8ff3fb3e1a77e10cb313473480ce5e7673749a93
2020-01-12 11:52:09 +01:00
Harald Welte 424eac8b6a usb: Use OSMO_STRLCPY where appropriate
Change-Id: I6b2a90fd8f4b042a1e38dbf8e99414a94a290375
2020-01-06 18:12:14 +01:00
Harald Welte d462e3fa7b usb: Import a variety of libusb utility functions from simtrace
Those functions were originally developed as part of simtrace; let's
import them to libosmousb as they are truly generic.

Change-Id: I2c18b938e4e1ea5b8a521a386f00db3a7389e47a
Related: OS#4299
2019-12-16 00:17:27 +01:00
Harald Welte da432cdc35 libosmocore libusb integration
Osmocom applications typically use libosmocore select.[ch] event loop
code as their main event dispatch mechanism.  When they want to deal
with libusb in a non-blocking/asynchronous way, they need to integrate
libusb into that select().

The new libosmousb is doing exactly that: Providing a shared utility
library for Osmocom programs that wish to use libusb.  This is useful
for example in simtrace2 host utilitie as well as osmo-e1d.

Change-Id: I656a1a38cbb5b1f3a9145d2869d3b4d0adefcae3
Closes: OS#4299
2019-12-16 00:17:27 +01:00