資源簡介
此驅(qū)動是WIFI模塊RTL8189ES使用的,我移植到了linux3.10嵌入式開發(fā)板上,可以正常使用。具體移植方法參考我的博文:http://blog.csdn.net/wzs250969969/article/details/78727293
代碼片段和文件信息
#include?“p2p_test.h“
unsigned?int?wps_pin_checksum(unsigned?int?pin)
{
unsigned?int?accum?=?0;
while(?pin?)
{
accum?+=?pin?%?10;
pin?/=?10;
accum?+=?3?*?(pin?%?10);
pin?/=?10;
}
return(?accum?%?10?);
}
char?lower(char?s)
{????
if((‘A‘?<=?s)?&&?(s?<=?‘Z‘))
return?(?s?=?‘a(chǎn)‘?+?(s?-?‘A‘)?);
return?s;
}
int?p2p_check_success(struct?p2p?*p)
{
int?ret?=?0;
if(?p->status?==?P2P_STATE_GONEGO_OK?)
ret?=?1;
return?ret;
}
int?read_all_sta(struct?p2p?*p)
{
int?sta_count?=?0;
FILE?*pf;
memset(?p->cmd?0x00?CMD_SZ?);
sprintf(?p->cmd?“%s?all_sta?>?supp_status.txt“?p->apcli_path);
system(?p->cmd?);
pf?=?fopen(?“./supp_status.txt“?“r“?);
if?(?pf?)
{
while(?!feof(?pf?)?){
memset(?p->parse?0x00?CMD_SZ?);
fgets(?p->parse?CMD_SZ?pf?);
if(?strncmp(?p->parse?“dot11RSNAStatsSTAAddress=“?25)?==?0?)
{
sta_count++;
if(?p->no_sta_connected?==?sta_count?)
return?_TRUE;
}
}
fclose(?pf?);
}
return?_FALSE;
}
void?do_wps(struct?p2p?*p)
{
FILE?*pf?=?NULL;
int?ret?=?_FALSE?parsing_ok?=?_FALSE;
do
{
memset(?p->cmd?0x00?CMD_SZ?);
if(?p->ap_open?==?_TRUE?)
{
if(p->wps_info==1?||?p->wps_info==2)
sprintf(?p->cmd?“%s?wps_pin?any?%d?>?supp_status.txt“?p->apcli_path?p->pin);
else?if(p->wps_info==3)
sprintf(?p->cmd?“%s?wps_pbc?any?>?supp_status.txt“?p->apcli_path);
}
else?if(p->wpa_open?==?_TRUE)
{
if(p->connect_go==1)
{
if(p->wps_info==1?||?p->wps_info==2)
sprintf(?p->cmd?“%s?wps_pin?%s?%d?>?supp_status.txt?“?p->wpacli_path?p->peer_devaddr?p->pin);
else?if(p->wps_info==3)
sprintf(?p->cmd?“%s?wps_pbc?%s?>?supp_status.txt?“?p->wpacli_path?p->peer_devaddr);
}
else?if(?strncmp(p->peer_ifaddr?“00:00:00:00:00:00“?17)==0?)
{
if(p->wps_info==1?||?p->wps_info==2)
sprintf(?p->cmd?“%s?wps_pin?any?%d?>?supp_status.txt?“?p->wpacli_path?p->pin);
else?if(p->wps_info==3)
sprintf(?p->cmd?“%s?wps_pbc?any?>?supp_status.txt?“?p->wpacli_path);
}
else
{
if(p->wps_info==1?||?p->wps_info==2)
sprintf(?p->cmd?“%s?wps_pin?%s?%d?>?supp_status.txt?“?p->wpacli_path?p->peer_ifaddr?p->pin);
else?if(p->wps_info==3)
sprintf(?p->cmd?“%s?wps_pbc?%s?>?supp_status.txt?“?p->wpacli_path?p->peer_ifaddr);
}
}
system(?p->cmd?);
pf?=?fopen(?“./supp_status.txt“?“r“?);
if?(?pf?)
{
while(?!feof(?pf?)?){
memset(p->parse?0x00?CMD_SZ);
fgets(p->parse?CMD_SZ?pf);
if(p->ap_open?==?_TRUE)
{
if(?(p->wps_info==1?||?p->wps_info==2)?&&?(strncmp(p->parse?““?2)?==?0)?)
parsing_ok?=?_TRUE;
else?if(?(p->wps_info==3)?&&?(strncmp(p->parse?“OK“?2)?==?0)?)
parsing_ok?=?_TRUE;
}
else?if(p->wpa_open?==?_TRUE)
{
if(?(p->wps_info==1?||?p->wps_info==2)?&& (strncmp(p->parse?“Se
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-11-30?09:49??RTL8189ES_linux_v4.3.18.1_15373.20151005\
?????目錄???????????0??2015-11-30?09:49??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_JB_4.2\
?????文件????????2030??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_JB_4.2\linux-3.0.42_STATION_INFO_ASSOC_REQ_IES.diff
?????文件??????273283??2015-08-21?10:38??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_JB_4.2\Realtek_Wi-Fi_SDK_for_Android_JB_4.2.pdf
?????文件???????17892??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_JB_4.2\realtek_wifi_SDK_for_android_JB_4.2_20130208.tar.gz
?????目錄???????????0??2015-11-30?09:49??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_KK_4.4\
?????文件????????2030??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_KK_4.4\linux-3.0.42_STATION_INFO_ASSOC_REQ_IES.diff
?????文件??????286000??2015-08-21?10:36??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_KK_4.4\Realtek_Wi-Fi_SDK_for_Android_KK_4.4.pdf
?????文件???????16390??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_KK_4.4\realtek_wifi_SDK_for_android_KK_4.4_20140117.tar.gz
?????目錄???????????0??2015-11-30?09:49??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_L_5.0\
?????文件????????2030??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_L_5.0\linux-3.0.42_STATION_INFO_ASSOC_REQ_IES.diff
?????文件??????239639??2015-08-21?10:40??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_L_5.0\Realtek_Wi-Fi_SDK_for_Android_L_5.0.pdf
?????文件????????9312??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\android_ref_codes_L_5.0\realtek_wifi_SDK_for_android_L_5.0_20141203.tar.gz
?????目錄???????????0??2015-11-30?09:49??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\
?????文件???????45044??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\HowTo_enable_driver_to_support_80211d.pdf
?????文件???????18740??2015-08-21?10:50??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\HowTo_enable_driver_to_support_WIFI_certification_test.pdf
?????文件??????175523??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\HowTo_enable_the_power_saving_functionality.pdf
?????文件???????37589??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\HowTo_read_external_TX_power_related_file.pdf
?????文件???????19593??2015-08-21?10:50??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\HowTo_support_more_VidPids.pdf
?????文件????????4190??2015-08-21?10:33??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\linux_dhcp_server_notes.txt
?????文件??????105294??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Miracast_for_Realtek_WiFi.pdf
?????文件???????83093??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_Adaptivity_and_Carrier_Sensing_Test.pdf
?????文件???????70594??2015-08-21?10:52??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_Bridge.pdf
?????文件??????134938??2015-08-21?10:52??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf
?????文件???????92322??2015-08-21?10:53??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_SoftAP.pdf
?????文件???????70927??2015-08-21?10:54??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_Station_Mode.pdf
?????文件??????257558??2015-08-21?10:54??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Quick_Start_Guide_for_WOW.pdf
?????文件??????225251??2015-08-21?10:52??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Realtek_WiFi_concurrent_mode_Introduction.pdf
?????文件??????128880??2015-08-21?10:52??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\RTK_P2P_WFD_Programming_guide.pdf
?????文件???????54930??2015-08-21?10:51??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\SoftAP_Mode_features.pdf
?????文件???????33979??2015-08-21?10:52??RTL8189ES_linux_v4.3.18.1_15373.20151005\document\Wireless_tools_porting_guide.pdf
............此處省略31個文件信息
- 上一篇:Snipaste截屏小工具.zip
- 下一篇:npoi .net 2.0和4.0版本
評論
共有 條評論