diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-06-09 19:32:07 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-07 22:18:41 +0200 |
commit | 2fe046c38035db78610ffd0db48d8163a46cb252 (patch) | |
tree | 3a7c125338a403d04c976e7d72470e51f20fbbf1 /rbutil/rbutilqt/base/system.cpp | |
parent | 729b6e4f33419489415a6111bb98e5d95221a338 (diff) | |
download | rockbox-2fe046c38035db78610ffd0db48d8163a46cb252.tar.gz rockbox-2fe046c38035db78610ffd0db48d8163a46cb252.zip |
rbutil: Drop support for libusb0.
libusb1 is maintained and stable since years. No need to keep the old
implementation around.
Change-Id: I25a4c5643fc9a88eaad3e8f2f7e1dd705be080e0
Diffstat (limited to 'rbutil/rbutilqt/base/system.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/system.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp index 55e92908ab..c33a172eeb 100644 --- a/rbutil/rbutilqt/base/system.cpp +++ b/rbutil/rbutilqt/base/system.cpp | |||
@@ -46,11 +46,7 @@ | |||
46 | 46 | ||
47 | // Linux includes | 47 | // Linux includes |
48 | #if defined(Q_OS_LINUX) | 48 | #if defined(Q_OS_LINUX) |
49 | #if defined(LIBUSB1) | ||
50 | #include <libusb-1.0/libusb.h> | 49 | #include <libusb-1.0/libusb.h> |
51 | #else | ||
52 | #include <usb.h> | ||
53 | #endif | ||
54 | #include <mntent.h> | 50 | #include <mntent.h> |
55 | #endif | 51 | #endif |
56 | 52 | ||
@@ -245,7 +241,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
245 | // usb pid detection | 241 | // usb pid detection |
246 | LOG_INFO() << "Searching for USB devices"; | 242 | LOG_INFO() << "Searching for USB devices"; |
247 | #if defined(Q_OS_LINUX) | 243 | #if defined(Q_OS_LINUX) |
248 | #if defined(LIBUSB1) | ||
249 | libusb_device **devs; | 244 | libusb_device **devs; |
250 | if(libusb_init(NULL) != 0) { | 245 | if(libusb_init(NULL) != 0) { |
251 | LOG_ERROR() << "Initializing libusb-1 failed."; | 246 | LOG_ERROR() << "Initializing libusb-1 failed."; |
@@ -285,53 +280,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
285 | 280 | ||
286 | libusb_free_device_list(devs, 1); | 281 | libusb_free_device_list(devs, 1); |
287 | libusb_exit(NULL); | 282 | libusb_exit(NULL); |
288 | #else | ||
289 | usb_init(); | ||
290 | usb_find_busses(); | ||
291 | usb_find_devices(); | ||
292 | struct usb_bus *b; | ||
293 | b = usb_busses; | ||
294 | |||
295 | while(b) { | ||
296 | if(b->devices) { | ||
297 | struct usb_device *u; | ||
298 | u = b->devices; | ||
299 | while(u) { | ||
300 | uint32_t id; | ||
301 | id = u->descriptor.idVendor << 16 | u->descriptor.idProduct; | ||
302 | // get identification strings | ||
303 | usb_dev_handle *dev; | ||
304 | QString name; | ||
305 | char string[256]; | ||
306 | int res; | ||
307 | dev = usb_open(u); | ||
308 | if(dev) { | ||
309 | if(u->descriptor.iManufacturer) { | ||
310 | res = usb_get_string_simple(dev, u->descriptor.iManufacturer, | ||
311 | string, sizeof(string)); | ||
312 | if(res > 0) | ||
313 | name += QString::fromLatin1(string) + " "; | ||
314 | } | ||
315 | if(u->descriptor.iProduct) { | ||
316 | res = usb_get_string_simple(dev, u->descriptor.iProduct, | ||
317 | string, sizeof(string)); | ||
318 | if(res > 0) | ||
319 | name += QString::fromLatin1(string); | ||
320 | } | ||
321 | usb_close(dev); | ||
322 | } | ||
323 | if(name.isEmpty()) name = tr("(no description available)"); | ||
324 | |||
325 | if(id) { | ||
326 | usbids.insertMulti(id, name); | ||
327 | LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; | ||
328 | } | ||
329 | u = u->next; | ||
330 | } | ||
331 | } | ||
332 | b = b->next; | ||
333 | } | ||
334 | #endif | ||
335 | #endif | 283 | #endif |
336 | 284 | ||
337 | #if defined(Q_OS_MACX) | 285 | #if defined(Q_OS_MACX) |