Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> --- drivers/usb/gadget/Kconfig | 1 + drivers/usb/gadget/g_ffs.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 8e81699..bb9c578 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -792,6 +792,7 @@ config USB_FUNCTIONFS_ETH depends on USB_FUNCTIONFS && NET select USB_U_ETHER select USB_F_ECM + select USB_F_SUBSET help Include a configuration with CDC ECM function (Ethernet) and the Function Filesystem. diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c index be6f2dd..f7bdd62 100644 --- a/drivers/usb/gadget/g_ffs.c +++ b/drivers/usb/gadget/g_ffs.c @@ -29,8 +29,7 @@ # endif # include "u_ecm.h" -#define USB_FSUBSET_INCLUDED -# include "f_subset.c" +# include "u_gether.h" # ifdef USB_ETH_RNDIS # include "f_rndis.c" # include "rndis.h" @@ -538,7 +537,38 @@ static int eth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], return 0; } else { - return geth_bind_config(c, ethaddr, dev); + struct gfs_configuration *gfs_conf; + struct usb_function_instance *f_gether_inst; + struct usb_function *f_gether; + struct f_gether_opts *gether_opts; + int status; + + gfs_conf = to_gfs_configuration(c); + gfs_conf->fi = f_gether_inst = + usb_get_function_instance("geth"); + if (IS_ERR(f_gether_inst)) + return PTR_ERR(f_gether_inst); + + gether_opts = container_of(f_gether_inst, struct f_gether_opts, + func_inst); + gether_opts->ethaddr = ethaddr; + gether_opts->dev = dev; + + gfs_conf->f = f_gether = usb_get_function(f_gether_inst); + if (IS_ERR(f_gether)) { + status = PTR_ERR(f_gether); + usb_put_function_instance(f_gether_inst); + return status; + } + + status = usb_add_function(c, f_gether); + if (status < 0) { + usb_put_function(f_gether); + usb_put_function_instance(f_gether_inst); + return status; + } + + return 0; } } -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html