usb-ctrl: Support ecm device

Enhance this script to support insert/eject ecm device, so that BMC
could "attach" a virtual USB ethernet between the BMC and the host.

Note that the function depends on the ECM related kernel configs.
To insert/eject ecm device:

  usb-ctrl ecm usb0 on
  usb-ctrl ecm usb0 off

Tested: Build kernel with below extra configs, and verify that
        the above commands creates/remove the USB ethernet bewteen
        BMC and host.

           +CONFIG_USB_U_ETHER=y
           +CONFIG_USB_F_ECM=y
           +CONFIG_USB_CONFIGFS_ECM=y

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I22796076609abaeab5c1e9e7996bcac28e7f6348
1 file changed
tree: 14e53a27c0cc08233558cda5b8818ccca1d37e70
  1. firstboot/
  2. http-redirect/
  3. usb-ctrl/
  4. .gitignore
  5. LICENSE
  6. meson.build
  7. meson_options.txt
  8. README.md
README.md

phosphor-misc

phosphor-misc is a collection of miscellaneous OpenBMC functions that doesn't really fit anywhere else.

Contributing

If you have a new function in mind to be hosted in phosphor-misc, it is usually a good idea to mention it on the OpenBMC mailing list before writing any code. There might already be an implementation of the desired function or the community may suggest alternatives.

phosphor-misc patches are reviewed using the Gerrit instance at https://gerrit.openbmc-project.xyz.

Please submit patches to Gerrit. More information on using Gerrit can be found here. https://github.com/openbmc/phosphor-misc is a hosting mirror only and GitHub pull requests are not monitored and will not be accepted.

Patch checklist. Please ensure patches adhere to the following guidelines:

For questions or help please come join us on the mailing list or in IRC.