Add usb rndis storage

Signed-off-by: yannikli <liyanqing18@huawei.com>
Change-Id: I6ee88823566124418d62c9f0f8828d5372249ded
This commit is contained in:
yannikli 2022-08-17 17:26:56 +08:00
parent 91ca5757f8
commit eecf29faa1

View File

@ -10,7 +10,10 @@
"write /config/usb_gadget/g1/bDeviceSubClass 0",
"write /config/usb_gadget/g1/bDeviceProtocol 0",
"rm /config/usb_gadget/g1/configs/b.1/f1",
"rm /config/usb_gadget/g1/functions/rndis.rn0",
"rm /config/usb_gadget/g1/configs/b.1/rndis.rn0",
"rmdir /config/usb_gadget/g1/functions/rndis.rn0",
"rm /config/usb_gadget/g1/configs/b.1/mass_storage.usb",
"rmdir /config/usb_gadget/g1/functions/mass_storage.usb",
"setparam sys.usb.state ${sys.usb.config}"
]
}, {
@ -40,7 +43,53 @@
"cmds" : [
"mkdir /config/usb_gadget/g1/functions/rndis.rn0",
"write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration rndis",
"symlink /config/usb_gadget/g1/functions/rndis.rn0 /config/usb_gadget/g1/configs/b.1/f1",
"symlink /config/usb_gadget/g1/functions/rndis.rn0 /config/usb_gadget/g1/configs/b.1/rndis.rn0",
"write /config/usb_gadget/g1/UDC ${sys.usb.controller}",
"setparam sys.usb.state ${sys.usb.config}"
]
}, {
"name" : "param:sys.usb.config=rndis_hdc && param:sys.usb.configfs=1",
"condition" : "sys.usb.config=rndis_hdc && sys.usb.configfs=1",
"cmds" : [
"mkdir /config/usb_gadget/g1/functions/rndis.rn0",
"symlink /config/usb_gadget/g1/functions/rndis.rn0 /config/usb_gadget/g1/configs/b.1/rndis.rn0",
"start hdcd"
]
}, {
"name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=rndis_hdc && param:sys.usb.configfs=1",
"condition" : "sys.usb.ffs.ready=1 && sys.usb.config=rndis_hdc && sys.usb.configfs=1",
"cmds" : [
"write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration rndis_hdc",
"symlink /config/usb_gadget/g1/functions/ffs.hdc /config/usb_gadget/g1/configs/b.1/f1",
"write /config/usb_gadget/g1/UDC ${sys.usb.controller}",
"setparam sys.usb.state ${sys.usb.config}"
]
}, {
"name" : "param:sys.usb.config=storage && param:sys.usb.configfs=1",
"condition" : "sys.usb.config=storage && sys.usb.configfs=1",
"cmds" : [
"mkdir /config/usb_gadget/g1/functions/mass_storage.usb",
"write /config/usb_gadget/g1/functions/mass_storage.usb/lun.0/file /dev/block/mmcblk0p11",
"write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration mass_storage",
"symlink /config/usb_gadget/g1/functions/mass_storage.usb /config/usb_gadget/g1/configs/b.1/mass_storage.usb",
"write /config/usb_gadget/g1/UDC ${sys.usb.controller}",
"setparam sys.usb.state ${sys.usb.config}"
]
}, {
"name" : "param:sys.usb.config=storage_hdc && param:sys.usb.configfs=1",
"condition" : "sys.usb.config=storage_hdc && sys.usb.configfs=1",
"cmds" : [
"mkdir /config/usb_gadget/g1/functions/mass_storage.usb",
"write /config/usb_gadget/g1/functions/mass_storage.usb/lun.0/file /dev/block/mmcblk0p11",
"symlink /config/usb_gadget/g1/functions/mass_storage.usb /config/usb_gadget/g1/configs/b.1/mass_storage.usb",
"start hdcd"
]
}, {
"name" : "param:sys.usb.ffs.ready=1 && param:sys.usb.config=storage_hdc && param:sys.usb.configfs=1",
"condition" : "sys.usb.ffs.ready=1 && sys.usb.config=storage_hdc && sys.usb.configfs=1",
"cmds" : [
"write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration storage_hdc",
"symlink /config/usb_gadget/g1/functions/ffs.hdc /config/usb_gadget/g1/configs/b.1/f1",
"write /config/usb_gadget/g1/UDC ${sys.usb.controller}",
"setparam sys.usb.state ${sys.usb.config}"
]