diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-05-23 11:22:03 +0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-06-10 18:10:57 +0400 |
commit | f1a1823ff24fa4e3412b5078f20021cf40834946 (patch) | |
tree | 7ede1143ae2a4945b5ed9f5292c84d39edea86b6 /drivers/usb/gadget/ether.c | |
parent | d68c277b501889b3a50c179d1c3d704db7947b83 (diff) | |
download | linux-f1a1823ff24fa4e3412b5078f20021cf40834946.tar.xz |
usb: gadget: u_ether: convert into module
u_ether.c has been #include'd by all gadgets which implement
USB Ethernet functions. In order to add configfs support,
the f_ecm.c, f_eem.c, f_ncm.c, f_subset.c, f_rndis.c need to be
converted into modules and must not be #include'd. Consequently,
the u_ether.c needs to be a module too, in a manner similar
to u_serial.c. The resulting module should not take any parameters,
so they are pushed to the current users of it, that is ether.c,
g_ffs.c, multi.c, ncm.c, nokia.c.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r-- | drivers/usb/gadget/ether.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 56c8ecae9bc3..75418c7050fb 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -107,11 +107,12 @@ static inline bool has_rndis(void) #include "rndis.c" #endif #include "f_eem.c" -#include "u_ether.c" /*-------------------------------------------------------------------------*/ USB_GADGET_COMPOSITE_OPTIONS(); +USB_ETHERNET_MODULE_PARAMETERS(); + /* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!! * Instead: allocate your own, using normal USB-IF procedures. */ @@ -206,7 +207,7 @@ static struct usb_gadget_strings *dev_strings[] = { NULL, }; -static u8 hostaddr[ETH_ALEN]; +static u8 host_mac[ETH_ALEN]; static struct eth_dev *the_dev; /*-------------------------------------------------------------------------*/ @@ -224,7 +225,7 @@ static int __init rndis_do_config(struct usb_configuration *c) c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; } - return rndis_bind_config(c, hostaddr, the_dev); + return rndis_bind_config(c, host_mac, the_dev); } static struct usb_configuration rndis_config_driver = { @@ -259,9 +260,9 @@ static int __init eth_do_config(struct usb_configuration *c) if (use_eem) return eem_bind_config(c, the_dev); else if (can_support_ecm(c->cdev->gadget)) - return ecm_bind_config(c, hostaddr, the_dev); + return ecm_bind_config(c, host_mac, the_dev); else - return geth_bind_config(c, hostaddr, the_dev); + return geth_bind_config(c, host_mac, the_dev); } static struct usb_configuration eth_config_driver = { @@ -279,7 +280,8 @@ static int __init eth_bind(struct usb_composite_dev *cdev) int status; /* set up network link layer */ - the_dev = gether_setup(cdev->gadget, hostaddr); + the_dev = gether_setup(cdev->gadget, dev_addr, host_addr, host_mac, + qmult); if (IS_ERR(the_dev)) return PTR_ERR(the_dev); |