static ssize_t host_chose(struct device * dev,struct device_attribute * attr,char * buf)
{
    //stop usb scan
    thread_run_flag = 0;

    hw_rmmod_usb_host();
    hw_rmmod_usb_device();
    usb_msg_center(&g_usb_cfg);

    hw_insmod_usb_host();
    usb_msg_center(&g_usb_cfg);

    return sprintf(buf, "%s\n", "host_chose finished!");
}
Beispiel #2
0
static int usb_hardware_scan_thread(void * pArg)
{
	struct usb_cfg *cfg = pArg;

	while(thread_run_flag){
		DMSG_DBG_MANAGER("\n\n");

		usb_hw_scan(cfg);
		usb_msg_center(cfg);

		DMSG_DBG_MANAGER("\n\n");

		msleep(1000);  /* 1s */
	}

	thread_stopped_flag = 1;

	return 0;
}