summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ncm.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/ncm.c
parentd68c277b501889b3a50c179d1c3d704db7947b83 (diff)
downloadop-kernel-dev-f1a1823ff24fa4e3412b5078f20021cf40834946.zip
op-kernel-dev-f1a1823ff24fa4e3412b5078f20021cf40834946.tar.gz
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/ncm.c')
-rw-r--r--drivers/usb/gadget/ncm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c
index 3b02fd4..e411135 100644
--- a/drivers/usb/gadget/ncm.c
+++ b/drivers/usb/gadget/ncm.c
@@ -37,7 +37,6 @@
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#include "f_ncm.c"
-#include "u_ether.c"
/*-------------------------------------------------------------------------*/
@@ -54,6 +53,8 @@
/*-------------------------------------------------------------------------*/
USB_GADGET_COMPOSITE_OPTIONS();
+USB_ETHERNET_MODULE_PARAMETERS();
+
static struct usb_device_descriptor device_desc = {
.bLength = sizeof device_desc,
.bDescriptorType = USB_DT_DEVICE,
@@ -112,7 +113,7 @@ static struct usb_gadget_strings *dev_strings[] = {
};
struct eth_dev *the_dev;
-static u8 hostaddr[ETH_ALEN];
+static u8 host_mac[ETH_ALEN];
/*-------------------------------------------------------------------------*/
@@ -125,7 +126,7 @@ static int __init ncm_do_config(struct usb_configuration *c)
c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
}
- return ncm_bind_config(c, hostaddr, the_dev);
+ return ncm_bind_config(c, host_mac, the_dev);
}
static struct usb_configuration ncm_config_driver = {
@@ -144,7 +145,8 @@ static int __init gncm_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);
OpenPOWER on IntegriCloud