summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/multi.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-23 09:22:03 +0200
committerFelipe Balbi <balbi@ti.com>2013-06-10 17:10:57 +0300
commitf1a1823ff24fa4e3412b5078f20021cf40834946 (patch)
tree7ede1143ae2a4945b5ed9f5292c84d39edea86b6 /drivers/usb/gadget/multi.c
parentd68c277b501889b3a50c179d1c3d704db7947b83 (diff)
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/multi.c')
-rw-r--r--drivers/usb/gadget/multi.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 4a45e80c6e38..cdb8dbf34c8d 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -49,10 +49,12 @@ MODULE_LICENSE("GPL");
# include "f_rndis.c"
# include "rndis.c"
#endif
-#include "u_ether.c"
+#include "u_ether.h"
USB_GADGET_COMPOSITE_OPTIONS();
+USB_ETHERNET_MODULE_PARAMETERS();
+
/***************************** Device Descriptor ****************************/
#define MULTI_VENDOR_NUM 0x1d6b /* Linux Foundation */
@@ -133,7 +135,7 @@ FSG_MODULE_PARAMETERS(/* no prefix */, fsg_mod_data);
static struct fsg_common fsg_common;
-static u8 hostaddr[ETH_ALEN];
+static u8 host_mac[ETH_ALEN];
static struct usb_function_instance *fi_acm;
static struct eth_dev *the_dev;
@@ -152,7 +154,7 @@ static __init int rndis_do_config(struct usb_configuration *c)
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}
- ret = rndis_bind_config(c, hostaddr, the_dev);
+ ret = rndis_bind_config(c, host_mac, the_dev);
if (ret < 0)
return ret;
@@ -216,7 +218,7 @@ static __init int cdc_do_config(struct usb_configuration *c)
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}
- ret = ecm_bind_config(c, hostaddr, the_dev);
+ ret = ecm_bind_config(c, host_mac, the_dev);
if (ret < 0)
return ret;
@@ -280,7 +282,8 @@ static int __ref multi_bind(struct usb_composite_dev *cdev)
}
/* 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);