Beispiel #1
0
static int use_device_by_usbip(char *busid)
{
	int ret;

	ret = unbind(busid);
	if (ret < 0) {
		dbg("unbind drivers of %s, failed", busid);
		return -1;
	}

	ret = modify_match_busid(busid, 1);
	if (ret < 0) {
		dbg("add %s to match_busid, failed", busid);
		return -1;
	}

	ret = bind_to_usbip(busid);
	if (ret < 0) {
		dbg("bind usbip to %s, failed", busid);
		modify_match_busid(busid, 0);
		return -1;
	}

	dbg("bind %s complete!", busid);

	return 0;
}
Beispiel #2
0
static int use_device_by_usbip(char *busid)
{
	int ret;

	ret = bind_to_usbip(busid);
	if (ret < 0) {
		errorToApp(sock_USBIPAPP, "bind usbip, failed");
		return -1;
	}

	printToApp(sock_USBIPAPP, "bind to usbip, complete!");

	return 0;
}