Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 1 | /* |
| 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 Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 32 | #include "ttype.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 33 | #include "80211hdr.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 34 | #include "80211mgr.h" |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 35 | |
| 36 | /*--------------------- Export Definitions -------------------------*/ |
| 37 | |
| 38 | |
| 39 | |
| 40 | #define AUTHENTICATE_TIMEOUT 1000 //ms |
| 41 | #define ASSOCIATE_TIMEOUT 1000 //ms |
| 42 | |
| 43 | |
| 44 | // Command code |
| 45 | typedef 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 Lieb | 193a823 | 2009-08-12 14:54:06 -0700 | [diff] [blame] | 61 | } CMD_CODE, *PCMD_CODE; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 62 | |
| 63 | #define CMD_Q_SIZE 32 |
| 64 | |
| 65 | typedef enum tagCMD_STATUS { |
| 66 | |
| 67 | CMD_STATUS_SUCCESS = 0, |
| 68 | CMD_STATUS_FAILURE, |
| 69 | CMD_STATUS_RESOURCES, |
| 70 | CMD_STATUS_TIMEOUT, |
| 71 | CMD_STATUS_PENDING |
| 72 | |
Jim Lieb | 193a823 | 2009-08-12 14:54:06 -0700 | [diff] [blame] | 73 | } CMD_STATUS, *PCMD_STATUS; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 74 | |
| 75 | typedef struct tagCMD_ITEM { |
| 76 | CMD_CODE eCmd; |
| 77 | BYTE abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; |
| 78 | BOOL bNeedRadioOFF; |
| 79 | BOOL bRadioCmd; |
| 80 | BOOL bForceSCAN; |
| 81 | WORD wDeAuthenReason; |
Jim Lieb | 193a823 | 2009-08-12 14:54:06 -0700 | [diff] [blame] | 82 | } CMD_ITEM, *PCMD_ITEM; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 83 | |
| 84 | // Command state |
| 85 | typedef enum tagCMD_STATE { |
| 86 | WLAN_CMD_SCAN_START, |
| 87 | WLAN_CMD_SCAN_END, |
| 88 | WLAN_CMD_DISASSOCIATE_START, |
| 89 | WLAN_CMD_DEAUTHEN_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_RADIO_START, |
| 96 | WLAN_CMD_CHANGE_BBSENSITIVITY_START, |
| 97 | WLAN_CMD_SETPOWER_START, |
| 98 | WLAN_CMD_AP_MODE_START, |
| 99 | WLAN_CMD_TBTT_WAKEUP_START, |
| 100 | WLAN_CMD_BECON_SEND_START, |
| 101 | WLAN_CMD_CHANGE_ANTENNA_START, |
| 102 | WLAN_CMD_REMOVE_ALLKEY_START, |
| 103 | WLAN_CMD_MAC_DISPOWERSAVING_START, |
| 104 | WLAN_CMD_11H_CHSW_START, |
| 105 | WLAN_CMD_IDLE |
Jim Lieb | 193a823 | 2009-08-12 14:54:06 -0700 | [diff] [blame] | 106 | } CMD_STATE, *PCMD_STATE; |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 107 | |
| 108 | |
| 109 | |
| 110 | /*--------------------- Export Classes ----------------------------*/ |
| 111 | |
| 112 | /*--------------------- Export Variables --------------------------*/ |
| 113 | |
| 114 | |
| 115 | /*--------------------- Export Types ------------------------------*/ |
| 116 | |
| 117 | |
| 118 | /*--------------------- Export Functions --------------------------*/ |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame^] | 119 | void |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 120 | vResetCommandTimer( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 121 | HANDLE hDeviceContext |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 122 | ); |
| 123 | |
| 124 | BOOL |
| 125 | bScheduleCommand( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 126 | HANDLE hDeviceContext, |
| 127 | CMD_CODE eCommand, |
| 128 | PBYTE pbyItem0 |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 129 | ); |
| 130 | |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame^] | 131 | void |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 132 | vRunCommand( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 133 | HANDLE hDeviceContext |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 134 | ); |
| 135 | /* |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame^] | 136 | void |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 137 | WCMDvCommandThread( |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame^] | 138 | void * Context |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 139 | ); |
| 140 | */ |
| 141 | |
| 142 | //2007-0115-09<Add>by MikeLiu |
| 143 | #ifdef TxInSleep |
Andres More | 8611a29 | 2010-05-01 14:25:00 -0300 | [diff] [blame^] | 144 | void |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 145 | BSSvSecondTxData( |
Andres More | 592ccfe | 2010-04-17 12:07:42 -0300 | [diff] [blame] | 146 | HANDLE hDeviceContext |
Forest Bond | 92b9679 | 2009-06-13 07:38:31 -0400 | [diff] [blame] | 147 | ); |
| 148 | #endif |
| 149 | |
| 150 | #endif //__WCMD_H__ |