blob: 8c6bbc49f0bc59c0d9ba89f7c680250613641089 [file] [log] [blame]
Forest Bond5449c682009-04-25 10:30:44 -04001/*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * File: wcmd.h
20 *
21 * Purpose: Handles the management command interface functions
22 *
23 * Author: Lyndon Chen
24 *
25 * Date: May 8, 2002
26 *
27 */
28
29#ifndef __WCMD_H__
30#define __WCMD_H__
31
32#if !defined(__TTYPE_H__)
33#include "ttype.h"
34#endif
35#if !defined(__80211HDR_H__)
36#include "80211hdr.h"
37#endif
38#if !defined(__80211MGR_H__)
39#include "80211mgr.h"
40#endif
41
42/*--------------------- Export Definitions -------------------------*/
43
44
45
46#define AUTHENTICATE_TIMEOUT 1000 //ms
47#define ASSOCIATE_TIMEOUT 1000 //ms
48
49// Command code
50typedef enum tagCMD_CODE {
51 WLAN_CMD_BSSID_SCAN,
52 WLAN_CMD_SSID,
53 WLAN_CMD_DISASSOCIATE,
54 WLAN_CMD_DEAUTH,
55 WLAN_CMD_RX_PSPOLL,
56 WLAN_CMD_RADIO,
57 WLAN_CMD_CHANGE_BBSENSITIVITY,
58 WLAN_CMD_SETPOWER,
59 WLAN_CMD_TBTT_WAKEUP,
60 WLAN_CMD_BECON_SEND,
61 WLAN_CMD_CHANGE_ANTENNA,
62 WLAN_CMD_REMOVE_ALLKEY,
63 WLAN_CMD_MAC_DISPOWERSAVING,
64 WLAN_CMD_11H_CHSW,
65 WLAN_CMD_RUN_AP
66} CMD_CODE, DEF* PCMD_CODE;
67
68#define CMD_Q_SIZE 32
69
70
71// Command code
72typedef enum tagCMD_STATUS {
73
74 CMD_STATUS_SUCCESS,
75 CMD_STATUS_FAILURE,
76 CMD_STATUS_RESOURCES,
77 CMD_STATUS_TIMEOUT,
78 CMD_STATUS_PENDING
79
80} CMD_STATUS, DEF* PCMD_STATUS;
81
82
83typedef struct tagCMD_ITEM {
84 CMD_CODE eCmd;
85 BYTE abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
86 BOOL bNeedRadioOFF;
87 WORD wDeAuthenReason;
88 BOOL bRadioCmd;
89 BOOL bForceSCAN;
90} CMD_ITEM, DEF* PCMD_ITEM;
91
92// Command state
93typedef enum tagCMD_STATE {
94 WLAN_CMD_SCAN_START,
95 WLAN_CMD_SCAN_END,
96 WLAN_CMD_DISASSOCIATE_START,
97 WLAN_CMD_SSID_START,
98 WLAN_AUTHENTICATE_WAIT,
99 WLAN_ASSOCIATE_WAIT,
100 WLAN_DISASSOCIATE_WAIT,
101 WLAN_CMD_TX_PSPACKET_START,
102 WLAN_CMD_AP_MODE_START,
103 WLAN_CMD_RADIO_START,
104 WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE,
105 WLAN_CMD_IDLE
106} CMD_STATE, DEF* PCMD_STATE;
107
108
109/*--------------------- Export Classes ----------------------------*/
110
111/*--------------------- Export Variables --------------------------*/
112
113
114/*--------------------- Export Types ------------------------------*/
115
116
117/*--------------------- Export Functions --------------------------*/
118
119VOID
120vResetCommandTimer(
121 IN HANDLE hDeviceContext
122 );
123
124VOID
125vCommandTimer (
126 IN HANDLE hDeviceContext
127 );
128
129BOOL bClearBSSID_SCAN(
130 IN HANDLE hDeviceContext
131 );
132
133BOOL
134bScheduleCommand(
135 IN HANDLE hDeviceContext,
136 IN CMD_CODE eCommand,
137 IN PBYTE pbyItem0
138 );
139
140VOID
141vCommandTimerWait(
142 IN HANDLE hDeviceContext,
143 IN UINT MSecond
144 );
145#ifdef TxInSleep
146VOID
147BSSvSecondTxData(
148 IN HANDLE hDeviceContext
149 );
150#endif
151#endif //__WCMD_H__