Lines Matching +full:host +full:- +full:port

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * 2005-2007 Takahiro Hirofuchi
5 * Copyright (C) 2015-2016 Samsung Electronics
29 " -r, --remote=<host> The machine with exported USB devices\n"
30 " -b, --busid=<busid> Busid of the device on <host>\n"
31 " -d, --device=<devid> Id of the virtual UDC on <host>\n";
39 static int record_connection(char *host, char *port, char *busid, int rhport) in record_connection() argument
54 return -1; in record_connection()
56 return -1; in record_connection()
58 return -1; in record_connection()
61 snprintf(path, PATH_MAX, VHCI_STATE_PATH"/port%d", rhport); in record_connection()
65 return -1; in record_connection()
68 host, port, busid); in record_connection()
73 return -1; in record_connection()
84 int port; in import_device() local
85 uint32_t speed = udev->speed; in import_device()
94 port = usbip_vhci_get_free_port(speed); in import_device()
95 if (port < 0) { in import_device()
96 err("no free port"); in import_device()
100 dbg("got free port %d", port); in import_device()
102 rc = usbip_vhci_attach_device(port, sockfd, udev->busnum, in import_device()
103 udev->devnum, udev->speed); in import_device()
112 return port; in import_device()
117 return -1; in import_device()
135 return -1; in query_import_device()
138 strncpy(request.busid, busid, SYSFS_BUS_ID_SIZE-1); in query_import_device()
145 return -1; in query_import_device()
151 err("Attach Request for %s failed - %s\n", in query_import_device()
153 return -1; in query_import_device()
159 return -1; in query_import_device()
167 return -1; in query_import_device()
174 static int attach_device(char *host, char *busid) in attach_device() argument
180 sockfd = usbip_net_tcp_connect(host, usbip_port_string); in attach_device()
183 return -1; in attach_device()
188 return -1; in attach_device()
192 rc = record_connection(host, usbip_port_string, busid, rhport); in attach_device()
195 return -1; in attach_device()
209 char *host = NULL; in usbip_attach() local
212 int ret = -1; in usbip_attach()
217 if (opt == -1) in usbip_attach()
222 host = optarg; in usbip_attach()
233 if (!host || !busid) in usbip_attach()
236 ret = attach_device(host, busid); in usbip_attach()