ImageVerifierCode 换一换
格式:DOCX , 页数:112 ,大小:50.94KB ,
资源ID:10555633      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/10555633.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(stm32驱动wifi88W8686WMGMR09edited.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

stm32驱动wifi88W8686WMGMR09edited.docx

1、stm32驱动wifi88W8686WMGMR09editedF:WiFi_V2.1srcwifiwlan_scan.c#include wifi.h#include #include #include /*Local Constants*/! Approximate amount of data needed to pass a scan result back to iwlist#define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN + MRVDRV_MAX_SSID_LENGTH + IW_EV_UINT_LEN + IW_EV_FREQ_LEN + IW_

2、EV_QUAL_LEN + MRVDRV_MAX_SSID_LENGTH + IW_EV_PARAM_LEN + 40) /* 40 for WPAIE */! Memory needed to store a max sized Channel List TLV for a firmware scan#define CHAN_TLV_MAX_SIZE (sizeof(MrvlIEtypesHeader_t) + (MRVDRV_MAX_CHANNELS_PER_SCAN * sizeof(ChanScanParamSet_t)/! Memory needed to store a max n

3、umber/size SSID TLV for a firmware scan#define SSID_TLV_MAX_SIZE (1 * sizeof(MrvlIEtypes_SsIdParamSet_t)/! WPS TLV MAX size is MAX IE size plus 2 bytes for u16 MRVL TLV extension#define WPS_TLV_MAX_SIZE (sizeof(IEEEtypes_VendorSpecific_t) + 2)/! Maximum memory needed for a wlan_scan_cmd_config with

4、all TLVs at max#define MAX_SCAN_CFG_ALLOC (sizeof(wlan_scan_cmd_config) + sizeof(MrvlIEtypes_NumProbes_t) + CHAN_TLV_MAX_SIZE + SSID_TLV_MAX_SIZE + WPS_TLV_MAX_SIZE)/! The maximum number of channels the firmware can scan per command#define MRVDRV_MAX_CHANNELS_PER_SCAN 14/* brief Number of channels t

5、o scan per firmware scan command issuance.* Number restricted to prevent hitting the limit on the amount of scan data* returned in a single firmware scan command.*/#define MRVDRV_CHANNELS_PER_SCAN_CMD 4/! Macro to enable/disable SSID checking before storing a scan table#ifdef DISCARD_BAD_SSID#define

6、 CHECK_SSID_IS_VALID(x) ssid_valid(&bssidEntry.Ssid)Page: 1F:WiFi_V2.1srcwifiwlan_scan.c#else#define CHECK_SSID_IS_VALID(x) TRUE#endif/*Local Variables and Types*/* brief Interally used to send a configured scan cmd between driver routines*/typedef unionwlan_scan_cmd_config config; /! Scan configura

7、tion (variable length)u8 configAllocBufMAX_SCAN_CFG_ALLOC; /!ScanTableindex;/* Dont check for compatibility if roaming */if (Adapter-MediaConnectStatus = WlanMediaStateConnected)& (Adapter-InfrastructureMode = Wlan802_11Infrastructure)& (pBSSDesc-InfrastructureMode = Wlan802_11Infrastructure) LEAVE(

8、);return index;if (Adapter-wps.SessionEnable = TRUE) printf(Return success directly in WPS periodn);LEAVE();return index;if (pBSSDesc-InfrastructureMode = mode) if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPDisabled& !Adapter-SecInfo.WPAEnabled& !Adapter-SecInfo.WPA2Enabled& pBSSDesc-wpaIE.VendHdr.El

9、ementId != WPA_IE& pBSSDesc-rsnIE.IeeeHdr.ElementId != RSN_IE& !Adapter-AdhocAESEnabled& Adapter-SecInfo.EncryptionMode = CIPHER_NONEPage: 2F:WiFi_V2.1srcwifiwlan_scan.c& !pBSSDesc-Privacy) /* no security */LEAVE();return index; else if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPEnabled& !Adapter-Sec

10、Info.WPAEnabled& !Adapter-SecInfo.WPA2Enabled& !Adapter-AdhocAESEnabled & pBSSDesc-Privacy) /* static WEP enabled */LEAVE();return index; else if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPDisabled& Adapter-SecInfo.WPAEnabled& !Adapter-SecInfo.WPA2Enabled& (pBSSDesc-wpaIE.VendHdr.ElementId = WPA_IE)&

11、 !Adapter-AdhocAESEnabled/* Privacy bit may NOT be set in some APs like LinkSys WRT54G& pBSSDesc-Privacy */) /* WPA enabled */printf(IsNetworkCompatible() WPA: index=%d wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s EncMode=%#x privacy=%#xn,index,pBSSDesc-wpaIE.VendHdr.ElementId,pBSSDesc-rsnIE.IeeeHdr

12、.ElementId,(Adapter-SecInfo.WEPStatus =Wlan802_11WEPEnabled) ? e : d,(Adapter-SecInfo.WPAEnabled) ? e : d,(Adapter-SecInfo.WPA2Enabled) ? e : d,Adapter-SecInfo.EncryptionMode, pBSSDesc-Privacy);LEAVE();return index; else if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPDisabled& !Adapter-SecInfo.WPAEnab

