Lines Matching refs:host

92 /* load host/dev list helpers */
113 { "host", no_argument, NULL, 'h'},
119 "ID", /* host-id or dev-id */
120 "STATE", /* host or device states */
121 "TYPE", /* host or deivce types */
141 { "host", required_argument, NULL, 'h'},
160 { "host", required_argument, NULL, 'h'},
166 /* remove/enable/disable host */
168 { "host", required_argument, NULL, 'h'},
191 { WUSBADM_NO_HOST, "host does not exist" },
195 { WUSBADM_INVAL_HOSTID, "invalid host id" },
197 { WUSBADM_HOST_NOT_ATTACH, "host not attached" },
215 * host and wireless usb devices.
216 * list - List the device and host status
217 * associated - Setup assocaition between host and devices.
219 * remove-host - Remove the host information and all the devices assocaiton to
220 * the host
221 * enable-host - Enable a host to be ready to accept wireless devices
222 * disable-host - Disable a host, host will not accpet connections
237 { "remove-host", do_remove_host, WUSB_AUTH_HOST},
238 { "enable-host", do_enable_host, WUSB_AUTH_HOST},
239 { "disable-host", do_disable_host, WUSB_AUTH_HOST},
287 wusb_prt("\tassociate [-h host-id] [[-c [-f]] | -n] [-o]\n");
288 wusb_prt("\tremove-dev [[-d dev-id] | [-h host-id]] [-f]\n");
289 wusb_prt("\tremove-host [-h host-id] [-f]\n");
290 wusb_prt("\tenable-host [-h host-id]\n");
291 wusb_prt("\tdisable-host [-h host-id] [-f]\n");
299 * 2. load host/deivce info from daemon
301 * 4. print host/deivce list one by one
326 * wusbadmin associate [-h host-id] [[-c [-f] | -n] [-o]
357 * remove-dev [[-d dev-id] | [-h host-id]] [-f]
361 * dev-id == 0 means remove all dev with a host
524 * wusbadmin remove-host routine
525 * remove-host [-h host-id] [-f]
534 * wusbadmin enable-host routine
535 * enable-host [-h host-id]
544 * wusbadmin disable-host routine
545 * disable-host [-h host-id] [-f]
554 * wusb do host routine. The wrapper for all host related
555 * subcommand (enable-host, disable-host, remove-host).
663 * Append the host-id / dev-id to the output buf.
664 * host-id - 2 digits number (XX)
675 devinfo->host, devinfo->dev);
677 (void) snprintf(tmp, WUSB_MAX_LEN, "%02d", devinfo->host);
684 * host - enabled/disabled
721 /* append the state for host */
735 * Appenend host/dev type to the ouput buf string
764 /* check if dev or host need to be print out */
784 * wusbadmin association [-h host-id] [[-c [-f] | -n] [-o]
797 parse_host_id(optarg, &(asso_ctrl->host));
827 /* get user input host id */
828 if (!asso_ctrl->host) {
829 (void) input_host_id(&asso_ctrl->host);
849 wusb_prt("Associate device (%s) with host (%02d) via cable\n",
850 asso_ctrl->path, asso_ctrl->host);
856 * Convert a string to an id (host-id/dev-id/cable-dev-id)
879 parse_host_id(char *arg, uint8_t *host) {
883 wusb_fail("host-id should be 2 digits");
885 if ((*host = str2id(arg)) == 0) {
886 wusb_fail("invalid host id:%s", arg);
888 if (find_dev_id(*host, 0) < 0) {
889 wusb_fail("host-id does not exist: %02d ", *host);
896 * Get the host from user input.
897 * 1. list all the host id from the daemon
898 * 2. Ask user to input the host id
899 * 3. Check host id and return
902 input_host_id(uint8_t *host)
911 /* show avaialbe host id to usr */
917 /* get user input of host id */
918 user_input("Please select 2 digits host-id:", buf, WUSB_MAX_LEN-1);
919 parse_host_id(buf, host);
933 /* show avaialbe host id to usr */
939 /* get user input of host id */
945 find_dev_id(uint8_t host, uint16_t dev)
952 (dev_lists[i].host == host)) {
1190 /* get host id */
1192 if ((devctrl->host = str2id(buf)) == 0) {
1201 if (find_dev_id(devctrl->host, devctrl->dev) < 0) {
1203 devctrl->host, devctrl->dev);
1213 * remove-dev [[-d dev-id] | [-h host-id]] [-f]
1230 if (devctrl->host) {
1234 /* get 2 digit host id */
1235 parse_host_id(optarg, &(devctrl->host));
1243 if (devctrl->host) {
1263 if ((devctrl->host == 0) && (devctrl->dev == 0)) {
1272 " can not be connected with the host until it is"
1274 devctrl->host, devctrl->dev);
1277 "associated with host (%02d) from the system\n"
1278 "All the devices asociated with the host can not"
1280 " again.\n", devctrl->host);
1340 * do host options parser
1341 * remove-host [-h host-id] [-f]
1342 * enable-host [-h host-id]
1343 * disable-host [-h host-id] [-f]
1355 if (hostctrl->host) {
1358 /* 2 digits host id */
1359 parse_host_id(optarg, &(hostctrl->host));
1364 /* enable host does not need -f */
1380 * all the host related command can be used without a specific
1381 * host-id, so list all the hosts avalable to users for selection
1383 if (hostctrl->host == 0) {
1384 (void) input_host_id(&(hostctrl->host));
1392 wusb_prt("Disable host (%02d).\nAll the"
1393 " devices connected with the host will be"
1394 " disconnected\n", hostctrl->host);
1398 wusb_prt("Remove host (%02d).\nAll the"
1399 " association with the host will be"
1400 " removed\n", hostctrl->host);