• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


Commit MetaInfo

Revision8ac9fea0db77ce1ace33e04a0da9def54a92ac55 (tree)
Zeit2019-06-13 18:08:41
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

init.sh: enable virt_wifi if needed

Some Android apps are not interested in ethernet devices and would rather
connect to a wireless interface. This patch allows the devices with only
ethernet interface to treat one of its network connections as wireless,
satisfying Android apps's network connection requirements.

The ethernet interface being simulated can be specified by the property
net.virt_wifi. The default is eth0.

The feature is enabled if wlan0 doesn't exist, or VIRT_WIFI=1 is set in
kernel cmdline. To disable it, set VIRT_WIFI=0 kernel cmdline.

Ändern Zusammenfassung

Diff

--- a/init.sh
+++ b/init.sh
@@ -44,6 +44,20 @@ function init_misc()
4444 wifi=$(basename `readlink /sys/class/net/wlan0/device/driver`)
4545 [ "$wifi" != "wl" ] && rmmod_if_exist wl
4646 fi
47+
48+ # enable virt_wifi if needed
49+ local eth=`getprop net.virt_wifi eth0`
50+ if [ -d /sys/class/net/$eth -a "$VIRT_WIFI" != "0" ]; then
51+ if [ -n "$wifi" -a "$VIRT_WIFI" = "1" ]; then
52+ rmmod_if_exist iwlmvm $wifi
53+ fi
54+ if [ ! -d /sys/class/net/wlan0 ]; then
55+ ifconfig $eth down
56+ ip link set $eth name wifi_eth
57+ ifconfig wifi_eth up
58+ ip link add link wifi_eth name wlan0 type virt_wifi
59+ fi
60+ fi
4761 }
4862
4963 function init_hal_audio()