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