blob: fc43d04ca1dab651ab70e53116378e138ec78229 [file] [log] [blame]
Johnny Kimc5c77ba2015-05-11 14:30:56 +09001
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 Kimc5c77ba2015-05-11 14:30:56 +090011#ifndef CORECONFIGURATOR_H
12#define CORECONFIGURATOR_H
13
Johnny Kimc5c77ba2015-05-11 14:30:56 +090014#include "wilc_wlan_if.h"
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090015
Johnny Kimc5c77ba2015-05-11 14:30:56 +090016#define NUM_BASIC_SWITCHES 45
Stanislav Kholmanskikh13994d12015-06-10 21:57:26 +030017#define NUM_FHSS_SWITCHES 0
Johnny Kimc5c77ba2015-05-11 14:30:56 +090018
Stanislav Kholmanskikh13994d12015-06-10 21:57:26 +030019#define NUM_RSSI 5
Johnny Kimc5c77ba2015-05-11 14:30:56 +090020
21#ifdef MAC_802_11N
22#define NUM_11N_BASIC_SWITCHES 25
23#define NUM_11N_HUT_SWITCHES 47
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090024#else
Johnny Kimc5c77ba2015-05-11 14:30:56 +090025#define NUM_11N_BASIC_SWITCHES 0
26#define NUM_11N_HUT_SWITCHES 0
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090027#endif
Johnny Kimc5c77ba2015-05-11 14:30:56 +090028
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090029#define MAC_HDR_LEN 24
Johnny Kimc5c77ba2015-05-11 14:30:56 +090030#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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090039#define SET_CFG 0
Johnny Kimc5c77ba2015-05-11 14:30:56 +090040#define GET_CFG 1
41
Stanislav Kholmanskikh13994d12015-06-10 21:57:26 +030042#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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090046
Stanislav Kholmanskikh13994d12015-06-10 21:57:26 +030047#define MAC_CONNECTED 1
48#define MAC_DISCONNECTED 0
Johnny Kimc5c77ba2015-05-11 14:30:56 +090049
Chaehyun Limd85f5322015-06-11 14:35:54 +090050#define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb))
Chaehyun Lim4e4467f2015-06-11 14:35:55 +090051#define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
Johnny Kimc5c77ba2015-05-11 14:30:56 +090052
Johnny Kimc5c77ba2015-05-11 14:30:56 +090053typedef enum {
Stanislav Kholmanskikh13994d12015-06-10 21:57:26 +030054 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,
Johnny Kimc5c77ba2015-05-11 14:30:56 +090070 CONNECT_STS_FORCE_16_BIT = 0xFFFF
71} tenuConnectSts;
72
Leo Kime9e0c262015-10-12 16:55:41 +090073struct wid {
Leo Kimdaaf16b2015-10-12 16:55:44 +090074 u16 id;
Glen Lee50327db2015-11-03 16:20:58 +090075 enum wid_type type;
Leo Kim2fd3e442015-10-12 16:55:45 +090076 s32 size;
Leo Kim900bb4a2015-10-12 16:55:46 +090077 s8 *val;
Leo Kime9e0c262015-10-12 16:55:41 +090078};
Johnny Kimc5c77ba2015-05-11 14:30:56 +090079
80typedef struct {
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +090081 u8 u8Full;
82 u8 u8Index;
Chaehyun Limca356ad2015-06-11 14:35:57 +090083 s8 as8RSSI[NUM_RSSI];
Johnny Kimc5c77ba2015-05-11 14:30:56 +090084} tstrRSSI;
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090085
Johnny Kimc5c77ba2015-05-11 14:30:56 +090086typedef struct {
Chaehyun Limca356ad2015-06-11 14:35:57 +090087 s8 s8rssi;
Chaehyun Limd85f5322015-06-11 14:35:54 +090088 u16 u16CapInfo;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +090089 u8 au8ssid[MAX_SSID_LEN];
90 u8 u8SsidLen;
91 u8 au8bssid[6];
Chaehyun Limd85f5322015-06-11 14:35:54 +090092 u16 u16BeaconPeriod;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +090093 u8 u8DtimPeriod;
94 u8 u8channel;
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090095 unsigned long u32TimeRcvdInScanCached;
Johnny Kimc5c77ba2015-05-11 14:30:56 +090096 unsigned long u32TimeRcvdInScan;
Dean Lee72ed4dc2015-06-12 14:11:44 +090097 bool bNewNetwork;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +090098 u8 u8Found;
Chaehyun Lim36cca3b2015-09-22 22:47:42 +090099 u32 u32Tsf;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +0900100 u8 *pu8IEs;
Chaehyun Limd85f5322015-06-11 14:35:54 +0900101 u16 u16IEsLen;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900102 void *pJoinParams;
103 tstrRSSI strRssi;
Chaehyun Lim36cca3b2015-09-22 22:47:42 +0900104 u64 u64Tsf;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900105} tstrNetworkInfo;
106
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900107typedef struct {
Chaehyun Limd85f5322015-06-11 14:35:54 +0900108 u16 u16capability;
109 u16 u16ConnectStatus;
110 u16 u16AssocID;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +0900111 u8 *pu8RespIEs;
Chaehyun Limd85f5322015-06-11 14:35:54 +0900112 u16 u16RespIEsLen;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900113} tstrConnectRespInfo;
114
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900115typedef struct {
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +0900116 u8 au8bssid[6];
117 u8 *pu8ReqIEs;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900118 size_t ReqIEsLen;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +0900119 u8 *pu8RespIEs;
Chaehyun Limd85f5322015-06-11 14:35:54 +0900120 u16 u16RespIEsLen;
121 u16 u16ConnectStatus;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900122} tstrConnectInfo;
123
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900124typedef struct {
Chaehyun Limd85f5322015-06-11 14:35:54 +0900125 u16 u16reason;
Greg Kroah-Hartman63d03e42015-06-02 14:16:04 +0900126 u8 *ie;
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900127 size_t ie_len;
128} tstrDisconnectNotifInfo;
129
Glen Leeec62e6d2015-11-18 15:11:33 +0900130s32 wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids,
131 u32 count, u32 drv);
Arnd Bergmann0e1af732015-11-16 15:04:54 +0100132s32 wilc_parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo);
133s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo);
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900134
Arnd Bergmann0e1af732015-11-16 15:04:54 +0100135s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen,
Joe Perchesb3ff2912015-08-10 14:51:33 -0700136 tstrConnectRespInfo **ppstrConnectRespInfo);
Arnd Bergmann0e1af732015-11-16 15:04:54 +0100137s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo);
Glen Leecd04d222015-12-21 14:18:42 +0900138void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer,
139 u32 u32Length);
140void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer,
141 u32 u32Length);
142void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *pu8Buffer,
143 u32 u32Length);
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900144#endif