diff mbox

[4/5] linaro_generic: Add basic generic wifi settings

Message ID 1465426091-21102-5-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz June 8, 2016, 10:48 p.m. UTC
Add basic entries for wifi support.

I suspect with a simple usb-wifi adapter on db410
this would work, but I've not been able to validate.

Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 BoardConfig.mk |  6 ++++++
 device.mk      | 13 +++++++++++++
 init.rc        | 22 ++++++++++++++++++++++
 3 files changed, 41 insertions(+)

-- 
1.9.1
diff mbox

Patch

diff --git a/BoardConfig.mk b/BoardConfig.mk
index 69ffdd2..c0acc56 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -20,3 +20,9 @@  BOARD_SYSTEMIMAGE_PARTITION_SIZE := 644245504
 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
 
 WITH_DEXPREOPT := false
+
+# generic wifi
+WPA_SUPPLICANT_VERSION := VER_0_8_X
+BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+BOARD_HOSTAPD_DRIVER := NL80211
+CONFIG_DRIVER_NL80211 := y
diff --git a/device.mk b/device.mk
index 9f889f1..f27a5ae 100644
--- a/device.mk
+++ b/device.mk
@@ -43,3 +43,16 @@  PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\
 	vendor/qcom/flo/proprietary/a300_pfp.fw:/system/vendor/firmware/a300_pfp.fw \
 	vendor/qcom/flo/proprietary/a300_pm4.fw:/system/vendor/firmware/a300_pm4.fw \
 )
+
+#wifi items
+PRODUCT_PACKAGES += \
+	libwpa_client \
+	hostapd \
+	dhcpcd.conf \
+	wpa_supplicant \
+	wpa_supplicant.conf
+
+
+PRODUCT_PROPERTY_OVERRIDES += \
+	wifi.interface=wlan0 \
+	wifi.supplicant_scan_interval=15
diff --git a/init.rc b/init.rc
index 40c5608..ba6fc15 100644
--- a/init.rc
+++ b/init.rc
@@ -34,6 +34,28 @@  on boot
     setprop status.battery.level_raw  50
     setprop status.battery.level_scale 9
 
+
+on property:init.svc.wpa_supplicant=stopped
+    stop dhcpcd
+
+service wpa_supplicant /system/bin/wpa_supplicant \
+    -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf \
+    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
+    socket wpa_wlan0 dgram 660 wifi wifi
+    class main
+    disabled
+    oneshot
+
+service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
+    class main
+    disabled
+    oneshot
+
+service iprenew_wlan0 /system/bin/dhcpcd -n
+    class main
+    disabled
+    oneshot
+
 service dhcpcd_eth0 /system/bin/dhcpcd -aABDKL
     class late_start
     disabled