SSD202 驱动WIFI-ssw01b的STA模式

news/2024/11/29 20:44:57/

1 电路相关

  • 复位芯片方法1
echo ON > /dev/wifi_reset
echo OFF > /dev/wifi_reset
  • 复位芯片方法2
echo 71 > /sys/class/gpio/export  
echo out > /sys/class/gpio/gpio71/direction
echo 0 > /sys/class/gpio/gpio71/value
sleep 2
echo 1 > /sys/class/gpio/gpio71/value

2 编译步骤

内核编译:

  • Networking support ->Networking options ->802.1d Ethernet Bridging
  • CONFIG_RFKILL=y
    文件系统:
  • 工具需要:bridge-utils,wireless-tools, dhcpd

3 测试步骤

3.1 配置运行的动态库路径:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./:/config/lib/:/customer/lib/:/config/wifi/
export PATH=$PATH:/config/wifi/

3.2 加载驱动:

insmod /config/wifi/llc.ko
insmod /config/wifi/stp.ko
insmod /config/wifi/bridge.ko
/config/wifi/ssw01bInit.sh

3.2.1 初始化wifi芯片

  • 芯片 BANK-0xe OFFSET-0x30 写入 0x11
  • 芯片 BANK-0x103c OFFSET-0x8 写入 0x0
  • 延时一段时间
  • 芯片 BANK-0x103c OFFSET-0x8 写入 0x10
# /config/riu_w e 30 11
/config/riu_w 103c 8 00
sleep 0.01
/config/riu_w 103c 8 10BANK:0xE 16bit-offset 0x30
0x0011
# /config/riu_w 103c 8 00
BANK:0x103C 16bit-offset 0x08
0x0001
# sleep 0.01
# /config/riu_w 103c 8 10
BANK:0x103C 16bit-offset 0x08
0x0011
# 

3.2.2 建立必要的文件目录

touch /appconfigs/hosts
mkdir -p /var/run/wpa_supplicant
chmod 777 /var/run/wpa_supplicant
mkdir -p /var/run/hostapd		
chmod 777 /var/run/hostapd
mkdir -p /appconfigs/misc/wifi/ # 具体不知道干什么用
mkdir -p /var/wifi/misc/ # 保存 dnsmasq一些信息
mkdir -p /var/lib/misc/  # 一些wifi的日志和配置

3.2.3 加载外设WIFI芯片驱动

  • 告警信息:[Sstar_log]: wsm_write_mib fail !!! mibId=4132
  • 告警信息:[Sstar_log]:apollo wifi : can’t open /data/.mac.info
    [Sstar_log]:efuse data is [0x1,0x3b,0x2,0x2,0x2,0x7,0x0,0x0,0x24:0x14:0x7:0x16:0x65:0x61]
  • 告警信息:[Sstar_log]:apollo wifi : can’t open /Sstar_txpwer_dcxo_cfg.txt
  • 告警信息:[Sstar_log]: br0_netdev_open()-1116: dev_get_by_name(br0) failed2![Sstar_log]:br0_netdev_open()-1116: dev_get_by_name(br0) failed2!
