📄 wcmd.c
字号:
/* * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. * All rights reserved. * * This software is copyrighted by and is the sole property of * VIA Networking Technologies, Inc. This software may only be used * in accordance with the corresponding license agreement. Any unauthorized * use, duplication, transmission, distribution, or disclosure of this * software is expressly forbidden. * * This software is provided by VIA Networking Technologies, Inc. "as is" * and any express or implied warranties, including, but not limited to, the * implied warranties of merchantability and fitness for a particular purpose * are disclaimed. In no event shall VIA Networking Technologies, Inc. * be liable for any direct, indirect, incidental, special, exemplary, or * consequential damages. * * File: wcmd.c * * Purpose: Handles the management command interface functions * * Author: Lyndon Chen * * Date: May 8, 2003 * * Functions: * s_vProbeChannel - Active scan channel * s_MgrMakeProbeRequest - Make ProbeRequest packet * CommandTimer - Timer function to handle command * s_bCommandComplete - Command Complete function * bScheduleCommand - Push Command and wait Command Scheduler to do * vCommandTimer- Command call back functions * vCommandTimerWait- Call back timer * s_bClearBSSID_SCAN- Clear BSSID_SCAN cmd in CMD Queue * * Revision History: * */ #if !defined(__TTYPE_H__)#include "ttype.h"#endif#if !defined(__TMACRO_H__)#include "tmacro.h"#endif#if !defined(__DEVICE_H__)#include "device.h"#endif#if !defined(__MAC_H__)#include "mac.h"#endif#if !defined(__CARD_H__)#include "card.h"#endif#if !defined(__80211HDR_H__)#include "80211hdr.h"#endif#if !defined(__WCMD_H__)#include "wcmd.h"#endif#if !defined(__WMGR_H__)#include "wmgr.h"#endif#if !defined(__POWER_H__)#include "power.h"#endif#if !defined(__WCTL_H__)#include "wctl.h"#endif#if !defined(__CARD_H__)#include "card.h"#endif#if !defined(__BASEBAND_H__)#include "baseband.h"#endif#if !defined(__CONTROL_H__)#include "control.h"#endif#if !defined(__UMEM_H__)#include "umem.h"#endif#if !defined(__RXTX_H__)#include "rxtx.h"#endif#if !defined(__RF_H__)#include "rf.h"#endif#if !defined(__RNDIS_H__)#include "rndis.h"#endif#if !defined (_CHANNEL_H_)#include "channel.h"#endif//DavidWang#if !defined(__IOWPA_H__)#include "iowpa.h"#endif/*--------------------- Static Definitions -------------------------*//*--------------------- Static Classes ----------------------------*//*--------------------- Static Variables --------------------------*/static int msglevel =MSG_LEVEL_INFO;//static int msglevel =MSG_LEVEL_DEBUG;/*--------------------- Static Functions --------------------------*/staticVOIDs_vProbeChannel( IN PSDevice pDevice ); static PSTxMgmtPackets_MgrMakeProbeRequest( IN PSDevice pDevice, IN PSMgmtObject pMgmt, IN PBYTE pScanBSSID, IN PWLAN_IE_SSID pSSID, IN PWLAN_IE_SUPP_RATES pCurrRates, IN PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); staticBOOLs_bCommandComplete ( PSDevice pDevice ); staticBOOL s_bClearBSSID_SCAN ( IN HANDLE hDeviceContext ); /*--------------------- Export Variables --------------------------*//*--------------------- Export Functions --------------------------*//* * Description: * Stop AdHoc beacon during scan process * * Parameters: * In: * pDevice - Pointer to the adapter * Out: * none * * Return Value: none * */staticvoidvAdHocBeaconStop(PSDevice pDevice){ PSMgmtObject pMgmt = &(pDevice->sMgmtObj); BOOL bStop; /* * temporarily stop Beacon packet for AdHoc Server * if all of the following coditions are met: * (1) STA is in AdHoc mode * (2) VT3253 is programmed as automatic Beacon Transmitting * (3) One of the following conditions is met * (3.1) AdHoc channel is in B/G band and the * current scan channel is in A band * or * (3.2) AdHoc channel is in A mode */ bStop = FALSE; if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState >= WMAC_STATE_STARTED)) { if ((pMgmt->uIBSSChannel <= CB_MAX_CHANNEL_24G) && (pMgmt->uScanChannel > CB_MAX_CHANNEL_24G)) { bStop = TRUE; } if (pMgmt->uIBSSChannel > CB_MAX_CHANNEL_24G) { bStop = TRUE; } } if (bStop) { //PMESG(("STOP_BEACON: IBSSChannel = %u, ScanChannel = %u\n", // pMgmt->uIBSSChannel, pMgmt->uScanChannel)); MACvRegBitsOff(pDevice, MAC_REG_TCR, TCR_AUTOBCNTX); } } /* vAdHocBeaconStop *//* * Description: * Restart AdHoc beacon after scan process complete * * Parameters: * In: * pDevice - Pointer to the adapter * Out: * none * * Return Value: none * */static voidvAdHocBeaconRestart(PSDevice pDevice){ PSMgmtObject pMgmt = &(pDevice->sMgmtObj); /* * Restart Beacon packet for AdHoc Server * if all of the following coditions are met: * (1) STA is in AdHoc mode * (2) VT3253 is programmed as automatic Beacon Transmitting */ if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState >= WMAC_STATE_STARTED)) { //PMESG(("RESTART_BEACON\n")); MACvRegBitsOn(pDevice, MAC_REG_TCR, TCR_AUTOBCNTX); } }/*+ * * Routine Description: * Prepare and send probe request management frames. * * * Return Value: * none. *-*/staticVOIDs_vProbeChannel( IN PSDevice pDevice ){ //1M, 2M, 5M, 11M, 18M, 24M, 36M, 54M BYTE abyCurrSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C}; BYTE abyCurrExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 0x0C, 0x12, 0x18, 0x60}; //6M, 9M, 12M, 48M BYTE abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; BYTE abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; PBYTE pbyRate; PSTxMgmtPacket pTxPacket; PSMgmtObject pMgmt = &(pDevice->sMgmtObj); UINT ii; if (pDevice->byBBType == BB_TYPE_11A) { pbyRate = &abyCurrSuppRatesA[0]; } else if (pDevice->byBBType == BB_TYPE_11B) { pbyRate = &abyCurrSuppRatesB[0]; } else { pbyRate = &abyCurrSuppRatesG[0]; } // build an assocreq frame and send it pTxPacket = s_MgrMakeProbeRequest ( pDevice, pMgmt, pMgmt->abyScanBSSID, (PWLAN_IE_SSID)pMgmt->abyScanSSID, (PWLAN_IE_SUPP_RATES)pbyRate, (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRatesG ); if (pTxPacket != NULL ){ for (ii = 0; ii < 1 ; ii++) { if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request sending fail.. \n"); } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Probe request is sending.. \n"); } } }} /*+ * * Routine Description: * Constructs an probe request frame * * * Return Value: * A ptr to Tx frame or NULL on allocation failue *-*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -