Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Jeff Johnson | bdcf63d | 2018-12-30 14:16:49 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | /** |
| 20 | * DOC : wlan_hdd_stats.h |
| 21 | * |
| 22 | * WLAN Host Device Driver statistics related implementation |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #if !defined(WLAN_HDD_STATS_H) |
| 27 | #define WLAN_HDD_STATS_H |
| 28 | |
| 29 | #include "wlan_hdd_main.h" |
| 30 | |
| 31 | #define INVALID_MCS_IDX 255 |
| 32 | #define MAX_HT_MCS_IDX 8 |
| 33 | #define MAX_VHT_MCS_IDX 10 |
| 34 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | #define DATA_RATE_11AC_MCS_MASK 0x03 |
| 36 | |
| 37 | /* LL stats get request time out value */ |
Mukul Sharma | 71d0c57 | 2016-09-03 15:35:30 +0530 | [diff] [blame] | 38 | #define WLAN_WAIT_TIME_LL_STATS 800 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | |
Himanshu Agarwal | 37e4241 | 2016-07-21 14:35:09 +0530 | [diff] [blame] | 40 | #define WLAN_HDD_TGT_NOISE_FLOOR_DBM (-96) |
| 41 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 42 | /** |
| 43 | * struct index_vht_data_rate_type - vht data rate type |
| 44 | * @beacon_rate_index: Beacon rate index |
| 45 | * @supported_VHT80_rate: VHT80 rate |
| 46 | * @supported_VHT40_rate: VHT40 rate |
| 47 | * @supported_VHT20_rate: VHT20 rate |
| 48 | */ |
| 49 | struct index_vht_data_rate_type { |
| 50 | uint8_t beacon_rate_index; |
| 51 | uint16_t supported_VHT80_rate[2]; |
| 52 | uint16_t supported_VHT40_rate[2]; |
| 53 | uint16_t supported_VHT20_rate[2]; |
| 54 | }; |
| 55 | |
| 56 | /** |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 57 | * enum - data_rate_11ac_max_mcs |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | * @DATA_RATE_11AC_MAX_MCS_7: MCS7 rate |
| 59 | * @DATA_RATE_11AC_MAX_MCS_8: MCS8 rate |
| 60 | * @DATA_RATE_11AC_MAX_MCS_9: MCS9 rate |
| 61 | * @DATA_RATE_11AC_MAX_MCS_NA:i Not applicable |
| 62 | */ |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 63 | enum data_rate_11ac_max_mcs { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 64 | DATA_RATE_11AC_MAX_MCS_7, |
| 65 | DATA_RATE_11AC_MAX_MCS_8, |
| 66 | DATA_RATE_11AC_MAX_MCS_9, |
| 67 | DATA_RATE_11AC_MAX_MCS_NA |
| 68 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * struct index_data_rate_type - non vht data rate type |
| 72 | * @beacon_rate_index: Beacon rate index |
| 73 | * @supported_rate: Supported rate table |
| 74 | */ |
| 75 | struct index_data_rate_type { |
| 76 | uint8_t beacon_rate_index; |
| 77 | uint16_t supported_rate[4]; |
| 78 | }; |
| 79 | |
| 80 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 81 | |
| 82 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 83 | * wlan_hdd_cfg80211_ll_stats_set() - set link layer stats |
| 84 | * @wiphy: Pointer to wiphy |
| 85 | * @wdev: Pointer to wdev |
| 86 | * @data: Pointer to data |
| 87 | * @data_len: Data length |
| 88 | * |
| 89 | * Return: int |
| 90 | */ |
| 91 | int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy, |
| 92 | struct wireless_dev *wdev, |
| 93 | const void *data, |
| 94 | int data_len); |
| 95 | |
| 96 | /** |
| 97 | * wlan_hdd_cfg80211_ll_stats_get() - get link layer stats |
| 98 | * @wiphy: Pointer to wiphy |
| 99 | * @wdev: Pointer to wdev |
| 100 | * @data: Pointer to data |
| 101 | * @data_len: Data length |
| 102 | * |
| 103 | * Return: int |
| 104 | */ |
| 105 | int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy, |
| 106 | struct wireless_dev *wdev, |
| 107 | const void *data, |
| 108 | int data_len); |
| 109 | |
| 110 | |
| 111 | /** |
| 112 | * wlan_hdd_cfg80211_ll_stats_clear() - clear link layer stats |
| 113 | * @wiphy: Pointer to wiphy |
| 114 | * @wdev: Pointer to wdev |
| 115 | * @data: Pointer to data |
| 116 | * @data_len: Data length |
| 117 | * |
| 118 | * Return: int |
| 119 | */ |
| 120 | int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy, |
| 121 | struct wireless_dev *wdev, |
| 122 | const void *data, |
| 123 | int data_len); |
| 124 | |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 125 | void wlan_hdd_clear_link_layer_stats(struct hdd_adapter *adapter); |
| 126 | |
Prashanth Bhatta | 75fa9a1 | 2016-01-11 18:30:08 -0800 | [diff] [blame] | 127 | static inline bool hdd_link_layer_stats_supported(void) |
| 128 | { |
| 129 | return true; |
| 130 | } |
| 131 | |
Zhang Qian | 4ead8f0 | 2017-03-27 14:21:47 +0800 | [diff] [blame] | 132 | /** |
| 133 | * __wlan_hdd_cfg80211_ll_stats_ext_set_param - config monitor parameters |
| 134 | * @wiphy: wiphy handle |
| 135 | * @wdev: wdev handle |
| 136 | * @data: user layer input |
| 137 | * @data_len: length of user layer input |
| 138 | * |
| 139 | * return: 0 success, einval failure |
| 140 | */ |
| 141 | int wlan_hdd_cfg80211_ll_stats_ext_set_param(struct wiphy *wiphy, |
| 142 | struct wireless_dev *wdev, |
| 143 | const void *data, |
| 144 | int data_len); |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 145 | /** |
| 146 | * hdd_get_interface_info() - get interface info |
| 147 | * @adapter: Pointer to device adapter |
| 148 | * @info: Pointer to interface info |
| 149 | * |
| 150 | * Return: bool |
| 151 | */ |
Jeff Johnson | a11f94b | 2017-08-29 14:21:35 -0700 | [diff] [blame] | 152 | bool hdd_get_interface_info(struct hdd_adapter *adapter, |
Jeff Johnson | c9770ee | 2019-03-08 15:56:52 -0800 | [diff] [blame] | 153 | struct wifi_interface_info *info); |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 154 | |
| 155 | /** |
| 156 | * wlan_hdd_ll_stats_get() - Get Link Layer statistics from FW |
| 157 | * @adapter: Pointer to device adapter |
| 158 | * @req_id: request id |
| 159 | * @req_mask: bitmask used by FW for the request |
| 160 | * |
| 161 | * Return: 0 on success and error code otherwise |
| 162 | */ |
Jeff Johnson | a11f94b | 2017-08-29 14:21:35 -0700 | [diff] [blame] | 163 | int wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 164 | uint32_t req_mask); |
| 165 | |
Jeff Johnson | 959f369 | 2018-07-03 17:30:40 -0700 | [diff] [blame] | 166 | /** |
| 167 | * wlan_hdd_cfg80211_link_layer_stats_callback() - This function is called |
| 168 | * @hdd_handle: Handle to HDD context |
| 169 | * @indication_type: Indication type |
| 170 | * @results: Pointer to results |
Dundi Raviteja | e232cf1 | 2018-05-16 18:34:34 +0530 | [diff] [blame] | 171 | * @cookie: Callback context |
Jeff Johnson | 959f369 | 2018-07-03 17:30:40 -0700 | [diff] [blame] | 172 | * |
| 173 | * After receiving Link Layer indications from FW.This callback converts the |
| 174 | * firmware data to the NL data and send the same to the kernel/upper layers. |
| 175 | * |
| 176 | * Return: None |
| 177 | */ |
| 178 | void wlan_hdd_cfg80211_link_layer_stats_callback(hdd_handle_t hdd_handle, |
| 179 | int indication_type, |
Dundi Raviteja | e232cf1 | 2018-05-16 18:34:34 +0530 | [diff] [blame] | 180 | tSirLLStatsResults *results, |
| 181 | void *cookie); |
Jeff Johnson | 959f369 | 2018-07-03 17:30:40 -0700 | [diff] [blame] | 182 | |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 183 | /** |
| 184 | * wlan_hdd_cfg80211_link_layer_stats_ext_callback() - Callback for LL ext |
| 185 | * @ctx: HDD context |
| 186 | * @rsp: msg from FW |
| 187 | * |
| 188 | * This function is an extension of |
| 189 | * wlan_hdd_cfg80211_link_layer_stats_callback. It converts |
| 190 | * monitoring parameters offloaded to NL data and send the same to the |
| 191 | * kernel/upper layers. |
| 192 | * |
| 193 | * Return: None. |
| 194 | */ |
| 195 | void wlan_hdd_cfg80211_link_layer_stats_ext_callback(hdd_handle_t ctx, |
| 196 | tSirLLStatsResults *rsp); |
| 197 | |
| 198 | /** |
| 199 | * hdd_lost_link_info_cb() - callback function to get lost link information |
Jeff Johnson | dc198ec | 2018-07-04 17:39:53 -0700 | [diff] [blame] | 200 | * @hdd_handle: Opaque handle for the HDD context |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 201 | * @lost_link_info: lost link information |
| 202 | * |
| 203 | * Return: none |
| 204 | */ |
Jeff Johnson | dc198ec | 2018-07-04 17:39:53 -0700 | [diff] [blame] | 205 | void hdd_lost_link_info_cb(hdd_handle_t hdd_handle, |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 206 | struct sir_lost_link_info *lost_link_info); |
| 207 | |
| 208 | #else /* WLAN_FEATURE_LINK_LAYER_STATS */ |
Prashanth Bhatta | 75fa9a1 | 2016-01-11 18:30:08 -0800 | [diff] [blame] | 209 | |
Prashanth Bhatta | 75fa9a1 | 2016-01-11 18:30:08 -0800 | [diff] [blame] | 210 | static inline bool hdd_link_layer_stats_supported(void) |
| 211 | { |
| 212 | return false; |
| 213 | } |
| 214 | |
Zhang Qian | 4ead8f0 | 2017-03-27 14:21:47 +0800 | [diff] [blame] | 215 | static inline int |
| 216 | wlan_hdd_cfg80211_ll_stats_ext_set_param(struct wiphy *wiphy, |
| 217 | struct wireless_dev *wdev, |
| 218 | const void *data, |
| 219 | int data_len) |
| 220 | { |
| 221 | return -EINVAL; |
| 222 | } |
| 223 | |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 224 | static inline int |
| 225 | wlan_hdd_ll_stats_get(struct hdd_adapter *adapter, uint32_t req_id, |
| 226 | uint32_t req_mask) |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 227 | { |
| 228 | return -EINVAL; |
| 229 | } |
| 230 | |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 231 | static inline void |
| 232 | wlan_hdd_clear_link_layer_stats(struct hdd_adapter *adapter) |
| 233 | { |
| 234 | } |
| 235 | |
| 236 | static inline void |
Jeff Johnson | 959f369 | 2018-07-03 17:30:40 -0700 | [diff] [blame] | 237 | wlan_hdd_cfg80211_link_layer_stats_callback(hdd_handle_t hdd_handle, |
| 238 | int indication_type, |
Dundi Raviteja | e232cf1 | 2018-05-16 18:34:34 +0530 | [diff] [blame] | 239 | tSirLLStatsResults *results, |
| 240 | void *cookie) |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 241 | { |
| 242 | } |
| 243 | |
| 244 | static inline void |
| 245 | wlan_hdd_cfg80211_link_layer_stats_ext_callback(hdd_handle_t ctx, |
| 246 | tSirLLStatsResults *rsp) |
| 247 | { |
| 248 | } |
| 249 | |
| 250 | static inline void |
Jeff Johnson | dc198ec | 2018-07-04 17:39:53 -0700 | [diff] [blame] | 251 | hdd_lost_link_info_cb(hdd_handle_t hdd_handle, |
Qiwei Cai | 3719efe | 2018-06-11 21:09:29 +0800 | [diff] [blame] | 252 | struct sir_lost_link_info *lost_link_info) |
| 253 | { |
| 254 | } |
| 255 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 256 | #endif /* End of WLAN_FEATURE_LINK_LAYER_STATS */ |
| 257 | |
| 258 | #ifdef WLAN_FEATURE_STATS_EXT |
| 259 | /** |
| 260 | * wlan_hdd_cfg80211_stats_ext_request() - ext stats request |
| 261 | * @wiphy: Pointer to wiphy |
| 262 | * @wdev: Pointer to wdev |
| 263 | * @data: Pointer to data |
| 264 | * @data_len: Data length |
| 265 | * |
| 266 | * Return: int |
| 267 | */ |
| 268 | int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy, |
| 269 | struct wireless_dev *wdev, |
| 270 | const void *data, |
| 271 | int data_len); |
Prashanth Bhatta | 75fa9a1 | 2016-01-11 18:30:08 -0800 | [diff] [blame] | 272 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 273 | #endif /* End of WLAN_FEATURE_STATS_EXT */ |
| 274 | |
| 275 | /** |
| 276 | * wlan_hdd_cfg80211_get_station() - get station statistics |
| 277 | * @wiphy: Pointer to wiphy |
| 278 | * @dev: Pointer to network device |
| 279 | * @mac: Pointer to mac |
| 280 | * @sinfo: Pointer to station info |
| 281 | * |
| 282 | * Return: 0 for success, non-zero for failure |
| 283 | */ |
| 284 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) |
| 285 | int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, |
| 286 | struct net_device *dev, const uint8_t *mac, |
| 287 | struct station_info *sinfo); |
| 288 | #else |
| 289 | int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, |
| 290 | struct net_device *dev, uint8_t *mac, |
| 291 | struct station_info *sinfo); |
| 292 | #endif |
| 293 | |
Himanshu Agarwal | 37e4241 | 2016-07-21 14:35:09 +0530 | [diff] [blame] | 294 | /** |
| 295 | * wlan_hdd_cfg80211_dump_station() - dump station statistics |
| 296 | * @wiphy: Pointer to wiphy |
| 297 | * @dev: Pointer to network device |
| 298 | * @idx: variable to determine whether to get stats or not |
| 299 | * @mac: Pointer to mac |
| 300 | * @sinfo: Pointer to station info |
| 301 | * |
| 302 | * Return: 0 for success, non-zero for failure |
| 303 | */ |
| 304 | int wlan_hdd_cfg80211_dump_station(struct wiphy *wiphy, |
| 305 | struct net_device *dev, |
| 306 | int idx, u8 *mac, |
| 307 | struct station_info *sinfo); |
| 308 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 309 | struct net_device_stats *hdd_get_stats(struct net_device *dev); |
| 310 | |
| 311 | int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy, |
| 312 | struct net_device *dev, |
| 313 | int idx, struct survey_info *survey); |
Nirav Shah | bf1b033 | 2016-05-25 14:27:39 +0530 | [diff] [blame] | 314 | |
| 315 | void hdd_display_hif_stats(void); |
| 316 | void hdd_clear_hif_stats(void); |
| 317 | |
Jeff Johnson | 4584365 | 2018-07-04 12:47:34 -0700 | [diff] [blame] | 318 | /** |
| 319 | * wlan_hdd_cfg80211_stats_ext_callback() - ext stats callback |
| 320 | * @hdd_handle: Opaque handle to HDD context |
| 321 | * @data: ext stats payload |
| 322 | * |
| 323 | * Return: nothing |
| 324 | */ |
| 325 | void wlan_hdd_cfg80211_stats_ext_callback(hdd_handle_t hdd_handle, |
| 326 | struct stats_ext_event *data); |
Arun Khandavalli | 4b55da7 | 2016-07-19 19:55:01 +0530 | [diff] [blame] | 327 | |
lifeng | 6683166 | 2017-05-19 16:01:35 +0800 | [diff] [blame] | 328 | /** |
Jeff Johnson | 4584365 | 2018-07-04 12:47:34 -0700 | [diff] [blame] | 329 | * wlan_hdd_cfg80211_stats_ext2_callback() - stats_ext2_callback |
| 330 | * @hdd_handle: opaque handle to the hdd context |
lifeng | 6683166 | 2017-05-19 16:01:35 +0800 | [diff] [blame] | 331 | * @pmsg: sir_sme_rx_aggr_hole_ind |
| 332 | * |
| 333 | * Return: void |
| 334 | */ |
Jeff Johnson | 4584365 | 2018-07-04 12:47:34 -0700 | [diff] [blame] | 335 | void |
| 336 | wlan_hdd_cfg80211_stats_ext2_callback(hdd_handle_t hdd_handle, |
| 337 | struct sir_sme_rx_aggr_hole_ind *pmsg); |
lifeng | 6683166 | 2017-05-19 16:01:35 +0800 | [diff] [blame] | 338 | |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 339 | /** |
| 340 | * wlan_hdd_get_rcpi() - Wrapper to get current RCPI |
| 341 | * @adapter: adapter upon which the measurement is requested |
| 342 | * @mac: peer addr for which measurement is requested |
| 343 | * @rcpi_value: pointer to where the RCPI should be returned |
| 344 | * @measurement_type: type of rcpi measurement |
| 345 | * |
| 346 | * This is a wrapper function for getting RCPI, invoke this function only |
| 347 | * when rcpi support is enabled in firmware |
| 348 | * |
| 349 | * Return: 0 for success, non-zero for failure |
| 350 | */ |
| 351 | int wlan_hdd_get_rcpi(struct hdd_adapter *adapter, uint8_t *mac, |
| 352 | int32_t *rcpi_value, |
| 353 | enum rcpi_measurement_type measurement_type); |
| 354 | |
tinlin | 9abd17f | 2019-08-14 13:29:44 +0800 | [diff] [blame^] | 355 | #ifdef WLAN_FEATURE_MIB_STATS |
| 356 | /** |
| 357 | * wlan_hdd_get_mib_stats() - Get the mib statistics |
| 358 | * @adapter: adapter upon which the measurement is requested |
| 359 | * |
| 360 | * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error |
| 361 | */ |
| 362 | QDF_STATUS wlan_hdd_get_mib_stats(struct hdd_adapter *adapter); |
| 363 | #endif |
| 364 | |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 365 | /** |
| 366 | * wlan_hdd_get_rssi() - Get the current RSSI |
| 367 | * @adapter: adapter upon which the measurement is requested |
| 368 | * @rssi_value: pointer to where the RSSI should be returned |
| 369 | * |
| 370 | * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error |
| 371 | */ |
| 372 | QDF_STATUS wlan_hdd_get_rssi(struct hdd_adapter *adapter, int8_t *rssi_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 373 | |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 374 | /** |
| 375 | * wlan_hdd_get_snr() - Get the current SNR |
| 376 | * @adapter: adapter upon which the measurement is requested |
| 377 | * @snr: pointer to where the SNR should be returned |
| 378 | * |
| 379 | * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error |
| 380 | */ |
| 381 | QDF_STATUS wlan_hdd_get_snr(struct hdd_adapter *adapter, int8_t *snr); |
| 382 | |
| 383 | /** |
| 384 | * wlan_hdd_get_linkspeed_for_peermac() - Get link speed for a peer |
| 385 | * @adapter: adapter upon which the peer is active |
| 386 | * @mac_address: MAC address of the peer |
| 387 | * @linkspeed: pointer to memory where returned link speed is to be placed |
| 388 | * |
| 389 | * This function will send a query to SME for the linkspeed of the |
| 390 | * given peer, and then wait for the callback to be invoked. |
| 391 | * |
| 392 | * Return: 0 if linkspeed data is available, negative errno otherwise |
| 393 | */ |
| 394 | int wlan_hdd_get_linkspeed_for_peermac(struct hdd_adapter *adapter, |
| 395 | struct qdf_mac_addr *mac_address, |
| 396 | uint32_t *linkspeed); |
| 397 | |
| 398 | /** |
| 399 | * wlan_hdd_get_link_speed() - get link speed |
| 400 | * @adapter: pointer to the adapter |
| 401 | * @link_speed: pointer to link speed |
| 402 | * |
| 403 | * This function fetches per bssid link speed. |
| 404 | * |
| 405 | * Return: if associated, link speed shall be returned. |
| 406 | * if not associated, link speed of 0 is returned. |
| 407 | * On error, error number will be returned. |
| 408 | */ |
| 409 | int wlan_hdd_get_link_speed(struct hdd_adapter *adapter, uint32_t *link_speed); |
| 410 | |
| 411 | /** |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 412 | * wlan_hdd_get_peer_info() - get peer info |
| 413 | * @adapter: hostapd interface |
| 414 | * @macaddress: request peer mac address |
| 415 | * @peer_info_ext: one peer extended info retrieved |
| 416 | * |
| 417 | * This function will call sme_get_peer_info_ext to get peer info |
| 418 | * |
| 419 | * Return: 0 on success, otherwise error value |
| 420 | */ |
| 421 | int wlan_hdd_get_peer_info(struct hdd_adapter *adapter, |
| 422 | struct qdf_mac_addr macaddress, |
| 423 | struct sir_peer_info_ext *peer_info_ext); |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 424 | /** |
| 425 | * wlan_hdd_get_station_stats() - Get station statistics |
| 426 | * @adapter: adapter for which statistics are desired |
| 427 | * |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 428 | * Return: status of operation |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 429 | */ |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 430 | int wlan_hdd_get_station_stats(struct hdd_adapter *adapter); |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 431 | |
| 432 | /** |
| 433 | * wlan_hdd_get_temperature() - get current device temperature |
| 434 | * @adapter: device upon which the request was made |
| 435 | * @temperature: pointer to where the temperature is to be returned |
| 436 | * |
| 437 | * Return: 0 if a temperature value (either current or cached) was |
| 438 | * returned, otherwise a negative errno is returned. |
| 439 | * |
| 440 | */ |
| 441 | int wlan_hdd_get_temperature(struct hdd_adapter *adapter, int *temperature); |
| 442 | |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 443 | /** |
Mohit Khanna | 7032200 | 2018-05-15 19:21:32 -0700 | [diff] [blame] | 444 | * wlan_hdd_display_txrx_stats() - display HDD txrx stats summary |
| 445 | * @hdd_ctx: hdd context |
| 446 | * |
| 447 | * Display TXRX Stats for all adapters |
| 448 | * |
| 449 | * Return: none |
| 450 | */ |
| 451 | void wlan_hdd_display_txrx_stats(struct hdd_context *hdd_ctx); |
Ashish Kumar Dhanotiya | 4c6f6b6 | 2019-04-16 12:59:57 +0530 | [diff] [blame] | 452 | |
| 453 | /** |
| 454 | * hdd_report_max_rate() - Fill the max rate stats in the station info structure |
| 455 | * to be sent to the userspace. |
| 456 | * |
| 457 | * @mac_handle: The mac handle |
Rajeev Kumar Sirasanagandla | e709bca | 2019-04-30 23:36:24 +0530 | [diff] [blame] | 458 | * @rate: The station_info tx/rx rate to be filled |
| 459 | * @signal: signal from station_info |
| 460 | * @rate_flags: TX/RX rate flags computed from tx/rx rate |
| 461 | * @mcs_index; The TX/RX mcs index computed from tx/rx rate |
| 462 | * @fw_rate: The tx/rx rate from fw stats |
| 463 | * @nss: The TX/RX NSS from fw stats |
Ashish Kumar Dhanotiya | 4c6f6b6 | 2019-04-16 12:59:57 +0530 | [diff] [blame] | 464 | * |
Rajeev Kumar Sirasanagandla | e709bca | 2019-04-30 23:36:24 +0530 | [diff] [blame] | 465 | * Return: True if fill is successful |
Ashish Kumar Dhanotiya | 4c6f6b6 | 2019-04-16 12:59:57 +0530 | [diff] [blame] | 466 | */ |
Rajeev Kumar Sirasanagandla | e709bca | 2019-04-30 23:36:24 +0530 | [diff] [blame] | 467 | bool hdd_report_max_rate(mac_handle_t mac_handle, |
| 468 | struct rate_info *rate, |
| 469 | int8_t signal, |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 470 | enum tx_rate_info rate_flags, |
Rajeev Kumar Sirasanagandla | e709bca | 2019-04-30 23:36:24 +0530 | [diff] [blame] | 471 | uint8_t mcs_index, |
| 472 | uint16_t fw_rate, uint8_t nss); |
Ashish Kumar Dhanotiya | 4c6f6b6 | 2019-04-16 12:59:57 +0530 | [diff] [blame] | 473 | |
Hangtian Zhu | cf89c86 | 2019-08-28 10:48:52 +0800 | [diff] [blame] | 474 | #ifdef QCA_SUPPORT_CP_STATS |
Ashish Kumar Dhanotiya | 017e502 | 2019-07-23 20:58:11 +0530 | [diff] [blame] | 475 | /** |
| 476 | * wlan_hdd_register_cp_stats_cb() - Register hdd stats specific |
| 477 | * callbacks to the cp stats component |
| 478 | * @hdd_ctx: hdd context |
| 479 | * |
| 480 | * Return: none |
| 481 | */ |
| 482 | |
| 483 | void wlan_hdd_register_cp_stats_cb(struct hdd_context *hdd_ctx); |
Hangtian Zhu | cf89c86 | 2019-08-28 10:48:52 +0800 | [diff] [blame] | 484 | #else |
| 485 | static inline void wlan_hdd_register_cp_stats_cb(struct hdd_context *hdd_ctx) {} |
| 486 | #endif |
Ashish Kumar Dhanotiya | 017e502 | 2019-07-23 20:58:11 +0530 | [diff] [blame] | 487 | |
Jeff Johnson | 5fe539b | 2018-03-23 13:53:30 -0700 | [diff] [blame] | 488 | #endif /* end #if !defined(WLAN_HDD_STATS_H) */ |