That's part of the Linux kernel, not i.MX6-specific. Search for something like "Linux USB gadget ethernet" on the internet or have a look in the kernel's documentation folder.
Thanks all.
There is nothing special to i.MX. You simply need to have a driver for your Ethernet card.