Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 1 | /* |
Ashish Kumar Dhanotiya | 9fbe737 | 2018-07-27 19:09:32 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 3 | * |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -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 | |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 19 | /** |
| 20 | * DOC: wlan_hdd_debugfs_llstat.h |
| 21 | * |
| 22 | * WLAN Host Device Driver implementation to update |
| 23 | * debugfs with Link Layer statistics |
| 24 | */ |
| 25 | |
| 26 | #ifndef _WLAN_HDD_DEBUGFS_LLSTAT_H |
| 27 | #define _WLAN_HDD_DEBUGFS_LLSTAT_H |
| 28 | |
Ashish Kumar Dhanotiya | 9fbe737 | 2018-07-27 19:09:32 +0530 | [diff] [blame] | 29 | #define DEBUGFS_LLSTATS_BUF_SIZE 12288 |
Yingying Tang | 7ccf7d0 | 2017-03-22 17:01:46 +0800 | [diff] [blame] | 30 | #define DEBUGFS_LLSTATS_REQID 4294967295UL |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 31 | #define DEBUGFS_LLSTATS_REQMASK 0x7 |
| 32 | |
| 33 | #include <wlan_hdd_main.h> |
| 34 | |
| 35 | #if defined(WLAN_FEATURE_LINK_LAYER_STATS) && defined(WLAN_DEBUGFS) |
| 36 | /** |
| 37 | * hdd_debugfs_process_peer_stats() - Parse Peer stats and add it to buffer |
| 38 | * @adapter: Pointer to device adapter |
| 39 | * @data: Pointer to stats data |
| 40 | * |
| 41 | * Receiving Link Layer peer statistics from FW. This function stores the |
| 42 | * firmware data in a buffer to be written into debugfs. |
| 43 | * |
| 44 | * Return: None |
| 45 | */ |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 46 | void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, void *data); |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * hdd_debugfs_process_radio_stats() - Parse Radio stats and add it to buffer |
| 50 | * @adapter: Pointer to device adapter |
| 51 | * @more_data: More data |
| 52 | * @data: Pointer to stats data |
| 53 | * @num_radio: Number of radios |
| 54 | * |
| 55 | * Receiving Link Layer Radio statistics from FW. This function stores the |
| 56 | * firmware data in a buffer to be written into debugfs. |
| 57 | * |
| 58 | * Return: None |
| 59 | */ |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 60 | void hdd_debugfs_process_radio_stats(struct hdd_adapter *adapter, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 61 | uint32_t more_data, void *data, uint32_t num_radio); |
| 62 | |
| 63 | /** |
| 64 | * hdd_link_layer_process_iface_stats() - This function is called after |
| 65 | * @adapter: Pointer to device adapter |
| 66 | * @data: Pointer to stats data |
| 67 | * @num_peers: Number of peers |
| 68 | * |
| 69 | * Receiving Link Layer Interface statistics from FW.This function converts |
| 70 | * the firmware data to the NL data and sends the same to the kernel/upper |
| 71 | * layers. |
| 72 | * |
| 73 | * Return: None |
| 74 | */ |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 75 | void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 76 | void *data, uint32_t num_peers); |
| 77 | |
| 78 | /** |
| 79 | * wlan_hdd_create_ll_stats_file() - API to create Link Layer stats file |
| 80 | * @adapter: interface adapter pointer |
| 81 | * |
| 82 | * Return: 0 on success and errno on failure |
| 83 | */ |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 84 | int wlan_hdd_create_ll_stats_file(struct hdd_adapter *adapter); |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 85 | #else |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 86 | static inline void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 87 | void *data) |
| 88 | { |
| 89 | } |
| 90 | |
| 91 | static inline void hdd_debugfs_process_radio_stats( |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 92 | struct hdd_adapter *adapter, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 93 | uint32_t more_data, void *data, uint32_t num_radio) |
| 94 | { |
| 95 | } |
| 96 | |
| 97 | static inline void hdd_debugfs_process_iface_stats( |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 98 | struct hdd_adapter *adapter, |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 99 | void *data, uint32_t num_peers) |
| 100 | { |
| 101 | } |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 102 | static inline int wlan_hdd_create_ll_stats_file(struct hdd_adapter *adapter) |
Krishna Kumaar Natarajan | c7e2bb7 | 2017-03-10 10:38:46 -0800 | [diff] [blame] | 103 | { |
| 104 | return 0; |
| 105 | } |
| 106 | #endif |
| 107 | #endif /* #ifndef _WLAN_HDD_DEBUGFS_LLSTAT_H */ |