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:

committed by
Felipe Balbi

parent
d68c277b50
commit
f1a1823ff2
@@ -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);
|
||||
|
Reference in New Issue
Block a user