blob: 8b7b04eb2eace5f12e6a1c18de2257e2e6afb599 [file] [log] [blame]
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -08001/*
Ashish Kumar Dhanotiya9fbe7372018-07-27 19:09:32 +05302 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -08003 *
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -08004 * 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 Natarajanc7e2bb72017-03-10 10:38:46 -080019/**
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 Dhanotiya9fbe7372018-07-27 19:09:32 +053029#define DEBUGFS_LLSTATS_BUF_SIZE 12288
Yingying Tang7ccf7d02017-03-22 17:01:46 +080030#define DEBUGFS_LLSTATS_REQID 4294967295UL
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080031#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 Johnson85b5c112017-08-11 15:15:23 -070046void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter, void *data);
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080047
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 Johnson85b5c112017-08-11 15:15:23 -070060void hdd_debugfs_process_radio_stats(struct hdd_adapter *adapter,
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080061 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 Johnson85b5c112017-08-11 15:15:23 -070075void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter,
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080076 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 Johnson85b5c112017-08-11 15:15:23 -070084int wlan_hdd_create_ll_stats_file(struct hdd_adapter *adapter);
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080085#else
Jeff Johnson85b5c112017-08-11 15:15:23 -070086static inline void hdd_debugfs_process_peer_stats(struct hdd_adapter *adapter,
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080087 void *data)
88{
89}
90
91static inline void hdd_debugfs_process_radio_stats(
Jeff Johnson85b5c112017-08-11 15:15:23 -070092 struct hdd_adapter *adapter,
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080093 uint32_t more_data, void *data, uint32_t num_radio)
94{
95}
96
97static inline void hdd_debugfs_process_iface_stats(
Jeff Johnson85b5c112017-08-11 15:15:23 -070098 struct hdd_adapter *adapter,
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -080099 void *data, uint32_t num_peers)
100{
101}
Jeff Johnson85b5c112017-08-11 15:15:23 -0700102static inline int wlan_hdd_create_ll_stats_file(struct hdd_adapter *adapter)
Krishna Kumaar Natarajanc7e2bb72017-03-10 10:38:46 -0800103{
104 return 0;
105}
106#endif
107#endif /* #ifndef _WLAN_HDD_DEBUGFS_LLSTAT_H */