M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
bin_PROGRAMS = usb_composition_switch
# Program to switch USB compositions
# =========================================================
usb_composition_switch_CC = @CC@
usb_composition_switch_SOURCES = usb_composition_switch.c
usb_composition_switch_CFLAGS = -O2 \
-g \
-Wall \
-Wno-unused-parameter
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + NMEA + MODEM (Android)
echo "Switching to composition number 0x9002"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9002 > /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 tty,smd > /sys/class/android_usb/android0/f_serial/transports
echo diag,serial > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
* )
run_9x15 &
;;
esac
+53
View File
@@ -0,0 +1,53 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + Audio [Android]
echo "Switching to composition number 0x901C"
if [ "$1" = "y" ]; then
num="1"
mode="hsic"
else
num="0"
mode="hsusb"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x901c > /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,audio > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
* )
run_9x15 &
;;
esac
+69
View File
@@ -0,0 +1,69 @@
#!/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.
# DESCRIPTION: DIAG + ADB [Android]
echo "Switching to composition number 0x901D"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x901D > /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,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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x901D > /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,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + QMI_RMNET (Android)
echo "Switching to composition number 0x9021"
if [ "$1" = "y" ]; then
num="1"
else
num="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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + ADB + QMI_RMNET (Android)
echo "Switching to composition number 0x9022"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+67
View File
@@ -0,0 +1,67 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS + ADB [Android]
echo "Switching to composition number 0x9024"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
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,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + ADB + MODEM + NMEA + QMI_RMNET + Mass Storage (Android)
echo "Switching to composition number 0x9025"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + MODEM + NMEA + QMI_RMNET + Mass Storage (Android)
echo "Switching to composition number 0x9026"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9026 > /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,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9026 > /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,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25_v2() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9026 > /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,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+68
View File
@@ -0,0 +1,68 @@
#!/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.
# DESCRIPTION: RNDIS + Mass Storage
echo "Switching to composition number 0x902A"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902A > /sys/class/android_usb/android$num/idProduct
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
echo rndis_qc,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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902A > /sys/class/android_usb/android$num/idProduct
echo 0x05C6 > /sys/class/android_usb/android$num/idVendor
echo rndis,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+68
View File
@@ -0,0 +1,68 @@
#!/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.
# DESCRIPTION: RNDIS + ADB + Mass Storage
echo "Switching to composition number 0x902B"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
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,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+69
View File
@@ -0,0 +1,69 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS + DIAG [Android]
echo "Switching to composition number 0x902C"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902C > /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 > /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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902C > /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 > /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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+69
View File
@@ -0,0 +1,69 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS + DIAG + ADB [Android]
echo "Switching to composition number 0x902D"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
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,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+96
View File
@@ -0,0 +1,96 @@
#!/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.
# DESCRIPTION: RNDIS + DIAG + MODEM + NMEA + QMI_RMNET + Mass Storage
echo "Switching to composition number 0x902E"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902E > /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 rndis_qc,diag,serial,rmnet,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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902E > /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 rndis,diag,serial,rmnet,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
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25_v2() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x902E > /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 rndis,diag,serial,rmnet,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+77
View File
@@ -0,0 +1,77 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + NMEA + MDM + MBIM [AMSS]
echo "Switching to composition number 0x9043"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9043 > /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 tty,smd > /sys/class/android_usb/android0/f_serial/transports
echo diag,serial,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/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9043 > /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 tty,smd > /sys/class/android_usb/android0/f_serial/transports
echo diag,serial,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+69
View File
@@ -0,0 +1,69 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + ADB + DUN + QMI_RMNET1 + QMI_RMNET2 + QMI_RMNET3 + Mass Storage [Android]
echo "Switching to composition number 0x9046"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9046 > /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,SMD,BAM2BAM,SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
echo diag,adb,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9046 > /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,QTI,BAM2BAM_IPA,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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + DUN + QMI_RMNET1 + QMI_RMNET2 + QMI_RMNET3 + Mass Storage [Android]
echo "Switching to composition number 0x9047"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9047 > /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,SMD,BAM2BAM,SMD,BAM2BAM > /sys/class/android_usb/android0/f_rmnet/transports
echo diag,serial,rmnet,mass_storage > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
* )
run_9x15 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/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.
# DESCRIPTION: DIAG + ADB + DUN + RMNET + Mass Storage + QDSS [Android]
echo "Switching to composition number 0x9049"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+54
View File
@@ -0,0 +1,54 @@
#!/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.
# DESCRIPTION: DIAG + QDSS [Android]
echo "Switching to composition number 0x904A"
if [ "$1" = "y" ]; then
num="1"
else
num="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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x25* )
run_9x25 &
;;
* )
run_9x25 &
;;
esac
+90
View File
@@ -0,0 +1,90 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + ADB + SERIAL + RMNET + Mass Storage + Audio [Android]
echo "Switching to composition number 0x9056"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+68
View File
@@ -0,0 +1,68 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS : ECM
echo "Switching to composition number 0x9057"
if [ "$1" = "y" ]; then
num="1"
else
num="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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+70
View File
@@ -0,0 +1,70 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS+DIAG+ADB : ECM
echo "Switching to composition number 0x9059"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+75
View File
@@ -0,0 +1,75 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG+ADB+MBIM : ECM
echo "Switching to composition number 0x905A"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x15() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x905A > /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: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/android$num/enable
}
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x905A > /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:ecm_qc > /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/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+72
View File
@@ -0,0 +1,72 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: MBIM
echo "Switching to composition number 0x905b"
if [ "$1" = "y" ]; then
num="1"
else
num="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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+54
View File
@@ -0,0 +1,54 @@
#!/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.
# DESCRIPTION: DIAG + QDSS + ADB
echo "Switching to composition number 0x9060"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x25* )
run_9x25 &
;;
* )
run_9x25 &
;;
esac
+75
View File
@@ -0,0 +1,75 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: RNDIS : ECM : MBIM
echo "Switching to composition number 0x9063"
if [ "$1" = "y" ]; then
num="1"
else
num="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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+104
View File
@@ -0,0 +1,104 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: DIAG + ADB + MODEM + QMI_RMNET : ECM : MBIM
echo "Switching to composition number 0x9064"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+98
View File
@@ -0,0 +1,98 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# DESCRIPTION: Mass storage + QMI_RMNET : Mass Storage + MBIM
echo "Switching to composition number 0x9067"
if [ "$1" = "y" ]; then
num="1"
else
num="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
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x15 &
;;
esac
+81
View File
@@ -0,0 +1,81 @@
#!/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.
# DESCRIPTION: DIAG + QDSS + RMNET
echo "Switching to composition number 0x9083"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
fi
run_9x25() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9083 > /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,rmnet > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
echo 1 > /sys/class/android_usb/android$num/enable
}
run_9x25_v2() {
echo 0 > /sys/class/android_usb/android$num/enable
echo 0x9083 > /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,rmnet > /sys/class/android_usb/android$num/functions
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x25 &
;;
esac
+81
View File
@@ -0,0 +1,81 @@
#!/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.
# DESCRIPTION: DIAG + QDSS + ADB + RMNET
echo "Switching to composition number 0x9084"
if [ "$1" = "y" ]; then
num="1"
else
num="0"
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
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
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/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
;;
* )
run_9x25 &
;;
esac
+77
View File
@@ -0,0 +1,77 @@
#!/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.
# DESCRIPTION: DIAG+ADB+MBIM+GNSS
echo "Switching to composition number 0x9085"
if [ "$1" = "y" ]; then
num="1"
mode="hsic"
else
num="0"
mode="hsusb"
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
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/android0/f_usb_mbim/mbim_transports
echo 1 > /sys/class/android_usb/android$num/remote_wakeup
echo 1 > /sys/class/android_usb/android$num/enable
}
case `source /usr/bin/usb/target` in
*9x15* )
run_9x15 &
;;
*9x25* )
run_9x25 &
;;
* )
run_9x15 &
;;
esac
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
# DESCRIPTION: it is used to allow either hsic or hsusb to have no composition at all(must reboot to take effect).
+1
View File
@@ -0,0 +1 @@
0
+1
View File
@@ -0,0 +1 @@
9025
+103
View File
@@ -0,0 +1,103 @@
#!/bin/sh
#
# Copyright (c) 2012-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.
# Starts the USB Android Gadget.
export KERNEL=`uname -r`
export ODU="N"
export ODU_EN="N"
case "$1" in
start)
case $KERNEL in
3.*)
case `source /usr/bin/usb/target` in
*9x15* )
# Nothing to do here for 9x15
;;
*9x25* )
if [ -f /sys/module/usbnet/parameters/usbnet_odu ]
then
ODU=`cat /sys/module/usbnet/parameters/usbnet_odu`
fi
if [ -f /usr/bin/usb/odu ]
then
ODU_EN=`cat /usr/bin/usb/odu`
fi
echo "ODU supported=$ODU enabled=$ODU_EN"
#In case of ODU, don't unbind the HSIC device
if [ "$ODU" == "Y" ] && [ "$ODU_EN" == "Y" ]
then
echo "EHCI HSIC device will be bound(odu=$ODU)"
ln -fs /usr/bin/usb/compositions/901D \
/usr/bin/usb/boot_hsusb_composition
else
#In other cases (for WLAN) unbind HSIC by default
echo "Shutdown EHCI HSIC device"
echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
fi
;;
esac
# boot hsusb composition:
if [ -d /sys/class/android_usb/android0 ]
then
/usr/bin/usb/boot_hsusb_composition n
fi
# boot hsic composition:
if [ -d /sys/class/android_usb/android1 ]
then
/usr/bin/usb/boot_hsic_composition y
fi
;;
2.*)
# Nothing to do for 2.x kernels
;;
*)
# Some other version of kernel?
;;
esac
;;
stop)
echo "Stopping USB Android Gadget"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage usb { start | stop | restart}" >&2
exit 1
;;
esac
+39
View File
@@ -0,0 +1,39 @@
#!/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.
case `cat /sys/devices/system/soc/soc0/build_id` in
*9x15* )
res="9x15"
;;
*9x25* )
res="9x25"
;;
* )
res="none"
;;
esac
echo $res
+243
View File
@@ -0,0 +1,243 @@
#!/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="/usr/bin/usb/compositions"
symlink_hsusb="/usr/bin/usb/boot_hsusb_composition"
symlink_hsic="/usr/bin/usb/boot_hsic_composition"
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
}
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=`readlink $symlink_hsusb | xargs basename`
hsic_comp=`readlink $symlink_hsic | xargs basename`
if [ "$#" -ge 5 ]; then
echo "Usage: usb_composition [Pid] [HSIC] [PERSISTENT] [IMMEDIATE]" >&2
exit 6
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
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"
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"
elif [ "$#" -eq 1 ]; then
if [ `legal_composition $1` = "0" ]; then
echo "Illegal pid"
exit 1
fi
pid=$1
hsic="n"
persistent="n"
immediate="y"
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`
fi
if [ $persistent = "n" ]; then
if [ $immediate = "n" ]; then
echo "Change will have no effect - Illegal combination of not persistent and not immediate"
exit 5
fi
fi
if [ $hsic = "y" ]; then
other=$hsusb_comp
else
other=$hsic_comp
fi
common=`common_functions $other $pid`
if [ $common != "0" ]; then
echo "Can't change composition, hsusb and hsic cant use the same usb function : $common"
exit 7
fi
if [ $persistent = "y" ]; then
if [ $hsic = "y" ]; then
rm $symlink_hsic
ln -s $COMP_DIR/$pid $symlink_hsic
rm /usr/bin/usb/compositions/hsic_next
echo "$pid" > /usr/bin/usb/compositions/hsic_next
else
rm $symlink_hsusb
ln -s $COMP_DIR/$pid $symlink_hsusb
rm /usr/bin/usb/compositions/hsusb_next
echo "$pid" > /usr/bin/usb/compositions/hsusb_next
fi
fi
if [ $hsic = "n" ]; then
if [ $immediate = "y" ]; then
$COMP_DIR/$pid n
fi
else
echo "Please reboot device for HSIC composition to take effect"
fi
+86
View File
@@ -0,0 +1,86 @@
/* 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.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h>
#include <signal.h>
#define COMMAND_SIZE 27
int main(int argc, char **argv) {
/* Our process ID and Session ID */
pid_t pid, sid;
char command[30];
if (argc < 5) {
exit(EXIT_FAILURE);
}
/* E.g. "usb_composition 9060 n n y" to switch to composition 9060*/
snprintf(command, COMMAND_SIZE, "usb_composition %s %s %s", argv[1], argv[2], argv[3]);
pid = fork();
if (pid < 0) {
exit(EXIT_FAILURE);
}
/* Let parent process exit after disabling USB */
if (pid > 0) {
system(command);
exit(EXIT_SUCCESS);
}
if (pid == 0) {
umask(0);
sid = setsid();
if (sid < 0) {
exit(EXIT_FAILURE);
}
if ((chdir("/")) < 0) {
exit(EXIT_FAILURE);
}
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
/* Let child process execute remaining usb_composition switch */
system(command);
exit(EXIT_SUCCESS);
}
}