Lines Matching +full:cdc +full:- +full:acm

1 // SPDX-License-Identifier: GPL-2.0+
3 * ether.c -- Ethernet gadget driver, with CDC and non-CDC options
5 * Copyright (C) 2003-2005,2008 David Brownell
6 * Copyright (C) 2003-2004 Robert Schwebel, Benedikt Spranger
26 * Ethernet gadget driver -- with CDC and non-CDC options
29 * CDC Ethernet is the standard USB solution for sending Ethernet frames
32 * this USB-IF standard as its open-systems interoperability solution;
35 * This is sometimes called "CDC ECM" (Ethernet Control Model) to support
36 * TLA-soup. "CDC ACM" (Abstract Control Model) is for modems, and a new
37 * "CDC EEM" (Ethernet Emulation Model) is starting to spread.
39 * There's some hardware that can't talk CDC ECM. We make that hardware
40 * implement a "minimalist" vendor-agnostic CDC core: same framing, but
41 * link-level setup only requires activating the configuration. Only the
44 * systems may not. (This is a subset of CDC Ethernet.)
46 * It turns out that if you add a few descriptors to that "CDC Subset",
50 * those MS-Windows drivers. Those added descriptors make it resemble a
51 * CDC MDLM device, but they don't change device behavior at all. (See
54 * A third option is also in use. Rather than CDC Ethernet, or something
57 * needlessly complex. They borrow more from CDC ACM than CDC ECM.
70 * This driver aims for interoperability by using CDC ECM unless
74 * returns false, in which case it supports the CDC Subset. By default,
75 * that returns true; most hardware has no problems with CDC ECM, that's
79 * IF YOUR HARDWARE CAN'T SUPPORT CDC ECM, UPDATE THAT ROUTINE!
103 /*-------------------------------------------------------------------------*/
108 /* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
109 * Instead: allocate your own, using normal USB-IF procedures.
113 * It's for devices with only CDC Ethernet configurations.
116 #define CDC_PRODUCT_NUM 0xa4a1 /* Linux-USB Ethernet Gadget */
118 /* For hardware that can't talk CDC, we use the same vendor ID that
119 * ARM Linux has used for ethernet-over-usb, both with sa1100 and
120 * with pxa250. We're protocol-compatible, if the host-side drivers
122 * drivers that need to hard-wire endpoint numbers have a hook.
124 * The protocol is a minimal subset of CDC Ether, which works on any bulk
126 * RNDIS (like SA-1100, with no interrupt endpoint, or anything that
127 * doesn't handle control-OUT).
134 * used with CDC Ethernet, Linux 2.4 hosts will need updates to choose
135 * the non-RNDIS configuration.
144 /*-------------------------------------------------------------------------*/
180 .language = 0x0409, /* en-us */
201 /*-------------------------------------------------------------------------*/
212 /* FIXME alloc iConfiguration string, set it in c->strings */ in rndis_do_config()
214 if (gadget_is_otg(c->cdev->gadget)) { in rndis_do_config()
215 c->descriptors = otg_desc; in rndis_do_config()
216 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; in rndis_do_config()
237 /*-------------------------------------------------------------------------*/
245 MODULE_PARM_DESC(use_eem, "use CDC EEM mode");
248 * We _always_ have an ECM, CDC Subset, or EEM configuration.
254 /* FIXME alloc iConfiguration string, set it in c->strings */ in eth_do_config()
256 if (gadget_is_otg(c->cdev->gadget)) { in eth_do_config()
257 c->descriptors = otg_desc; in eth_do_config()
258 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; in eth_do_config()
271 } else if (can_support_ecm(c->cdev->gadget)) { in eth_do_config()
302 /*-------------------------------------------------------------------------*/
306 struct usb_gadget *gadget = cdev->gadget; in eth_bind()
322 net = eem_opts->net; in eth_bind()
324 eth_config_driver.label = "CDC Ethernet (EEM)"; in eth_bind()
336 net = ecm_opts->net; in eth_bind()
338 eth_config_driver.label = "CDC Ethernet (ECM)"; in eth_bind()
340 /* CDC Subset */ in eth_bind()
349 net = geth_opts->net; in eth_bind()
351 eth_config_driver.label = "CDC Subset/SAFE"; in eth_bind()
366 /* RNDIS plus ECM-or-Subset */ in eth_bind()
367 gether_set_gadget(net, cdev->gadget); in eth_bind()
373 eem_opts->bound = true; in eth_bind()
375 ecm_opts->bound = true; in eth_bind()
377 geth_opts->bound = true; in eth_bind()
407 status = -ENOMEM; in eth_bind()
428 dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n", in eth_bind()
458 } else if (can_support_ecm(cdev->gadget)) { in eth_unbind()