Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289573
b: refs/heads/master
c: d11519a
h: refs/heads/master
i:
  289571: 415f24f
v: v3
  • Loading branch information
Praveena Nadahally authored and Felipe Balbi committed Jan 30, 2012
1 parent 8d79b21 commit 68c2952
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcc0bb5ace11e6d0a27bdbdbf2e5e6d361a4e701
refs/heads/master: d11519adc214c243ec606f186316f2667b677694
25 changes: 25 additions & 0 deletions trunk/drivers/usb/gadget/f_ecm.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ static inline unsigned ecm_bitrate(struct usb_gadget *g)

/* interface descriptor: */

static struct usb_interface_assoc_descriptor
ecm_iad_descriptor = {
.bLength = sizeof ecm_iad_descriptor,
.bDescriptorType = USB_DT_INTERFACE_ASSOCIATION,

/* .bFirstInterface = DYNAMIC, */
.bInterfaceCount = 2, /* control + data */
.bFunctionClass = USB_CLASS_COMM,
.bFunctionSubClass = USB_CDC_SUBCLASS_ETHERNET,
.bFunctionProtocol = USB_CDC_PROTO_NONE,
/* .iFunction = DYNAMIC */
};


static struct usb_interface_descriptor ecm_control_intf = {
.bLength = sizeof ecm_control_intf,
.bDescriptorType = USB_DT_INTERFACE,
Expand Down Expand Up @@ -199,6 +213,7 @@ static struct usb_endpoint_descriptor fs_ecm_out_desc = {

static struct usb_descriptor_header *ecm_fs_function[] = {
/* CDC ECM control descriptors */
(struct usb_descriptor_header *) &ecm_iad_descriptor,
(struct usb_descriptor_header *) &ecm_control_intf,
(struct usb_descriptor_header *) &ecm_header_desc,
(struct usb_descriptor_header *) &ecm_union_desc,
Expand Down Expand Up @@ -247,6 +262,7 @@ static struct usb_endpoint_descriptor hs_ecm_out_desc = {

static struct usb_descriptor_header *ecm_hs_function[] = {
/* CDC ECM control descriptors */
(struct usb_descriptor_header *) &ecm_iad_descriptor,
(struct usb_descriptor_header *) &ecm_control_intf,
(struct usb_descriptor_header *) &ecm_header_desc,
(struct usb_descriptor_header *) &ecm_union_desc,
Expand Down Expand Up @@ -339,6 +355,7 @@ static struct usb_string ecm_string_defs[] = {
[0].s = "CDC Ethernet Control Model (ECM)",
[1].s = NULL /* DYNAMIC */,
[2].s = "CDC Ethernet Data",
[3].s = "CDC ECM",
{ } /* end of list */
};

Expand Down Expand Up @@ -674,6 +691,7 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
if (status < 0)
goto fail;
ecm->ctrl_id = status;
ecm_iad_descriptor.bFirstInterface = status;

ecm_control_intf.bInterfaceNumber = status;
ecm_union_desc.bMasterInterface0 = status;
Expand Down Expand Up @@ -864,6 +882,13 @@ ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
return status;
ecm_string_defs[1].id = status;
ecm_desc.iMACAddress = status;

/* IAD label */
status = usb_string_id(c->cdev);
if (status < 0)
return status;
ecm_string_defs[3].id = status;
ecm_iad_descriptor.iFunction = status;
}

/* allocate and initialize one new instance */
Expand Down

0 comments on commit 68c2952

Please sign in to comment.