# insmod /config/wifi/ssw101b_wifi_HT40_usb.ko
[Sstar_log]:Sstar_usb_module_init 0
[Sstar_log]:Sstar_init_firmware
[Sstar_log]:xxxx minstrel ht init
[Sstar_log]:SVN_VER=14606,DPLL_CLOCK=2,BUILD_TIME=[===USB-ARES_B==
[Sstar_log]:Probe called
[Sstar_log]:CONFIG_USE_DMA_ADDR_BUFFER TX_BUFFER_SIZE 800
[Sstar_log]:CONFIG_USB_AGGR_URB_TX enable cnt tx_dma_addr_buffer_end(  (null))tx_dma_addr_buffer(  (null)),0
[Sstar_log]:Sstar_usb_urb_malloc CONFIG_USE_DMA_ADDR_BUFFER max_num 4, total 131072
[Sstar_log]:CONFIG_USB_AGGR_URB_TX enable cnt tx_dma_addr_buffer_end(c42c0000)tx_dma_addr_buffer(c42e0000),8
[Sstar_log]:CONFIG_TX_NO_CONFIRM
[Sstar_log]:self->tx_hwChanId 0
[Sstar_log]:Allocated hw_priv @ c2ba50a0
[Sstar_log]:Sstarwifi USB_USE_TASTLET_TXRX enable
[Sstar_log]:Sstar_before_load_firmware++
[Sstar_log]:+++++++++++++++++1.1v++++++++++++++++++
[Sstar_log]:===================~_~====================
[Sstar_log]:Sstar_start_load_firmware++
[Sstar_log]:Sstar_start_load_firmware: used firmware.h=
[Sstar_log]:Sstar_set_firmare:fw_iccm(c96ba000)
[Sstar_log]:Sstar_set_firmare:fw_dccm(c8571000)
[Sstar_log]:Sstar_start_load_firmware: START DOWNLOAD ICCM=========
[Sstar_log]:Sstar_load_firmware_generic: addr 10000: len 20000
[Sstar_log]:Sstar_start_load_firmware: START DOWNLOAD DCCM=========
[Sstar_log]:Sstar_load_firmware_generic: addr 800000: len 8000
[Sstar_log]:Sstar_after_load_firmware++
[Sstar_log]:Sstar_after_load_firmware:0x1610102c=0x4020e
[Sstar_log]:Sstar_after_load_firmware:0x1610102c=0x1020f
[Sstar_log]:Sstar_after_load_firmware:0x16101000=0x8000e08
[Sstar_log]:set_block_size=256
[Sstar_log]:firmwareCap f58f
[Sstar_log]:firmwareCap2 888f
[Sstar_log]:wsm_caps.firmwareCap 888ff58f
[Sstar_log]:apollo wifi WSM init done.Input buffers: 32 x 2048 bytesHardware: 7.2WSM firmware [=MODEM=RF=Ares_AX  2GHZ Dec 24 2019 19:59:25NOTXConfrim], ver: 8677, build: 2690, api: 1060, cap: 0x888FF58F Config[30008]  expection 900a5c0, ep0 cmd addr 901be2c NumOfStations[8] NumOfInterfaces[3]
[Sstar_log]:EFUSE(8)				[0]
[Sstar_log]:EFUSE(I)					[0]
[Sstar_log]:EFUSE(B)			[1]
[Sstar_log]:CAPABILITIES_SSTAR_PRIVATE_IE      [1]
[Sstar_log]:CAPABILITIES_NVR_IPC              [1]
[Sstar_log]:CAPABILITIES_NO_CONFIRM           [1]
[Sstar_log]:CAPABILITIES_SDIO_PATCH           [0]
[Sstar_log]:CAPABILITIES_NO_BACKOFF           [0]
[Sstar_log]:CAPABILITIES_CFO                  [0]
[Sstar_log]:CAPABILITIES_AGC                  [1]
[Sstar_log]:CAPABILITIES_TXCAL                [1]
[Sstar_log]:CAPABILITIES_MONITOR              [0]
[Sstar_log]:CAPABILITIES_CUSTOM               [1]
[Sstar_log]:CAPABILITIES_SMARTCONFIG          [0]
[Sstar_log]:CAPABILITIES_ETF                  [1]
[Sstar_log]:CAPABILITIES_LMAC_RATECTL         [1]
[Sstar_log]:CAPABILITIES_LMAC_TPC             [1]
[Sstar_log]:CAPABILITIES_LMAC_TEMPC           [1]
[Sstar_log]:CAPABILITIES_CTS_BUG              [1]
[Sstar_log]:CAPABILITIES_USB_RECOVERY_BUG     [1]
[Sstar_log]:CAPABILITIES_USE_IPC              [1]
[Sstar_log]:CAPABILITIES_OUTER_PA             [0]
[Sstar_log]:CAPABILITIES_POWER_CONSUMPTION    [0]
[Sstar_log]:CAPABILITIES_RSSI_DECIDE_TXPOWER  [0]
[Sstar_log]:CAPABILITIES_RTS_LONG_DURATION    [1]
[Sstar_log]:CAPABILITIES_TX_CFO_PPM_CORRECTION[0]
[Sstar_log]:CAPABILITIES_SHARE_CRYSTAL       [0]
[Sstar_log]:CAPABILITIES_HW_CHECKSUM          [0]
[Sstar_log]:CAPABILITIES_SINGLE_CHANNEL_MULRX [1]
[Sstar_log]:CAPABILITIES_CFO_DCXO_CORRECTION  [0]
[Sstar_log]:mdelay wait wsm_startup_done  !!
[Sstar_log]:WSM_FIRMWARE_CHECK_ID
[Sstar_log]:wsm_generic_confirm:status(2)
[Sstar_log]:<WARNING> wsm_write_mib fail !!! mibId=4132
[Sstar_log]:apollo wifi : can't open /data/.mac.info
[Sstar_log]:efuse data is [0x1,0x3b,0x2,0x2,0x2,0x7,0x0,0x0,0x24:0x14:0x7:0x16:0x65:0x61]
[Sstar_log]:apollo wifi : can't open /Sstar_txpwer_dcxo_cfg.txt
[Sstar_log]:ELOG_INIT len 64 
[Sstar_log]:[Sstar_wtd]:set wtd_probe = 1
usbcore: registered new interface driver Sstar_wlan
[Sstar_log]:[wtd] register.
# [Sstar_log]:br0_netdev_open()-1116: dev_get_by_name(br0) failed2![Sstar_log]:br0_netdev_open()-1116: dev_get_by_name(br0) failed2!

3.2.4 检测对应外设节点

检查 wlan0 是否被建立节点

mdev -s
wlan0=`ifconfig -a | grep wlan0`
trial=0
maxtrycnt=50
while [ -z "$wlan0" ] && [ $trial -le $maxtrycnt ]
do sleep 0.2#echo currect try $trial...trial=$(($trial + 1 ))wlan0=`ifconfig -a | grep wlan0`
done
if [ $trial -le $maxtrycnt ]; thenecho try $trial times
fi
if [ $trial -gt $maxtrycnt ];thenecho wlan0 not foundexit -1
fi

3.2.5 操作日志开关

echo LOG_WARN=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask
echo LOG_INIT=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask
echo LOG_EXIT=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask
echo LOG_SCAN=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask
echo LOG_LMAC=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask
echo LOG_PM=OFF > /sys/module/ssw101b_wifi_usb/Sstarfs/Sstar_printk_mask

3.3 启动STA模式

# ifconfig wlan0 up
# ifconfig wlan0
  • ctrl_interface 需要和工具wpa_cli 保持一致
# cat /appconfigs/wpa_supplicant.conf
ctrl_interface=/tmp/wifi/run/wpa_supplicant
update_config=1
  • 后台运行wifi
    如果wpa_supplicant.conf已经包含了network信息,则自动连接,如果没有仅进行初始化。可用通过后期wpa_cli 操作连接
# wpa_supplicant -D nl80211 -i wlan0 -c /appconfigs/wpa_supplicant.conf -B &
# Successfully initialized wpa_supplicant
[Sstar_log]:ieee80211_mgd_auth:(94:87:e0:47:64:db),ssid(chxm)
[Sstar_log]:Sstar_set_priv_queue_cap:[0],queue_cap[224]
[Sstar_log]:wlan0: authenticated
[Sstar_log]:ieee80211_start_connecting_work:bssid(94:87:e0:47:64:db)
[Sstar_log]:wlan0: associated
[Sstar_log]:[94:87:e0:47:64:db]:20M channel
[Sstar_log]:ieee80211_wk_connecting: time out
[Sstar_log]:ieee80211_ifa_changed(wlan0):IPv4 enable,end_time(307150)
  • 关闭wifi功能
killall wpa_supplicant
killall udhcpc 可以不用,因为其它网口还需要

3.4 wpa_cli 操作剪辑

  • 建立连接
# wpa_cli -i wlan0 scan
OK
# wpa_cli -i wlan0 scan_result
bssid / frequency / signal level / flags / ssid
94:87:e0:47:64:db	2447	-40	[WPA2-PSK-CCMP][ESS]	chxm
# wpa_cli -i wlan0 add_network
0
# wpa_cli -i wlan0 set_network 0 ssid '"chxm"'
OK
# wpa_cli -i wlan0 set_network 0 psk '"chxmtest123"'
OK
  • 保存连接信息
# wpa_cli -i wlan0 save_config
OK

配置文件被修改

# cat /appconfigs/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1network={ssid="chxm"psk="chxmtest123"
}
  • 选择已有的连接
