13 #include <linux/slab.h>
14 #include <linux/kernel.h>
15 #include <linux/device.h>
78 .bLength =
sizeof subset_data_intf,
82 .bAlternateSetting = 0,
86 .bInterfaceProtocol = 0,
91 .bLength =
sizeof mdlm_header_desc,
99 .bLength =
sizeof mdlm_desc,
105 0x5d, 0x34, 0xcf, 0x66, 0x11, 0x18, 0x11, 0xd6,
106 0xa2, 0x1a, 0x00, 0x01, 0x02, 0xca, 0x9a, 0x7f,
114 static u8 mdlm_detail_desc[] = {
125 .bLength =
sizeof ether_desc,
134 .bNumberPowerFilters = 0,
214 .bLength =
sizeof ss_subset_bulk_comp_desc,
237 static struct usb_string geth_string_defs[] = {
238 [0].s =
"CDC Ethernet Subset/SAFE",
245 .strings = geth_string_defs,
257 struct f_gether *geth = func_to_geth(f);
263 if (geth->
port.in_ep->driver_data) {
264 DBG(cdev,
"reset cdc subset\n");
268 DBG(cdev,
"init + activate cdc subset\n");
277 return IS_ERR(net) ? PTR_ERR(net) : 0;
282 struct f_gether *geth = func_to_geth(f);
285 DBG(cdev,
"net deactivated\n");
297 struct f_gether *geth = func_to_geth(f);
313 geth->
port.in_ep = ep;
319 geth->
port.out_ep = ep;
331 if (gadget_is_dualspeed(c->
cdev->gadget)) {
343 if (gadget_is_superspeed(c->
cdev->gadget)) {
360 DBG(cdev,
"CDC Subset: %s speed IN/%s OUT/%s\n",
361 gadget_is_superspeed(c->
cdev->gadget) ?
"super" :
362 gadget_is_dualspeed(c->
cdev->gadget) ?
"dual" :
"full",
363 geth->
port.in_ep->name, geth->
port.out_ep->name);
373 if (geth->
port.out_ep->desc)
374 geth->
port.out_ep->driver_data =
NULL;
375 if (geth->
port.in_ep->desc)
376 geth->
port.in_ep->driver_data =
NULL;
378 ERROR(cdev,
"%s: can't bind, err %d\n", f->
name, status);
386 if (gadget_is_superspeed(c->
cdev->gadget))
388 if (gadget_is_dualspeed(c->
cdev->gadget))
391 geth_string_defs[1].
s =
NULL;
392 kfree(func_to_geth(f));
416 if (geth_string_defs[0].
id == 0) {
440 geth_string_defs[1].
s = geth->
ethaddr;
444 geth->
port.func.name =
"cdc_subset";
445 geth->
port.func.strings = geth_strings;
446 geth->
port.func.bind = geth_bind;
447 geth->
port.func.unbind = geth_unbind;
448 geth->
port.func.set_alt = geth_set_alt;
449 geth->
port.func.disable = geth_disable;
453 geth_string_defs[1].
s =
NULL;