Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303890
b: refs/heads/master
c: 1fbfeff
h: refs/heads/master
v: v3
  • Loading branch information
Benoit Goby authored and Greg Kroah-Hartman committed May 10, 2012
1 parent dd54b12 commit d1d7d79
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 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: 80134da9d244eddbc840a446bdda2ac80932a769
refs/heads/master: 1fbfeff9274561d110eb796e60726bc54e95db97
29 changes: 10 additions & 19 deletions trunk/drivers/usb/gadget/f_rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct f_rndis {
struct gether port;
u8 ctrl_id, data_id;
u8 ethaddr[ETH_ALEN];
u32 vendorID;
const char *manufacturer;
int config;

struct usb_ep *notify;
Expand Down Expand Up @@ -768,12 +770,10 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
rndis_set_param_medium(rndis->config, NDIS_MEDIUM_802_3, 0);
rndis_set_host_mac(rndis->config, rndis->ethaddr);

#if 0
// FIXME
if (rndis_set_param_vendor(rndis->config, vendorID,
manufacturer))
goto fail0;
#endif
if (rndis->manufacturer && rndis->vendorID &&
rndis_set_param_vendor(rndis->config, rndis->vendorID,
rndis->manufacturer))
goto fail;

/* NOTE: all that is done without knowing or caring about
* the network link ... which is unavailable to this code
Expand Down Expand Up @@ -841,20 +841,9 @@ static inline bool can_support_rndis(struct usb_configuration *c)
return true;
}

/**
* rndis_bind_config - add RNDIS network link to a configuration
* @c: the configuration to support the network link
* @ethaddr: a buffer in which the ethernet address of the host side
* side of the link was recorded
* Context: single threaded during gadget setup
*
* Returns zero on success, else negative errno.
*
* Caller must have called @gether_setup(). Caller is also responsible
* for calling @gether_cleanup() before module unload.
*/
int
rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
u32 vendorID, const char *manufacturer)
{
struct f_rndis *rndis;
int status;
Expand Down Expand Up @@ -899,6 +888,8 @@ rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
goto fail;

memcpy(rndis->ethaddr, ethaddr, ETH_ALEN);
rndis->vendorID = vendorID;
rndis->manufacturer = manufacturer;

/* RNDIS activates when the host changes this filter */
rndis->port.cdc_filter = 0;
Expand Down
25 changes: 23 additions & 2 deletions trunk/drivers/usb/gadget/u_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,37 @@ int eem_bind_config(struct usb_configuration *c);

#ifdef USB_ETH_RNDIS

int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
u32 vendorID, const char *manufacturer);

#else

static inline int
rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
u32 vendorID, const char *manufacturer)
{
return 0;
}

#endif

/**
* rndis_bind_config - add RNDIS network link to a configuration
* @c: the configuration to support the network link
* @ethaddr: a buffer in which the ethernet address of the host side
* side of the link was recorded
* Context: single threaded during gadget setup
*
* Returns zero on success, else negative errno.
*
* Caller must have called @gether_setup(). Caller is also responsible
* for calling @gether_cleanup() before module unload.
*/
static inline int rndis_bind_config(struct usb_configuration *c,
u8 ethaddr[ETH_ALEN])
{
return rndis_bind_config_vendor(c, ethaddr, 0, NULL);
}


#endif /* __U_ETHER_H */

0 comments on commit d1d7d79

Please sign in to comment.