blob: c3c418089513c001a6507877b17eee3e07b65a5e [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
Forest Bond5449c682009-04-25 10:30:44 -040032#include "ttype.h"
Forest Bond5449c682009-04-25 10:30:44 -040033#include "80211hdr.h"
Forest Bond5449c682009-04-25 10:30:44 -040034#include "80211mgr.h"
Forest Bond5449c682009-04-25 10:30:44 -040035
36/*--------------------- Export Definitions -------------------------*/
37
38
39
40#define AUTHENTICATE_TIMEOUT 1000 //ms
41#define ASSOCIATE_TIMEOUT 1000 //ms
42
Jim Lieb612822f2009-08-12 14:54:03 -070043
Forest Bond5449c682009-04-25 10:30:44 -040044// Command code
45typedef enum tagCMD_CODE {
46 WLAN_CMD_BSSID_SCAN,
47 WLAN_CMD_SSID,
48 WLAN_CMD_DISASSOCIATE,
49 WLAN_CMD_DEAUTH,
50 WLAN_CMD_RX_PSPOLL,
51 WLAN_CMD_RADIO,
52 WLAN_CMD_CHANGE_BBSENSITIVITY,
53 WLAN_CMD_SETPOWER,
54 WLAN_CMD_TBTT_WAKEUP,
55 WLAN_CMD_BECON_SEND,
56 WLAN_CMD_CHANGE_ANTENNA,
57 WLAN_CMD_REMOVE_ALLKEY,
58 WLAN_CMD_MAC_DISPOWERSAVING,
59 WLAN_CMD_11H_CHSW,
60 WLAN_CMD_RUN_AP
Jim Lieba8848472009-08-12 14:54:07 -070061} CMD_CODE, *PCMD_CODE;
Forest Bond5449c682009-04-25 10:30:44 -040062
63#define CMD_Q_SIZE 32
64
Forest Bond5449c682009-04-25 10:30:44 -040065typedef enum tagCMD_STATUS {
66
Jim Lieb612822f2009-08-12 14:54:03 -070067 CMD_STATUS_SUCCESS = 0,
Forest Bond5449c682009-04-25 10:30:44 -040068 CMD_STATUS_FAILURE,
69 CMD_STATUS_RESOURCES,
70 CMD_STATUS_TIMEOUT,
71 CMD_STATUS_PENDING
72
Jim Lieba8848472009-08-12 14:54:07 -070073} CMD_STATUS, *PCMD_STATUS;
Forest Bond5449c682009-04-25 10:30:44 -040074
75
76typedef struct tagCMD_ITEM {
77 CMD_CODE eCmd;
78 BYTE abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
79 BOOL bNeedRadioOFF;
80 WORD wDeAuthenReason;
81 BOOL bRadioCmd;
82 BOOL bForceSCAN;
Jim Lieba8848472009-08-12 14:54:07 -070083} CMD_ITEM, *PCMD_ITEM;
Forest Bond5449c682009-04-25 10:30:44 -040084
85// Command state
86typedef enum tagCMD_STATE {
87 WLAN_CMD_SCAN_START,
88 WLAN_CMD_SCAN_END,
89 WLAN_CMD_DISASSOCIATE_START,
90 WLAN_CMD_SSID_START,
91 WLAN_AUTHENTICATE_WAIT,
92 WLAN_ASSOCIATE_WAIT,
93 WLAN_DISASSOCIATE_WAIT,
94 WLAN_CMD_TX_PSPACKET_START,
95 WLAN_CMD_AP_MODE_START,
96 WLAN_CMD_RADIO_START,
97 WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE,
98 WLAN_CMD_IDLE
Jim Lieba8848472009-08-12 14:54:07 -070099} CMD_STATE, *PCMD_STATE;
Forest Bond5449c682009-04-25 10:30:44 -0400100
101
Jim Lieb612822f2009-08-12 14:54:03 -0700102
Forest Bond5449c682009-04-25 10:30:44 -0400103/*--------------------- Export Classes ----------------------------*/
104
105/*--------------------- Export Variables --------------------------*/
106
107
108/*--------------------- Export Types ------------------------------*/
109
110
111/*--------------------- Export Functions --------------------------*/
Charles Clément6b35b7b2010-05-07 12:30:19 -0700112void
Forest Bond5449c682009-04-25 10:30:44 -0400113vResetCommandTimer(
Charles Clément3a215e02010-05-12 20:54:39 -0700114 void *hDeviceContext
Forest Bond5449c682009-04-25 10:30:44 -0400115 );
116
Charles Clément6b35b7b2010-05-07 12:30:19 -0700117void
Forest Bond5449c682009-04-25 10:30:44 -0400118vCommandTimer (
Charles Clément3a215e02010-05-12 20:54:39 -0700119 void *hDeviceContext
Forest Bond5449c682009-04-25 10:30:44 -0400120 );
121
122BOOL bClearBSSID_SCAN(
Charles Clément3a215e02010-05-12 20:54:39 -0700123 void *hDeviceContext
Forest Bond5449c682009-04-25 10:30:44 -0400124 );
125
126BOOL
127bScheduleCommand(
Charles Clément3a215e02010-05-12 20:54:39 -0700128 void *hDeviceContext,
129 CMD_CODE eCommand,
130 PBYTE pbyItem0
Forest Bond5449c682009-04-25 10:30:44 -0400131 );
132
Charles Clément6b35b7b2010-05-07 12:30:19 -0700133void
Forest Bond5449c682009-04-25 10:30:44 -0400134vCommandTimerWait(
Charles Clément3a215e02010-05-12 20:54:39 -0700135 void *hDeviceContext,
136 UINT MSecond
Forest Bond5449c682009-04-25 10:30:44 -0400137 );
138#ifdef TxInSleep
Charles Clément6b35b7b2010-05-07 12:30:19 -0700139void
Forest Bond5449c682009-04-25 10:30:44 -0400140BSSvSecondTxData(
Charles Clément3a215e02010-05-12 20:54:39 -0700141 void *hDeviceContext
Forest Bond5449c682009-04-25 10:30:44 -0400142 );
143#endif
Jim Lieb612822f2009-08-12 14:54:03 -0700144
Forest Bond5449c682009-04-25 10:30:44 -0400145#endif //__WCMD_H__