blob: 2844476d5dc9dfedb88566a73bfbd25286c9f957 [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
Forest Bond5449c682009-04-25 10:30:44 -040038#define AUTHENTICATE_TIMEOUT 1000 //ms
39#define ASSOCIATE_TIMEOUT 1000 //ms
40
41// Command code
42typedef enum tagCMD_CODE {
Joe Perches3bd1a382013-03-18 10:45:09 -070043 WLAN_CMD_BSSID_SCAN,
44 WLAN_CMD_SSID,
45 WLAN_CMD_DISASSOCIATE,
46 WLAN_CMD_DEAUTH,
47 WLAN_CMD_RX_PSPOLL,
48 WLAN_CMD_RADIO,
49 WLAN_CMD_CHANGE_BBSENSITIVITY,
50 WLAN_CMD_SETPOWER,
51 WLAN_CMD_TBTT_WAKEUP,
52 WLAN_CMD_BECON_SEND,
53 WLAN_CMD_CHANGE_ANTENNA,
54 WLAN_CMD_REMOVE_ALLKEY,
55 WLAN_CMD_MAC_DISPOWERSAVING,
56 WLAN_CMD_11H_CHSW,
57 WLAN_CMD_RUN_AP
Jim Lieba8848472009-08-12 14:54:07 -070058} CMD_CODE, *PCMD_CODE;
Forest Bond5449c682009-04-25 10:30:44 -040059
60#define CMD_Q_SIZE 32
61
Forest Bond5449c682009-04-25 10:30:44 -040062typedef enum tagCMD_STATUS {
Joe Perches3bd1a382013-03-18 10:45:09 -070063 CMD_STATUS_SUCCESS = 0,
64 CMD_STATUS_FAILURE,
65 CMD_STATUS_RESOURCES,
66 CMD_STATUS_TIMEOUT,
67 CMD_STATUS_PENDING
Jim Lieba8848472009-08-12 14:54:07 -070068} CMD_STATUS, *PCMD_STATUS;
Forest Bond5449c682009-04-25 10:30:44 -040069
Forest Bond5449c682009-04-25 10:30:44 -040070typedef struct tagCMD_ITEM {
Joe Perches3bd1a382013-03-18 10:45:09 -070071 CMD_CODE eCmd;
72 unsigned char abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
73 bool bNeedRadioOFF;
74 unsigned short wDeAuthenReason;
75 bool bRadioCmd;
76 bool bForceSCAN;
Jim Lieba8848472009-08-12 14:54:07 -070077} CMD_ITEM, *PCMD_ITEM;
Forest Bond5449c682009-04-25 10:30:44 -040078
79// Command state
80typedef enum tagCMD_STATE {
Joe Perches3bd1a382013-03-18 10:45:09 -070081 WLAN_CMD_SCAN_START,
82 WLAN_CMD_SCAN_END,
83 WLAN_CMD_DISASSOCIATE_START,
84 WLAN_CMD_SSID_START,
85 WLAN_AUTHENTICATE_WAIT,
86 WLAN_ASSOCIATE_WAIT,
87 WLAN_DISASSOCIATE_WAIT,
88 WLAN_CMD_TX_PSPACKET_START,
89 WLAN_CMD_AP_MODE_START,
90 WLAN_CMD_RADIO_START,
91 WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE,
92 WLAN_CMD_IDLE
Jim Lieba8848472009-08-12 14:54:07 -070093} CMD_STATE, *PCMD_STATE;
Forest Bond5449c682009-04-25 10:30:44 -040094
Forest Bond5449c682009-04-25 10:30:44 -040095/*--------------------- Export Classes ----------------------------*/
96
97/*--------------------- Export Variables --------------------------*/
98
Forest Bond5449c682009-04-25 10:30:44 -040099/*--------------------- Export Types ------------------------------*/
100
Forest Bond5449c682009-04-25 10:30:44 -0400101/*--------------------- Export Functions --------------------------*/
Charles Clément6b35b7b2010-05-07 12:30:19 -0700102void
Forest Bond5449c682009-04-25 10:30:44 -0400103vResetCommandTimer(
Joe Perches3bd1a382013-03-18 10:45:09 -0700104 void *hDeviceContext
105);
Forest Bond5449c682009-04-25 10:30:44 -0400106
Charles Clément6b35b7b2010-05-07 12:30:19 -0700107void
Joe Perches3bd1a382013-03-18 10:45:09 -0700108vCommandTimer(
109 void *hDeviceContext
110);
Forest Bond5449c682009-04-25 10:30:44 -0400111
Charles Clément7b6a0012010-08-01 17:15:50 +0200112bool bClearBSSID_SCAN(
Joe Perches3bd1a382013-03-18 10:45:09 -0700113 void *hDeviceContext
114);
Forest Bond5449c682009-04-25 10:30:44 -0400115
Charles Clément7b6a0012010-08-01 17:15:50 +0200116bool
Forest Bond5449c682009-04-25 10:30:44 -0400117bScheduleCommand(
Joe Perches3bd1a382013-03-18 10:45:09 -0700118 void *hDeviceContext,
119 CMD_CODE eCommand,
120 unsigned char *pbyItem0
121);
Forest Bond5449c682009-04-25 10:30:44 -0400122
Charles Clément6b35b7b2010-05-07 12:30:19 -0700123void
Forest Bond5449c682009-04-25 10:30:44 -0400124vCommandTimerWait(
Joe Perches3bd1a382013-03-18 10:45:09 -0700125 void *hDeviceContext,
126 unsigned int MSecond
127);
Forest Bond5449c682009-04-25 10:30:44 -0400128#ifdef TxInSleep
Charles Clément6b35b7b2010-05-07 12:30:19 -0700129void
Forest Bond5449c682009-04-25 10:30:44 -0400130BSSvSecondTxData(
Joe Perches3bd1a382013-03-18 10:45:09 -0700131 void *hDeviceContext
132);
Forest Bond5449c682009-04-25 10:30:44 -0400133#endif
Jim Lieb612822f2009-08-12 14:54:03 -0700134
Forest Bond5449c682009-04-25 10:30:44 -0400135#endif //__WCMD_H__