Bringup wifi driver to android 6.0


1. android_root/system/core/rootdir/init.rc

mkdir /data/misc/systemkeys 0700 system system
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
    mkdir /data/misc/ethernet 0770 system system
    mkdir /data/misc/dhcp 0770 dhcp dhcp
    mkdir /data/misc/user 0771 root root
    mkdir /data/misc/perfprofd 0775 root root
    # give system access to wpa_supplicant.conf for backup and restore
    chmod 0660 /data/misc/wifi/wpa_supplicant.conf
    chmod 0660 /data/misc/wifi/p2p_supplicant_overlay.conf
    mkdir /data/local 0751 root root
    mkdir /data/misc/media 0700 media media

    mkdir /data/misc/vold 0700 root root

2. device/****/common/wifi.mk

######################################### Amlogic_WiFi ###################################
ifeq ($(WIFI_MODULE),amlwifi)
#keeep the following blank, you will have to install driver manually.Otherwise it will be installed by kernel autonoumously.
WIFI_DRIVER :=
WIFI_DRIVER_MODULE_PATH := /system/lib/vlsicomm.ko
WIFI_DRIVER_MODULE_NAME := vlsicomm
#WIFI_DRIVER_MODULE_ARG  := "firmware_path=/etc/wifi/4354/fw_bcm4354a1_ag.bin nvram_path=/etc/wifi/4354/nvram_ap6354.txt"
#WIFI_DRIVER_FW_PATH_STA := /etc/wifi/4354/fw_bcm4354a1_ag.bin
#WIFI_DRIVER_FW_PATH_AP  := /etc/wifi/4354/fw_bcm4354a1_ag_apsta.bin
#WIFI_DRIVER_FW_PATH_P2P := /etc/wifi/4354/fw_bcm4354a1_ag_p2p.bin


BOARD_WLAN_DEVICE := vlsicomm
#WIFI_DRIVER_FW_PATH_PARAM   := "/sys/module/dhd/parameters/firmware_path"


WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
#BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_HOSTAPD_DRIVER        := NL80211
#BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_bcmdhd


#PRODUCT_PACKAGES += \
#   4354/nvram_ap6354.txt \
#   4354/fw_bcm4354a1_ag.bin \
#   4354/fw_bcm4354a1_ag_apsta.bin \
#   4354/fw_bcm4354a1_ag_p2p.bin \
#   wl \
#   p2p_supplicant_overlay.conf \
#   dhd


PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml
PRODUCT_COPY_FILES += device/amlogic/common/init.amlogic.wifi_aml.rc:root/init.amlogic.wifi.rc
#PRODUCT_COPY_FILES += device/amlogic/common/init.amlogic.wifi_bcm.rc:root/init.amlogic.wifi.rc
PRODUCT_COPY_FILES += hardware/amlogic/wifi/multi_wifi/config/wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf
PRODUCT_COPY_FILES += hardware/amlogic/wifi/multi_wifi/config/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf


ifneq ($(wildcard $(TARGET_PRODUCT_DIR)/vlsicomm.ko),)
PRODUCT_COPY_FILES += $(TARGET_PRODUCT_DIR)/vlsicomm.ko:system/lib/vlsicomm.ko
endif


PRODUCT_PROPERTY_OVERRIDES += \
    wifi.interface=wlan0

endif


##################################################################################

3. wifi_driver.mk

***wifi:
    @echo "wifi module is ***** WiFi Module"

    $(amlwifi-modules)

4. ---wpa_supplicant, Support STA/AP and P2P

/device/amlogic/common


init.a****.wifi.rc

import init.amlogic.usb.rc


on fs


service aml_supplicant /system/bin/wpa_supplicant \
    -ip2p0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    -I/system/etc/wifi/aml_supplicant_overlay.conf \
    -m/data/misc/wifi/p2p_supplicant.conf \
    -O/data/misc/wifi/sockets \
    -g@android:wpa_wlan0    \
    -puse_p2p_group_interface=1p2p_device=1 -e/data/misc/wifi/entropy.bin
#   we will start as root and wpa_supplicant will switch to user wifi
#   after setting up the capabilities required for WEXT
#   user wifi
#   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

init.a****.wifi_a**.rc

service wpa_supplicant /system/bin/wpa_supplicant \
    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
    -I/system/etc/wifi/wpa_supplicant_overlay.conf \
    -O/data/misc/wifi/sockets \
    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
    #   we will start as root and wpa_supplicant will switch to user wifi
    #   after setting up the capabilities required for WEXT
    #   user wifi
    #   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot


service p2p_supplicant /system/bin/wpa_supplicant \
    -ip2p0 -Dnl80211 -c /data/misc/wifi/p2p_supplicant.conf \
    -m/data/misc/wifi/p2p_supplicant.conf \
    -I/system/etc/wifi/p2p_supplicant_overlay.conf \
    -O/data/misc/wifi/sockets \
    -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 \
    -N -puse_p2p_group_interface=1 \
    -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf
#   we will start as root and wpa_supplicant will switch to user wifi
#   after setting up the capabilities required for WEXT
#   user wifi
#   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

你可能感兴趣的:(Android,WiFi)