1# Copyright 2012 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15on init
16    write /sys/class/android_usb/android0/f_rndis/manufacturer ASUS
17    write /sys/class/android_usb/android0/f_rndis/vendorID 18D1
18    write /sys/class/android_usb/android0/f_rndis/wceis 1
19
20on boot
21    write /sys/class/android_usb/android0/iSerial $ro.serialno
22    write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
23    write /sys/class/android_usb/android0/iProduct $ro.product.model
24
25# MTP
26on property:sys.usb.config=mtp
27    stop adbd
28    write /sys/class/android_usb/android0/enable 0
29    write /sys/class/android_usb/android0/idVendor 18D1
30    write /sys/class/android_usb/android0/idProduct 4EE1
31    write /sys/class/android_usb/android0/bDeviceClass 0
32    write /sys/class/android_usb/android0/bDeviceSubClass 0
33    write /sys/class/android_usb/android0/bDeviceProtocol 0
34    write /sys/class/android_usb/android0/functions mtp
35    write /sys/class/android_usb/android0/enable 1
36    setprop sys.usb.state ${sys.usb.config}
37
38on property:sys.usb.config=mtp,adb
39    write /sys/class/android_usb/android0/enable 0
40    write /sys/class/android_usb/android0/idVendor 18D1
41    write /sys/class/android_usb/android0/idProduct 4EE2
42    write /sys/class/android_usb/android0/bDeviceClass 0
43    write /sys/class/android_usb/android0/bDeviceSubClass 0
44    write /sys/class/android_usb/android0/bDeviceProtocol 0
45    write /sys/class/android_usb/android0/functions mtp,adb
46    write /sys/class/android_usb/android0/enable 1
47    start adbd
48    setprop sys.usb.state ${sys.usb.config}
49
50# rndis
51on property:sys.usb.config=rndis
52    stop adbd
53    write /sys/class/android_usb/android0/enable 0
54    write /sys/class/android_usb/android0/idVendor 18D1
55    write /sys/class/android_usb/android0/idProduct 4EE3
56    write /sys/class/android_usb/android0/bDeviceClass 239
57    write /sys/class/android_usb/android0/bDeviceSubClass 2
58    write /sys/class/android_usb/android0/bDeviceProtocol 1
59    write /sys/class/android_usb/android0/functions rndis
60    write /sys/class/android_usb/android0/enable 1
61    setprop sys.usb.state ${sys.usb.config}
62
63on property:sys.usb.config=rndis,adb
64    write /sys/class/android_usb/android0/enable 0
65    write /sys/class/android_usb/android0/idVendor 18D1
66    write /sys/class/android_usb/android0/idProduct 4EE4
67    write /sys/class/android_usb/android0/bDeviceClass 239
68    write /sys/class/android_usb/android0/bDeviceSubClass 2
69    write /sys/class/android_usb/android0/bDeviceProtocol 1
70    write /sys/class/android_usb/android0/functions rndis,adb
71    write /sys/class/android_usb/android0/enable 1
72    start adbd
73    setprop sys.usb.state ${sys.usb.config}
74
75# PTP
76on property:sys.usb.config=ptp
77    stop adbd
78    write /sys/class/android_usb/android0/enable 0
79    write /sys/class/android_usb/android0/idVendor 18D1
80    write /sys/class/android_usb/android0/idProduct 4EE5
81    write /sys/class/android_usb/android0/bDeviceClass 0
82    write /sys/class/android_usb/android0/bDeviceSubClass 0
83    write /sys/class/android_usb/android0/bDeviceProtocol 0
84    write /sys/class/android_usb/android0/functions ptp
85    write /sys/class/android_usb/android0/enable 1
86    setprop sys.usb.state ${sys.usb.config}
87
88on property:sys.usb.config=ptp,adb
89    write /sys/class/android_usb/android0/enable 0
90    write /sys/class/android_usb/android0/idVendor 18D1
91    write /sys/class/android_usb/android0/idProduct 4EE6
92    write /sys/class/android_usb/android0/bDeviceClass 0
93    write /sys/class/android_usb/android0/bDeviceSubClass 0
94    write /sys/class/android_usb/android0/bDeviceProtocol 0
95    write /sys/class/android_usb/android0/functions ptp,adb
96    write /sys/class/android_usb/android0/enable 1
97    start adbd
98    setprop sys.usb.state ${sys.usb.config}
99
100# USB midi configuration
101on property:sys.usb.config=midi
102    write /sys/class/android_usb/android0/enable 0
103    write /sys/class/android_usb/android0/idVendor 18D1
104    write /sys/class/android_usb/android0/idProduct 4EE8
105    write /sys/class/android_usb/android0/functions ${sys.usb.config}
106    write /sys/class/android_usb/android0/enable 1
107    start adbd
108    setprop sys.usb.state ${sys.usb.config}
109
110# USB midi configuration, with adb
111on property:sys.usb.config=midi,adb
112    write /sys/class/android_usb/android0/enable 0
113    write /sys/class/android_usb/android0/idVendor 18D1
114    write /sys/class/android_usb/android0/idProduct 4EE9
115    write /sys/class/android_usb/android0/functions ${sys.usb.config}
116    write /sys/class/android_usb/android0/enable 1
117    start adbd
118    setprop sys.usb.state ${sys.usb.config}
119
120# diag
121on property:sys.usb.config=diag
122    stop adbd
123    write /sys/class/android_usb/android0/enable 0
124    write /sys/class/android_usb/android0/idVendor 1004
125    write /sys/class/android_usb/android0/idProduct 631B
126    write /sys/class/android_usb/android0/bDeviceClass 239
127    write /sys/class/android_usb/android0/bDeviceSubClass 2
128    write /sys/class/android_usb/android0/bDeviceProtocol 1
129    write /sys/class/android_usb/android0/f_acm/acm_transports tty
130    write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
131    write /sys/class/android_usb/android0/functions acm,diag,mtp,adb
132    write /sys/class/android_usb/android0/enable 1
133    start adbd
134    setprop sys.usb.state ${sys.usb.config}
135
136on property:sys.usb.config=diag,adb
137    write /sys/class/android_usb/android0/enable 0
138    write /sys/class/android_usb/android0/idVendor 05C6
139    write /sys/class/android_usb/android0/idProduct 9025
140    write /sys/class/android_usb/android0/f_diag/clients diag
141    write /sys/class/android_usb/android0/f_serial/transports smd,tty
142    write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
143    write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
144    write /sys/class/android_usb/android0/enable 1
145    start adbd
146    setprop sys.usb.state $sys.usb.config
147
148on property:sys.usb.config=diag,mdm,adb
149    stop adbd
150    write /sys/class/android_usb/android0/enable 0
151    write /sys/class/android_usb/android0/idVendor 05C6
152    write /sys/class/android_usb/android0/idProduct 9031
153    write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
154    write /sys/class/android_usb/android0/f_serial/transports hsic,tty
155    write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
156    write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
157    write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
158    write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
159    write /sys/class/android_usb/android0/enable 1
160    start adbd
161    setprop sys.usb.state ${sys.usb.config}
162
163# Fusion 3 composition with diag_mdm and adb
164on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb
165    write /sys/class/android_usb/android0/enable 0
166    write /sys/class/android_usb/android0/idVendor 05C6
167    write /sys/class/android_usb/android0/idProduct 9031
168    write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
169    write /sys/class/android_usb/android0/f_serial/transports hsic,tty
170    write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
171    write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
172    write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
173    write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
174    write /sys/class/android_usb/android0/enable 1
175    start adbd
176    setprop sys.usb.state ${sys.usb.config}
177