Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e66fa8b0 authored by Nobuo Iwata's avatar Nobuo Iwata Committed by Greg Kroah-Hartman
Browse files

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: default avatarNobuo Iwata <nobuo.iwata@fujixerox.co.jp>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 128f8b3d
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -22,10 +22,13 @@ static int list_imported_devices(void)
	struct usbip_imported_device *idev;
	struct usbip_imported_device *idev;
	int ret;
	int ret;


	if (usbip_names_init(USBIDS_FILE))
		err("failed to open %s", USBIDS_FILE);

	ret = usbip_vhci_driver_open();
	ret = usbip_vhci_driver_open();
	if (ret < 0) {
	if (ret < 0) {
		err("open vhci_driver");
		err("open vhci_driver");
		return -1;
		goto err_names_free;
	}
	}


	printf("Imported USB devices\n");
	printf("Imported USB devices\n");
@@ -35,13 +38,19 @@ static int list_imported_devices(void)
		idev = &vhci_driver->idev[i];
		idev = &vhci_driver->idev[i];


		if (usbip_vhci_imported_device_dump(idev) < 0)
		if (usbip_vhci_imported_device_dump(idev) < 0)
			ret = -1;
			goto err_driver_close;
	}
	}


	usbip_vhci_driver_close();
	usbip_vhci_driver_close();
	usbip_names_free();


	return ret;
	return ret;


err_driver_close:
	usbip_vhci_driver_close();
err_names_free:
	usbip_names_free();
	return -1;
}
}


int usbip_port_show(__attribute__((unused)) int argc,
int usbip_port_show(__attribute__((unused)) int argc,