# wpa_cli -i wlan0 list_network 
network id / ssid / bssid / flags
0	chxm	any	[DISABLED]
# wpa_cli -i wlan0 select_network 0
OK
# 
  • 查看wifi状态
# wpa_cli -i wlan0 list_network 
network id / ssid / bssid / flags
0	chxm	any	[CURRENT]
# wpa_cli -i wlan0 status
bssid=94:87:e0:47:64:db
ssid=chxm
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.43.139
p2p_device_address=24:14:07:16:65:61
address=24:14:07:16:65:61
# 
  • 激活连接
# wpa_cli -i wlan0 enable_network 0
OK
  • 断开连接
# wpa_cli -i wlan0 disable_network 0
[Sstar_log]:ieee80211_mgd_deauth
[Sstar_log]:wlan0: deauthenticating from 94:87:e0:47:64:db by local choice (reason=3)
[Sstar_log]:Sstar_rate_control_send_low cbss is null
OK

http://www.ppmy.cn/news/310453.html

相关文章

DM355与THS8200及TVP7002

DM355与THS8200及TVP7002 视频采集要求HDMI、VESA(即各种VGA)、标清CVBS&#xff0c;输出反之。当然要求有音频。 项目来自于客户的一个无线高清视频方案&#xff0c;结构框架并不复杂&#xff0c;但是硬件真正出来后&#xff0c;才发现要比想象的难的多。 THS8200是TI主推的高…

