Lines Matching refs:host

60 /* Restrict the max number association for one host to 200 */
137 /* host-id / dev-id util funcs */
153 /* enable/disable host funcs */
215 wusbd_info("Stop all host before exit");
375 /* check if host id exist */
376 if ((host_cc = find_host_cc(asso_ctrl->host)) == NULL) {
377 wusbd_warn("wusbd_do_association:asso_ctrl.host = %d err = %s",
378 asso_ctrl->host, strerror(errno));
382 if (get_host_path(asso_ctrl->host, host_path) < 0) {
383 wusbd_warn("wusbd_do_association:host = %d not attached",
384 asso_ctrl->host);
429 rmctrl->host, rmctrl->dev);
435 if (remove_one_dev(rmctrl->host, rmctrl->dev) < 0) {
437 rmctrl->host, rmctrl->dev);
442 /* remove all the device associated to the host */
443 if (remove_all_dev(rmctrl->host) < 0) {
444 wusbd_warn("wusbd_do_remove_dev: host-id = %d failed",
445 rmctrl->host);
464 /* Respond client's remove-host request. */
481 wusbd_info("wusbd_do_remove_host start: hostid = %d", host_ctrl->host);
484 wusbd_warn("wusbd_do_remove_host :host_ctrl->host = %d failed",
485 host_ctrl->host);
489 if (remove_all_dev(host_ctrl->host) < 0) {
490 wusbd_warn("wusbd_do_remove_host :host_ctrl->host = %d failed",
491 host_ctrl->host);
496 if (get_host_path(host_ctrl->host, host_path) < 0) {
497 wusbd_warn("wusbd_do_host:host_ctrl->host = %d not attached",
498 host_ctrl->host);
502 * Stop host if possible, if the host can not
503 * be stoped we just remove the host cc from
504 * system, this means the host should be re-plugged
514 /* remove the last CC for host */
515 remove_from_global_list(devids[host_ctrl->host][0]);
516 free_dev_id(host_ctrl->host, 0);
533 /* Respond client's enable-host request. */
543 /* Respond client's disable-host request. */
554 * wusbd_do_host is the only wrapper for any host related cmds.
576 wusbd_warn("wusbd_do_host: host-id = %d failed",
577 host_ctrl->host);
581 if (get_host_path(host_ctrl->host, host_path) < 0) {
582 wusbd_warn("wusbd_do_host:host_ctrl->host = %d not attached",
583 host_ctrl->host);
588 wusbd_info("wusbd_do_host: host = %s flag = %d", host_path, flag);
597 (void) add_all_cc_to_host(host_path, host_ctrl->host);
598 /* start the host */
600 wusbd_warn("wusbd_do_host: host = %s start failed",
678 update_cc_list(const char *host)
688 wusbd_info("update_cc_list: host = %s", host);
689 if (load_host_mac(host, mac) < 0) {
690 wusbd_warn("update_cc_list: host = %s failed", host);
700 if ((fd = open(host, O_RDONLY)) == -1) {
701 wusbd_warn("update_cc_list: host = %s, err = %s",
702 host, strerror(errno));
707 /* update host states */
741 /* find the host cc infor with host id */
757 /* find the device CDID with host id */
774 /* find the host id with mac address */
813 * to setup an association for host and device
981 print_array("New CC to host", newinfo->cc.CHID, 48);
994 newinfo->host = hostinfo->host;
995 if ((newinfo->dev = assign_dev_id(newinfo->host)) == 0) {
996 wusbd_warn("ca_save_cc: host-id:%d", newinfo->host);
1041 * 3. Send SET_ASSOCIATION_RESPONSE with the host CHID
1056 wusbd_warn("wusbd_do_ca: set host info failred");
1075 * 3. Add new cc to the host controller
1086 * Check if CDID exist in the host cc list, if so, We need to update
1092 old_cc = find_dev_cc(host_cc->host, device_info.CDID);
1095 (void) remove_cc_from_host(old_cc->host, old_cc->dev);
1141 * generate_wusb_CC: Generate CC infor for a device and host
1142 * generate_wusb_CHID: Generate CHID for a host
1287 * Find an unused host id and return it.
1288 * The wusbadm use two digits to represent a host. This means
1307 * traverse the CC store, search in the specified host,
1392 wusbd_info("\thostid:%x", list->info.host);
1403 wusbd_info("write_cc_list: host-id = %d dev-id = %d",
1404 list->info.host, list->info.dev);
1439 devinfo.host = list->info.host;
1486 devids[ccinfo->host][ccinfo->dev] = newlist;
1494 /* save cc info to the host */
1544 * load all the cc to the host controller
1546 * related to this host.
1547 * 2. add the cc to the host controller
1548 * 3. start the host controller
1556 wusbd_warn("add_all_cc_to_host: host = %s", host_path);
1557 /* open host file */
1559 wusbd_warn("add_all_cc_to_host: host = %s err = %s",
1565 /* Find all the device cc and add cc to host controler */
1586 /* Remove all the cc infor from a host device */
1603 wusbd_warn("remove_all_cc_from host: host = %s err = %s",
1637 * cc file will be created in /etc/usb, all the wusb host
1666 devids[list->info.host][list->info.dev] = list;
1711 wusbd_info("host-id = %d, dev-id = %d, type = %s",
1712 list->info.host, list->info.dev, list->info.type);
1724 if (tmp->info.host > list->info.host) {
1733 if (next->info.host < list->info.host) {
1736 if (next->info.host == list->info.host) {
1757 wusbd_info("remove_from_global_list: host-id:%d, dev-id:%d, path:%s",
1758 list->info.host, list->info.dev, list->info.type);
1796 /* Set all the device/host state to be disabled or disconnected */
1837 /* Get the host file path in /dev/usb from a host id */
1847 wusbd_info("get_host_path :host = %d", hostid);
1859 wusbd_warn("get_host_path: host = %s failed",
1882 /* Check all the host device */
1891 /* Stop the host device */
1902 * stat of the device and host, device nodename
1950 wusbd_info("load_host_mac: host = %s\n", filename);
1951 /* open host/dev file */
1958 /* Get the mac address of the host */
1977 * create host cc
1978 * 1. create the cc for host
1986 wusbd_info("create host cc for :%s", filename);
1989 wusbd_warn("create_host_cc: host = %s, load mac failed",
2000 wusbd_warn("create_host_cc: host = %s, reate chid failed",
2006 print_array("New CC for host:", ccinfo.cc.CHID, 48);
2013 /* don't allocate dev id here , for host, dev id set to 0 */
2014 if ((ccinfo.host = assign_host_id()) == 0) {
2021 /* save cc infor to host and cc file */
2034 * OR add CCs to the host which is newly hotplugged in
2037 check_host(const char *host)
2043 wusbd_info("check_host: host = %s", host);
2044 if (load_host_mac(host, mac) < 0) {
2045 wusbd_warn("check_host: host = %s load mac fail", host);
2050 wusbd_info("check_host: host = %s host-id = %d found",
2051 host, hostid);
2052 (void) add_all_cc_to_host(host, hostid);
2053 /* start the host */
2054 (void) start_host(host);
2057 wusbd_info("check_host: newhost = %s found", host);
2058 if (WUSBA_SUCCESS == create_host_cc(host)) {
2059 /* check host again */
2060 (void) check_host(host);
2066 * Remove one cc from host
2086 wusbd_warn("remove_cc_from_host: host = %s err = %s",
2105 /* Stop/disable a host device */
2107 stop_host(const char *host)
2111 wusbd_info("stop_host: host = %s", host);
2112 if ((fd = open(host, O_RDONLY)) == -1) {
2113 wusbd_warn("stop_host:host = %s err = %s", host,
2119 * We'll only send the cmd to stop host while host has already
2120 * been startd. start/stop host takes time becasue host controller
2146 /* start/enable a host device */
2148 start_host(const char *host)
2152 wusbd_warn("start_host : host = %s", host);
2153 if ((fd = open(host, O_RDONLY)) == -1) {
2154 wusbd_warn("start_host: host = %s err = %s", host,
2160 * Check if the host is already start. if the host has been started.
2161 * it is not proper to send the start command to the host controller,
2162 * because it may cause some issue for host contoller reset the
2192 if ((dev_ctrl->host == 0) || (dev_ctrl->host >= HOST_MAX)) {
2193 wusbd_warn("check_dev_ctrl: host-id = %02d", dev_ctrl->host);
2197 if (!devids[dev_ctrl->host][0]) {
2198 wusbd_warn("check_dev_ctrl: host-id = %02d cc = NULL",
2199 dev_ctrl->host);
2210 if (!devids[dev_ctrl->host][dev_ctrl->dev]) {
2212 dev_ctrl->host, dev_ctrl->dev);
2220 /* Check the args of a host ctrl door call request */
2224 if ((dev_ctrl->host == 0) || (dev_ctrl->host >= HOST_MAX)) {
2225 wusbd_warn("check_host_ctrl: host-id = %02d", dev_ctrl->host);
2229 if (!devids[dev_ctrl->host][0]) {
2230 wusbd_warn("check_host_ctrl: host-id = %02d, cc = NULL",
2231 dev_ctrl->host);
2252 "remove cc from host failed", hostid, devid);
2384 /* update host CC when a wireless host is plugged */
2402 /* check if the device is host device and update cc list */