Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115125
b: refs/heads/master
c: 7e75bc0
h: refs/heads/master
i:
  115123: 4020931
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Oct 16, 2008
1 parent ab071df commit ac58d9c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e9ba518ec19c6c961bf6074ec05ae1a927230bc
refs/heads/master: 7e75bc0f9006e995a0fa25f0a285addc3d5fd5cb
2 changes: 1 addition & 1 deletion trunk/drivers/usb/gadget/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ obj-$(CONFIG_USB_M66592) += m66592-udc.o
#
C_UTILS = composite.o usbstring.o config.o epautoconf.o

g_zero-objs := zero.o f_sourcesink.o f_loopback.o $(C_UTILS)
g_zero-objs := zero.o
g_ether-objs := ether.o u_ether.o f_subset.o f_ecm.o $(C_UTILS)
g_serial-objs := serial.o
g_midi-objs := gmidi.o usbstring.o config.o epautoconf.o
Expand Down
34 changes: 18 additions & 16 deletions trunk/drivers/usb/gadget/f_loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ static struct usb_interface_descriptor loopback_intf = {

/* full speed support: */

static struct usb_endpoint_descriptor fs_source_desc = {
static struct usb_endpoint_descriptor fs_loop_source_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

.bEndpointAddress = USB_DIR_IN,
.bmAttributes = USB_ENDPOINT_XFER_BULK,
};

static struct usb_endpoint_descriptor fs_sink_desc = {
static struct usb_endpoint_descriptor fs_loop_sink_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -88,22 +88,22 @@ static struct usb_endpoint_descriptor fs_sink_desc = {

static struct usb_descriptor_header *fs_loopback_descs[] = {
(struct usb_descriptor_header *) &loopback_intf,
(struct usb_descriptor_header *) &fs_sink_desc,
(struct usb_descriptor_header *) &fs_source_desc,
(struct usb_descriptor_header *) &fs_loop_sink_desc,
(struct usb_descriptor_header *) &fs_loop_source_desc,
NULL,
};

/* high speed support: */

static struct usb_endpoint_descriptor hs_source_desc = {
static struct usb_endpoint_descriptor hs_loop_source_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

.bmAttributes = USB_ENDPOINT_XFER_BULK,
.wMaxPacketSize = __constant_cpu_to_le16(512),
};

static struct usb_endpoint_descriptor hs_sink_desc = {
static struct usb_endpoint_descriptor hs_loop_sink_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -113,8 +113,8 @@ static struct usb_endpoint_descriptor hs_sink_desc = {

static struct usb_descriptor_header *hs_loopback_descs[] = {
(struct usb_descriptor_header *) &loopback_intf,
(struct usb_descriptor_header *) &hs_source_desc,
(struct usb_descriptor_header *) &hs_sink_desc,
(struct usb_descriptor_header *) &hs_loop_source_desc,
(struct usb_descriptor_header *) &hs_loop_sink_desc,
NULL,
};

Expand Down Expand Up @@ -152,7 +152,7 @@ loopback_bind(struct usb_configuration *c, struct usb_function *f)

/* allocate endpoints */

loop->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_source_desc);
loop->in_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_source_desc);
if (!loop->in_ep) {
autoconf_fail:
ERROR(cdev, "%s: can't autoconfigure on %s\n",
Expand All @@ -161,17 +161,17 @@ loopback_bind(struct usb_configuration *c, struct usb_function *f)
}
loop->in_ep->driver_data = cdev; /* claim */

loop->out_ep = usb_ep_autoconfig(cdev->gadget, &fs_sink_desc);
loop->out_ep = usb_ep_autoconfig(cdev->gadget, &fs_loop_sink_desc);
if (!loop->out_ep)
goto autoconf_fail;
loop->out_ep->driver_data = cdev; /* claim */

/* support high speed hardware */
if (gadget_is_dualspeed(c->cdev->gadget)) {
hs_source_desc.bEndpointAddress =
fs_source_desc.bEndpointAddress;
hs_sink_desc.bEndpointAddress =
fs_sink_desc.bEndpointAddress;
hs_loop_source_desc.bEndpointAddress =
fs_loop_source_desc.bEndpointAddress;
hs_loop_sink_desc.bEndpointAddress =
fs_loop_sink_desc.bEndpointAddress;
f->hs_descriptors = hs_loopback_descs;
}

Expand Down Expand Up @@ -255,8 +255,10 @@ enable_loopback(struct usb_composite_dev *cdev, struct f_loopback *loop)
struct usb_request *req;
unsigned i;

src = ep_choose(cdev->gadget, &hs_source_desc, &fs_source_desc);
sink = ep_choose(cdev->gadget, &hs_sink_desc, &fs_sink_desc);
src = ep_choose(cdev->gadget,
&hs_loop_source_desc, &fs_loop_source_desc);
sink = ep_choose(cdev->gadget,
&hs_loop_sink_desc, &fs_loop_sink_desc);

/* one endpoint writes data back IN to the host */
ep = loop->in_ep;
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/usb/gadget/zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@
#include "gadget_chips.h"


/*-------------------------------------------------------------------------*/

/*
* Kbuild is not very cooperative with respect to linking separately
* compiled library objects into one module. So for now we won't use
* separate compilation ... ensuring init/exit sections work to shrink
* the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#include "composite.c"
#include "usbstring.c"
#include "config.c"
#include "epautoconf.c"

#include "f_sourcesink.c"
#include "f_loopback.c"

/*-------------------------------------------------------------------------*/

#define DRIVER_VERSION "Cinco de Mayo 2008"
Expand Down

0 comments on commit ac58d9c

Please sign in to comment.