linux/drivers/staging/wilc1000/coreconfigurator.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2
   3/*!
   4 *  @file       coreconfigurator.h
   5 *  @brief
   6 *  @author
   7 *  @sa         coreconfigurator.c
   8 *  @date       1 Mar 2012
   9 *  @version    1.0
  10 */
  11
  12#ifndef CORECONFIGURATOR_H
  13#define CORECONFIGURATOR_H
  14
  15#include "wilc_wlan_if.h"
  16
  17#define NUM_BASIC_SWITCHES      45
  18#define NUM_FHSS_SWITCHES       0
  19
  20#define NUM_RSSI                5
  21
  22#ifdef MAC_802_11N
  23#define NUM_11N_BASIC_SWITCHES  25
  24#define NUM_11N_HUT_SWITCHES    47
  25#else
  26#define NUM_11N_BASIC_SWITCHES  0
  27#define NUM_11N_HUT_SWITCHES    0
  28#endif
  29
  30#define MAC_HDR_LEN             24
  31#define MAX_SSID_LEN            33
  32#define FCS_LEN                 4
  33#define TIME_STAMP_LEN          8
  34#define BEACON_INTERVAL_LEN     2
  35#define CAP_INFO_LEN            2
  36#define STATUS_CODE_LEN         2
  37#define AID_LEN                 2
  38#define IE_HDR_LEN              2
  39
  40#define SET_CFG              0
  41#define GET_CFG              1
  42
  43#define MAX_STRING_LEN               256
  44#define MAX_SURVEY_RESULT_FRAG_SIZE  MAX_STRING_LEN
  45#define SURVEY_RESULT_LENGTH         44
  46#define MAX_ASSOC_RESP_FRAME_SIZE    MAX_STRING_LEN
  47
  48#define MAC_CONNECTED                1
  49#define MAC_DISCONNECTED             0
  50
  51#define MAKE_WORD16(lsb, msb) ((((u16)(msb) << 8) & 0xFF00) | (lsb))
  52#define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
  53
  54enum connect_status {
  55        SUCCESSFUL_STATUSCODE    = 0,
  56        UNSPEC_FAIL              = 1,
  57        UNSUP_CAP                = 10,
  58        REASOC_NO_ASOC           = 11,
  59        FAIL_OTHER               = 12,
  60        UNSUPT_ALG               = 13,
  61        AUTH_SEQ_FAIL            = 14,
  62        CHLNG_FAIL               = 15,
  63        AUTH_TIMEOUT             = 16,
  64        AP_FULL                  = 17,
  65        UNSUP_RATE               = 18,
  66        SHORT_PREAMBLE_UNSUP     = 19,
  67        PBCC_UNSUP               = 20,
  68        CHANNEL_AGIL_UNSUP       = 21,
  69        SHORT_SLOT_UNSUP         = 25,
  70        OFDM_DSSS_UNSUP          = 26,
  71        CONNECT_STS_FORCE_16_BIT = 0xFFFF
  72};
  73
  74struct rssi_history_buffer {
  75        bool full;
  76        u8 index;
  77        s8 samples[NUM_RSSI];
  78};
  79
  80struct network_info {
  81        s8 rssi;
  82        u16 cap_info;
  83        u8 ssid[MAX_SSID_LEN];
  84        u8 ssid_len;
  85        u8 bssid[6];
  86        u16 beacon_period;
  87        u8 dtim_period;
  88        u8 ch;
  89        unsigned long time_scan_cached;
  90        unsigned long time_scan;
  91        bool new_network;
  92        u8 found;
  93        u32 tsf_lo;
  94        u8 *ies;
  95        u16 ies_len;
  96        void *join_params;
  97        struct rssi_history_buffer rssi_history;
  98        u64 tsf_hi;
  99};
 100
 101struct connect_resp_info {
 102        u16 capability;
 103        u16 status;
 104        u16 assoc_id;
 105        u8 *ies;
 106        u16 ies_len;
 107};
 108
 109struct connect_info {
 110        u8 bssid[6];
 111        u8 *req_ies;
 112        size_t req_ies_len;
 113        u8 *resp_ies;
 114        u16 resp_ies_len;
 115        u16 status;
 116};
 117
 118struct disconnect_info {
 119        u16 reason;
 120        u8 *ie;
 121        size_t ie_len;
 122};
 123
 124s32 wilc_parse_network_info(u8 *msg_buffer,
 125                            struct network_info **ret_network_info);
 126s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len,
 127                               struct connect_resp_info **ret_connect_resp_info);
 128void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length);
 129void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length);
 130void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length);
 131#endif
 132