diff mbox

linaro_generic: Add basic generic wifi settings

Message ID 1466800025-12403-1-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz June 24, 2016, 8:27 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       |  3 ++-
 wifi/Android.mk |  9 +++++++++
 wifi/device.mk  | 13 +++++++++++++
 wifi/wifi.rc    | 21 +++++++++++++++++++++
 5 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 wifi/Android.mk
 create mode 100644 wifi/device.mk
 create mode 100644 wifi/wifi.rc

-- 
1.9.1
diff mbox

Patch

diff --git a/BoardConfig.mk b/BoardConfig.mk
index 8900439..3ec97d1 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -19,3 +19,9 @@  BOARD_KERNEL_BASE := $(CONFIG_KERNEL_BASE_ADDR)
 BOARD_MKBOOTIMG_ARGS := --ramdisk_offset $(CONFIG_RAMDISK_OFFSET)
 
 WITH_DEXPREOPT := $(CONFIG_DEX_PREOPT)
+
+# 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 4d04298..fb15eb2 100644
--- a/device.mk
+++ b/device.mk
@@ -56,7 +56,7 @@  PRODUCT_COPY_FILES += \
     frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
     $(LOCAL_PATH)/media_codecs.xml:system/etc/media_codecs.xml \
 
-subdirs-true :=
+subdirs-true := wifi
 subdirs-$(CONFIG_ETHERNET) += ethernet
 subdirs-$(CONFIG_SENSOR) += sensor
 
@@ -64,3 +64,4 @@  include $(foreach dir,$(subdirs-true), $(LOCAL_PATH)/$(dir)/device.mk)
 DEVICE_PACKAGE_OVERLAYS += $(foreach dir,$(subdirs-true), $(LOCAL_PATH)/$(dir)/overlay)
 
 PRODUCT_COPY_FILES += $(PRODUCT_COPY_FILES-true)
+
diff --git a/wifi/Android.mk b/wifi/Android.mk
new file mode 100644
index 0000000..d31a80c
--- /dev/null
+++ b/wifi/Android.mk
@@ -0,0 +1,9 @@ 
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= wifi.rc
+
+LOCAL_INIT_RC := $(LOCAL_MODULE)
+
+include $(BUILD_PHONY_PACKAGE)
diff --git a/wifi/device.mk b/wifi/device.mk
new file mode 100644
index 0000000..f07d629
--- /dev/null
+++ b/wifi/device.mk
@@ -0,0 +1,13 @@ 
+#wifi items
+PRODUCT_PACKAGES += \
+		wifi.rc \
+		libwpa_client \
+		hostapd \
+		dhcpcd.conf \
+		wpa_supplicant \
+		wpa_supplicant.conf
+
+
+PRODUCT_PROPERTY_OVERRIDES += \
+		wifi.interface=wlan0 \
+		wifi.supplicant_scan_interval=15
diff --git a/wifi/wifi.rc b/wifi/wifi.rc
new file mode 100644
index 0000000..8a866d9
--- /dev/null
+++ b/wifi/wifi.rc
@@ -0,0 +1,21 @@ 
+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
+	neshot
+
+service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
+	class main
+	disabled
+	oneshot
+
+service iprenew_wlan0 /system/bin/dhcpcd -n
+	class main
+	disabled
+	oneshot
+