예제 #1
0
static int __init cdc_do_config(struct usb_configuration *c)
{
	int ret;

	if (gadget_is_otg(c->cdev->gadget)) {
		c->descriptors = otg_desc;
		c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
	}

	ret = ecm_bind_config(c, hostaddr);
	if (ret < 0)
		return ret;

	ret = acm_bind_config(c, 0);
	if (ret < 0)
		return ret;

	ret = fsg_add(c->cdev, c, fsg_common);
	if (ret < 0)
		return ret;
	if (ret < 0)
		return ret;

	return 0;
}
static int maemo_do_config(struct usb_configuration *c)
{
	int ret;

	ret = rndis_bind_config(c, hostaddr);
	if (ret < 0)
		return ret;

	ret = diag_function_add(c);
	if (ret < 0)
		return ret;

	ret = gser_bind_config(c, 0);
	if (ret < 0)
		return ret;

	ret = gser_bind_config(c, 1);
	if (ret < 0)
		return ret;

	ret = rmnet_function_add(c);
	if (ret < 0)
		return ret;

	ret = fsg_add(c->cdev, c, fsg_common);
	if (ret < 0)
		return ret;

	return 0;
}
예제 #3
0
파일: g_dnl.c 프로젝트: disdi/u-boot-cavium
static int g_dnl_do_config(struct usb_configuration *c)
{
	const char *s = c->cdev->driver->name;
	int ret = -1;

	debug("%s: configuration: 0x%p composite dev: 0x%p\n",
	      __func__, c, c->cdev);

	printf("GADGET DRIVER: %s\n", s);
	if (!strcmp(s, "usb_dnl_dfu"))
		ret = dfu_add(c);
	else if (!strcmp(s, "usb_dnl_ums"))
		ret = fsg_add(c);

	return ret;
}
예제 #4
0
static int __init msg_do_config(struct usb_configuration *c)
{
	struct fsg_common *common;
	struct fsg_config config;
	int ret;

	if (gadget_is_otg(c->cdev->gadget)) {
		c->descriptors = otg_desc;
		c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
	}

	fsg_config_from_params(&config, &mod_data);
	config.thread_exits = (void(*)(struct fsg_common*))&msg_cleanup;
	common = fsg_common_init(0, c->cdev, &config);
	if (IS_ERR(common))
		return PTR_ERR(common);

	ret = fsg_add(c->cdev, c, common);
	fsg_common_put(common);
	return ret;
}
예제 #5
0
static int g_dnl_do_config(struct usb_configuration *c)
{
	const char *s = c->cdev->driver->name;
	int ret = -1;

	debug("%s: configuration: 0x%p composite dev: 0x%p\n",
	      __func__, c, c->cdev);

	printf("GADGET DRIVER: %s\n", s);
#if defined(CONFIG_DFU_FUNCTION)
	if (!strcmp(s, "usb_dnl_dfu"))
		ret = dfu_add(c);
#endif
#if defined(CONFIG_CMD_FASTBOOT)
        if (!strcmp(s, "usb_dnl_fastboot"))
                ret = fastboot_add(c);
#endif
#if defined(CONFIG_USB_GADGET_MASS_STORAGE)
	if (!strcmp(s, "usb_dnl_ums"))
		ret = fsg_add(c);
#endif

	return ret;
}