diff options
| author | Nobuo Iwata <nobuo.iwata@fujixerox.co.jp> | 2016-03-22 03:31:03 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-03 17:32:07 -0400 |
| commit | e66fa8b08fbd87f375f964f1eaa1f5dfab9dc0c4 (patch) | |
| tree | 629abb3d33b384bcd484cb52c72937a43da7ee59 | |
| parent | 128f8b3d77149e9f38fb6f52931cf791155d277a (diff) | |
usbip: adding names db to port operation
Adding names database to port command.
BEFORE) 'unknown' for vendor and product string.
Imported USB devices
====================
Port 00: <Port in Use> at Low Speed(1.5Mbps)
unknown vendor : unknown product (03f0:0224)
3-1 -> usbip://10.0.2.15:3240/5-1
-> remote bus/dev 005/002
AFTER) Most vendor string will be converted.
Imported USB devices
====================
Port 00: <Port in Use> at Low Speed(1.5Mbps)
Hewlett-Packard : unknown product (03f0:0224)
3-1 -> usbip://10.0.2.15:3240/5-1
-> remote bus/dev 005/002
Signed-off-by: Nobuo Iwata <nobuo.iwata@fujixerox.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | tools/usb/usbip/src/usbip_port.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/usb/usbip/src/usbip_port.c b/tools/usb/usbip/src/usbip_port.c index a2e884fd9226..7bd74fb3a9cd 100644 --- a/tools/usb/usbip/src/usbip_port.c +++ b/tools/usb/usbip/src/usbip_port.c | |||
| @@ -22,10 +22,13 @@ static int list_imported_devices(void) | |||
| 22 | struct usbip_imported_device *idev; | 22 | struct usbip_imported_device *idev; |
| 23 | int ret; | 23 | int ret; |
| 24 | 24 | ||
| 25 | if (usbip_names_init(USBIDS_FILE)) | ||
| 26 | err("failed to open %s", USBIDS_FILE); | ||
| 27 | |||
| 25 | ret = usbip_vhci_driver_open(); | 28 | ret = usbip_vhci_driver_open(); |
| 26 | if (ret < 0) { | 29 | if (ret < 0) { |
| 27 | err("open vhci_driver"); | 30 | err("open vhci_driver"); |
| 28 | return -1; | 31 | goto err_names_free; |
| 29 | } | 32 | } |
| 30 | 33 | ||
| 31 | printf("Imported USB devices\n"); | 34 | printf("Imported USB devices\n"); |
| @@ -35,13 +38,19 @@ static int list_imported_devices(void) | |||
| 35 | idev = &vhci_driver->idev[i]; | 38 | idev = &vhci_driver->idev[i]; |
| 36 | 39 | ||
| 37 | if (usbip_vhci_imported_device_dump(idev) < 0) | 40 | if (usbip_vhci_imported_device_dump(idev) < 0) |
| 38 | ret = -1; | 41 | goto err_driver_close; |
| 39 | } | 42 | } |
| 40 | 43 | ||
| 41 | usbip_vhci_driver_close(); | 44 | usbip_vhci_driver_close(); |
| 45 | usbip_names_free(); | ||
| 42 | 46 | ||
| 43 | return ret; | 47 | return ret; |
| 44 | 48 | ||
| 49 | err_driver_close: | ||
| 50 | usbip_vhci_driver_close(); | ||
| 51 | err_names_free: | ||
| 52 | usbip_names_free(); | ||
| 53 | return -1; | ||
| 45 | } | 54 | } |
| 46 | 55 | ||
| 47 | int usbip_port_show(__attribute__((unused)) int argc, | 56 | int usbip_port_show(__attribute__((unused)) int argc, |
