multi.c (b10778a00d40b3d9fdaaf5891e802794781ff71c) | multi.c (c94e289f195e0e13cf34d27f9338d28221a85751) |
---|---|
1/* 2 * multi.c -- Multifunction Composite driver 3 * 4 * Copyright (C) 2008 David Brownell 5 * Copyright (C) 2008 Nokia Corporation 6 * Copyright (C) 2009 Samsung Electronics 7 * Author: Michal Nazarewicz (mina86@mina86.com) 8 * --- 135 unchanged lines hidden (view full) --- 144/********** RNDIS **********/ 145 146#ifdef USB_ETH_RNDIS 147static struct usb_function_instance *fi_rndis; 148static struct usb_function *f_acm_rndis; 149static struct usb_function *f_rndis; 150static struct usb_function *f_msg_rndis; 151 | 1/* 2 * multi.c -- Multifunction Composite driver 3 * 4 * Copyright (C) 2008 David Brownell 5 * Copyright (C) 2008 Nokia Corporation 6 * Copyright (C) 2009 Samsung Electronics 7 * Author: Michal Nazarewicz (mina86@mina86.com) 8 * --- 135 unchanged lines hidden (view full) --- 144/********** RNDIS **********/ 145 146#ifdef USB_ETH_RNDIS 147static struct usb_function_instance *fi_rndis; 148static struct usb_function *f_acm_rndis; 149static struct usb_function *f_rndis; 150static struct usb_function *f_msg_rndis; 151 |
152static __init int rndis_do_config(struct usb_configuration *c) | 152static int rndis_do_config(struct usb_configuration *c) |
153{ 154 struct fsg_opts *fsg_opts; 155 int ret; 156 157 if (gadget_is_otg(c->cdev->gadget)) { 158 c->descriptors = otg_desc; 159 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 160 } --- 71 unchanged lines hidden (view full) --- 232/********** CDC ECM **********/ 233 234#ifdef CONFIG_USB_G_MULTI_CDC 235static struct usb_function_instance *fi_ecm; 236static struct usb_function *f_acm_multi; 237static struct usb_function *f_ecm; 238static struct usb_function *f_msg_multi; 239 | 153{ 154 struct fsg_opts *fsg_opts; 155 int ret; 156 157 if (gadget_is_otg(c->cdev->gadget)) { 158 c->descriptors = otg_desc; 159 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 160 } --- 71 unchanged lines hidden (view full) --- 232/********** CDC ECM **********/ 233 234#ifdef CONFIG_USB_G_MULTI_CDC 235static struct usb_function_instance *fi_ecm; 236static struct usb_function *f_acm_multi; 237static struct usb_function *f_ecm; 238static struct usb_function *f_msg_multi; 239 |
240static __init int cdc_do_config(struct usb_configuration *c) | 240static int cdc_do_config(struct usb_configuration *c) |
241{ 242 struct fsg_opts *fsg_opts; 243 int ret; 244 245 if (gadget_is_otg(c->cdev->gadget)) { 246 c->descriptors = otg_desc; 247 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 248 } --- 212 unchanged lines hidden (view full) --- 461fail: 462#endif 463#ifdef CONFIG_USB_G_MULTI_CDC 464 usb_put_function_instance(fi_ecm); 465#endif 466 return status; 467} 468 | 241{ 242 struct fsg_opts *fsg_opts; 243 int ret; 244 245 if (gadget_is_otg(c->cdev->gadget)) { 246 c->descriptors = otg_desc; 247 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; 248 } --- 212 unchanged lines hidden (view full) --- 461fail: 462#endif 463#ifdef CONFIG_USB_G_MULTI_CDC 464 usb_put_function_instance(fi_ecm); 465#endif 466 return status; 467} 468 |
469static int __exit multi_unbind(struct usb_composite_dev *cdev) | 469static int multi_unbind(struct usb_composite_dev *cdev) |
470{ 471#ifdef CONFIG_USB_G_MULTI_CDC 472 usb_put_function(f_msg_multi); 473#endif 474#ifdef USB_ETH_RNDIS 475 usb_put_function(f_msg_rndis); 476#endif 477 usb_put_function_instance(fi_msg); --- 14 unchanged lines hidden (view full) --- 492#endif 493 return 0; 494} 495 496 497/****************************** Some noise ******************************/ 498 499 | 470{ 471#ifdef CONFIG_USB_G_MULTI_CDC 472 usb_put_function(f_msg_multi); 473#endif 474#ifdef USB_ETH_RNDIS 475 usb_put_function(f_msg_rndis); 476#endif 477 usb_put_function_instance(fi_msg); --- 14 unchanged lines hidden (view full) --- 492#endif 493 return 0; 494} 495 496 497/****************************** Some noise ******************************/ 498 499 |
500static __refdata struct usb_composite_driver multi_driver = { | 500static struct usb_composite_driver multi_driver = { |
501 .name = "g_multi", 502 .dev = &device_desc, 503 .strings = dev_strings, 504 .max_speed = USB_SPEED_HIGH, 505 .bind = multi_bind, | 501 .name = "g_multi", 502 .dev = &device_desc, 503 .strings = dev_strings, 504 .max_speed = USB_SPEED_HIGH, 505 .bind = multi_bind, |
506 .unbind = __exit_p(multi_unbind), | 506 .unbind = multi_unbind, |
507 .needs_serial = 1, 508}; 509 510module_usb_composite_driver(multi_driver); | 507 .needs_serial = 1, 508}; 509 510module_usb_composite_driver(multi_driver); |