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>
This commit is contained in:
Andrzej Pietrasiewicz
2013-05-23 09:22:03 +02:00
committed by Felipe Balbi
parent d68c277b50
commit f1a1823ff2
10 changed files with 98 additions and 52 deletions

View File

@@ -41,11 +41,13 @@
#include "f_ecm.c"
#include "f_obex.c"
#include "f_phonet.c"
#include "u_ether.c"
#include "u_ether.h"
/*-------------------------------------------------------------------------*/
USB_GADGET_COMPOSITE_OPTIONS();
USB_ETHERNET_MODULE_PARAMETERS();
#define NOKIA_VENDOR_ID 0x0421 /* Nokia */
#define NOKIA_PRODUCT_ID 0x01c8 /* Nokia Gadget */
@@ -98,7 +100,7 @@ MODULE_LICENSE("GPL");
/*-------------------------------------------------------------------------*/
static struct usb_function *f_acm_cfg1;
static struct usb_function *f_acm_cfg2;
static u8 hostaddr[ETH_ALEN];
static u8 host_mac[ETH_ALEN];
static struct eth_dev *the_dev;
enum {
@@ -152,7 +154,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
if (status)
goto err_conf;
status = ecm_bind_config(c, hostaddr, the_dev);
status = ecm_bind_config(c, host_mac, the_dev);
if (status) {
pr_debug("could not bind ecm config %d\n", status);
goto err_ecm;
@@ -186,7 +188,8 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
goto err_ether;
}
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)) {
status = PTR_ERR(the_dev);
goto err_ether;