Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 1 | |
| 2 | /*! |
| 3 | * @file coreconfigurator.h |
| 4 | * @brief |
| 5 | * @author |
| 6 | * @sa coreconfigurator.c |
| 7 | * @date 1 Mar 2012 |
| 8 | * @version 1.0 |
| 9 | */ |
| 10 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 11 | #ifndef CORECONFIGURATOR_H |
| 12 | #define CORECONFIGURATOR_H |
| 13 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 14 | #include "wilc_wlan_if.h" |
| 15 | /*****************************************************************************/ |
| 16 | /* Constants */ |
| 17 | /*****************************************************************************/ |
| 18 | /* Number of WID Options Supported */ |
| 19 | #define NUM_BASIC_SWITCHES 45 |
Stanislav Kholmanskikh | 13994d1 | 2015-06-10 21:57:26 +0300 | [diff] [blame] | 20 | #define NUM_FHSS_SWITCHES 0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 21 | |
Stanislav Kholmanskikh | 13994d1 | 2015-06-10 21:57:26 +0300 | [diff] [blame] | 22 | #define NUM_RSSI 5 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 23 | |
| 24 | #ifdef MAC_802_11N |
| 25 | #define NUM_11N_BASIC_SWITCHES 25 |
| 26 | #define NUM_11N_HUT_SWITCHES 47 |
| 27 | #else /* MAC_802_11N */ |
| 28 | #define NUM_11N_BASIC_SWITCHES 0 |
| 29 | #define NUM_11N_HUT_SWITCHES 0 |
| 30 | #endif /* MAC_802_11N */ |
| 31 | |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 32 | extern u16 g_num_total_switches; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 33 | |
| 34 | #define MAC_HDR_LEN 24 /* No Address4 - non-ESS */ |
| 35 | #define MAX_SSID_LEN 33 |
| 36 | #define FCS_LEN 4 |
| 37 | #define TIME_STAMP_LEN 8 |
| 38 | #define BEACON_INTERVAL_LEN 2 |
| 39 | #define CAP_INFO_LEN 2 |
| 40 | #define STATUS_CODE_LEN 2 |
| 41 | #define AID_LEN 2 |
| 42 | #define IE_HDR_LEN 2 |
| 43 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 44 | /* Operating Mode: SET */ |
| 45 | #define SET_CFG 0 |
| 46 | /* Operating Mode: GET */ |
| 47 | #define GET_CFG 1 |
| 48 | |
| 49 | #define MAX_PACKET_BUFF_SIZE 1596 |
| 50 | |
Stanislav Kholmanskikh | 13994d1 | 2015-06-10 21:57:26 +0300 | [diff] [blame] | 51 | #define MAX_STRING_LEN 256 |
| 52 | #define MAX_SURVEY_RESULT_FRAG_SIZE MAX_STRING_LEN |
| 53 | #define SURVEY_RESULT_LENGTH 44 |
| 54 | #define MAX_ASSOC_RESP_FRAME_SIZE MAX_STRING_LEN |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 55 | |
Stanislav Kholmanskikh | 13994d1 | 2015-06-10 21:57:26 +0300 | [diff] [blame] | 56 | #define STATUS_MSG_LEN 12 |
| 57 | #define MAC_CONNECTED 1 |
| 58 | #define MAC_DISCONNECTED 0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 59 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 60 | /*****************************************************************************/ |
| 61 | /* Function Macros */ |
| 62 | /*****************************************************************************/ |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 63 | #define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb)) |
Chaehyun Lim | 4e4467f | 2015-06-11 14:35:55 +0900 | [diff] [blame] | 64 | #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw)) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 65 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 66 | /*****************************************************************************/ |
| 67 | /* Type Definitions */ |
| 68 | /*****************************************************************************/ |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 69 | /* Status Codes for Authentication and Association Frames */ |
| 70 | typedef enum { |
Stanislav Kholmanskikh | 13994d1 | 2015-06-10 21:57:26 +0300 | [diff] [blame] | 71 | SUCCESSFUL_STATUSCODE = 0, |
| 72 | UNSPEC_FAIL = 1, |
| 73 | UNSUP_CAP = 10, |
| 74 | REASOC_NO_ASOC = 11, |
| 75 | FAIL_OTHER = 12, |
| 76 | UNSUPT_ALG = 13, |
| 77 | AUTH_SEQ_FAIL = 14, |
| 78 | CHLNG_FAIL = 15, |
| 79 | AUTH_TIMEOUT = 16, |
| 80 | AP_FULL = 17, |
| 81 | UNSUP_RATE = 18, |
| 82 | SHORT_PREAMBLE_UNSUP = 19, |
| 83 | PBCC_UNSUP = 20, |
| 84 | CHANNEL_AGIL_UNSUP = 21, |
| 85 | SHORT_SLOT_UNSUP = 25, |
| 86 | OFDM_DSSS_UNSUP = 26, |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 87 | CONNECT_STS_FORCE_16_BIT = 0xFFFF |
| 88 | } tenuConnectSts; |
| 89 | |
| 90 | typedef struct { |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 91 | u16 u16WIDid; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 92 | tenuWIDtype enuWIDtype; |
Chaehyun Lim | fb4ec9c | 2015-06-11 14:35:59 +0900 | [diff] [blame] | 93 | s32 s32ValueSize; |
Chaehyun Lim | ca356ad | 2015-06-11 14:35:57 +0900 | [diff] [blame] | 94 | s8 *ps8WidVal; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 95 | |
| 96 | } tstrWID; |
| 97 | |
| 98 | typedef struct { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 99 | u8 u8Full; |
| 100 | u8 u8Index; |
Chaehyun Lim | ca356ad | 2015-06-11 14:35:57 +0900 | [diff] [blame] | 101 | s8 as8RSSI[NUM_RSSI]; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 102 | } tstrRSSI; |
| 103 | /* This structure is used to support parsing of the received 'N' message */ |
| 104 | typedef struct { |
Chaehyun Lim | ca356ad | 2015-06-11 14:35:57 +0900 | [diff] [blame] | 105 | s8 s8rssi; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 106 | u16 u16CapInfo; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 107 | u8 au8ssid[MAX_SSID_LEN]; |
| 108 | u8 u8SsidLen; |
| 109 | u8 au8bssid[6]; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 110 | u16 u16BeaconPeriod; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 111 | u8 u8DtimPeriod; |
| 112 | u8 u8channel; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 113 | unsigned long u32TimeRcvdInScanCached; /* of type unsigned long to be accepted by the linux kernel macro time_after() */ |
| 114 | unsigned long u32TimeRcvdInScan; |
Dean Lee | 72ed4dc | 2015-06-12 14:11:44 +0900 | [diff] [blame] | 115 | bool bNewNetwork; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 116 | #ifdef AGING_ALG |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 117 | u8 u8Found; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 118 | #endif |
| 119 | #ifdef WILC_P2P |
Chaehyun Lim | 4e4467f | 2015-06-11 14:35:55 +0900 | [diff] [blame] | 120 | u32 u32Tsf; /* time-stamp [Low only 32 bit] */ |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 121 | #endif |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 122 | u8 *pu8IEs; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 123 | u16 u16IEsLen; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 124 | void *pJoinParams; |
| 125 | tstrRSSI strRssi; |
Chaehyun Lim | 57b298f | 2015-06-11 14:35:56 +0900 | [diff] [blame] | 126 | u64 u64Tsf; /* time-stamp [Low and High 64 bit] */ |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 127 | } tstrNetworkInfo; |
| 128 | |
| 129 | /* This structure is used to support parsing of the received Association Response frame */ |
| 130 | typedef struct { |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 131 | u16 u16capability; |
| 132 | u16 u16ConnectStatus; |
| 133 | u16 u16AssocID; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 134 | u8 *pu8RespIEs; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 135 | u16 u16RespIEsLen; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 136 | } tstrConnectRespInfo; |
| 137 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 138 | typedef struct { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 139 | u8 au8bssid[6]; |
| 140 | u8 *pu8ReqIEs; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 141 | size_t ReqIEsLen; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 142 | u8 *pu8RespIEs; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 143 | u16 u16RespIEsLen; |
| 144 | u16 u16ConnectStatus; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 145 | } tstrConnectInfo; |
| 146 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 147 | typedef struct { |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 148 | u16 u16reason; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 149 | u8 *ie; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 150 | size_t ie_len; |
| 151 | } tstrDisconnectNotifInfo; |
| 152 | |
| 153 | #ifndef CONNECT_DIRECT |
| 154 | typedef struct wid_site_survey_reslts { |
Dean Lee | 576917a | 2015-06-15 11:58:57 +0900 | [diff] [blame] | 155 | char SSID[MAX_SSID_LEN]; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 156 | u8 BssType; |
| 157 | u8 Channel; |
| 158 | u8 SecurityStatus; |
| 159 | u8 BSSID[6]; |
Dean Lee | 576917a | 2015-06-15 11:58:57 +0900 | [diff] [blame] | 160 | char RxPower; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 161 | u8 Reserved; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 162 | |
| 163 | } wid_site_survey_reslts_s; |
| 164 | #endif |
| 165 | |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 166 | s32 CoreConfiguratorInit(void); |
| 167 | s32 CoreConfiguratorDeInit(void); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 168 | |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 169 | s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs, |
| 170 | u32 u32WIDsCount, bool bRespRequired, u32 drvHandler); |
| 171 | s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo); |
| 172 | s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 173 | |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 174 | s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen, |
| 175 | tstrConnectRespInfo **ppstrConnectRespInfo); |
| 176 | s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 177 | |
| 178 | #ifndef CONNECT_DIRECT |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 179 | s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE], |
| 180 | wid_site_survey_reslts_s **ppstrSurveyResults, |
| 181 | u32 *pu32SurveyResultsCount); |
| 182 | s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 183 | #endif |
| 184 | |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 185 | s32 SendRawPacket(s8 *pspacket, s32 s32PacketLen); |
| 186 | void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length); |
Chaehyun Lim | 4e4467f | 2015-06-11 14:35:55 +0900 | [diff] [blame] | 187 | void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length); |
| 188 | void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 189 | |
| 190 | #endif |