Ejemplo n.º 1
0
/*
 * We _always_ have both CDC ECM and CDC ACM functions.
 */
static int __init cdc_do_config(struct usb_configuration *c)
{
	int	status;

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

#ifdef CONFIG_USB_MITs 
	status = acm_bind_config(c, 0);
	if (status < 0)
		return status;

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

#else
	status = ecm_bind_config(c, hostaddr);
	if (status < 0)
		return status;

	status = acm_bind_config(c, 0);
	if (status < 0)
		return status;
#endif

	return 0;
}
Ejemplo n.º 2
0
static int __init nokia_bind_config(struct usb_configuration *c)
{
	int status = 0;

	status = phonet_bind_config(c);
	if (status)
		printk(KERN_DEBUG "could not bind phonet config\n");

	status = obex_bind_config(c, 0);
	if (status)
		printk(KERN_DEBUG "could not bind obex config %d\n", 0);

	status = obex_bind_config(c, 1);
	if (status)
		printk(KERN_DEBUG "could not bind obex config %d\n", 0);

	status = acm_bind_config(c, 2);
	if (status)
		printk(KERN_DEBUG "could not bind acm config\n");

	if (use_eem) {
		status = eem_bind_config(c);
		if (status)
			printk(KERN_DEBUG "could not bind eem config\n");
	} else {
		status = ecm_bind_config(c, hostaddr);
		if (status)
			printk(KERN_DEBUG "could not bind ecm config\n");
	}

	return status;
}
Ejemplo n.º 3
0
static __init int 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, host_mac, the_dev);
	if (ret < 0)
		return ret;

	/* implicit port_num is zero */
	f_acm_multi = usb_get_function(fi_acm);
	if (IS_ERR(f_acm_multi))
		return PTR_ERR(f_acm_multi);

	ret = usb_add_function(c, f_acm_multi);
	if (ret)
		goto err_conf;

	ret = fsg_bind_config(c->cdev, c, &fsg_common);
	if (ret < 0)
		goto err_fsg;

	return 0;
err_fsg:
	usb_remove_function(c, f_acm_multi);
err_conf:
	usb_put_function(f_acm_multi);
	return ret;
}
Ejemplo n.º 4
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;
}
Ejemplo n.º 5
0
/*
 * We _always_ have an ECM, CDC Subset, or EEM configuration.
 */
static int __init eth_do_config(struct usb_configuration *c)
{
	/* FIXME alloc iConfiguration string, set it in c->strings */

	if (use_eem)
		return eem_bind_config(c);
	else if (can_support_ecm(c->cdev->gadget))
		return ecm_bind_config(c, hostaddr);
	else
		return geth_bind_config(c, hostaddr);
}
Ejemplo n.º 6
0
/*
 * We _always_ have an ECM or CDC Subset configuration.
 */
static int __init eth_do_config(struct usb_configuration *c)
{
	/* FIXME alloc iConfiguration string, set it in c->strings */

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

	if (can_support_ecm(c->cdev->gadget))
		return ecm_bind_config(c, hostaddr);
	else
		return geth_bind_config(c, hostaddr);
}
Ejemplo n.º 7
0
static int __init eth_do_config(struct usb_configuration *c)
{
	

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

	if (use_eem)
		return eem_bind_config(c);
	else if (can_support_ecm(c->cdev->gadget))
		return ecm_bind_config(c, hostaddr);
	else
		return geth_bind_config(c, hostaddr);
}
Ejemplo n.º 8
0
int personality_ecm_bind_config(struct usb_configuration *c)
{
  u8 ethaddr[ETH_ALEN];
  int result = gether_setup(c->cdev->gadget, /* out */ ethaddr);
  if (!result) {
    result = ecm_bind_config(c, /* by value */ ethaddr);
    if (!result) {
      return 0;
    } else {
      printk(KERN_WARNING "%s: ecm_bind_config failed (%d)\n", __FUNCTION__, result);
    }
    gether_cleanup();
  } else {
    printk(KERN_WARNING "%s: gether_setup failed (%d)\n", __FUNCTION__, result);
  }
  return result;
}