USB Class

来源:互联网 发布:嘀哩嘀哩软件官方下载 编辑:程序博客网 时间:2024/06/06 01:18

1 USBFN Class

1.1 COM

1.1.1 COM

@ atci_main.c, hal_platform.h


1.1.2 VCOM

@ atci_main.c, serial_port.h


1.2 RMNET

1.2.1 BAM Match

@ drivers/usb/gadget/function/u_bam.c



[...]

2 Host Class

2.1 Android Ethernet Porting Guide

2.1.1 Usual network commands for Android
netstat, netcfg, ifconfig, ip route.
You can config ethernet ip address manually like as below:
ifconfig eth0 up
ifconfig eth0 192.168.0.2 netmask 255.255.255.0

2.1.2 Ethernet configuration
@ frameworks/base/core/res/res/values/config.xml, search networkAttributes,
append the following line <item>"ethernet,9,9,0,-1,true"</item> , which is
illustrated as below:
[Connection name],
[ConnectivityManager.TYPE_xxxx],
[associated radio-type],
[priority],
[restoral-timer(ms)],
[dependencyMet]

Then search radioAttributes
Append the following line <item>”9,1”</item>, which is illustrated as below:
[ConnectivityManager connectionType],
[simultaneous connection types]"

For tethering, search config_tether_upstream_types,
Add <item>9</item>

Add two services device/qcom/common/rootdir/etc/init.qcom.rc like as below:
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot

service iprenew_eth0 /system/bin/dhcpcd -n
class main
disabled
oneshot

In Android, EthernetNetworkFactory.java can be found under frameworks/
/opt/net/ethernet/java/com/android/server/ethernet/
Please add logs in this file when debug android ethernet function.
Add Ethernet feature under device/qcom/{ro.board.platform}/{ro.board.platform}.mk as shown below:
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/perm
issions/android.hardware.ethernet.xml

2.1.3 System level route config
Firstly, open Windows command shell, please do shown as below:
adb shell
su
cat /proc/net/route
# add a route
ip route 192.168.0.1/32 dev eth0
# delete a route
ip route del 192.168.0.1/32
You should add ip as prefix in the route, which is not the same as general Linux
release version, also you can typo ‘ip route help’ to get more helps


原创粉丝点击