MDM-WIFI(QCA9377,QCA6174)
一:wlan的配置文件其目录
apps_proc\mdm-init中wlan_sdio 中的makefile有如下内容
etcdir = ${sysconfdir}
dist_etc_DATA = cld-hostapd-wlan0.sh
dist_etc_DATA += cld-hostapd-wlan1.sh
misc_ddir = ${userfsdatadir}/misc/wifi
dist_misc_d_DATA = hostapd.conf
dist_misc_d_DATA += hostapd-wlan1.conf
dist_misc_d_DATA += sta_mode_hostapd.conf
dist_misc_d_DATA += wpa_supplicant.conf
init_ddir = ${sysconfdir}/init.d
dist_init_d_SCRIPTS = wlan
firmware_ddir = ${base_libdir}/firmware/wlan/qca_cld
dist_firmware_d_DATA = WCNSS_qcom_cfg.ini
cld-hostapd-wlan0.sh cld-hostapd-wlan1.sh hostapd.conf hostapd-wlan1.conf Makefile.am sta_mode_hostapd.conf WCNSS_qcom_cfg.ini wlan wpa_supplicant.conf
上面的文件在/data/mobileap_cfg.xml中的配置文件中需要使用
<EnableIPV4>1</EnableIPV4>
<EnableIPV6>1</EnableIPV6>
<GatewayURL>mw43.home</GatewayURL>
<WlanMode>AP</WlanMode>
<WlanRestartDelay>1</WlanRestartDelay>
<MobileAPSTABridgeEnable>0</MobileAPSTABridgeEnable>
<HostAPDCfg>/data/misc/wifi/hostapd.conf</HostAPDCfg>
<HostAPDEntropy>/data/misc/wifi/entropy_file</HostAPDEntropy>
<STAModeHostAPDCfg>/data/misc/wifi/sta_mode_hostapd.conf</STAModeHostAPDCfg>
<APIPAddr>192.168.1.1</APIPAddr>
<SubNetMask>255.255.255.0</SubNetMask>
<EnableDHCPServer>1</EnableDHCPServer>
二:hci-qcomm-init
在不使用BT功能的时候,正常是不需要hci-qcomm-init模块按照高通的文档,而此时ftmdaemon需要使用此lib
IMAGE_INSTALL += "hci-qcomm-init"
故上面的文件还不能屏蔽
/bin # ./ftmdaemon
./ftmdaemon: error while loading shared libraries: libbtnv.so.0: cannot open shared object file: No such file or directory
/bin #
/bin #
三:WLAN的启动
0:驱动
MDM平台默认的硬件接口为:SDIO,其主要芯片为:QCA9377,QCA6174,这些WIFI芯片属于网卡芯片,有主CPU进行控制,驱动也运行在host cpu上面。
MDM针对此芯片(QCA9377,QCA6174)提供的驱动为:wlan.ko,
IMAGE_INSTALL += "qcacld-hl"
其编译的.bb文件为:apps_proc\poky\meta-qti-bsp\recipes-connectivity\wlan中的qcacld-hl_git.bb
/usr/lib/modules/3.18.44/extra # ls -al
total 4228
drwxr-xr-x 2 root root 456 Dec 9 09:30 .
drwxr-xr-x 4 root root 1176 Jan 1 1970 ..
-rw-r--r-- 1 root root 13028 Nov 19 09:18 shortcut-fe-cm.ko
-rw-r--r-- 1 root root 32016 Nov 19 09:18 shortcut-fe-ipv6.ko
-rw-r--r-- 1 root root 31760 Nov 19 09:18 shortcut-fe.ko
-rw-r--r-- 1 root root 4243916 Nov 19 09:18 wlan.ko
/usr/lib/modules/3.18.44/extra #
/lib/firmware/wlan/qca_cld # ls -al
total 32
drwxr-xr-x 2 root root 384 Dec 9 09:31 .
drwxr-xr-x 3 root root 224 Nov 19 09:17 ..
-rw-r--r-- 1 root root 10234 Nov 19 09:18 WCNSS_cfg.dat
-rw-r--r-- 1 root root 13992 Nov 19 09:17 WCNSS_qcom_cfg.ini
-rw-rw-rw- 1 root root 62 Dec 9 09:31 wlan_mac.bin
其中wlan_mac.bin用来存储MAC地址,WCNSS_qcom_cfg.ini其中是WLAN的配置文件,其比较重要,可以结合驱动和说明文档进行分析。
~ # ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:03:7F:24:8B:E7
inet addr:169.254.1.1 Bcast:255.255.255.255 Mask:0.0.0.0
inet6 addr: fe80::203:7fff:fe24:8be7/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:249 errors:0 dropped:0 overruns:0 frame:0
TX packets:636 errors:0 dropped:10 overruns:0 carrier:0
collisions:0 txqueuelen:3000
RX bytes:22078 (21.5 KiB) TX bytes:56862 (55.5 KiB)
1:运行模式
运行模式在<WlanMode>AP</WlanMode>中配置,其可以配置的参数如下:
typedef enum {
QCMAP_MSGR_WLAN_MODE_ENUM_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/
QCMAP_MSGR_WLAN_MODE_AP_V01 = 0x01, /**< WLAN is in AP mode */
QCMAP_MSGR_WLAN_MODE_AP_AP_V01 = 0x02, /**< WLAN is in AP/AP Mode */
QCMAP_MSGR_WLAN_MODE_AP_STA_V01 = 0x03, /**< WLAN is in AP/STA Mode */
QCMAP_MSGR_WLAN_MODE_AP_AP_AP_V01 = 0x04, /**< WLAN is in AP/AP/AP Mode */
QCMAP_MSGR_WLAN_MODE_AP_AP_STA_V01 = 0x05, /**< WLAN is in AP/AP/STA Mode */
QCMAP_MSGR_WLAN_MODE_STA_ONLY_V01 = 0x06, /**< WLAN is in STA only Mode */
QCMAP_MSGR_WLAN_MODE_AP_AP_AP_AP_V01 = 0x07, /**< WLAN is in AP-AP-AP-AP Mode */
QCMAP_MSGR_WLAN_MODE_AP_STA_BRIDGE_V01 = 0x08, /**< WLAN is in AP/STA Bridge Mode Only used for GetWLANStatus */
QCMAP_MSGR_WLAN_MODE_AP_AP_STA_BRIDGE_V01 = 0x09, /**< WLAN is in AP/AP/STA Bridge Mode Only used for GetWLANStatus */
QCMAP_MSGR_WLAN_MODE_STA_ONLY_BRIDGE_V01 = 0x0A, /**< WLAN is in STA Bridge Mode Only used for GetWLANStatus */
QCMAP_MSGR_WLAN_MODE_ENUM_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/
}qcmap_msgr_wlan_mode_enum_v01;
2:启动与关闭
驱动加载之后,枚举出来wlan0,之后直接对wlan0接口进行操作,或者通过调用QCMAP_ConnectionManager提供的服务来启动,
这一部分可以参考: QCMAP_CLI的代码,加入自己的处理逻辑。
~ # QCMAP_CLI
Please select an option to test from the items listed below.
1. MobileAP Configuration
2. LAN Configuration
3. NAT/ALG/VPN Configuration
4. WLAN Configuration
5. Firewall Configuration
6. Backhaul Configuration
7. Tetehring Configuration
8. Media Service Configuration
Option >
其中定义的接口如下:
class QCMAP_WLAN
{
private:
static bool flag;
static QCMAP_WLAN *object;
QCMAP_WLAN();
public:
static QCMAP_WLAN* Get_Instance(boolean obj_create=false);
~QCMAP_WLAN();
/*----------------------MobileAP WLAN Execution-----------------------*/
//ALL VARIABLES HERE//
qcmap_cm_wlan_conf_t wlan_cfg;
/* Which mode is wifi brought up in */
qcmap_cm_debug_conf_t debug_config;
qcmap_msgr_wlan_mode_enum_v01 wifi_mode;
qcmap_msgr_access_profile_v01 prev_guest_1_profile;
qcmap_msgr_access_profile_v01 prev_guest_2_profile;
qcmap_msgr_access_profile_v01 prev_guest_3_profile;
boolean activate_wlan_in_progress;
/* eth device number for first AP iface */
static bool priv_client_restart_wlan;
/* Variable to Store the STAOnlyMode enabled state */
boolean is_sta_only_mode_enabled;
qcmap_msgr_wlan_status_ind_msg_v01 current_wlan_status;
boolean AssociateWLANtoBridge(int wlan_index);
boolean ReadWLANConfigFromXML();
static boolean ReadWLANConfigPathsFromXML(qcmap_cm_wlan_paths_conf_t *wlan_paths);
static boolean GetsetWLANConfigFromXML( qcmap_wlan_config_enum conf,
qcmap_action_type action,
uint32 *value );
inline boolean IsWlanModeUpdated()
{return (this->wifi_mode != this->wlan_cfg.wlan_mode); }
static boolean EnableWLAN( qmi_error_type_v01 *qmi_err_num,
boolean enable_wlan_onbootup = false,
boolean privileged_client = false );
boolean EnableWLANModule(char *,boolean bootup);
/* Bring down Linux LAN. */
static boolean DisableWLAN( qmi_error_type_v01 *qmi_err_num,
boolean privileged_client = false );
inline boolean IsSSRInProgress(void)
{return QCMAP_WLAN::priv_client_restart_wlan;}
boolean DisableWLANModule(void);
/* Set WLAN Mode. */
static boolean SetWLANConfig
( qcmap_msgr_wlan_mode_enum_v01 wlan_mode,
qcmap_msgr_guest_profile_config_v01* guest_ap_access_profile,
qcmap_msgr_station_mode_config_v01 *station_config,
qmi_error_type_v01 *qmi_err_num );
/* Get Configured LAN Mode */
static boolean GetWLANConfig
( qcmap_msgr_wlan_mode_enum_v01 *wlan_mode,
qcmap_msgr_guest_profile_config_v01 *guest_access_profile,
qcmap_msgr_station_mode_config_v01 *station_config,
qmi_error_type_v01 *qmi_err_num );
/* Actiavte WLAN Request. */
static boolean ActivateWLAN(qmi_error_type_v01 *qmi_err_num);
/* Restart WLAN Request. */
static boolean RestartWLAN(void);
/* Get the Current LAN Status. */
static boolean GetWLANStatus( qcmap_msgr_wlan_mode_enum_v01 *wlan_mode,
qmi_error_type_v01 *qmi_err_num );
/* Activate HostapdConfig Request.*/
static boolean ActivateHostapdConfig
( qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type,
qcmap_msgr_activate_hostapd_action_enum_v01 action_type,
qmi_error_type_v01 *qmi_err_num );
boolean ActivateHostapdActionStart
( qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type,
int ap_pid,
int guest_ap_pid,
int guest_ap2_pid,
int guest_ap3_pid,
int active_ap_num,
qmi_error_type_v01 *qmi_err_num );
boolean ActivateHostapdActionStop
( qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type,
int ap_pid,
int guest_ap_pid,
int guest_ap2_pid,
int guest_ap3_pid,
qmi_error_type_v01 *qmi_err_num);
boolean ActivateHostapdActionRestart
( qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type,
int ap_pid,
int guest_ap_pid,
int guest_ap2_pid,
int guest_ap3_pid,
int active_ap_num,
qmi_error_type_v01 *qmi_err_num);
/* Checks if hostapd is running. */
boolean IsHostapdRunning(int iface);
/* Checks if wpa_supplicant is running. */
boolean IsSupplicantRunning(void);
/* Kills the appropriate instance of hostapd_cli*/
void StopHostapdCli(qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type);
/* Starts the appropriate instance of hostapd_cli*/
void StartHostapdCli(qcmap_msgr_activate_hostapd_ap_enum_v01 ap_type);
/* Configure, start and stop the Linux HostAPD server. */
boolean StopHostAPD(void);
boolean StartHostAPD(int intf,int wlan_dev_index);
boolean IsGuestProfile1Updated();
boolean IsGuestProfile2Updated();
void UpdateAccessProfileRules();
void InstallGuestAPAccessRules(int ap_dev_num);
void DeleteGuestAPAccessRules();
boolean IsHostapdkilled(int omit_pid1, int omit_pid2, int omit_pid3);
/*Get count of APs active*/
int GetActiveAPCount(qcmap_msgr_wlan_mode_enum_v01 wifi_mode);
/* Updates the IPACM_cfg file */
boolean SetIPAWLANMode(int ap_dev_num,int mode);
/* Enable STA Only Mode.
Putting it in WLAN Class so that we dont have to create any additional objects */
static boolean EnableSTAOnlyMode(qmi_error_type_v01 *qmi_err_num);
static boolean DisableSTAOnlyMode(qmi_error_type_v01 *qmi_err_num);
/* Send WLAN Status IND */
void SendWLANStatusIND(void);
};
#endif
3:hostapd的关闭与启动
1238 root 0:00 [VosWDThread]
1239 root 0:01 [VosMCThread]
1274 root 0:00 hostapd -B /data/misc/wifi/hostapd.conf -P /data/hostapd_ssid1.pid -e /data/misc/wifi/entropy_file
1406 root 0:03 [kworker/0:3]
1417 root 0:00 hostapd_cli -i wlan0 -p /var/run/hostapd -B -a /usr/bin/QCMAP_StaInterface
1785 root 0:00 {sh} /bin/busybox /bin/sh -
1788 root 0:00 {telnetd} /bin/busybox /sbin/telnetd
1789 root 0:00 {sh} /bin/busybox /bin/sh
1799 root 0:00 {sleep} /bin/busybox /bin/sleep 15
1801 root 0:00 {ps} /bin/busybox /bin/ps
~ #
4: WPS
启动WPS
~ # hostapd_cli -i wlan0 wps_get_status
PBC Status: Disabled
Last WPS result: Success
Peer Address: 5c:1c:b9:4d:3e:03
查看链接的station
~ # hostapd_cli -i wlan0 all_sta
5c:1c:b9:4d:3e:03
flags=[AUTH][ASSOC][AUTHORIZED]
aid=0
capability=0x0
listen_interval=0
supported_rates=
timeout_next=NULLFUNC POLL
dot11RSNAStatsSTAAddress=5c:1c:b9:4d:3e:03
dot11RSNAStatsVersion=1
dot11RSNAStatsSelectedPairwiseCipher=00-0f-ac-4
dot11RSNAStatsTKIPLocalMICFailures=0
dot11RSNAStatsTKIPRemoteMICFailures=0
hostapdWPAPTKState=11
hostapdWPAPTKGroupState=0
wpsUuid=39ffa78d-f5c4-5dff-bea8-a4a5a0d45740
wpsPrimaryDeviceType=10-0050F204-5
wpsDeviceName=PD1730G
wpsManufacturer=vivo
wpsModelName=vivo Z3x
wpsModelNumber=vivo Z3x
wpsSerialNumber=6b1c6835
rx_packets=0
tx_packets=0
rx_bytes=0
tx_bytes=0
connected_time=11
~ #
MDM-WIFI(QCA9377,QCA6174)相关推荐
- arm oe linux gnueabi 系统,【技术分享】Quectel 4G模块Opencpu中实现高通wifi功能
导语 越来越多的IOT应用场景中需要使用4G模块,而在有些特定的场合需要把4G上网能力转化wifi功能,比如说无人机中视频传输,以及打印机行业中都有类似的应用案例,以便更好的提供给更多的客户端去使用. ...
- 【2021.11综合方案】Ubuntu + 高通QCA6174无线网卡连接不上WIFI问题解决
背景:win10笔记本,安装Ubuntu18.04LTS系统后,发现没有WIFI接口,搜索不到wifi网络. 参考教程: 解决过程: 1.确定问题:无线打开显示无适配器,猜测无匹配驱动. 2.查看无线 ...
- 高通wifi驱动 linux,ubuntu下安裝Qualcomm Atheros QCA6174無線網卡驅動方法
lspci | grep Qu 07:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapt ...
- 【sdx12】QCA6174 WiFi 5G信道auto时屏蔽DFS信道,手动设置信道检测到雷达信号之后,跳转到指定信道方法
需求描述 QCA6174 WiFi信道自动选择屏蔽DFS信道,手动设置信道检测到雷达信号之后,跳转到指定信道方法 Hostapd版本 / # hostapd hostapd v2.10-devel U ...
- [sdx12]sdx12平台QCA6174 使用hostapd WiFi 2.4G强制40MHz频宽不生效问题分析及实现
问题描述 sdx12平台,高通默认hostapd 2.4G不支持强制40MHz的功能,在干扰环境下默认总是协商到20MHz,比方便认证和跑流测试. hostapd版本 / # hostapd host ...
- 【QCA6174】SDX12 WiFi QCA6174 bdwlan30.bin和bdwlan30.txt相互转化操作说明
1.从高通获bin文件和txt文件相互转化工具 软件包名称 QCA6174_BDF_Converter.zip 2.解压工具包,解压之后包括以下文件 3.从sdx12 sdk拷贝bdwlan30.bi ...
- 主流WiFi芯片原厂
看看国内有没有2.4/5G WIFI IC 或是模组 , 看来仍然需要加油啊 主流WiFi芯片原厂 1.Broadcom(博通,美国) 2.Atheros(创锐讯,美国,被高通(Qualcomm)收 ...
- 智能机器人主板方案-wifi芯片选择
主流WiFi芯片原厂 1.Broadcom(博通,美国) 2.Atheros(创锐讯,美国,被高通(Qualcomm)收购) 3.Marvell(美满科技,美国) 4.TI(德州仪器,美国) 5.Ra ...
- 创建一个简单的 MDM server(1)
前提:已获得 APNS 证书 ,已完毕 MDM 配置描写叙述文件的制作.请參考< MDM 证书申请流程 >一文和<配置MDM Provisioning Profile>. 环境 ...
- Linux WIFI模块驱动移植
作者 QQ群:852283276 微信:arm80x86 微信公众号:青儿创客基地 B站:主页 https://space.bilibili.com/208826118 参考 请问有知道atheros ...
最新文章
- 相机标定 matlab opencv ROS三种方法标定步骤(2)
- C#中常用的经典文件操作方法
- DELL服务器安装过程中出现的ERROR及解决方案
- Openresty 预编译安装教程
- Failed to capture snapshot of output files for task ' :packagePreDebug' property ''outputDirectory'
- 深圳php就业,传智播客深圳校区PHP04期毕业15个工作日就业率67.74%
- lambda表达式语法_使用类似Lambda的语法作为Java中的表达式进行切换
- ubuntu系统debootstrap的使用(构建一套基本的系统)
- C++安全方向(三)3.3 openssl的MD5接口调用演示
- “System.FormatException”类型的未经处理的异常在 System.IdentityModel.dll 中发生 其他信息: 十六进制字符串格式无效。
- 计算机网络————P3 速率相关的性能指标
- jQuery - 通过文本描述设置选择控件的选定值
- 利用EasyRecovery恢复照片文件的技巧
- 人事管理系统(毕业设计)
- JRebel激活教程
- pythonstdin_关于python:从sys.stdin接收输入,非阻塞
- android 4.4 java版本_Android4.0-4.4 加入实体按键振动支持的方法(java + smali版本号)
- 多核时代多线程编程(一)基本策略
- mysql修改数据库名的方法
- 图说不为人知的IT传奇故事-3-硅谷DNA创造者HP