VMware虚拟机(Linux)如何找出系统中磁盘设备对应的硬盘

VMware虚拟机&#xff08;Linux&#xff09;中&#xff0c;我们的Linux服务器可能拥有多个磁盘&#xff08;或者叫虚拟磁盘&#xff09;&#xff0c;如下所示&#xff0c;这个服务器的磁盘有硬盘1、硬盘2、…………硬盘10总共10块硬盘。 而Linux系统中&#xff0c;磁盘中对应的…

30.STM32 DS18B20

1.STM32 DS18B20 1.独特的单总线接口方式&#xff0c;DS18B20在与微处理器连接时仅需要一条口线即可实现微处理器与DS18B20的双向通讯。大大提高了系统的抗干扰性。 2.测温范围 &#xff0d;55℃&#xff5e;125℃&#xff0c;精度为0&#xff0e;5℃。 3.支持多点组网功能&am…

ST3000DM001

**************************************************************************************************** 故障&#xff1a;正常尋道不就緒&#xff0c;com端BSY,需要短路才能到F3 T>&#xff0c;短路後再次進入會提示以下訊息&#xff0c;并可以正常到T級 解決&#xff1…

Linux查看分区文件系统类型的几种方法

在Linux 中如何查看分区的文件系统类型&#xff0c;下面总结几种查看分区文件系统类型的方法。 1、df -T 命令查看 这个是最简单的命令&#xff0c;文件系统类型在Type列输出。只可以查看已经挂载的分区和文件系统类型。如下所示&#xff1a; [rootmylnx008 ~]# df -T /dev/…

外地客户顺丰过来一个希捷 ST500DM002 FW:KC48说是开盘,其实不需要。

今天收到一外地客户盘&#xff0c;急要数据&#xff0c;希捷 ST500DM002 FW:KC48 上电&#xff0c;指令出如下&#xff1a; 不进F3&#xff0c; Boot 0x10M Spin Up FAIL Servo Op0100 Resp0003 ResponseFrame FFFF 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 000…

TiDB亿级数据亚秒响应查询集群部署

目录 1 集群部署1.1 环境要求1.1.1 操作系统建议配置1.1.2 服务器建议配置 1.2 环境准备1.3 安装TiUP1.3.1 什么是TiUP1.3.2 安装TiUP组件1.3.3 配置TiUP环境1.3.4 检查TiUP 工具是否安装1.3.5 安装 cluster 组件1.3.6 升级cluster组件 1.4 编辑部署文件1.4.1 常见的部署场景1.…

Prometheus插件安装(mysql_exporter)

简介 mysql_exporter是用来收集MysQL或者Mariadb数据库相关指标的&#xff0c;mysql_exporter需要连接到数据库并有相关权限。既可以用二进制安装部署&#xff0c;也可以通过容器形式部署&#xff0c;但为了数据收集的准确性&#xff0c;推荐二进制安装。 一&#xff0c;下载安…