mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-06-08 02:54:40 +08:00
simple qcom init (#569)
* start merging the qcom init * remove duplicate adsp crap * ipa * rm chgrp-diag * remove ab_mount.sh * rm wlan_daemon * rm more unused * usb cleanup * rm sfsconifg * rm more usb junk * rm getslotsuffix * lil more
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting atreset: "
|
||||
start-stop-daemon -S -b -x /sbin/init_mss
|
||||
echo "done"
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping atreset: "
|
||||
start-stop-daemon -K -n init_mss
|
||||
echo "done"
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage init_mss{ start | stop | restart }" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
#==============================================================================
|
||||
# FILE: ipa_fws.sh
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# Indicate to IPA driver that FWs are available from user space for fetching
|
||||
# and loading
|
||||
#
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#==============================================================================
|
||||
# Look for ipa_config.txt file and cat it's content to /dev/ipa before ipa is ready.
|
||||
# A write of 1 or MHI to /dev/ipa will indicate that user space is available and the
|
||||
# FWs can be fetched.
|
||||
FILE=/data/misc/ipa/ipa_config.txt
|
||||
if [ -f $FILE ]; then
|
||||
echo $(cat $FILE) > /dev/ipa
|
||||
fi
|
||||
# replace 1 with mhi if mhi usecases is execersized.
|
||||
echo 1 > /dev/ipa
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
# Starts the cnss_services daemon
|
||||
#
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
SSR_SUBSYS_PATH=/sys/bus/msm_subsys/devices
|
||||
SSR_SUBSYS=`ls -d $SSR_SUBSYS_PATH/subsys*`
|
||||
SSR_CLD_SUBSYS_NAME=AR6320
|
||||
SSR_RESTART_LEVEL=system
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting cnss_daemon... $@"
|
||||
if [ -e /tmp/cnss_daemon.log ];
|
||||
then
|
||||
echo "Starting cnss_daemon..." >> /tmp/cnss_daemon.log
|
||||
start-stop-daemon -S -x /usr/sbin/cnss_daemon -- -d -f /tmp/cnss_daemon.log
|
||||
else
|
||||
start-stop-daemon -S -x /usr/sbin/cnss_daemon
|
||||
fi
|
||||
echo "done"
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping cnss_services: "
|
||||
start-stop-daemon -K -n /usr/sbin/cnss_daemon
|
||||
echo "done"
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: cnss_daemon { start | stop | restart }" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#It is for sda845-ubuntu
|
||||
|
||||
export MODULE_BASE=/lib/modules/`uname -r`
|
||||
export RETRY_LIMIT=3
|
||||
HELP="Usage $0 {start | stop | restart} <ap | sta>"
|
||||
DUMP_TO_KMSG=/dev/kmsg
|
||||
|
||||
do_ctrl_nl80211() {
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting WLAN... $@" > $DUMP_TO_KMSG
|
||||
shift
|
||||
|
||||
set -e
|
||||
insmod $MODULE_BASE/extra/wlan.ko $@
|
||||
set +e
|
||||
|
||||
c=1
|
||||
ifconfig wlan0 up 2> /dev/null
|
||||
rc=$?
|
||||
while [ $rc -ne 0 -a $c -le $RETRY_LIMIT ]; do
|
||||
sleep 1
|
||||
ifconfig wlan0 up 2> /dev/null
|
||||
rc=$?
|
||||
c=`expr $c + 1`
|
||||
done
|
||||
|
||||
if [ $c -gt $RETRY_LIMIT ]; then
|
||||
echo "WLAN bring-up failed!" > $DUMP_TO_KMSG
|
||||
exit 1
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "Stopping WLAN..." > $DUMP_TO_KMSG
|
||||
ifconfig wlan0 down
|
||||
rmmod wlan
|
||||
;;
|
||||
|
||||
restart)
|
||||
do_ctrl_nl80211 stop
|
||||
shift
|
||||
do_ctrl_nl80211 start $@
|
||||
|
||||
return $?
|
||||
;;
|
||||
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
do_ctrl_nl80211 $@
|
||||
if [ $? -ne 0 ]; then
|
||||
echo $HELP >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||
|
||||
suffix=$(getslotsuffix)
|
||||
partition=$3${suffix}
|
||||
|
||||
count=0
|
||||
while [ ! -h "$partition" ]; do
|
||||
sleep 0.1
|
||||
# wait 10s for file
|
||||
count=$(( $count + 1 ))
|
||||
if [ $count -ge 100 ]; then
|
||||
echo "[ERROR] Can not find the"$partition
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
mount -o $1 -t $2 $partition $4
|
||||
result=$?
|
||||
if [ 0 -ne $result ];then
|
||||
sleep 2
|
||||
mount -o $1 -t $2 $partition $4
|
||||
fi
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
###############################################################################
|
||||
#
|
||||
# This script is used for System V init scripts to start adsp
|
||||
#
|
||||
# Copyright (c) 2012-2016 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting adsp: "
|
||||
/usr/local/qr-linux/adsp-start.sh
|
||||
echo "done"
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping adsp: "
|
||||
echo 0 > /sys/kernel/boot_adsp/boot
|
||||
echo "done"
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage adsp.sh { start | stop | restart}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#change the group that owns /dev/diag and change permissions to user rw and group rw (no other rw)
|
||||
chgrp diag /dev/diag
|
||||
chmod 660 /dev/diag
|
||||
chown diag:diag /media/card
|
||||
chown diag:diag /sdcard
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
#==============================================================================
|
||||
# FILE: sfs_config
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# create files and give permissions to the files and directories needed by
|
||||
# secure file system
|
||||
#
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#==============================================================================
|
||||
set -e
|
||||
|
||||
soc_id=`cat /sys/devices/soc0/soc_id`
|
||||
|
||||
if [[ "$soc_id" -ne "290" && "$soc_id" -ne "296" && "$soc_id" -ne "297" && "$soc_id" -ne "298" && "$soc_id" -ne "299" ]]; then
|
||||
if [ "$soc_id" -eq "341" ]; then
|
||||
if [[ -e /data/persist && ! -e /persist ]]; then
|
||||
ln -sf /data/persist /persist
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /persist ]; then
|
||||
if [ ! -d /persist/data ]; then
|
||||
echo "Creating /persist/data"
|
||||
mkdir /persist/data
|
||||
fi
|
||||
chmod o+rwx /persist/data
|
||||
fi
|
||||
|
||||
if [ ! -d /data/misc ]; then
|
||||
echo "Creating /data/misc"
|
||||
mkdir /data/misc
|
||||
fi
|
||||
chmod o+rwx /data/misc
|
||||
if [ ! -d /persist/tzstorage ]; then
|
||||
echo "Creating /persist/tzstorage"
|
||||
mkdir -p /persist/tzstorage
|
||||
fi
|
||||
chmod o+rwx /persist/tzstorage
|
||||
if [ ! -L /data/vendor/tzstorage ]; then
|
||||
echo "Creating /data/vendor/tzstorage"
|
||||
mkdir -p /data/vendor/
|
||||
ln -s /persist/tzstorage /data/vendor/tzstorage
|
||||
fi
|
||||
|
||||
echo "SFS configuration completed."
|
||||
fi
|
||||
exit 0
|
||||
@@ -1,192 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015, 2018, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Starts the USB Android Gadget.
|
||||
export KERNEL=`uname -r`
|
||||
export SOFTAP_W_DUN="N"
|
||||
export ANDROID_LOG_TAGS="*:d"
|
||||
export LS_COLORS="none"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -d /sys/class/android_usb/android0/f_ffs ]
|
||||
then
|
||||
echo adb > /sys/class/android_usb/android0/f_ffs/aliases
|
||||
fi
|
||||
|
||||
# get soc platform to update product related information
|
||||
if [ -f /sys/devices/soc0/hw_platform ]; then
|
||||
socplatform=`cat /sys/devices/soc0/machine` 2> /dev/null
|
||||
soc_hwplatform=`cat /sys/devices/soc0/hw_platform`
|
||||
soc_subtypeid=`cat /sys/devices/soc0/platform_subtype_id`
|
||||
else
|
||||
socplatform=`cat /sys/devices/system/soc/soc0/machine` 2> /dev/null
|
||||
fi
|
||||
echo "soc:" $socplatform
|
||||
|
||||
# find serialno from cmdline
|
||||
serialno=`cat /proc/cmdline | grep -o "androidboot.serialno=[A-Za-z0-9]*" | cut -d "=" -f2`
|
||||
if [ "$serialno" == "" ]; then
|
||||
echo "serialno not found with cmdline, use default"
|
||||
serialno="12345678"
|
||||
fi
|
||||
echo "serialno:" $serialno
|
||||
|
||||
msm_serial=`cat /sys/devices/soc0/serial_number`
|
||||
msm_serial_hex=`printf %08X $msm_serial`
|
||||
product_string="$socplatform-$soc_hwplatform _SN:$msm_serial_hex"
|
||||
|
||||
# try to mount configfs, and create instance of USB functions if it goes through
|
||||
mount -t configfs none /sys/kernel/config
|
||||
if [ -d /sys/kernel/config/usb_gadget ]; then
|
||||
echo "Configuring the USB gadget using ConfigFS..."
|
||||
cd /sys/kernel/config/usb_gadget
|
||||
mkdir g1
|
||||
cd g1
|
||||
mkdir strings/0x409
|
||||
mkdir configs/c.1
|
||||
mkdir configs/c.1/strings/0x409
|
||||
mkdir functions/mass_storage.0
|
||||
mkdir functions/mass_storage.1
|
||||
mkdir functions/ffs.adb
|
||||
mkdir functions/diag.diag
|
||||
mkdir functions/cser.dun.0
|
||||
mkdir functions/cser.nmea.1
|
||||
mkdir functions/gser.0
|
||||
mkdir functions/rmnet_bam.rmnet
|
||||
mkdir functions/gsi.rmnet
|
||||
mkdir functions/gsi.rndis
|
||||
mkdir functions/gsi.ecm
|
||||
mkdir functions/gsi.mbim
|
||||
mkdir functions/gsi.dpl
|
||||
mkdir functions/gsi.gps
|
||||
mkdir functions/ncm.0
|
||||
mkdir functions/qdss.qdss
|
||||
mkdir functions/uac1.uac1
|
||||
if [ ! -s "/etc/adb_devid" ]
|
||||
then
|
||||
echo $serialno > /etc/adb_devid
|
||||
sync
|
||||
fi
|
||||
cat /etc/adb_devid > strings/0x409/serialnumber
|
||||
echo "QCOM" > strings/0x409/manufacturer
|
||||
echo "$product_string" > strings/0x409/product
|
||||
setprop sys.usb.configfs 1
|
||||
cd /
|
||||
fi
|
||||
|
||||
if [ -d /sys/class/android_usb/android0 ]
|
||||
then
|
||||
echo "$product_string" > /sys/class/android_usb/android0/iProduct
|
||||
fi
|
||||
|
||||
# mount functionfs
|
||||
mkdir -p /dev/usb-ffs/adb
|
||||
mount -o uid=2000,gid=2000 -t functionfs adb /dev/usb-ffs/adb
|
||||
mount -o remount,gid=5,mode=620 /dev/pts
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
# Nothing to do here for 9x15
|
||||
;;
|
||||
*9x25* )
|
||||
echo "Unbind EHCI HSIC host device driver"
|
||||
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
|
||||
;;
|
||||
*9x35* )
|
||||
echo "Unbind EHCI HSIC host device driver"
|
||||
echo f9a15000.hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
|
||||
echo 1 > /sys/devices/virtual/android_usb/android0/f_rndis_qc/max_pkt_per_xfer
|
||||
echo 3 > /sys/module/dwc3/parameters/bulk_ep_xfer_timeout_ms
|
||||
;;
|
||||
*8916* )
|
||||
echo 9091 > /etc/usb/boot_hsusb_comp
|
||||
;;
|
||||
*9640* )
|
||||
echo 16384 > /sys/module/g_android/parameters/rndis_dl_max_xfer_size
|
||||
;;
|
||||
*9650* )
|
||||
echo 16384 > /sys/module/g_android/parameters/gsi_in_rndis_aggr_size
|
||||
;;
|
||||
*sdx20* )
|
||||
echo Y > /sys/module/libcomposite/parameters/enable_l1_for_hs
|
||||
echo Y > /sys/module/dwc3/parameters/enable_dwc3_u1u2
|
||||
;;
|
||||
*8909* | *8053* | *8017* | *qcs605* | *qcs40x* )
|
||||
echo 901D > /etc/usb/boot_hsusb_comp
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable debug message
|
||||
if [ -f /sbin/usb/debuger/default_debug ];
|
||||
then
|
||||
rm -rf /sbin/usb/debuger/statusFile
|
||||
usb_debug -f on n /sbin/usb/debuger/default_debug
|
||||
fi
|
||||
|
||||
# enable concurrent SoftAP and DUN
|
||||
if [ -f /data/usb/softap_w_dun ]
|
||||
then
|
||||
SOFTAP_W_DUN=`cat /data/usb/softap_w_dun`
|
||||
fi
|
||||
|
||||
# boot hsic composition:
|
||||
if [ -d /sys/class/android_usb/android1 ]
|
||||
then
|
||||
pid=`cat /etc/usb/boot_hsic_comp`
|
||||
/sbin/usb/compositions/$pid y
|
||||
# let hsic compostion script run before starting hsusb
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# boot hsusb composition:
|
||||
if [ -d /sys/class/android_usb/android0 ]
|
||||
then
|
||||
pid=`cat /etc/usb/boot_hsusb_comp`
|
||||
/sbin/usb/compositions/$pid n
|
||||
|
||||
if [ "$SOFTAP_W_DUN" == "Y" ]
|
||||
then
|
||||
echo "DUN+SOFTAP mode is enabled."
|
||||
echo 1 > /sys/devices/virtual/android_usb/android0/f_serial/dun_w_softap_enable
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "Stopping USB Android Gadget"
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage usb { start | stop | restart}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#It is for sda845-ubuntu
|
||||
|
||||
export MODULE_BASE=/lib/modules/`uname -r`
|
||||
export RETRY_LIMIT=3
|
||||
HELP="Usage $0 {start | stop | restart} <ap | sta>"
|
||||
DUMP_TO_KMSG=/dev/kmsg
|
||||
|
||||
do_ctrl_nl80211() {
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting WLAN... $@" > $DUMP_TO_KMSG
|
||||
shift
|
||||
|
||||
set -e
|
||||
insmod $MODULE_BASE/extra/wlan.ko $@
|
||||
set +e
|
||||
|
||||
c=1
|
||||
ifconfig wlan0 up 2> /dev/null
|
||||
rc=$?
|
||||
while [ $rc -ne 0 -a $c -le $RETRY_LIMIT ]; do
|
||||
sleep 1
|
||||
ifconfig wlan0 up 2> /dev/null
|
||||
rc=$?
|
||||
c=`expr $c + 1`
|
||||
done
|
||||
|
||||
if [ $c -gt $RETRY_LIMIT ]; then
|
||||
echo "WLAN bring-up failed!" > $DUMP_TO_KMSG
|
||||
exit 1
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "Stopping WLAN..." > $DUMP_TO_KMSG
|
||||
ifconfig wlan0 down
|
||||
rmmod wlan
|
||||
;;
|
||||
|
||||
restart)
|
||||
do_ctrl_nl80211 stop
|
||||
shift
|
||||
do_ctrl_nl80211 start $@
|
||||
|
||||
return $?
|
||||
;;
|
||||
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
do_ctrl_nl80211 $@
|
||||
if [ $? -ne 0 ]; then
|
||||
echo $HELP >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=chgrp-diag Service
|
||||
SourcePath=/etc/initscripts/chgrp-diag
|
||||
|
||||
[Service]
|
||||
Restart=no
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/initscripts/chgrp-diag start
|
||||
ExecStop=/etc/initscripts/chgrp-diag stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1 +0,0 @@
|
||||
/etc/systemd/chgrp-diag.service
|
||||
@@ -1 +0,0 @@
|
||||
/etc/systemd/system/sfsconfig.service
|
||||
@@ -1 +0,0 @@
|
||||
/etc/systemd/system/wlan_daemon.service
|
||||
@@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
|
||||
[Unit]
|
||||
Description=sfs configuration Service
|
||||
SourcePath=/etc/initscripts/sfs_config
|
||||
After=qseecomd.service
|
||||
|
||||
[Service]
|
||||
Restart=no
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/initscripts/sfs_config
|
||||
ExecStop=/etc/initscripts/sfs_config
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,42 +0,0 @@
|
||||
# Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
[Unit]
|
||||
Description=Wlan Service
|
||||
SourcePath=/etc/init.d/wlan
|
||||
Requires=wcnss_wlan.service
|
||||
After=persist.mount firmware-links.service wcnss_wlan.service usb.service
|
||||
|
||||
[Service]
|
||||
Restart=no
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/initscripts/wlan start
|
||||
ExecStop=/etc/initscripts/wlan stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,2 +0,0 @@
|
||||
SUBSYSTEM=="tty", KERNEL=="ttyHS0", GROUP="gpio", MODE="0660"
|
||||
SUBSYSTEM=="tty", KERNEL=="ttyUSB2", GROUP="gpio", MODE="0660"
|
||||
@@ -1 +0,0 @@
|
||||
901D
|
||||
@@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=adsp start service
|
||||
SourcePath=/etc/initscripts/adsp.sh
|
||||
|
||||
[Service]
|
||||
Restart=no
|
||||
TimeoutSec=5min
|
||||
RemainAfterExit=true
|
||||
ExecStart=/etc/initscripts/adsp.sh start
|
||||
ExecStop=/etc/initscripts/adsp.sh stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Start cdsp
|
||||
SourcePath=/usr/bin/cdsp.sh
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh /usr/bin/cdsp.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1 +0,0 @@
|
||||
/lib/systemd/system/init_sys_mss.service
|
||||
@@ -1 +0,0 @@
|
||||
/lib/systemd/system/rmt_storage.service
|
||||
@@ -1,16 +0,0 @@
|
||||
# Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=ipa firmware load script
|
||||
SourcePath=/etc/init.d/ipa_fws.sh
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Restart=no
|
||||
ExecStart=/etc/init.d/ipa_fws.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,12 +0,0 @@
|
||||
[Unit]
|
||||
Description=IRSC util Service
|
||||
SourcePath=/usr/bin/irsc_util
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/irsc_util /etc/sec_config
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
@@ -1 +0,0 @@
|
||||
/lib/systemd/system/adsp.service
|
||||
@@ -1 +0,0 @@
|
||||
/lib/systemd/system/ipa_fws.service
|
||||
@@ -1 +0,0 @@
|
||||
/lib/systemd/system/usb.service
|
||||
@@ -1,7 +1,6 @@
|
||||
[Unit]
|
||||
Description= Remote Storage Service
|
||||
SourcePath=/sbin/rmt_storage
|
||||
After=usb.service
|
||||
Before=init_sys_mss.service
|
||||
|
||||
[Service]
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
||||
|
||||
|
||||
[Unit]
|
||||
SourcePath=/etc/initscripts/usb
|
||||
Description=usb Service
|
||||
After=systemrw.mount leprop.service
|
||||
Requires=systemrw-adb_devid.service systemrw-boot_hsusb_comp.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Restart=no
|
||||
TimeoutSec=5min
|
||||
IgnoreSIGPIPE=no
|
||||
KillMode=process
|
||||
GuessMainPID=no
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/initscripts/usb start
|
||||
ExecStop=/etc/initscripts/usb stop
|
||||
@@ -1,103 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014,2017-2018, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB
|
||||
|
||||
echo "Switching to composition number 0x901D" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
if [ -f /sys/class/android_usb/android$num/enable ]; then
|
||||
configfs_supported="n"
|
||||
else
|
||||
configfs_supported="y"
|
||||
fi
|
||||
|
||||
run_non_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 901D > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x901d > idProduct
|
||||
echo "DIAG_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
* )
|
||||
if [ $configfs_supported = "y" ]; then
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
else
|
||||
run_non_configfs &
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -1,177 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + QMI_RMNET (Android)
|
||||
|
||||
echo "Switching to composition number 0x9021" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,bam2bam > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9021 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,rmnet_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9021 > idProduct
|
||||
echo "DIAG_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/gsi.rmnet configs/c.1/f2
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,205 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + QMI_RMNET (Android)
|
||||
|
||||
echo "Switching to composition number 0x9022" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo SMD,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9022 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,rmnet_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9022 > idProduct
|
||||
echo "DIAG_ADB_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/gsi.rmnet configs/c.1/f3
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,170 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS + ADB [Android]
|
||||
|
||||
echo "Switching to composition number 0x9024" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9024 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9024 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9024 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc,ffs > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9024 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_gsi,ffs > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9024 > idProduct
|
||||
echo "RNDIS_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*8017* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,252 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + MODEM + NMEA + QMI_RMNET + Mass Storage (Android)
|
||||
|
||||
echo "Switching to composition number 0x9025" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9025 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9025 > idProduct
|
||||
echo "DIAG_ADB_DUN_NMEA_RMNET_MSC" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
if [ -f /etc/data/usb/softap_w_dun ]
|
||||
then
|
||||
SOFTAP_W_DUN=`cat /etc/data/usb/softap_w_dun`
|
||||
fi
|
||||
if [ "$SOFTAP_W_DUN" == "Y" ]
|
||||
then
|
||||
ln -s functions/gser.0 configs/c.1/f3
|
||||
else
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
fi
|
||||
ln -s functions/cser.nmea.1 configs/c.1/f4
|
||||
ln -s functions/$2.rmnet configs/c.1/f5
|
||||
ln -s functions/mass_storage.0 configs/c.1/f6
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
echo "This composition can't be supported on 8909"
|
||||
;;
|
||||
*8096* )
|
||||
udcname="6a00000.dwc3"
|
||||
if [ -f /sys/class/android_usb/android$num/enable ]; then
|
||||
run_9x35 &
|
||||
else
|
||||
xport="rmnet_bam"
|
||||
run_configfs $udcname $xport &
|
||||
fi
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
xport="gsi"
|
||||
run_configfs $udcname $xport &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,169 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2014,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS + ADB + Mass Storage
|
||||
|
||||
echo "Switching to composition number 0x902B" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x902B > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc,adb,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902B > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis,adb,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902B > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc,ffs,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902B > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_gsi,ffs,mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x902B > idProduct
|
||||
echo "RNDIS_ADB_MS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/mass_storage.0 configs/c.1/f3
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS + DIAG + ADB [Android]
|
||||
|
||||
echo "Switching to composition number 0x902D" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x902D > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis_qc,diag,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902D > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis,diag,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902D > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android$num/f_diag/clients
|
||||
echo rndis_qc,diag,ffs > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android$num/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 902D > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android$num/f_diag/clients
|
||||
echo rndis_gsi,diag,ffs > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x902d > idProduct
|
||||
echo "RNDIS_DIAG_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/diag.diag configs/c.1/f2
|
||||
ln -s functions/ffs.adb configs/c.1/f3
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,77 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: MTP + ADB(Android)
|
||||
|
||||
echo "Switching to composition number 0x9039" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9039() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9039 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo mtp,adb > /sys/class/android_usb/android$num/functions
|
||||
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
case `/sbin/usb/target` in
|
||||
*8974* )
|
||||
run_9039 &
|
||||
;;
|
||||
*8096* | *8053* )
|
||||
run_9039 &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
@@ -1,242 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + DUN + RMNET + Mass Storage + QDSS [Android]
|
||||
|
||||
echo "Switching to composition number 0x9049" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9049 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9049 > idProduct
|
||||
echo "DIAG_ADB_SER_RMNET_MS_QDSS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
ln -s functions/gsi.rmnet configs/c.1/f4
|
||||
ln -s functions/mass_storage.0 configs/c.1/f5
|
||||
ln -s functions/qdss.qdss configs/c.1/f6
|
||||
echo 1 > functions/qdss.qdss/enable_debug_inface
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
echo "This composition can't be supported on 8909"
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,112 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + QDSS [Android]
|
||||
|
||||
echo "Switching to composition number 0x904A" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x904A > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,qdss > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 904A > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,qdss > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
pkill adbd
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x904A > idProduct
|
||||
echo "DIAG_QDSS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/qdss.qdss configs/c.1/f2
|
||||
echo 1 > functions/qdss.qdss/enable_debug_inface
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9x35 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,229 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + SERIAL + RMNET + Mass Storage + Audio [Android]
|
||||
|
||||
echo "Switching to composition number 0x9056" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo SMD,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9056 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,audio > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9056 > idProduct
|
||||
echo "DIAG_ADB_SER_RMNET_MS_AUDIO" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
ln -s functions/gsi.rmnet configs/c.1/f4
|
||||
ln -s functions/mass_storage.0 configs/c.1/f5
|
||||
ln -s functions/uac1.uac1 configs/c.1/f6
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
echo "This composition can't be supported on 8909"
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,152 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS : ECM
|
||||
|
||||
echo "Switching to composition number 0x9057" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9057 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9057 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_ecm_qc/ecm_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9057 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_qc:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9057 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis:ecm > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9057 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo rndis_gsi:ecm_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
pkill adbd
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9057 > idProduct
|
||||
echo "RNDIS" > configs/c.1/strings/0x409/configuration
|
||||
echo "ECM" > configs/c.2/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/gsi.ecm configs/c.2/f1
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,191 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG+ADB+RNDIS : ECM
|
||||
|
||||
echo "Switching to composition number 0x9059" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9059 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis_qc,diag,adb:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9059 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis,diag,adb:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_ecm_qc/ecm_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9059 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis_qc,diag,ffs:ecm_qc > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9059 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis,diag,adb:ecm > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9059 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo rndis_gsi,diag,adb:ecm_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9059 > idProduct
|
||||
echo "RNDIS_DIAG_ADB" > configs/c.1/strings/0x409/configuration
|
||||
echo "ECM" > configs/c.2/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/diag.diag configs/c.1/f2
|
||||
ln -s functions/ffs.adb configs/c.1/f3
|
||||
ln -s functions/gsi.ecm configs/c.2/f1
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,161 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: MBIM
|
||||
|
||||
echo "Switching to composition number 0x905b" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x905b > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x905b > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 905b > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 905b > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 905b > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
pkill adbd
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x905B > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "MBIM" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/gsi.mbim configs/c.1/f1
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,131 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + QDSS + ADB
|
||||
|
||||
echo "Switching to composition number 0x9060" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9060 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,qdss,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9060 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,qdss,ffs > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9060 > idProduct
|
||||
echo "DIAG_QDSS_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/qdss.qdss configs/c.1/f2
|
||||
ln -s functions/ffs.adb configs/c.1/f3
|
||||
echo 1 > functions/qdss.qdss/enable_debug_inface
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9x35 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,183 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS : ECM : MBIM
|
||||
|
||||
echo "Switching to composition number 0x9063" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9063 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo rndis_qc:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9063 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo rndis:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9063 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo rndis_qc:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis_qc/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9063 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo rndis:ecm:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
echo 1 > /sys/class/android_usb/android0/f_rndis/wceis
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9063 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo rndis_gsi:ecm_gsi:mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
mkdir configs/c.3
|
||||
mkdir configs/c.3/strings/0x409
|
||||
echo 0x9063 > idProduct
|
||||
echo 0x05c6 > idVendor
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "RNDIS" > configs/c.1/strings/0x409/configuration
|
||||
echo "ECM" > configs/c.2/strings/0x409/configuration
|
||||
echo "MBIM" > configs/c.3/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/gsi.ecm configs/c.2/f1
|
||||
ln -s functions/gsi.mbim configs/c.3/f1
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo 0xA0 > configs/c.3/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,274 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + MODEM + QMI_RMNET : ECM : MBIM
|
||||
|
||||
echo "Switching to composition number 0x9064" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo smd,bam2bam > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo smd,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet:ecm:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,adb,serial,rmnet:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,ffs,serial,rmnet:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo diag,adb,serial,rmnet:ecm:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi:ecm_gsi:mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9064 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi:ecm_gsi:mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
mkdir configs/c.3
|
||||
mkdir configs/c.3/strings/0x409
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9064 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "DIAG_ADB_DUN_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
echo "ECM" > configs/c.2/strings/0x409/configuration
|
||||
echo "MBIM" > configs/c.3/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
ln -s functions/gsi.rmnet configs/c.1/f4
|
||||
ln -s functions/gsi.ecm configs/c.2/f1
|
||||
ln -s functions/gsi.mbim configs/c.3/f1
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo 0xA0 > configs/c.3/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,202 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: Mass storage + QMI_RMNET : Mass Storage + MBIM
|
||||
|
||||
echo "Switching to composition number 0x9067" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo smd,bam2bam > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo mass_storage,rmnet:mass_storage,usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo smd,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo mass_storage,rmnet:mass_storage,usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo mass_storage,rmnet:mass_storage,usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo mass_storage,rmnet:mass_storage,usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo mass_storage,rmnet:mass_storage,usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9067 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo mass_storage,rmnet_gsi:mass_storage,mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9067 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "MS_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
echo "MS_MBIM" > configs/c.2/strings/0x409/configuration
|
||||
ln -s functions/mass_storage.0 configs/c.1/f1
|
||||
ln -s functions/gsi.rmnet configs/c.1/f2
|
||||
ln -s functions/mass_storage.1 configs/c.2/f1
|
||||
ln -s functions/gsi.mbim configs/c.2/f2
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,205 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + QDSS + ADB + RMNET
|
||||
|
||||
echo "Switching to composition number 0x9084" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9084 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,qdss,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25_v2() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9084 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,qdss,adb,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9084 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo qti,bam2bam_ipa > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,qdss,ffs,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9084 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,qdss,ffs,rmnet > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9084 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo 1 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,qdss,ffs,rmnet_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9084 > idProduct
|
||||
echo "DIAG_QDSS_ADB_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/qdss.qdss configs/c.1/f2
|
||||
ln -s functions/ffs.adb configs/c.1/f3
|
||||
ln -s functions/gsi.rmnet configs/c.1/f4
|
||||
echo 1 > functions/qdss.qdss/enable_debug_inface
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
echo "This composition is not supported in 9x15"
|
||||
;;
|
||||
*9x25* )
|
||||
case `cat /sys/devices/soc0/revision` in
|
||||
*1.0* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*2.* )
|
||||
run_9x25_v2 &
|
||||
;;
|
||||
* )
|
||||
run_9x25 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG+ADB+MBIM+GNSS
|
||||
|
||||
echo "Switching to composition number 0x9085" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
mode="hsic"
|
||||
else
|
||||
num="0"
|
||||
mode="hsusb"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x15() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9085 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,usb_mbim,gps > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x25() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 0x9085 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,usb_mbim,gps > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android$num/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9085 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,ffs,usb_mbim,gps > /sys/class/android_usb/android$num/functions
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9085 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,usb_mbim,gps > /sys/class/android_usb/android$num/functions
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9085 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo $1 > /sys/class/android_usb/android$num/f_gps/transport
|
||||
echo diag,ffs,mbim_gsi,gps > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9085 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "DIAG_ADB_MBIM_GNSS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/gsi.mbim configs/c.1/f3
|
||||
ln -s functions/gsi.gps configs/c.1/f4
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x15* )
|
||||
run_9x15 &
|
||||
;;
|
||||
*9x25* )
|
||||
run_9x25 &
|
||||
;;
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 "smd" &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_9650 "glink" &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + MODEM + QMI_RMNET + ADB
|
||||
|
||||
echo "Switching to composition number 0x9091" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9091 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,serial,rmnet,adb > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9091 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo QTI,BAM > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo diag,serial,rmnet,adb > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9091 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,serial,rmnet_gsi,adb > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 9091 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,serial,rmnet_gsi,adb > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x9091 > idProduct
|
||||
echo "DIAG_SER_RMNET_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/cser.dun.0 configs/c.1/f2
|
||||
ln -s functions/gsi.rmnet configs/c.1/f3
|
||||
ln -s functions/ffs.adb configs/c.1/f4
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8916* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9x35 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,149 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + (multiplexed) QMI_RMNET (Android)
|
||||
|
||||
echo "Switching to composition number 0x90A1" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A1 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,ffs,rmnet> /sys/class/android_usb/android$num/functions
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A1 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,rmnet> /sys/class/android_usb/android$num/functions
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A1 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,ffs,rmnet_gsi> /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90A1 > idProduct
|
||||
echo "DIAG_ADB_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/gsi.rmnet configs/c.1/f3
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014-2015,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + MODEM + NMEA + QDSS (bulk in) + RMNET : ECM : MBIM
|
||||
|
||||
echo "Switching to composition number 0x90A9" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A9 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_ecm_qc/ecm_transports
|
||||
echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,qdss,rmnet:ecm_qc:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A9 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo BAM_DMUX > /sys/class/android_usb/android0/f_usb_mbim/mbim_transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,qdss,rmnet:ecm:usb_mbim > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A9 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,qdss,rmnet_gsi:ecm_gsi:mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90A9 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo bam > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,qdss,rmnet_gsi:ecm_gsi:mbim_gsi > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
mkdir configs/c.2
|
||||
mkdir configs/c.2/strings/0x409
|
||||
mkdir configs/c.3
|
||||
mkdir configs/c.3/strings/0x409
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90A9 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "DIAG_ADB_SER_NMEA_QDSS_RMNET" > configs/c.1/strings/0x409/configuration
|
||||
echo "ECM" > configs/c.2/strings/0x409/configuration
|
||||
echo "MBIM" > configs/c.3/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
ln -s functions/cser.nmea.1 configs/c.1/f4
|
||||
ln -s functions/qdss.qdss configs/c.1/f5
|
||||
ln -s functions/gsi.rmnet configs/c.1/f6
|
||||
ln -s functions/gsi.ecm configs/c.2/f1
|
||||
ln -s functions/gsi.mbim configs/c.3/f1
|
||||
echo 1 > functions/qdss.qdss/enable_debug_inface
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo 0xA0 > configs/c.2/bmAttributes
|
||||
echo 0xA0 > configs/c.3/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
echo "This composition can't be supported on 8909"
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,183 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + MODEM + NMEA + QMI_RMNET + Mass Storage + DPL
|
||||
|
||||
echo "Switching to composition number 0x90AD" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90AD > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo 0 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
# DPL functionality is implemented using QDSS function driver.
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo QTI,BAM2BAM_IPA > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90AD > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo 0 > /sys/class/android_usb/android0/f_qdss/debug_intf
|
||||
# DPL functionality is implemented using QDSS function driver.
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_qdss/transports
|
||||
echo QTI,BAM_DMUX > /sys/class/android_usb/android0/f_rmnet/transports
|
||||
echo qdss_bam > /sys/class/android_usb/android0/f_qdss/transport_names
|
||||
echo diag,ffs,serial,rmnet,mass_storage,qdss > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90AD > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,dpl_gsi > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90AD > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,serial,rmnet_gsi,mass_storage,dpl_gsi > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90AD > idProduct
|
||||
echo "DIAG_ADB_DUN_NMEA_RMNET_MS_DPL" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/cser.dun.0 configs/c.1/f3
|
||||
ln -s functions/cser.nmea.1 configs/c.1/f4
|
||||
ln -s functions/gsi.rmnet configs/c.1/f5
|
||||
ln -s functions/mass_storage.0 configs/c.1/f6
|
||||
ln -s functions/gsi.dpl configs/c.1/f7
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
echo "This composition can't be supported on 8909 "
|
||||
;;
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9650 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + DUN + NMEA + RMNET + Mass Storage + DPL
|
||||
|
||||
echo "Switching to composition number 0x90B0" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_sdx20() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90B0 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge,tty > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,serial,rmnet_gsi,mass_storage,dpl_gsi > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
* )
|
||||
echo "This composition currently supported only for sdx20 "
|
||||
;;
|
||||
esac
|
||||
@@ -1,77 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: ECM
|
||||
|
||||
echo "Switching to composition number 0x90B1" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
echo "ERROR: PID 90B1 is only supported on HSIC"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90B1 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo ecm > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_9607() {
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90B1 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo ecm > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9607* )
|
||||
run_9607 &
|
||||
;;
|
||||
*8909* )
|
||||
run_9607 &
|
||||
;;
|
||||
* )
|
||||
run_9x35 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + DUN + RMNET + DPL + ADB
|
||||
|
||||
echo "Switching to composition number 0x90B8" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90B8 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,serial,rmnet_gsi,dpl_gsi,adb > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90B8 > idProduct
|
||||
echo "DIAG_SER_RMNET_DPL_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
if [ -f /etc/data/usb/softap_w_dun ]
|
||||
then
|
||||
SOFTAP_W_DUN=`cat /etc/data/usb/softap_w_dun`
|
||||
fi
|
||||
if [ "$SOFTAP_W_DUN" == "Y" ]
|
||||
then
|
||||
ln -s functions/gser.0 configs/c.1/f2
|
||||
else
|
||||
ln -s functions/cser.dun.0 configs/c.1/f2
|
||||
fi
|
||||
ln -s functions/gsi.rmnet configs/c.1/f3
|
||||
ln -s functions/gsi.dpl configs/c.1/f4
|
||||
ln -s functions/ffs.adb configs/c.1/f5
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: RNDIS + DIAG + DPL + ADB (Android)
|
||||
|
||||
echo "Switching to composition number 0x90C0" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90C0 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 1 > /sys/class/android_usb/android$num/f_rndis/wceis
|
||||
echo diag > /sys/class/android_usb/android$num/f_diag/clients
|
||||
echo rndis_gsi,diag,dpl_gsi,adb > /sys/class/android_usb/android$num/functions
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90c0 > idProduct
|
||||
echo "RNDIS_DIAG_DPL_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/gsi.rndis configs/c.1/f1
|
||||
ln -s functions/diag.diag configs/c.1/f2
|
||||
ln -s functions/gsi.dpl configs/c.1/f3
|
||||
ln -s functions/ffs.adb configs/c.1/f4
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + UAC2
|
||||
|
||||
echo "Switching to composition number 0x90CA" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_8009() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90CA > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,adb,uac2_func > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
* )
|
||||
run_8009 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + GNSS
|
||||
|
||||
echo "Switching to composition number 0x90CD" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_comp_90cd() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90CD > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo diag,ffs,gps > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/launch_adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90CD > idProduct
|
||||
echo "DIAG_ADB_GNSS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/gsi.gps configs/c.1/f3
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9650* | *sdx20* )
|
||||
run_comp_90cd &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + ADB + MBIM + GNSS + DUN
|
||||
|
||||
echo "Switching to composition number 0x90D5" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
mode="hsic"
|
||||
else
|
||||
num="0"
|
||||
mode="hsusb"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90D5 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,ffs,mbim_gsi,gps,serial > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/init.d/adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90D5 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo glink > /sys/class/android_usb/android$num/f_gps/transport
|
||||
echo diag,ffs,mbim_gsi,gps,serial > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
/etc/init.d/adbd start
|
||||
fi
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90D5 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "DIAG_ADB_MBIM_GNSS_DUN" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/ffs.adb configs/c.1/f2
|
||||
ln -s functions/gsi.mbim configs/c.1/f3
|
||||
ln -s functions/gsi.gps configs/c.1/f4
|
||||
ln -s functions/cser.dun.0 configs/c.1/f5
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + MBIM + GNSS + DUN
|
||||
|
||||
echo "Switching to composition number 0x90D6" > /dev/kmsg
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
mode="hsic"
|
||||
else
|
||||
num="0"
|
||||
mode="hsusb"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9650() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90D6 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo smd > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo diag,mbim_gsi,gps,serial > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90D6 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo diag > /sys/class/android_usb/android0/f_diag/clients
|
||||
echo char_bridge > /sys/class/android_usb/android0/f_serial/transports
|
||||
echo glink > /sys/class/android_usb/android$num/f_gps/transport
|
||||
echo diag,mbim_gsi,gps,serial > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90D6 > idProduct
|
||||
echo 239 > bDeviceClass
|
||||
echo 2 > bDeviceSubClass
|
||||
echo 1 > bDeviceProtocol
|
||||
echo "DIAG_MBIM_GNSS_DUN" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
ln -s functions/gsi.mbim configs/c.1/f2
|
||||
ln -s functions/gsi.gps configs/c.1/f3
|
||||
ln -s functions/cser.dun.0 configs/c.1/f4
|
||||
echo 0xA0 > configs/c.1/bmAttributes
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: DIAG + DUN + RMNET + DPL + QDSS(Trace) + ADB
|
||||
|
||||
echo "Switching to composition number 0x90DB" > /dev/kmsg
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_configfs() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
/etc/launch_adbd start
|
||||
sleep 1
|
||||
fi
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f* 2> /dev/null
|
||||
rm -rf configs/c.2 configs/c.3 2> /dev/null
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0x90DB > idProduct
|
||||
echo "DIAG_SER_RMNET_DPL_QDSS_ADB" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/diag.diag configs/c.1/f1
|
||||
if [ -f /etc/data/usb/softap_w_dun ]
|
||||
then
|
||||
SOFTAP_W_DUN=`cat /etc/data/usb/softap_w_dun`
|
||||
fi
|
||||
if [ "$SOFTAP_W_DUN" == "Y" ]
|
||||
then
|
||||
ln -s functions/gser.0 configs/c.1/f2
|
||||
else
|
||||
ln -s functions/cser.dun.0 configs/c.1/f2
|
||||
fi
|
||||
ln -s functions/gsi.rmnet configs/c.1/f3
|
||||
ln -s functions/gsi.dpl configs/c.1/f4
|
||||
ln -s functions/qdss.qdss configs/c.1/f5
|
||||
ln -s functions/ffs.adb configs/c.1/f6
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
echo "This composition is not supported"
|
||||
;;
|
||||
esac
|
||||
@@ -1,97 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: MBIM + GNSS
|
||||
|
||||
echo "Switching to composition number 0x90E2"
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
mode="hsic"
|
||||
else
|
||||
num="0"
|
||||
mode="hsusb"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 2 ]; then
|
||||
delay=$2
|
||||
else
|
||||
delay="0"
|
||||
fi
|
||||
|
||||
if [ "$#" -ge 3 ]; then
|
||||
from_adb=$3
|
||||
else
|
||||
from_adb="n"
|
||||
fi
|
||||
|
||||
run_9650() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90E2 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo mbim_gsi,gps > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_sdx20() {
|
||||
if [ $from_adb = "n" ]
|
||||
then
|
||||
pkill adbd
|
||||
fi
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo 90E2 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo 239 > /sys/class/android_usb/android$num/bDeviceClass
|
||||
echo 2 > /sys/class/android_usb/android$num/bDeviceSubClass
|
||||
echo 1 > /sys/class/android_usb/android$num/bDeviceProtocol
|
||||
echo glink > /sys/class/android_usb/android$num/f_gps/transport
|
||||
echo mbim_gsi,gps > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
|
||||
sleep $delay
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9650* )
|
||||
run_9650 &
|
||||
;;
|
||||
*sdx20* )
|
||||
run_sdx20 &
|
||||
;;
|
||||
* )
|
||||
echo "Composition not supported on this target "
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2014,2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# DESCRIPTION: Mass Storage
|
||||
|
||||
echo "Switching to composition number F000"
|
||||
|
||||
if [ "$1" = "y" ]; then
|
||||
num="1"
|
||||
else
|
||||
num="0"
|
||||
fi
|
||||
|
||||
run_9x35() {
|
||||
pkill adbd
|
||||
echo 0 > /sys/class/android_usb/android$num/enable
|
||||
echo F000 > /sys/class/android_usb/android$num/idProduct
|
||||
echo 05C6 > /sys/class/android_usb/android$num/idVendor
|
||||
echo "Create CD ROM lun"
|
||||
echo rom > /sys/class/android_usb/android0/f_mass_storage/luns
|
||||
echo mass_storage > /sys/class/android_usb/android$num/functions
|
||||
echo 1 > /sys/class/android_usb/android$num/enable
|
||||
}
|
||||
|
||||
run_configfs() {
|
||||
pkill adbd
|
||||
cd /sys/kernel/config/usb_gadget/g1
|
||||
rm configs/c*/f*
|
||||
echo 0x05c6 > idVendor
|
||||
echo 0xF000 > idProduct
|
||||
echo "MS" > configs/c.1/strings/0x409/configuration
|
||||
ln -s functions/mass_storage.0 configs/c.1/f1
|
||||
echo "binding UDC with Gadget..." $1
|
||||
echo $1 > UDC
|
||||
cd /
|
||||
}
|
||||
|
||||
case `source /sbin/usb/target` in
|
||||
*9x35* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*9640* )
|
||||
run_9x35 &
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
udcname=`ls -1 /sys/class/udc | head -n 1`
|
||||
run_configfs $udcname &
|
||||
;;
|
||||
* )
|
||||
run_9x35 &
|
||||
;;
|
||||
esac
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
# DESCRIPTION: it is used to allow either hsic or hsusb to have no composition at all(must reboot to take effect).
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
0
|
||||
@@ -1 +0,0 @@
|
||||
9025
|
||||
@@ -1,33 +0,0 @@
|
||||
_______________________________________
|
||||
1 msm_otg
|
||||
_______________________________________
|
||||
2 ci13xxx_udc
|
||||
_______________________________________
|
||||
3 ci13xxx_msm
|
||||
_______________________________________
|
||||
4 f_gps
|
||||
_______________________________________
|
||||
5 f_mbim
|
||||
_______________________________________
|
||||
6 f_qc_ecm
|
||||
_______________________________________
|
||||
7 f_qc_rndis
|
||||
_______________________________________
|
||||
8 f_rmnet
|
||||
_______________________________________
|
||||
9 f_tcm
|
||||
_______________________________________
|
||||
10 u_bam
|
||||
_______________________________________
|
||||
11 u_bam_data
|
||||
_______________________________________
|
||||
12 usb_bam
|
||||
_______________________________________
|
||||
13 android
|
||||
_______________________________________
|
||||
14 composite
|
||||
_______________________________________
|
||||
15 ehci-msm-hsic
|
||||
_______________________________________
|
||||
16 u_qc_ether
|
||||
_______________________________________
|
||||
@@ -1,28 +0,0 @@
|
||||
usb_debug:
|
||||
Bash script for enable or disable debug message from usb related files.
|
||||
Usage:
|
||||
usb_debug [status]
|
||||
usb_debug [flag] [Operation] [As Default?] [Arg....]
|
||||
status:
|
||||
show list of the active files (enable debug messaged)
|
||||
flag:
|
||||
-l, read files name from argument list. here Arg is file name (without suffix ".c")
|
||||
-f, read filenames from Arg, here Arg is path to a file that contain list of filenames
|
||||
(each name without suffix ".c")
|
||||
all, enable or disable debug messages from all the files in debugFiles
|
||||
(the files that the script support)
|
||||
Operation:
|
||||
on, enable debug message
|
||||
off, disable debug message
|
||||
As Default:
|
||||
y/n enable debug messages from these files also in next power cycle?
|
||||
- set these files as default debug configuration?
|
||||
|
||||
*** important notes ***
|
||||
1) You can always use the manual interface. Just usb_debug with no param.
|
||||
2) Each default setting is overrides the previous one.
|
||||
3) To insert or delete files, you have to edit debugFiles manually,
|
||||
add a new line with number(Fid) and file name (without suffix ".c").
|
||||
4) debugFiles path: on target usr/bin/usb/debuger/debugFiles
|
||||
GIT system/core/usb/debuger/debugFiles
|
||||
5)TIP: to set the files that active now as defult use: usb_debug -f on y usr/bin/usb/debuger/statusFile
|
||||
@@ -1,85 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, 2014-2015, 2017, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
TARGET_DIR=/target # default directory
|
||||
if [ ! -f $TARGET_DIR ]; then
|
||||
TARGET_DIR=/sys/devices/soc0/machine
|
||||
fi
|
||||
|
||||
case `cat ${TARGET_DIR}` in
|
||||
*9x15* )
|
||||
res="9x15"
|
||||
;;
|
||||
*9x25* )
|
||||
res="9x25"
|
||||
;;
|
||||
*9x35* )
|
||||
res="9x35"
|
||||
;;
|
||||
*9607* )
|
||||
res="9607"
|
||||
;;
|
||||
*8909* | *8009* )
|
||||
res="8909"
|
||||
;;
|
||||
*8917* | *8017* )
|
||||
res="8017"
|
||||
;;
|
||||
*8916* | *8016* )
|
||||
res="8916"
|
||||
;;
|
||||
*9640* )
|
||||
res="9640";
|
||||
;;
|
||||
*9650* )
|
||||
res="9650";
|
||||
;;
|
||||
*sdx20* )
|
||||
res="sdx20";
|
||||
;;
|
||||
*8953* | *8053* )
|
||||
res="8053";
|
||||
;;
|
||||
*8996* | *8096* )
|
||||
res="8096";
|
||||
;;
|
||||
*605* )
|
||||
res="qcs605";
|
||||
;;
|
||||
*405* )
|
||||
res="qcs40x";
|
||||
;;
|
||||
*8098* )
|
||||
res="8098";
|
||||
;;
|
||||
*sdxpoorwills* )
|
||||
res="sdxpoorwills";
|
||||
;;
|
||||
* )
|
||||
res="none"
|
||||
;;
|
||||
esac
|
||||
echo $res
|
||||
@@ -1,288 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2012, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Switch to a chosen USB composition.
|
||||
|
||||
COMP_DIR="/sbin/usb/compositions"
|
||||
symlink_hsusb="/etc/usb/boot_hsusb_comp"
|
||||
symlink_hsic="/etc/usb/boot_hsic_comp"
|
||||
|
||||
legal_composition() {
|
||||
for c in $( ls $COMP_DIR ); do
|
||||
if [ "$1" = "$c" ]; then
|
||||
echo "1"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
echo "0"
|
||||
}
|
||||
|
||||
read_pid() {
|
||||
local tmp_pid='0'
|
||||
read -p "Pid number : " tmp_pid
|
||||
while [ true ]; do
|
||||
if [ `legal_composition $tmp_pid` = "1" ]; then
|
||||
echo "$tmp_pid"
|
||||
exit
|
||||
fi
|
||||
read -p "Illegal Pid number, try again : " tmp_pid
|
||||
done
|
||||
}
|
||||
|
||||
read_hsic() {
|
||||
local tmp_hsic='0'
|
||||
read -p "Choose core: y - hsic, n - hsusb ? (y/n)" tmp_hsic
|
||||
while [ true ]; do
|
||||
if [ $tmp_hsic = "y" ] || [ $tmp_hsic = "n" ]; then
|
||||
echo "$tmp_hsic"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'y' or 'n' are allowed, try again : " tmp_hsic
|
||||
done
|
||||
}
|
||||
|
||||
read_persistent() {
|
||||
local tmp_persistent='0'
|
||||
read -p "Would you like it to be the default composition ? (y/n)" tmp_persistent
|
||||
while [ true ]; do
|
||||
if [ $tmp_persistent = "y" ] || [ $tmp_persistent = "n" ]; then
|
||||
echo "$tmp_persistent"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'y' or 'n' are allowed, try again : " tmp_persistent
|
||||
done
|
||||
}
|
||||
|
||||
read_immediate() {
|
||||
local tmp_immediate='0'
|
||||
read -p "Would you like the composition to change immediately? (y/n)" tmp_immediate
|
||||
while [ true ]; do
|
||||
if [ $tmp_immediate = "y" ] || [ $tmp_immediate = "n" ]; then
|
||||
echo "$tmp_immediate"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'y' or 'n' are allowed, try again : " tmp_immediate
|
||||
done
|
||||
}
|
||||
|
||||
read_from_adb() {
|
||||
local tmp_adbd='0'
|
||||
read -p "Are you performing the composition switch from adbd? (y/n)" tmp_adbd
|
||||
while [ true ]; do
|
||||
if [ $tmp_adbd = "y" ] || [ $tmp_adbd = "n" ]; then
|
||||
echo "$tmp_adbd"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'y' or 'n' are allowed, try again : " tmp_adbd
|
||||
done
|
||||
}
|
||||
|
||||
common_functions() {
|
||||
if [ "$1" = "empty" ] || [ "$2" = "empty" ]; then
|
||||
echo "0"
|
||||
exit
|
||||
fi
|
||||
func_list_1=`grep functions $COMP_DIR/$1 | sed 's/echo //' | sed 's/>.*$//' | tr , '\n' | tr : '\n'`
|
||||
func_list_2=`grep functions $COMP_DIR/$2 | sed 's/echo //' | sed 's/>.*$//' | tr , '\n' | tr : '\n'`
|
||||
for func_1 in $func_list_1
|
||||
do
|
||||
for func_2 in $func_list_2
|
||||
do
|
||||
if [ "$func_1" = "$func_2" ]; then
|
||||
echo $func_1
|
||||
exit
|
||||
fi
|
||||
done
|
||||
done
|
||||
echo "0"
|
||||
}
|
||||
|
||||
hsusb_comp=`cat $symlink_hsusb`
|
||||
hsic_comp=`cat $symlink_hsic`
|
||||
|
||||
if [ "$#" -ge 6 ]; then
|
||||
echo "Usage: usb_composition [Pid] [HSIC] [PERSISTENT] [IMMEDIATE] [FROM_ADBD]" >&2
|
||||
exit 7
|
||||
|
||||
elif [ "$#" -eq 5 ]; then
|
||||
|
||||
if [ `legal_composition $1` = "0" ]; then
|
||||
echo "Illegal pid"
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "y" ] && [ $2 != "n" ]; then
|
||||
echo "Illegal hsic choice (must be 'y' or 'n')."
|
||||
exit 2
|
||||
fi
|
||||
if [ $3 != "y" ] && [ $3 != "n" ]; then
|
||||
echo "Illegal persistent choice (must be 'y' or 'n')."
|
||||
exit 3
|
||||
fi
|
||||
if [ $4 != "y" ] && [ $4 != "n" ]; then
|
||||
echo "Illegal immediate choice (must be 'y' or 'n')."
|
||||
exit 4
|
||||
fi
|
||||
if [ $5 != "y" ] && [ $5 != "n" ]; then
|
||||
echo "Illegal from adbd (must be 'y' or 'n')."
|
||||
exit 5
|
||||
fi
|
||||
pid=$1
|
||||
hsic=$2
|
||||
persistent=$3
|
||||
immediate=$4
|
||||
from_adb=$5
|
||||
|
||||
elif [ "$#" -eq 4 ]; then
|
||||
|
||||
if [ `legal_composition $1` = "0" ]; then
|
||||
echo "Illegal pid"
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "y" ] && [ $2 != "n" ]; then
|
||||
echo "Illegal hsic choice (must be 'y' or 'n')."
|
||||
exit 2
|
||||
fi
|
||||
if [ $3 != "y" ] && [ $3 != "n" ]; then
|
||||
echo "Illegal persistent choice (must be 'y' or 'n')."
|
||||
exit 3
|
||||
fi
|
||||
if [ $4 != "y" ] && [ $4 != "n" ]; then
|
||||
echo "Illegal immediate choice (must be 'y' or 'n')."
|
||||
exit 4
|
||||
fi
|
||||
pid=$1
|
||||
hsic=$2
|
||||
persistent=$3
|
||||
immediate=$4
|
||||
from_adb="n"
|
||||
|
||||
elif [ "$#" -eq 3 ]; then
|
||||
|
||||
if [ `legal_composition $1` = "0" ]; then
|
||||
echo "Illegal pid"
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "y" ] && [ $2 != "n" ]; then
|
||||
echo "Illegal hsic choice (must be 'y' or 'n')."
|
||||
exit 2
|
||||
fi
|
||||
if [ $3 != "y" ] && [ $3 != "n" ]; then
|
||||
echo "Illegal persistent choice (must be 'y' or 'n')."
|
||||
exit 3
|
||||
fi
|
||||
pid=$1
|
||||
hsic=$2
|
||||
persistent=$3
|
||||
immediate="y"
|
||||
from_adb="n"
|
||||
|
||||
elif [ "$#" -eq 2 ]; then
|
||||
|
||||
if [ `legal_composition $1` = "0" ]; then
|
||||
echo "Illegal pid"
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "y" ] && [ $2 != "n" ]; then
|
||||
echo "Illegal hsic choice (must be 'y' or 'n')."
|
||||
exit 2
|
||||
fi
|
||||
pid=$1
|
||||
hsic=$2
|
||||
persistent="n"
|
||||
immediate="y"
|
||||
from_adb="n"
|
||||
|
||||
elif [ "$#" -eq 1 ]; then
|
||||
|
||||
if [ `legal_composition $1` = "0" ]; then
|
||||
echo "Illegal pid"
|
||||
exit 1
|
||||
fi
|
||||
pid=$1
|
||||
hsic="n"
|
||||
persistent="n"
|
||||
immediate="y"
|
||||
from_adb="n"
|
||||
|
||||
elif [ "$#" -eq 0 ]; then
|
||||
|
||||
echo "boot hsusb composition: $hsusb_comp"
|
||||
echo "boot hsic composition: $hsic_comp"
|
||||
echo "Choose Composition by Pid:"
|
||||
for i in $( ls $COMP_DIR ); do
|
||||
desc=`grep DESCRIPTION: $COMP_DIR/$i | sed 's/.*DESCRIPTION: *//g'`
|
||||
echo " $i - $desc"
|
||||
done
|
||||
pid=`read_pid`
|
||||
hsic=`read_hsic`
|
||||
persistent=`read_persistent`
|
||||
immediate=`read_immediate`
|
||||
from_adb=`read_from_adb`
|
||||
|
||||
fi
|
||||
|
||||
if [ $persistent = "n" ]; then
|
||||
if [ $immediate = "n" ]; then
|
||||
echo "Change will have no effect - Illegal combination of not persistent and not immediate"
|
||||
exit 6
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $hsic = "y" ]; then
|
||||
other=$hsusb_comp
|
||||
else
|
||||
other=$hsic_comp
|
||||
fi
|
||||
|
||||
common=`common_functions $other $pid`
|
||||
if [ $common != "0" ]; then
|
||||
echo "******************************************************************************"
|
||||
echo "* !!!WARNING!!! *"
|
||||
echo "* Due to this composition change, HSIC and USB have the potential to use the *"
|
||||
echo "* same usb function : $common. *"
|
||||
echo "* Please take care to not use the same function on both ports as this is not *"
|
||||
echo "* properly supported. *"
|
||||
echo "* *"
|
||||
echo "******************************************************************************"
|
||||
fi
|
||||
|
||||
if [ $persistent = "y" ]; then
|
||||
if [ $hsic = "y" ]; then
|
||||
echo "$pid" > $symlink_hsic
|
||||
else
|
||||
echo "$pid" > $symlink_hsusb
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $hsic = "n" ]; then
|
||||
if [ $immediate = "y" ]; then
|
||||
$COMP_DIR/$pid n 0.2 $from_adb
|
||||
fi
|
||||
else
|
||||
echo "Please reboot device for HSIC composition to take effect"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,355 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Enable or disable debug messages in USB related files.
|
||||
# this script allows the user to chose the files in which should enable or disable debug messages
|
||||
# and also allows the user to save the debug configuration for the next reboot
|
||||
# This in order to allow early boot debug information.
|
||||
|
||||
DBG_FILE="/sbin/usb/debuger/debugFiles"
|
||||
DEFAULT_FILE="/sbin/usb/debuger/default_debug"
|
||||
HELP="/sbin/usb/debuger/help"
|
||||
statusFile="/sbin/usb/debuger/statusFile"
|
||||
|
||||
legal_fileName(){
|
||||
file_list=`cat $DBG_FILE| cut -f 2| grep -v ___`
|
||||
for c in $file_list
|
||||
do
|
||||
if [ "$1" = "$c" ]; then
|
||||
echo "1"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
echo "0"
|
||||
}
|
||||
|
||||
legal_fid() {
|
||||
local id_list=`cat $DBG_FILE| cut -f 1| grep -v ___`
|
||||
for num in $id_list
|
||||
do
|
||||
if [ "$1" = "$num" ]; then
|
||||
echo "1"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
echo "0"
|
||||
}
|
||||
|
||||
legal_fileNames(){
|
||||
local i=1
|
||||
for j in "$@"
|
||||
do
|
||||
if [ $i -gt $1 ]; then
|
||||
if [ `legal_fileName $j` = "0" ]; then
|
||||
echo "0"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
let i+=1
|
||||
done
|
||||
echo "1"
|
||||
}
|
||||
|
||||
get_fileList(){
|
||||
local i=1
|
||||
local list=""
|
||||
for j in "$@"
|
||||
do
|
||||
if [ $i -gt $1 ]; then
|
||||
list="$list$j "
|
||||
fi
|
||||
let i+=1
|
||||
done
|
||||
echo $list
|
||||
}
|
||||
|
||||
read_fid() {
|
||||
# this func gets the file id and returns the file names of the chosen files
|
||||
local flag="1"
|
||||
local tmp_fid="0"
|
||||
local files=""
|
||||
read -p "fid number : " tmp_fid
|
||||
while [ true ];
|
||||
do
|
||||
for num in $tmp_fid
|
||||
do
|
||||
if [ `legal_fid $num` = "0" ]; then
|
||||
flag="0"
|
||||
break
|
||||
else
|
||||
files="$files `cat $DBG_FILE|grep -w $num|grep -v ___|cut -f 2` "
|
||||
fi
|
||||
done
|
||||
if [ $flag = "0" ]; then
|
||||
flag="1"
|
||||
files=""
|
||||
read -p "Illegal Fid number, try again : " tmp_fid
|
||||
else
|
||||
echo "$files"
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
read_persistent() {
|
||||
local tmp_persistent='0'
|
||||
read -p "Would you like it to be the default file\s for debug ? (y/n) " tmp_persistent
|
||||
while [ true ]; do
|
||||
if [ $tmp_persistent = "y" ] || [ $tmp_persistent = "n" ]; then
|
||||
echo "$tmp_persistent"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'y' or 'n' are allowed, try again : " tmp_persistent
|
||||
done
|
||||
}
|
||||
read_operation() {
|
||||
local tmp_op='0'
|
||||
read -p "Would you like to enable or disable the debug messages ? (on/off) " tmp_op
|
||||
while [ true ]; do
|
||||
if [ $tmp_op = "on" ] || [ $tmp_op = "off" ]; then
|
||||
echo "$tmp_op"
|
||||
exit
|
||||
fi
|
||||
read -p "Only 'on' or 'off' are allowed, try again : " tmp_op
|
||||
done
|
||||
}
|
||||
|
||||
add_toStatus() {
|
||||
if [ -f $statusFile ]; then
|
||||
if [ `cat $statusFile |grep -c $1` = 0 ]; then
|
||||
echo $1 >> $statusFile
|
||||
fi
|
||||
else
|
||||
echo $1 >> $statusFile
|
||||
fi
|
||||
}
|
||||
|
||||
rm_fromStatus() {
|
||||
if [ -f $statusFile ]; then
|
||||
sed -i '/^'$1'$/d' $statusFile
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
#===============================================================================================#
|
||||
#===============================================================================================#
|
||||
if [ ! -f $DBG_FILE ]; then
|
||||
echo "ERROR: debugFiles is missing"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
cat $DBG_FILE
|
||||
echo " "
|
||||
echo "Choose files by id: "
|
||||
file=`read_fid`
|
||||
flag="-l"
|
||||
operation=`read_operation`
|
||||
persistent=`read_persistent`
|
||||
elif [ "$#" -eq 1 ]; then
|
||||
if [ $1 == "status" ]; then
|
||||
if [ -f $statusFile ]; then
|
||||
cat $statusFile
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
exit 1
|
||||
elif [ $1 == "-h" ] || [ $1 == "help" ]; then
|
||||
cat $HELP
|
||||
exit 1
|
||||
else
|
||||
echo "Usage: usb_debug -h" >&2
|
||||
echo "Usage: usb_debug status" >&2
|
||||
echo "Usage: usb_debug [-l] [OPERATION] [PERSISTENT] [LIST]" >&2
|
||||
echo "Usage: usb_debug [-f] [OPERATION] [PERSISTENT] [PATH]" >&2
|
||||
echo "Usage: usb_debug [all][OPERATION] [PERSISTENT]" >&2
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$#" -eq 2 ]; then
|
||||
if [ $1 != "all" ]; then
|
||||
echo "Usage: usb_debug [-l] [OPERATION] [PERSISTENT] [LIST]" >&2
|
||||
echo "Usage: usb_debug [-f] [OPERATION] [PERSISTENT] [PATH]" >&2
|
||||
echo "Usage: usb_debug [all][OPERATION] [PERSISTENT]" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "on" ] && [ $2 != "off" ]; then
|
||||
echo "Illegal operation choice (must be 'on' or 'off')."
|
||||
exit 2
|
||||
fi
|
||||
if [ $2 = "on" ]; then
|
||||
flag=$1
|
||||
operation=$2
|
||||
file=`cat $DBG_FILE| cut -f 2| grep -v ___`
|
||||
persistent=`read_persistent`
|
||||
else
|
||||
flag=$1
|
||||
operation=$2
|
||||
file=`cat $DBG_FILE| cut -f 2| grep -v ___`
|
||||
persistent="y"
|
||||
fi
|
||||
elif [ "$#" -ge 3 ]; then
|
||||
if [ $1 != "-l" ] && [ $1 != "-f" ] && [ $1 != "all" ]; then
|
||||
echo "Usage: usb_debug [-l] [OPERATION] [PERSISTENT] [LIST]" >&2
|
||||
echo "Usage: usb_debug [-f] [OPERATION] [PERSISTENT] [PATH]" >&2
|
||||
echo "Usage: usb_debug [all][OPERATION] [PERSISTENT]" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $2 != "on" ] && [ $2 != "off" ]; then
|
||||
echo "Illegal operation choice (must be 'on' or 'off')."
|
||||
exit 2
|
||||
fi
|
||||
if [ $1 = "-l" ]; then
|
||||
if [ `legal_fileName $3` = "1" ]; then
|
||||
if [ "$#" -ge 4 ]; then
|
||||
#handle more then one file - default presistance=n
|
||||
if [ `legal_fileNames 3 "$@"` = "0" ]; then
|
||||
echo "Illegal file name."
|
||||
exit 4
|
||||
fi
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent="n"
|
||||
file=`get_fileList 3 "$@"`
|
||||
else
|
||||
#case just one file name
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent="n"
|
||||
file=$3
|
||||
fi
|
||||
elif [ $3 = "y" ] || [ $3 = "n" ]; then
|
||||
if [ `legal_fileName $4` = "0" ]; then
|
||||
echo "Illegal file name."
|
||||
exit 4
|
||||
fi
|
||||
if [ "$#" -ge 5 ]; then
|
||||
#handle more then one file - presistance=$3
|
||||
if [ `legal_fileNames 4 "$@"` = "0" ]; then
|
||||
echo "Illegal file name."
|
||||
exit 5
|
||||
fi
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent=$3
|
||||
file=`get_fileList 4 "$@"`
|
||||
else
|
||||
#just one file
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent=$3
|
||||
file=$4
|
||||
fi
|
||||
else
|
||||
echo "Illegal file name or persistent choice (persistent must be 'y' or 'n')."
|
||||
exit 4
|
||||
fi
|
||||
elif [ $1 = "-f" ]; then
|
||||
if [ -f $3 ]; then
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent="n"
|
||||
file=`cat $3`
|
||||
if [ `legal_fileNames 1 $file` = 0 ]; then
|
||||
echo "Illegal file name (in the input file)"
|
||||
exit 3
|
||||
fi
|
||||
elif [ $3 = "y" ] || [ $3 = "n" ]; then
|
||||
if [ "$#" -eq 3 ]; then
|
||||
echo "Usage: usb_debug [-f] [OPERATION] [PERSISTENT] [PATH]" >&2
|
||||
exit 3
|
||||
fi
|
||||
if [ -f $4 ]; then
|
||||
flag=$1
|
||||
operation=$2
|
||||
persistent=$3
|
||||
file=`cat $4`
|
||||
if [ `legal_fileNames 1 "$file"` = 0 ]; then
|
||||
echo "Illegal file name (in the input file)"
|
||||
exit 4
|
||||
fi
|
||||
else
|
||||
echo "Illegal input file."
|
||||
exit 4
|
||||
fi
|
||||
else
|
||||
echo "Illegal file or persistent choice (persistent must be 'y' or 'n')."
|
||||
exit 3
|
||||
fi
|
||||
else
|
||||
# $1=all
|
||||
if [ $3 != "y" ] && [ $3 != "n" ]; then
|
||||
echo "Illegal persistent choice (persistent must be 'y' or 'n')."
|
||||
exit 3
|
||||
fi
|
||||
flag=$1
|
||||
operation=$2
|
||||
file=`cat $DBG_FILE| cut -f 2| grep -v ___`
|
||||
persistent=$3
|
||||
fi
|
||||
else
|
||||
echo "Usage: usb_debug [-l] [OPERATION] [PERSISTENT] [LIST]" >&2
|
||||
echo "Usage: usb_debug [-f] [OPERATION][PERSISTENT] [PATH]" >&2
|
||||
echo "Usage: usb_debug [all][OPERATION] [PERSISTENT]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#===============================================================================================
|
||||
#===============================================================================================
|
||||
|
||||
# mount debugfs just one time
|
||||
if [ `mount | grep -c debugfs` = 0 ]; then
|
||||
mkdir /data/dbg
|
||||
mount -t debugfs none /data/dbg
|
||||
fi
|
||||
|
||||
if [ $persistent = "y" ]; then
|
||||
if [ $operation = "off" ]; then
|
||||
if [ $flag = "all" ]; then
|
||||
rm -f $DEFAULT_FILE
|
||||
else
|
||||
echo "Change will have no effect on default file- Illegal combination of persistent and disable debug messages"
|
||||
fi
|
||||
else
|
||||
rm -f $DEFAULT_FILE
|
||||
echo $file > $DEFAULT_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $operation = "on" ]; then
|
||||
for f in $file
|
||||
do
|
||||
`add_toStatus $f`
|
||||
f="$f.c"
|
||||
echo -n 'file $f +p' > /data/dbg/dynamic_debug/control
|
||||
done
|
||||
else
|
||||
for f in $file
|
||||
do
|
||||
`rm_fromStatus $f`
|
||||
f="$f.c"
|
||||
echo -n 'file $f -p' > /data/dbg/dynamic_debug/control
|
||||
done
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (c) 2018 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
|
||||
set -e
|
||||
echo -n "Starting cdsp: "
|
||||
|
||||
if [ -f /sys/kernel/boot_cdsp/boot ]; then
|
||||
echo 1 > /sys/kernel/boot_cdsp/boot
|
||||
else
|
||||
echo "File not found! : /sys/kernel/boot_cdsp/boot"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of The Linux Foundation nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
abctl --boot_slot
|
||||
Binary file not shown.
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# centralized qualcomm init
|
||||
# *************************
|
||||
|
||||
# don't restart whole SoC on subsystem crash
|
||||
for i in {0..7}; do
|
||||
echo "related" | sudo tee /sys/bus/msm_subsys/devices/subsys${i}/restart_level
|
||||
@@ -11,3 +14,10 @@ echo 2649600 | sudo tee /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq
|
||||
|
||||
# boot wifi
|
||||
echo 1 | sudo tee /sys/kernel/boot_wlan/boot_wlan
|
||||
/usr/bin/irsc_util /etc/sec_config
|
||||
|
||||
# cdsp
|
||||
echo 1 > /sys/kernel/boot_cdsp/boot
|
||||
|
||||
# ipa
|
||||
echo 1 > /dev/ipa
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/bin/sh
|
||||
###############################################################################
|
||||
#
|
||||
# This script is used for administration of the Hexagon DSP
|
||||
#
|
||||
# Copyright (c) 2012-2016 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
KEEP_ALIVE=0
|
||||
subsys_name=""
|
||||
|
||||
# Wait for adsp.mdt to show up
|
||||
count=0
|
||||
while [ ! -s /firmware/image/adsp.mdt ]; do
|
||||
sleep 0.1
|
||||
# wait 10s for /firmare mounted
|
||||
count=$(( $count + 1 ))
|
||||
if [ $count -ge 100 ]; then
|
||||
echo "[ERROR] Can not find the adsp's firmware"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for subsys in `ls /sys/bus/msm_subsys/devices`; do
|
||||
name=`cat /sys/bus/msm_subsys/devices/${subsys}/name`
|
||||
if [ "`cat /sys/bus/msm_subsys/devices/${subsys}/name`" = "adsp" ]; then
|
||||
subsys_name="${subsys}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$KEEP_ALIVE" = "1" ]; then
|
||||
if [ -n "${subsys_name}" ]; then
|
||||
sysctl -w kernel.panic=0
|
||||
echo 1 > /sys/bus/msm_subsys/devices/${subsys_name}/keep_alive
|
||||
else
|
||||
echo "[ERROR] Can not keep adsp alive"
|
||||
fi
|
||||
fi
|
||||
|
||||
# FIXME: See ATL-3054
|
||||
echo 1 > /sys/module/subsystem_restart/parameters/enable_debug
|
||||
# Bring adsp out of reset
|
||||
echo "[INFO] Bringing adsp out of reset"
|
||||
echo 1 > /sys/kernel/boot_adsp/boot
|
||||
|
||||
# wait boot finished
|
||||
if [ -n "${subsys_name}" ]; then
|
||||
count=0
|
||||
state=`cat /sys/bus/msm_subsys/devices/${subsys_name}/state`
|
||||
while [ "${state}" != "ONLINE" ]; do
|
||||
# wait 2s for subsys boot finished
|
||||
count=$(( $count + 1 ))
|
||||
if [ $count -ge 200 ]; then
|
||||
echo "[ERROR] adsp fail to boot"
|
||||
exit 1
|
||||
fi
|
||||
sleep 0.01
|
||||
state=`cat /sys/bus/msm_subsys/devices/${subsys_name}/state`
|
||||
done
|
||||
fi
|
||||
|
||||
# Emit adsp
|
||||
#initctl emit adsp
|
||||
@@ -1,10 +1,5 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Enable DSP support services
|
||||
systemctl enable irsc_util.service
|
||||
systemctl enable adsp
|
||||
systemctl enable cdsp
|
||||
|
||||
# Enable our services
|
||||
systemctl enable fs_setup.service
|
||||
systemctl enable serial-hostname.service
|
||||
@@ -41,7 +36,6 @@ systemctl disable apt-daily.service
|
||||
systemctl disable apt-daily-upgrade.timer
|
||||
systemctl disable apt-daily.timer
|
||||
systemctl disable serial-getty@ttyS0.service
|
||||
systemctl disable wlan_daemon.service
|
||||
systemctl disable remote-fs.target
|
||||
systemctl disable remote-fs-pre.target
|
||||
systemctl disable e2scrub_all.timer
|
||||
@@ -50,7 +44,6 @@ systemctl disable motd-news.service
|
||||
systemctl disable motd-news.timer
|
||||
systemctl disable multipathd.service
|
||||
systemctl disable multipathd.socket
|
||||
systemctl disable chgrp-diag.service
|
||||
systemctl disable lvm2-monitor.service
|
||||
systemctl mask systemd-backlight@.service
|
||||
systemctl disable dpkg-db-backup.timer
|
||||
@@ -74,4 +67,3 @@ systemctl disable remote-fs-pre.target
|
||||
systemctl disable networking.service
|
||||
|
||||
systemctl disable console-setup.service
|
||||
systemctl disable sfsconfig.service
|
||||
|
||||
Reference in New Issue
Block a user