Skip to content
Snippets Groups Projects
Commit b7394149 authored by Chris Dearman's avatar Chris Dearman
Browse files

Set WiFi MAC addresses from OTP data

Bug:27479111
Change-Id: I44ede163dfed607d103fc81da2b21694976c5508
parent 65d3e31d
No related branches found
No related tags found
No related merge requests found
......@@ -32,4 +32,14 @@ LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := wifisetmac
LOCAL_SRC_FILES := wifisetmac
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
include $(BUILD_PREBUILT)
endif
......@@ -14,6 +14,8 @@
# limitations under the License.
#
LOCAL_PATH := hardware/bsp/imagination/peripheral/wifi/uccp420
# UCCP420 WIFI Firmware
UCCP420_WIFI_FW_SRC = vendor/bsp/imagination/peripheral/wifi/uccp420_firmware
UCCP420_WIFI_FW_DST = system/vendor/firmware/img/uccp420wlan
......@@ -22,5 +24,11 @@ PRODUCT_COPY_FILES += \
$(UCCP420_WIFI_FW_SRC)/v4_5_8/MAC_LOADER.ldr:$(UCCP420_WIFI_FW_DST)/MAC_LOADER.ldr \
$(UCCP420_WIFI_FW_SRC)/v4_5_8/MCP_LOADER.ldr:$(UCCP420_WIFI_FW_DST)/MCP_LOADER.ldr
BOARD_SEPOLICY_DIRS += \
$(LOCAL_PATH)/sepolicy
DEVICE_PACKAGES += \
wifisetmac
WIFI_DRIVER_HAL_MODULE := wifi_driver.$(soc_name)
WIFI_DRIVER_HAL_PERIPHERAL := uccp420
/system/bin/wifisetmac u:object_r:wifisetmac_exec:s0
# Domain for wifisetmac
type wifisetmac, domain;
type wifisetmac_exec, exec_type, file_type;
brillo_domain(wifisetmac)
allow_crash_reporter(wifisetmac)
allow wifisetmac shell_exec:file read;
allow wifisetmac proc:file write;
allow wifisetmac system_file:file execute_no_trans;
allow wifisetmac mtd_device:dir search;
allow wifisetmac mtd_device:chr_file { rw_file_perms };
# bcsp configuration
# uucp420 configuration
# Tell the kernel driver where to find the firmware
on early-boot
write /sys/module/firmware_class/parameters/path /vendor/firmware
exec /system/bin/wifisetmac
#!/system/bin/sh
#
# Initialize WiFi MAC addresses
if [ -x /system/bin/proddata ]; then
mac0=`proddata read MAC_0`
mac1=`proddata read MAC_1`
echo "vif_macs=$mac0$mac1" > /proc/uccp420/params
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment