summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/u_ether.h
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/u_ether.h
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/u_ether.h')
-rw-r--r--drivers/usb/gadget/u_ether.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h
index 02522338a70..02f58acdd5e 100644
--- a/drivers/usb/gadget/u_ether.h
+++ b/drivers/usb/gadget/u_ether.h
@@ -21,6 +21,26 @@
#include "gadget_chips.h"
+#define QMULT_DEFAULT 5
+
+/*
+ * dev_addr: initial value
+ * changed by "ifconfig usb0 hw ether xx:xx:xx:xx:xx:xx"
+ * host_addr: this address is invisible to ifconfig
+ */
+#define USB_ETHERNET_MODULE_PARAMETERS() \
+ static unsigned qmult = QMULT_DEFAULT; \
+ module_param(qmult, uint, S_IRUGO|S_IWUSR); \
+ MODULE_PARM_DESC(qmult, "queue length multiplier at high/super speed");\
+ \
+ static char *dev_addr; \
+ module_param(dev_addr, charp, S_IRUGO); \
+ MODULE_PARM_DESC(dev_addr, "Device Ethernet Address"); \
+ \
+ static char *host_addr; \
+ module_param(host_addr, charp, S_IRUGO); \
+ MODULE_PARM_DESC(host_addr, "Host Ethernet Address")
+
struct eth_dev;
/*
@@ -71,8 +91,9 @@ struct gether {
|USB_CDC_PACKET_TYPE_DIRECTED)
/* variant of gether_setup that allows customizing network device name */
-struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
- const char *netname);
+struct eth_dev *gether_setup_name(struct usb_gadget *g,
+ const char *dev_addr, const char *host_addr,
+ u8 ethaddr[ETH_ALEN], unsigned qmult, const char *netname);
/* netdev setup/teardown as directed by the gadget driver */
/* gether_setup - initialize one ethernet-over-usb link
@@ -88,9 +109,10 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
* Returns negative errno, or zero on success
*/
static inline struct eth_dev *gether_setup(struct usb_gadget *g,
- u8 ethaddr[ETH_ALEN])
+ const char *dev_addr, const char *host_addr,
+ u8 ethaddr[ETH_ALEN], unsigned qmult)
{
- return gether_setup_name(g, ethaddr, "usb");
+ return gether_setup_name(g, dev_addr, host_addr, ethaddr, qmult, "usb");
}
void gether_cleanup(struct eth_dev *dev);