/* * 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; }
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; }
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 __init serial_bind_config(struct usb_configuration *c) { unsigned i; int status = 0; for (i = 0; i < n_ports && status == 0; i++) { if (use_acm) status = acm_bind_config(c, i); else status = gser_bind_config(c, i); } return status; }
static int serial_bind_config(struct usb_configuration *c) { unsigned i; int status = 0; for (i = 0; i < n_ports && status == 0; i++) { if (use_acm) status = acm_bind_config(c, i); #ifdef HAVE_OBEX else if (use_obex) status = obex_bind_config(c, i); #endif else status = gser_bind_config(c, i); } return status; }
static int __init acm_ms_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; } status = acm_bind_config(c, 0); if (status < 0) return status; status = fsg_bind_config(c->cdev, c, &fsg_common); if (status < 0) return status; return 0; }
int acm_function_add(struct usb_configuration *c, u8 port_num) { return acm_bind_config(c, port_num); }