diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc index 29d3cd32..bd2d93f4 100644 --- a/rootdir/etc/init.qcom.usb.rc +++ b/rootdir/etc/init.qcom.usb.rc @@ -447,21 +447,27 @@ on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmn setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=rndis + setprop sys.usb.config rndis,${persist.sys.usb.config.extra} + +on property:sys.usb.config=rndis,none write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 05C6 write /sys/class/android_usb/android0/idProduct F00E write /sys/class/android_usb/android0/functions rndis write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis on property:sys.usb.config=rndis,adb + setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb + +on property:sys.usb.config=rndis,none,adb write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/idVendor 05C6 write /sys/class/android_usb/android0/idProduct 9024 write /sys/class/android_usb/android0/functions rndis,adb write /sys/class/android_usb/android0/enable 1 start adbd - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis,adb on property:sys.usb.config=rndis,diag write /sys/class/android_usb/android0/enable 0 @@ -470,7 +476,7 @@ on property:sys.usb.config=rndis,diag write /sys/class/android_usb/android0/f_diag/clients diag write /sys/class/android_usb/android0/functions rndis,diag write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis on property:sys.usb.config=rndis,diag,adb write /sys/class/android_usb/android0/enable 0 @@ -480,7 +486,7 @@ on property:sys.usb.config=rndis,diag,adb write /sys/class/android_usb/android0/functions rndis,diag,adb write /sys/class/android_usb/android0/enable 1 start adbd - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis,adb on property:sys.usb.config=rndis,diag,diag_mdm write /sys/class/android_usb/android0/enable 0 @@ -489,7 +495,7 @@ on property:sys.usb.config=rndis,diag,diag_mdm write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm write /sys/class/android_usb/android0/functions rndis,diag write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis on property:sys.usb.config=rndis,diag,diag_mdm,adb write /sys/class/android_usb/android0/enable 0 @@ -499,7 +505,7 @@ on property:sys.usb.config=rndis,diag,diag_mdm,adb write /sys/class/android_usb/android0/functions rndis,diag,adb write /sys/class/android_usb/android0/enable 1 start adbd - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis,adb on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc write /sys/class/android_usb/android0/enable 0 @@ -508,7 +514,7 @@ on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc write /sys/class/android_usb/android0/functions rndis,diag write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,adb write /sys/class/android_usb/android0/enable 0 @@ -518,7 +524,7 @@ on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,adb write /sys/class/android_usb/android0/functions rndis,diag,adb write /sys/class/android_usb/android0/enable 1 start adbd - setprop sys.usb.state ${sys.usb.config} + setprop sys.usb.state rndis,adb on property:sys.usb.config=ptp write /sys/class/android_usb/android0/enable 0 diff --git a/rootdir/etc/init.qcom.usb.sh b/rootdir/etc/init.qcom.usb.sh index 5b3f5e84..a2aa61b1 100644 --- a/rootdir/etc/init.qcom.usb.sh +++ b/rootdir/etc/init.qcom.usb.sh @@ -193,3 +193,33 @@ case "$baseband" in chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait ;; esac + + +# +# Add changes to support diag with rndis +# +diag_extra=`getprop persist.sys.usb.config.extra` +case "$diag_extra" in + "diag" | "diag,diag_mdm" | "diag,diag_mdm,diag_qsc") + case "$baseband" in + "mdm") + setprop persist.sys.usb.config.extra diag,diag_mdm + ;; + "dsda" | "sglte2" ) + setprop persist.sys.usb.config.extra diag,diag_mdm,diag_qsc + ;; + "sglte") + setprop persist.sys.usb.config.extra diag,diag_qsc + ;; + "dsda2") + setprop persist.sys.usb.config.extra diag,diag_mdm,diag_mdm2 + ;; + *) + setprop persist.sys.usb.config.extra diag + ;; + esac + ;; + *) + setprop persist.sys.usb.config.extra none + ;; +esac