13、led& Adapter-SecInfo.WPA2Enabled& (pBSSDesc-rsnIE.IeeeHdr.ElementId = RSN_IE)& !Adapter-AdhocAESEnabled/* Privacy bit may NOT be set in some APs like LinkSys WRT54G& pBSSDesc-Privacy */) /* WPA2 enabled */printf( IsNetworkCompatible() WPA2: index=%d wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s EncMo

14、de=%#x privacy=%#xn,index,pBSSDesc-wpaIE.VendHdr.ElementId,pBSSDesc-rsnIE.IeeeHdr.ElementId,(Adapter-SecInfo.WEPStatus =Wlan802_11WEPEnabled) ? e : d,(Adapter-SecInfo.WPAEnabled) ? e : d,(Adapter-SecInfo.WPA2Enabled) ? e : d,Adapter-SecInfo.EncryptionMode, pBSSDesc-Privacy);LEAVE();return index; els

15、e if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPDisabled& !Adapter-SecInfo.WPAEnabled& !Adapter-SecInfo.WPA2Enabled& (pBSSDesc-wpaIE.VendHdr.ElementId != WPA_IE)& (pBSSDesc-rsnIE.IeeeHdr.ElementId != RSN_IE)& Adapter-AdhocAESEnabled& Adapter-SecInfo.EncryptionMode = CIPHER_NONE& pBSSDesc-Privacy) /*

16、Ad-hoc AES enabled */LEAVE();return index; else if (Adapter-SecInfo.WEPStatus = Wlan802_11WEPDisabled& !Adapter-SecInfo.WPAEnabledPage: 3F:WiFi_V2.1srcwifiwlan_scan.c& !Adapter-SecInfo.WPA2Enabled& (pBSSDesc-wpaIE.VendHdr.ElementId != WPA_IE)& (pBSSDesc-rsnIE.IeeeHdr.ElementId != RSN_IE)& !Adapter-A

17、dhocAESEnabled& Adapter-SecInfo.EncryptionMode != CIPHER_NONE& pBSSDesc-Privacy) /* dynamic WEP enabled */printf( IsNetworkCompatible() dynamic WEP: index=%d wpa_ie=%#x wpa2_ie=%#x EncMode=%#x privacy=%#xn,index,pBSSDesc-wpaIE.VendHdr.ElementId,pBSSDesc-rsnIE.IeeeHdr.ElementId,Adapter-SecInfo.Encryp

18、tionMode, pBSSDesc-Privacy);LEAVE();return index;/* security doesnt match */printf( IsNetworkCompatible() FAILED: index=%d wpa_ie=%#x wpa2_ie=%#x WEP=%s WPA=%s WPA2=%s EncMode=%#x privacy=%#xn,index,pBSSDesc-wpaIE.VendHdr.ElementId,pBSSDesc-rsnIE.IeeeHdr.ElementId,(Adapter-SecInfo.WEPStatus =Wlan802

19、_11WEPEnabled) ? e : d,(Adapter-SecInfo.WPAEnabled) ? e : d,(Adapter-SecInfo.WPA2Enabled) ? e : d,Adapter-SecInfo.EncryptionMode, pBSSDesc-Privacy);LEAVE();return -ECONNREFUSED;/* mode doesnt match */LEAVE();return -ENETUNREACH;/* brief This function validates a SSID as being able to be printed* par

20、am pSsid SSID structure to validate* return TRUE or FALSE*/static BOOLEANssid_valid(WLAN_802_11_SSID * pSsid)int ssidIdx;for (ssidIdx = 0; ssidIdx SsidLength; ssidIdx+) if (!isprint(pSsid-SsidssidIdx) return FALSE;return TRUE;/* brief Post process the scan table after a new scan command has complete

21、d* Inspect each entry of the scan table and try to find an entry that* matches our current associated/joined network from the scan. If* one is found, update the stored copy of the BSSDescriptor for our* current network.* Debug dump the current scan table contents if compiled accordingly.*Page: 4F:Wi

22、Fi_V2.1srcwifiwlan_scan.c* param priv A pointer to wlan_private structure* return void*/static voidwlan_scan_process_results(wlan_private * priv)wlan_adapter *Adapter = priv-adapter;int i;/int foundCurrent;/foundCurrent = FALSE;if (Adapter-MediaConnectStatus = WlanMediaStateConnected) Adapter-CurBss

23、Params.BSSDescriptor.pBeaconBuf = NULL;Adapter-CurBssParams.BSSDescriptor.beaconBufSize = 0;Adapter-CurBssParams.BSSDescriptor.beaconBufSizeMax = 0;i = FindSSIDInList(Adapter,&Adapter-CurBssParams.BSSDescriptor.Ssid,Adapter-CurBssParams.BSSDescriptor.MacAddress,Adapter-InfrastructureMode);if (i = 0)

24、 printf(Found current ssid/bssid in list index #%dn, i);/* Make a copy of current BSSID descriptor */memcpy(&Adapter-CurBssParams.BSSDescriptor,&Adapter-ScanTablei,sizeof(Adapter-CurBssParams.BSSDescriptor);for (i = 0; i NumInScanTable; i+) printf( Scan:(%02d) %02x:%02x:%02x:%02x:%02x:%02x, RSSI%03d

25、, SSID%sn,i,Adapter-ScanTablei.MacAddress0,Adapter-ScanTablei.MacAddress1,Adapter-ScanTablei.MacAddress2,Adapter-ScanTablei.MacAddress3,Adapter-ScanTablei.MacAddress4,Adapter-ScanTablei.MacAddress5,(s32) Adapter-ScanTablei.Rssi,Adapter-ScanTablei.Ssid.Ssid);/* brief Create a channel list for the dri

26、ver to scan based on region info* Use the driver region/band information to construct a comprehensive list* of channels to scan. This routine is used for any scan that is not* provided a specific channel list to scan.* param priv A pointer to wlan_private structure* param scanChanList Output parameter: Resulting channel list to scan* param filteredScan Flag indicating whether or not a BSSID or SSID filter* is being sent in the command to firmware. Used to* increase the number

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1