3 * @file coreconfigurator.h
6 * @sa coreconfigurator.c
11 #ifndef CORECONFIGURATOR_H
12 #define CORECONFIGURATOR_H
14 #include "wilc_wlan_if.h"
15 /*****************************************************************************/
17 /*****************************************************************************/
18 /* Number of WID Options Supported */
19 #define NUM_BASIC_SWITCHES 45
20 #define NUM_FHSS_SWITCHES 0
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 */
32 extern u16 g_num_total_switches;
34 #define MAC_HDR_LEN 24 /* No Address4 - non-ESS */
35 #define MAX_SSID_LEN 33
37 #define TIME_STAMP_LEN 8
38 #define BEACON_INTERVAL_LEN 2
39 #define CAP_INFO_LEN 2
40 #define STATUS_CODE_LEN 2
44 /* Operating Mode: SET */
46 /* Operating Mode: GET */
49 #define MAX_PACKET_BUFF_SIZE 1596
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
56 #define STATUS_MSG_LEN 12
57 #define MAC_CONNECTED 1
58 #define MAC_DISCONNECTED 0
60 /*****************************************************************************/
62 /*****************************************************************************/
63 #define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb))
64 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
66 /*****************************************************************************/
67 /* Type Definitions */
68 /*****************************************************************************/
69 /* Status Codes for Authentication and Association Frames */
71 SUCCESSFUL_STATUSCODE = 0,
82 SHORT_PREAMBLE_UNSUP = 19,
84 CHANNEL_AGIL_UNSUP = 21,
85 SHORT_SLOT_UNSUP = 25,
87 CONNECT_STS_FORCE_16_BIT = 0xFFFF
92 tenuWIDtype enuWIDtype;
101 s8 as8RSSI[NUM_RSSI];
103 /* This structure is used to support parsing of the received 'N' message */
107 u8 au8ssid[MAX_SSID_LEN];
113 unsigned long u32TimeRcvdInScanCached; /* of type unsigned long to be accepted by the linux kernel macro time_after() */
114 unsigned long u32TimeRcvdInScan;
120 u32 u32Tsf; /* time-stamp [Low only 32 bit] */
126 u64 u64Tsf; /* time-stamp [Low and High 64 bit] */
129 /* This structure is used to support parsing of the received Association Response frame */
132 u16 u16ConnectStatus;
136 } tstrConnectRespInfo;
144 u16 u16ConnectStatus;
151 } tstrDisconnectNotifInfo;
153 #ifndef CONNECT_DIRECT
154 typedef struct wid_site_survey_reslts {
155 char SSID[MAX_SSID_LEN];
163 } wid_site_survey_reslts_s;
166 s32 CoreConfiguratorInit(void);
167 s32 CoreConfiguratorDeInit(void);
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);
174 s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
175 tstrConnectRespInfo **ppstrConnectRespInfo);
176 s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo);
178 #ifndef CONNECT_DIRECT
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);
185 s32 SendRawPacket(s8 *pspacket, s32 s32PacketLen);
186 void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length);
187 void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length);
188 void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length);