/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* 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:
*
*/
#include "ttype.h"
#include "tmacro.h"
#include "device.h"
#include "mac.h"
#include "card.h"
#include "80211hdr.h"
#include "wcmd.h"
#include "wmgr.h"
#include "power.h"
#include "wctl.h"
#include "baseband.h"
#include "control.h"
#include "rxtx.h"
#include "rf.h"
#include "rndis.h"
#include "channel.h"
#include "iowpa.h"
/*--------------------- Static Definitions -------------------------*/
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
static int msglevel =MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG;
/*--------------------- Static Functions --------------------------*/
static
void
s_vProbeChannel(
PSDevice pDevice
);
static
PSTxMgmtPacket
s_MgrMakeProbeRequest(
PSDevice pDevice,
PSMgmtObject pMgmt,
PBYTE pScanBSSID,
PWLAN_IE_SSID pSSID,
PWLAN_IE_SUPP_RATES pCurrRates,
PWLAN_IE_SUPP_RATES pCurrExtSuppRates
);
static
BOOL
s_bCommandComplete (
PSDevice pDevice
);
static BOOL s_bClearBSSID_SCAN(void *hDeviceContext);
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
/*
* Description:
* Stop AdHoc beacon during scan process
*
* Parameters:
* In:
* pDevice - Pointer to the adapter
* Out:
* none
*
* Return Value: none
*
*/
static
void
vAdHocBeaconStop(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));