blob: 778208a336e890bbfc47dd054c2addf366349d93 [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
Jim Lieb612822f2009-08-12 14:54:03 -070049
Forest Bond5449c682009-04-25 10:30:44 -040050// Command code
51typedef enum tagCMD_CODE {
52 WLAN_CMD_BSSID_SCAN,
53 WLAN_CMD_SSID,
54 WLAN_CMD_DISASSOCIATE,
55 WLAN_CMD_DEAUTH,
56 WLAN_CMD_RX_PSPOLL,
57 WLAN_CMD_RADIO,
58 WLAN_CMD_CHANGE_BBSENSITIVITY,
59 WLAN_CMD_SETPOWER,
60 WLAN_CMD_TBTT_WAKEUP,
61 WLAN_CMD_BECON_SEND,
62 WLAN_CMD_CHANGE_ANTENNA,
63 WLAN_CMD_REMOVE_ALLKEY,
64 WLAN_CMD_MAC_DISPOWERSAVING,
65 WLAN_CMD_11H_CHSW,
66 WLAN_CMD_RUN_AP
Jim Lieba8848472009-08-12 14:54:07 -070067} CMD_CODE, *PCMD_CODE;
Forest Bond5449c682009-04-25 10:30:44 -040068
69#define CMD_Q_SIZE 32
70
Forest Bond5449c682009-04-25 10:30:44 -040071typedef enum tagCMD_STATUS {
72
Jim Lieb612822f2009-08-12 14:54:03 -070073 CMD_STATUS_SUCCESS = 0,
Forest Bond5449c682009-04-25 10:30:44 -040074 CMD_STATUS_FAILURE,
75 CMD_STATUS_RESOURCES,
76 CMD_STATUS_TIMEOUT,
77 CMD_STATUS_PENDING
78
Jim Lieba8848472009-08-12 14:54:07 -070079} CMD_STATUS, *PCMD_STATUS;
Forest Bond5449c682009-04-25 10:30:44 -040080
81
82typedef struct tagCMD_ITEM {
83 CMD_CODE eCmd;
84 BYTE abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
85 BOOL bNeedRadioOFF;
86 WORD wDeAuthenReason;
87 BOOL bRadioCmd;
88 BOOL bForceSCAN;
Jim Lieba8848472009-08-12 14:54:07 -070089} CMD_ITEM, *PCMD_ITEM;
Forest Bond5449c682009-04-25 10:30:44 -040090
91// Command state
92typedef enum tagCMD_STATE {
93 WLAN_CMD_SCAN_START,
94 WLAN_CMD_SCAN_END,
95 WLAN_CMD_DISASSOCIATE_START,
96 WLAN_CMD_SSID_START,
97 WLAN_AUTHENTICATE_WAIT,
98 WLAN_ASSOCIATE_WAIT,
99 WLAN_DISASSOCIATE_WAIT,
100 WLAN_CMD_TX_PSPACKET_START,
101 WLAN_CMD_AP_MODE_START,
102 WLAN_CMD_RADIO_START,
103 WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE,
104 WLAN_CMD_IDLE
Jim Lieba8848472009-08-12 14:54:07 -0700105} CMD_STATE, *PCMD_STATE;
Forest Bond5449c682009-04-25 10:30:44 -0400106
107
Jim Lieb612822f2009-08-12 14:54:03 -0700108
Forest Bond5449c682009-04-25 10:30:44 -0400109/*--------------------- Export Classes ----------------------------*/
110
111/*--------------------- Export Variables --------------------------*/
112
113
114/*--------------------- Export Types ------------------------------*/
115
116
117/*--------------------- Export Functions --------------------------*/
Forest Bond5449c682009-04-25 10:30:44 -0400118VOID
119vResetCommandTimer(
120 IN HANDLE hDeviceContext
121 );
122
123VOID
124vCommandTimer (
125 IN HANDLE hDeviceContext
126 );
127
128BOOL bClearBSSID_SCAN(
129 IN HANDLE hDeviceContext
130 );
131
132BOOL
133bScheduleCommand(
134 IN HANDLE hDeviceContext,
135 IN CMD_CODE eCommand,
136 IN PBYTE pbyItem0
137 );
138
139VOID
140vCommandTimerWait(
141 IN HANDLE hDeviceContext,
142 IN UINT MSecond
143 );
144#ifdef TxInSleep
145VOID
146BSSvSecondTxData(
147 IN HANDLE hDeviceContext
148 );
149#endif
Jim Lieb612822f2009-08-12 14:54:03 -0700150
Forest Bond5449c682009-04-25 10:30:44 -0400151#endif //__WCMD_H__