• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #define NUM_BASIC_SWITCHES      45
17 #define NUM_FHSS_SWITCHES       0
18 
19 #define NUM_RSSI                5
20 
21 #ifdef MAC_802_11N
22 #define NUM_11N_BASIC_SWITCHES  25
23 #define NUM_11N_HUT_SWITCHES    47
24 #else
25 #define NUM_11N_BASIC_SWITCHES  0
26 #define NUM_11N_HUT_SWITCHES    0
27 #endif
28 
29 #define MAC_HDR_LEN             24
30 #define MAX_SSID_LEN            33
31 #define FCS_LEN                 4
32 #define TIME_STAMP_LEN          8
33 #define BEACON_INTERVAL_LEN     2
34 #define CAP_INFO_LEN            2
35 #define STATUS_CODE_LEN         2
36 #define AID_LEN                 2
37 #define IE_HDR_LEN              2
38 
39 #define SET_CFG              0
40 #define GET_CFG              1
41 
42 #define MAX_STRING_LEN               256
43 #define MAX_SURVEY_RESULT_FRAG_SIZE  MAX_STRING_LEN
44 #define SURVEY_RESULT_LENGTH         44
45 #define MAX_ASSOC_RESP_FRAME_SIZE    MAX_STRING_LEN
46 
47 #define MAC_CONNECTED                1
48 #define MAC_DISCONNECTED             0
49 
50 #define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb))
51 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
52 
53 typedef enum {
54 	SUCCESSFUL_STATUSCODE    = 0,
55 	UNSPEC_FAIL              = 1,
56 	UNSUP_CAP                = 10,
57 	REASOC_NO_ASOC           = 11,
58 	FAIL_OTHER               = 12,
59 	UNSUPT_ALG               = 13,
60 	AUTH_SEQ_FAIL            = 14,
61 	CHLNG_FAIL               = 15,
62 	AUTH_TIMEOUT             = 16,
63 	AP_FULL                  = 17,
64 	UNSUP_RATE               = 18,
65 	SHORT_PREAMBLE_UNSUP     = 19,
66 	PBCC_UNSUP               = 20,
67 	CHANNEL_AGIL_UNSUP       = 21,
68 	SHORT_SLOT_UNSUP         = 25,
69 	OFDM_DSSS_UNSUP          = 26,
70 	CONNECT_STS_FORCE_16_BIT = 0xFFFF
71 } tenuConnectSts;
72 
73 struct wid {
74 	u16 id;
75 	enum WID_TYPE type;
76 	s32 size;
77 	s8 *val;
78 };
79 
80 typedef struct {
81 	u8 u8Full;
82 	u8 u8Index;
83 	s8 as8RSSI[NUM_RSSI];
84 } tstrRSSI;
85 
86 typedef struct {
87 	s8 s8rssi;
88 	u16 u16CapInfo;
89 	u8 au8ssid[MAX_SSID_LEN];
90 	u8 u8SsidLen;
91 	u8 au8bssid[6];
92 	u16 u16BeaconPeriod;
93 	u8 u8DtimPeriod;
94 	u8 u8channel;
95 	unsigned long u32TimeRcvdInScanCached;
96 	unsigned long u32TimeRcvdInScan;
97 	bool bNewNetwork;
98 	u8 u8Found;
99 	u32 u32Tsf;
100 	u8 *pu8IEs;
101 	u16 u16IEsLen;
102 	void *pJoinParams;
103 	tstrRSSI strRssi;
104 	u64 u64Tsf;
105 } tstrNetworkInfo;
106 
107 typedef struct {
108 	u16 u16capability;
109 	u16 u16ConnectStatus;
110 	u16 u16AssocID;
111 	u8 *pu8RespIEs;
112 	u16 u16RespIEsLen;
113 } tstrConnectRespInfo;
114 
115 typedef struct {
116 	u8 au8bssid[6];
117 	u8 *pu8ReqIEs;
118 	size_t ReqIEsLen;
119 	u8 *pu8RespIEs;
120 	u16 u16RespIEsLen;
121 	u16 u16ConnectStatus;
122 } tstrConnectInfo;
123 
124 typedef struct {
125 	u16 u16reason;
126 	u8 *ie;
127 	size_t ie_len;
128 } tstrDisconnectNotifInfo;
129 
130 s32 send_config_pkt(u8 mode, struct wid *wids, u32 count, u32 drv);
131 s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo);
132 s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo);
133 
134 s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
135 		       tstrConnectRespInfo **ppstrConnectRespInfo);
136 s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo);
137 
138 void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length);
139 void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length);
140 void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length);
141 
142 #endif
143