1 /* 2 * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #if !defined(__HOST_DIAG_CORE_LOG_H) 20 #define __HOST_DIAG_CORE_LOG_H 21 22 /**========================================================================= 23 24 \file host_diag_core_log.h 25 26 \brief WLAN UTIL host DIAG logs 27 28 Definitions for WLAN UTIL host diag events 29 30 ========================================================================*/ 31 32 /* $Header$ */ 33 34 /*-------------------------------------------------------------------------- 35 Include Files 36 ------------------------------------------------------------------------*/ 37 #include "qdf_types.h" 38 #include "i_host_diag_core_log.h" 39 40 /*-------------------------------------------------------------------------- 41 Preprocessor definitions and constants 42 ------------------------------------------------------------------------*/ 43 #ifdef __cplusplus 44 extern "C" { 45 #endif /* __cplusplus */ 46 47 /*-------------------------------------------------------------------------- 48 Preprocessor definitions and constants 49 ------------------------------------------------------------------------*/ 50 #define HOST_LOG_MAX_NUM_SSID (21) 51 #define HOST_LOG_MAX_NUM_BSSID (21) 52 #define HOST_LOG_MAX_SSID_SIZE (32) 53 #define HOST_LOG_MAX_BSSID_SIZE (6) 54 #define HOST_LOG_MAX_NUM_CHANNEL (64) 55 #define HOST_LOG_MAX_NUM_HO_CANDIDATE_APS (20) 56 #define HOST_LOG_MAX_WOW_PTRN_SIZE (128) 57 #define HOST_LOG_MAX_WOW_PTRN_MASK_SIZE (16) 58 #define VOS_LOG_PKT_LOG_SIZE (2048) 59 #define HOST_LOG_PKT_LOG_THRESHOLD 40960 60 61 /* Version to be updated whenever format of vos_log_pktlog_info changes */ 62 #define VERSION_LOG_WLAN_PKT_LOG_INFO_C 1 63 64 /*--------------------------------------------------------------------------- 65 This packet contains the scan results of the recent scan operation 66 LOG_WLAN_SCAN_C 0x1496 67 ---------------------------------------------------------------------------*/ 68 typedef struct { 69 log_hdr_type hdr; 70 uint8_t eventId; 71 uint8_t numSsid; 72 uint8_t ssid[HOST_LOG_MAX_NUM_SSID][HOST_LOG_MAX_SSID_SIZE]; 73 uint8_t bssid[HOST_LOG_MAX_NUM_BSSID][HOST_LOG_MAX_BSSID_SIZE]; 74 uint8_t totalSsid; 75 uint8_t minChnTime; 76 uint8_t maxChnTime; 77 uint16_t timeBetweenBgScan; 78 uint8_t BSSMode; 79 uint8_t numChannel; 80 uint8_t channels[HOST_LOG_MAX_NUM_CHANNEL]; 81 uint16_t status; 82 } host_log_scan_pkt_type; 83 84 /*--------------------------------------------------------------------------- 85 This packet contains the information related to IBSS connection setup 86 LOG_WLAN_IBSS_C 0x1497 87 ---------------------------------------------------------------------------*/ 88 typedef struct { 89 log_hdr_type hdr; 90 uint8_t eventId; 91 uint8_t channelSetting; 92 struct qdf_mac_addr bssid; 93 struct qdf_mac_addr peer_macaddr; 94 uint8_t ssid[HOST_LOG_MAX_SSID_SIZE]; 95 uint8_t operatingChannel; 96 uint8_t beaconInterval; 97 uint8_t status; 98 } host_log_ibss_pkt_type; 99 100 /*--------------------------------------------------------------------------- 101 This packet contains the information related to 802.11D 102 LOG_WLAN_80211D_C 0x1498 103 ---------------------------------------------------------------------------*/ 104 typedef struct { 105 log_hdr_type hdr; 106 uint8_t eventId; 107 uint8_t numChannel; 108 uint8_t Channels[HOST_LOG_MAX_NUM_CHANNEL]; 109 uint8_t TxPwr[HOST_LOG_MAX_NUM_CHANNEL]; 110 uint8_t countryCode[3]; 111 uint8_t supportMultipleDomain; 112 } host_log_802_11d_pkt_type; 113 114 /*--------------------------------------------------------------------------- 115 This is a log packet which contains below handoff information: 116 - Current AP + RSSI (if already associated) 117 - Candidate AP + RSSI (before association and when the list is updated) 118 - For each BSSID in candidate list, provide RSSI, QoS and security compatibility 119 LOG_WLAN_HANDOFF_C 0x1499 120 ---------------------------------------------------------------------------*/ 121 typedef struct { 122 uint8_t ssid[9]; 123 uint8_t bssid[HOST_LOG_MAX_BSSID_SIZE]; 124 uint8_t channel_id; 125 uint32_t qos_score; 126 uint32_t sec_score; 127 uint32_t rssi_score; 128 uint32_t overall_score; 129 uint32_t tx_per; /* represented as a % */ 130 uint32_t rx_per; /* represented as a % */ 131 132 } host_log_ho_ap_info; 133 134 typedef struct { 135 log_hdr_type hdr; 136 uint32_t num_aps; 137 host_log_ho_ap_info current_ap_info; 138 host_log_ho_ap_info 139 candidate_ap_info[HOST_LOG_MAX_NUM_HO_CANDIDATE_APS]; 140 } host_log_ho_pkt_type; 141 142 /*--------------------------------------------------------------------------- 143 This packet contains the information related to the EDCA parameters 144 advertised by the AP 145 LOG_WLAN_QOS_EDCA_C 0x149A 146 ---------------------------------------------------------------------------*/ 147 typedef struct { 148 log_hdr_type hdr; 149 uint8_t aci_be; 150 uint8_t cw_be; 151 uint16_t txoplimit_be; 152 uint8_t aci_bk; 153 uint8_t cw_bk; 154 uint16_t txoplimit_bk; 155 uint8_t aci_vi; 156 uint8_t cw_vi; 157 uint16_t txoplimit_vi; 158 uint8_t aci_vo; 159 uint8_t cw_vo; 160 uint16_t txoplimit_vo; 161 } host_log_qos_edca_pkt_type; 162 163 /*--------------------------------------------------------------------------- 164 This packet contains the total number of beacon received value 165 LOG_WLAN_BEACON_UPDATE_C 0x149B 166 ---------------------------------------------------------------------------*/ 167 typedef struct { 168 log_hdr_type hdr; 169 uint32_t bcn_rx_cnt; 170 } host_log_beacon_update_pkt_type; 171 172 /*--------------------------------------------------------------------------- 173 This packet contains the information related to a WoW patern value when set 174 LOG_WLAN_POWERSAVE_WOW_ADD_PTRN_C 0x149C 175 ---------------------------------------------------------------------------*/ 176 typedef struct { 177 log_hdr_type hdr; 178 uint8_t pattern_id; 179 uint8_t pattern_byte_offset; 180 uint8_t pattern_size; 181 uint8_t pattern[HOST_LOG_MAX_WOW_PTRN_SIZE]; 182 uint8_t pattern_mask_size; 183 uint8_t pattern_mask[HOST_LOG_MAX_WOW_PTRN_MASK_SIZE]; 184 } host_log_powersave_wow_add_ptrn_pkt_type; 185 186 /*--------------------------------------------------------------------------- 187 This packet contains the Tspec info negotiated with the AP for the 188 specific AC 189 LOG_WLAN_QOS_TSPEC_C 0x14A2 190 ---------------------------------------------------------------------------*/ 191 typedef struct { 192 log_hdr_type hdr; 193 uint8_t tsinfo[3]; 194 uint16_t nominal_msdu_size; 195 uint16_t maximum_msdu_size; 196 uint32_t min_service_interval; 197 uint32_t max_service_interval; 198 uint32_t inactivity_interval; 199 uint32_t suspension_interval; 200 uint32_t svc_start_time; 201 uint32_t min_data_rate; 202 uint32_t mean_data_rate; 203 uint32_t peak_data_rate; 204 uint32_t max_burst_size; 205 uint32_t delay_bound; 206 uint32_t min_phy_rate; 207 uint16_t surplus_bw_allowance; 208 uint16_t medium_time; 209 } host_log_qos_tspec_pkt_type; 210 211 /*--------------------------------------------------------------------------- 212 This packet contains data information when stall detected 213 LOG_TRSP_DATA_STALL_C 0x1801 214 ---------------------------------------------------------------------------*/ 215 216 typedef struct { 217 char channelName[4]; 218 uint32_t numDesc; 219 uint32_t numFreeDesc; 220 uint32_t numRsvdDesc; 221 uint32_t headDescOrder; 222 uint32_t tailDescOrder; 223 uint32_t ctrlRegVal; 224 uint32_t statRegVal; 225 uint32_t numValDesc; 226 uint32_t numInvalDesc; 227 } host_log_data_stall_channel_type; 228 229 typedef struct { 230 log_hdr_type hdr; 231 uint32_t PowerState; 232 uint32_t numFreeBd; 233 host_log_data_stall_channel_type dxeChannelInfo[4]; 234 } host_log_data_stall_type; 235 236 /*--------------------------------------------------------------------------- 237 This packet contains the rssi value from BSS descriptor 238 LOG_WLAN_RSSI_UPDATE_C 0x1354 239 ---------------------------------------------------------------------------*/ 240 typedef struct { 241 log_hdr_type hdr; 242 int8_t rssi; 243 } host_log_rssi_pkt_type; 244 245 /** 246 * struct host_log_pktlog_info - Packet log info 247 * @log_hdr: Log header 248 * @buf_len: Length of the buffer that follows 249 * @buf: Buffer containing the packet log info 250 * 251 * Structure containing the packet log information 252 * LOG_WLAN_PKT_LOG_INFO_C 0x18E0 253 */ 254 struct host_log_pktlog_info { 255 log_hdr_type log_hdr; 256 uint32_t version; 257 uint32_t seq_no; 258 uint32_t buf_len; 259 uint8_t buf[]; 260 }; 261 262 /*------------------------------------------------------------------------- 263 Function declarations and documenation 264 ------------------------------------------------------------------------*/ 265 266 #ifdef __cplusplus 267 } 268 #endif /* __cplusplus */ 269 #endif /* __HOST_DIAG_CORE_LOG_H */ 270