commit | 2af04734ff808452c24e893aae6303698a35048c | [log] [tgz] |
---|---|---|
author | Igor Kononenko <i.kononenko@yadro.com> | Tue Sep 15 15:09:34 2020 +0300 |
committer | Igor Kononenko <i.kononenko@yadro.com> | Tue Sep 22 12:43:23 2020 +0300 |
tree | 9623d639036fb9d9cc02d72cf2f2517eaf0c941c | |
parent | aeacd252676fffa9eb8a5dc50f54b923855bd5b2 [diff] |
usb-ctrl: adds to configure the usb interface type Implementation of adjust interface type of inserting usb-gadget: ```usb-ctrl insert <name> <file> [<type=usb|usb-ro|hdd|cdrom>]``` * usb - RW, Removable USB-flash * usb-ro - RO, USB-flash * hdd - RW, USB-HDD * cdrom - RO, Removable USB-CDROM If type not specified or illegal then using 'usb-ro' as default Tested: calling `usb-ctrl insert` with each posible value (usb|usb-ro|hdd|cdrom); additionally been call with empty value and with invalid value 'err_type': * ``` root@:~# usb-ctrl insert usb0 /dev/nbd0 usb root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 1 root@:~# usb-ctrl insert usb0 /dev/nbd0 usb-ro root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 1 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 1 root@:~# usb-ctrl insert usb0 /dev/nbd0 hdd root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 0 root@:~# usb-ctrl insert usb0 /dev/nbd0 cdrom root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 1 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 1 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 1 root@:~# usb-ctrl insert usb0 /dev/nbd0 No mass-storage interface type specified or illegal Configuring interface type to 'usb-ro' root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 1 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 1 root@:~# usb-ctrl insert usb0 /dev/nbd0 err_type No mass-storage interface type specified or illegal Configuring interface type to 'usb-ro' root@:~# cat /sys/.../mass-storage/....usb0/lun.0/cdrom 0 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/ro 1 root@:~# cat /sys/.../mass-storage/....usb0/lun.0/removable 1 ``` Signed-off-by: Igor Kononenko <i.kononenko@yadro.com> Change-Id: I46155e28ec7a441863ce86f425a46ac1297444ed
phosphor-misc is a collection of miscellaneous OpenBMC functions that doesn't really fit anywhere else.
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.