Android 支持 ap6236 wifi 模块补丁

简介: Android 支持 ap6236 wifi 模块补丁

这个补丁是我在全志A40 4.4 增加的ap6236 wifi模块的适配 , 思路万古不变 , 希望能帮助到有需要的人。

这个补丁主要修改了 Android 的一些硬件配置和驱动代码,以支持 ap6236 wifi 模块并修复了 ap6236 wifi 模块。

修改的文件

  • android/device/softwinner/t3-p1/BoardConfig.mk
  • android/hardware/broadcom/libbt/src/userial_vendor.c
  • android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212.zip
  • android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk
  • android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt
  • android/hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk
  • android/hardware/libhardware_legacy/wifi_hardware_info/wifi_hardware_info.c
  • `lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_android_defconfig## 对每个文件的修改说明
  • BoardConfig.mk:修改了 wifi 和蓝牙的配置,将默认的 wifi 模块从 ap6212 修改为 ap6236。
  • userial_vendor.c:在 userial_vendor_open 函数中添加了对 ap6236 模块的支持。
  • ap6212.zip:添加了新的固件文件。
  • device-bcm.mk:创建了新的文件,定义了 ap6236 模块的固件文件路径。
  • nvram_ap6212.txt:创建了新的文件,定义了 ap6236 模块的 NVRAM 配置。
  • firmware-bcm.mk:在此文件中添加了对 ap6236 模块的支持。
  • wifi_hardware_info.c:在 wifi_list 中添加了对 ap6236 模块的支持。
  • sun8iw11p1smp_android_defconfig:修改了 BCMHD 的固件路径和 NVRAM 路径,将其指向 ap6236 模块的相关文件。

如何应用这个补丁

  1. 将这个补丁应用到你的 Android 源码树中。
  2. 根据你的硬件配置,可能需要修改 nvram_ap6212.txtsun8iw11p1smp_android_defconfig 中的相关设置。
  3. 编译并刷入你的 Android 系统。
  4. 当的设备启动时,系统应该能够正确地检测和使用 ap6236 wifi 模块。

注意:这个补丁可能需要根据你的具体硬件和 Android 版本进行一些调整。

Subject: [PATCH] Add ap6236 wifi & fiexd wifi module ap6236
 
---
 .../device/softwinner/t3-p1/BoardConfig.mk    |   8 +-
 .../broadcom/libbt/src/userial_vendor.c       |  10 ++
 .../broadcom/wlan/bcmdhd/firmware/ap6212.zip  | Bin 0 -> 725992 bytes
 .../wlan/bcmdhd/firmware/ap6212/ap6212.hcd    | Bin 0 -> 42667 bytes
 .../bcmdhd/firmware/ap6212/bcm43438a0.hcd     | Bin 38644 -> 0 bytes
 .../wlan/bcmdhd/firmware/ap6212/device-bcm.mk |  11 +-
 .../bcmdhd/firmware/ap6212/nvram_ap6212.txt   | 117 ++++++++++--------
 .../wlan/bcmdhd/firmware/ap6236/ap6212.hcd    | Bin 0 -> 42667 bytes
 .../wlan/bcmdhd/firmware/ap6236/device-bcm.mk |  24 ++++
 .../bcmdhd/firmware/ap6236/nvram_ap6212.txt   |  65 ++++++++++
 .../wlan/bcmdhd/firmware/firmware-bcm.mk      |   2 +-
 .../wifi_hardware_info/wifi_hardware_info.c   |  13 +-
 .../configs/sun8iw11p1smp_android_defconfig   |   4 +-
 13 files changed, 189 insertions(+), 65 deletions(-)
 create mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212.zip
 create mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212/ap6212.hcd
 delete mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212/bcm43438a0.hcd
 create mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/ap6212.hcd
 create mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk
 create mode 100755 android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt
 
diff --git a/android/device/softwinner/t3-p1/BoardConfig.mk b/android/device/softwinner/t3-p1/BoardConfig.mk
index a9f8c3608c..807662cecb 100755
--- a/android/device/softwinner/t3-p1/BoardConfig.mk
+++ b/android/device/softwinner/t3-p1/BoardConfig.mk
@@ -20,19 +20,23 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368
 
 # wifi and bt configuration
 # 1. wifi Configuration
+#$shh$20180829$modify$wifi module default ap6236$
 WPA_SUPPLICANT_VERSION := VER_0_8_X
 BOARD_WPA_SUPPLICANT_DRIVER := NL80211
 BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd
 BOARD_HOSTAPD_DRIVER        := NL80211
 BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd
-
+BOARD_USR_WIFI := ap6212
 include hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk
 
 # 2. Bluetooth Configuration
 # make sure BOARD_HAVE_BLUETOOTH is true for every bt vendor
-include device/softwinner/common/hardware/realtek/bluetooth/rtl8723bs/firmware/rtlbtfw_cfg.mk
+#include device/softwinner/common/hardware/realtek/bluetooth/rtl8723bs/firmware/rtlbtfw_cfg.mk
 BOARD_HAVE_BLUETOOTH := true
+BOARD_HAVE_BLUETOOTH_BCM := true
+BOARD_HAVE_BLUETOOTH_NAME := ap6212
 BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/softwinner/t3-p1/bluetooth/
+#$shh$20180829$modify$wifi module default ap6236$
 
 # 3. Sensor HAL Configuration
 SW_BOARD_USES_SENSORS_TYPE = aw_sensors
diff --git a/android/hardware/broadcom/libbt/src/userial_vendor.c b/android/hardware/broadcom/libbt/src/userial_vendor.c
index 34981ba69c..ddcad1945e 100755
--- a/android/hardware/broadcom/libbt/src/userial_vendor.c
+++ b/android/hardware/broadcom/libbt/src/userial_vendor.c
@@ -271,6 +271,16 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
         }
     }
     else if (strcmp(module_info.mod_name, "ap6212") == 0)
+    {
+        usleep(300000);
+        close(vnd_userial.fd);
+        if ((vnd_userial.fd = open(vnd_userial.port_name, O_RDWR)) == -1)
+        {
+            ALOGE("userial vendor open: unable to open %s", vnd_userial.port_name);
+            return -1;
+        }
+    }
+ else if (strcmp(module_info.mod_name, "ap6236") == 0)
     {
         usleep(300000);
         close(vnd_userial.fd);
diff --git a/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212.zip b/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6212.zip
literal 0
HcmV?d00001
 
diff --git a/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk b/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk
new file mode 100755
index 0000000000..6c561de7dc
--- /dev/null
+++ b/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2008 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+-include hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk
+
+PRODUCT_COPY_FILES += \
+    hardware/broadcom/wlan/bcmdhd/firmware/ap6236/fw_bcm43438a0.bin:system/vendor/modules/fw_bcm43438a0.bin \
+    hardware/broadcom/wlan/bcmdhd/firmware/ap6236/fw_bcm43438a0_apsta.bin:system/vendor/modules/fw_bcm43438a0_apsta.bin \
+    hardware/broadcom/wlan/bcmdhd/firmware/ap6236/fw_bcm43438a0_p2p.bin:system/vendor/modules/fw_bcm43438a0_p2p.bin \
+    hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt:system/vendor/modules/nvram_ap6212.txt \
+    hardware/broadcom/wlan/bcmdhd/firmware/ap6236/ap6212.hcd:system/vendor/modules/ap6212.hcd
diff --git a/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt b/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt
new file mode 100755
index 0000000000..3537469be1
--- /dev/null
+++ b/android/hardware/broadcom/wlan/bcmdhd/firmware/ap6236/nvram_ap6212.txt
@@ -0,0 +1,65 @@
+#AP6236_NVRAM_V1.1_20170804
+# NVRAM file for BCM943430WLPTH, Bx Chip
+# 2.4 GHz, 20 MHz BW mode
+
+# The following parameter values are just placeholders, need to be updated.
+manfid=0x2d0
+prodid=0x0727
+vendid=0x14e4
+devid=0x43e2
+boardtype=0x0727
+boardrev=0x1331
+boardnum=22
+macaddr=00:90:4c:c5:12:38
+sromrev=11
+boardflags=0x00404201
+boardflags3=0x08000000
+xtalfreq=26000
+nocrc=1
+ag0=255
+aa2g=1
+ccode=ALL
+
+pa0itssit=0x20
+extpagain2g=0
+#PA parameters for 2.4GHz, measured at CHIP OUTPUT
+pa2ga0=-202,5582,-671
+AvVmid_c0=0x0,0xc8
+cckpwroffset0=5
+
+# PPR params
+maxp2ga0=74
+txpwrbckof=6
+cckbw202gpo=0x2222
+legofdmbw202gpo=0x55555555
+mcsbw202gpo=0x76666666
+propbw202gpo=0xcc
+
+# OFDM IIR :
+ofdmdigfilttype=18
+ofdmdigfilttypebe=18
+# PAPD mode:
+papdmode=1
+pacalidx2g=42
+papdepsoffset=-22
+papdendidx=58
+
+# LTECX flags
+ltecxmux=0
+ltecxpadnum=0x0102
+ltecxfnsel=0x44
+ltecxgcigpio=0x01
+
+il0macaddr=00:90:4c:c5:12:38
+wl0id=0x431b
+
+deadman_to=0xffffffff
+# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
+muxenab=0x10
+# CLDO PWM voltage settings - 0x4 - 1.1 volt
+#cldo_pwm=0x4
+
+#VCO freq 326.4MHz
+spurconfig=0x3 
+
+AvVmidIQcal=0x2,0xa8
\ No newline at end of file
diff --git a/android/hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk b/android/hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk
index a6cd5ddff1..8e1c175a66 100755
--- a/android/hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk
+++ b/android/hardware/broadcom/wlan/bcmdhd/firmware/firmware-bcm.mk
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-
+include hardware/broadcom/wlan/bcmdhd/firmware/ap6236/device-bcm.mk
 include hardware/broadcom/wlan/bcmdhd/firmware/ap6210/device-bcm.mk
 include hardware/broadcom/wlan/bcmdhd/firmware/ap6330/device-bcm.mk
 include hardware/broadcom/wlan/bcmdhd/firmware/ap6335/device-bcm.mk
diff --git a/android/hardware/libhardware_legacy/wifi_hardware_info/wifi_hardware_info.c b/android/hardware/libhardware_legacy/wifi_hardware_info/wifi_hardware_info.c
index 46b5101fe6..1e6e231d64 100755
--- a/android/hardware/libhardware_legacy/wifi_hardware_info/wifi_hardware_info.c
+++ b/android/hardware/libhardware_legacy/wifi_hardware_info/wifi_hardware_info.c
@@ -104,7 +104,17 @@ static const struct wifi_hardware_info wifi_list[] = {
         .fw_path_ap  = "AP",
         .fw_path_p2p = "P2P",
     },
- 
+ /*///$shh$20180829$add$ap6236 wifi module$
+ {
+        .device_id   = 0x1a9a6,
+        .module_name = "ap6236",
+        .driver_name = "bcmdhd",
+        .vendor_name = "broadcom",
+        .fw_path_sta = "/system/vendor/modules/fw_bcm43438a1.bin",
+        .fw_path_ap  = "/system/vendor/modules/fw_bcm43438a1_apsta.bin",
+        .fw_path_p2p = "/system/vendor/modules/fw_bcm43438a1_p2p.bin",
+    },
+    ///$shh$20180829$add$ap6236 wifi module$ */
     {
         .device_id   = 0x1a9a6,
         .module_name = "ap6212",
@@ -114,6 +124,7 @@ static const struct wifi_hardware_info wifi_list[] = {
         .fw_path_ap  = "/system/vendor/modules/fw_bcm43438a0_apsta.bin",
         .fw_path_p2p = "/system/vendor/modules/fw_bcm43438a0_p2p.bin",
     },
+
     {
         .device_id   = 0x1a962,
         .module_name = "ap6210",
diff --git a/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_android_defconfig b/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_android_defconfig
index f9cb15cbdd..0f1907ab4d 100755
--- a/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_android_defconfig
+++ b/lichee/linux-3.10/arch/arm/configs/sun8iw11p1smp_android_defconfig
@@ -1375,8 +1375,8 @@ CONFIG_RTL8189ES=m
 # CONFIG_WIFI_CONTROL_FUNC is not set
 # CONFIG_ATH_CARDS is not set
 CONFIG_BCMDHD=m
-CONFIG_BCMDHD_FW_PATH="/system/vendor/modules/fw_bcm43438a0.bin"
-CONFIG_BCMDHD_NVRAM_PATH="/system/vendor/modules/nvram_ap6212.txt"
+CONFIG_BCMDHD_FW_PATH="/system/vendor/modules/fw_bcm43438a1.bin"
+CONFIG_BCMDHD_NVRAM_PATH="/system/vendor/modules/nvram_ap6236.txt"
 CONFIG_BCMDHD_SDIO=y
 CONFIG_BCMDHD_OOB=y
 # CONFIG_BCMDHD_SDIO_IRQ is not set
-- 
2.25.1
 


相关文章
|
26天前
|
开发框架 前端开发 Android开发
Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势
本文深入探讨了 Flutter 与原生模块(Android 和 iOS)之间的通信机制,包括方法调用、事件传递等,分析了通信的必要性、主要方式、数据传递、性能优化及错误处理,并通过实际案例展示了其应用效果,展望了未来的发展趋势。这对于实现高效的跨平台移动应用开发具有重要指导意义。
105 4
|
7月前
|
Android开发
Android 状态栏WiFi图标的显示逻辑
Android 状态栏WiFi图标的显示逻辑
186 0
|
4月前
|
编解码 网络协议 前端开发
如何实现Android平台GB28181设备接入模块按需打开摄像头并回传数据
后台采集摄像头,如果想再进一步扩展,可以把android平台gb28181的camera2 demo,都移植过来,实现功能更强大的国标设备侧,这里主要是展示,收到国标平台侧的回传请求后,才打开摄像头,才开始编码打包,最大限度的减少资源的占用
|
4月前
|
编解码 网络协议 Android开发
Android平台GB28181设备接入模块实现后台service按需回传摄像头数据到国标平台侧
我们在做Android平台GB28181设备对接模块的时候,遇到这样的技术需求,开发者希望能以后台服务的形式运行程序,国标平台侧没有视频回传请求的时候,仅保持信令链接,有发起视频回传请求或语音广播时,打开摄像头,并实时回传音视频数据或接收处理国标平台侧发过来的语音广播数据。
|
4月前
|
Java Android开发
添加Flutter模块到已有项目(Android)
添加Flutter模块到已有项目(Android)
51 3
|
4月前
|
监控 Java 开发工具
如何快速对接Android平台GB28181接入模块(SmartGBD)
大牛直播SDK推出的Android平台GB28181接入SDK(SmartGBD),可实现不具备国标音视频能力的 Android终端,通过平台注册接入到现有的GB/T28181—2016服务,可用于如执法记录仪、智能安全帽、智能监控、智慧零售、智慧教育、远程办公、明厨亮灶、智慧交通、智慧工地、雪亮工程、平安乡村、生产运输、车载终端等场景,可能是业内为数不多功能齐全性能优异的商业级水准GB28181接入SDK。
|
4月前
|
编解码 开发工具 Android开发
Android平台RTMP直播推送模块技术接入说明
大牛直播SDK跨平台RTMP直播推送模块,始于2015年,支持Windows、Linux(x64_64架构|aarch64)、Android、iOS平台,支持采集推送摄像头、屏幕、麦克风、扬声器、编码前、编码后数据对接,功能强大,性能优异,配合大牛直播SDK的SmartPlayer播放器,轻松实现毫秒级的延迟体验,满足大多数行业的使用场景。RTMP直播推送模块数据源,支持编码前、编码后数据对接
|
4月前
|
监控 开发工具 Android开发
结合GB/T28181规范探讨Android平台设备接入模块心跳实现
本文介绍了GB28181标准中的状态信息报送机制,即心跳机制,用于监控设备与服务器间的连接状态。根据国标GB/T28181-2016,设备在异常时需立即发送状态信息,在正常状态下则按固定间隔(默认60秒)定期发送。若连续三次(默认值)未收到心跳,则视为离线。文章展示了在Android平台的GB28181设备接入模块(SmartGBD)中,如何调整心跳间隔为20秒及超时次数为3次,并给出了心跳消息的示例和异常处理代码片段。对于希望深入了解或遇到问题的开发者,作者提供了进一步交流的机会。
|
4月前
|
编解码 API 开发工具
Android平台轻量级RTSP服务模块二次封装版调用说明
本文介绍了Android平台上轻量级RTSP服务模块的二次封装实践,旨在简化开发流程,让开发者能更专注于业务逻辑。通过`LibPublisherWrapper`类提供的API,可在应用中轻松初始化RTSP服务、配置视频参数(如分辨率、编码类型)、启动与停止RTSP服务及流发布,并获取RTSP会话数量。此外,还展示了如何处理音频和视频数据的采集与推送。最后,文章提供了从启动服务到销毁资源的完整示例,帮助开发者快速集成实时流媒体功能。
|
4月前
|
编解码 开发工具 Android开发
Android平台轻量级RTSP服务模块技术接入说明
为满足内网无纸化/电子教室等内网超低延迟需求,避免让用户配置单独的服务器,大牛直播SDK在推送端发布了轻量级RTSP服务SDK。 轻量级RTSP服务解决的核心痛点是避免用户或者开发者单独部署RTSP或者RTMP服务,实现本地的音视频数据(如摄像头、麦克风),编码后,汇聚到内置RTSP服务,对外提供可供拉流的RTSP URL,轻量级RTSP服务,适用于内网环境下,对并发要求不高的场景,支持H.264/H.265,支持RTSP鉴权、单播、组播模式,考虑到单个服务承载能力,我们支持同时创建多个RTSP服务,并支持获取当前RTSP服务会话连接数。