blob: b8ca56e0a20fee5e026fe5bf8708678715fd0684 [file] [log] [blame]
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +05301/*
2 * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * DOC: wlan_hdd_debugfs_csr.h
30 *
31 * WLAN Host Device Driver implementation to update
32 * debugfs with connect, scan and roam information
33 */
34
35#ifndef _WLAN_HDD_DEBUGFS_CSR_H
36#define _WLAN_HDD_DEBUGFS_CSR_H
37
38#include <wlan_hdd_includes.h>
39
40#ifdef WLAN_DEBUGFS
41
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +053042#define DEBUGFS_CONNECT_INFO_BUF_SIZE (4 * 1024)
Rajeev Kumar Sirasanagandla85f8b022018-03-12 12:52:59 +053043#define DEBUGFS_OFFLOAD_INFO_BUF_SIZE (4 * 1024)
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +053044#define DEBUGFS_ROAM_SCAN_STATS_INFO_BUF_SIZE (4 * 1024)
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +053045
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +053046/**
47 * struct wlan_hdd_debugfs_buffer_info - Debugfs buffer info
48 * @length: current length of the debugfs buffer
49 * @max_buf_len: maximum buffer length of the debugfs buffer
50 * @id: id from enum hdd_debugfs_file_id used to identify file
51 * @data: start of debugfs buffer from which file read starts
52 * @adapter: pointer to adapter
53 *
54 * This structure is used to hold the debugfs buffer details and is stored in
55 * private data of file argument in file open operation.
56 */
57struct wlan_hdd_debugfs_buffer_info {
58 ssize_t length;
59 ssize_t max_buf_len;
60 enum hdd_debugfs_file_id id;
61 uint8_t *data;
62 struct hdd_adapter *adapter;
63};
64
65/**
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +053066 * struct hdd_roam_scan_stats_debugfs_priv - private data for request mgr
67 * @res: pointer to roam scan stats response
68 */
69struct hdd_roam_scan_stats_debugfs_priv {
70 struct wmi_roam_scan_stats_res *roam_scan_stats_res;
71};
72
73/**
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +053074 * wlan_hdd_debugfs_csr_init() - Create wifi diagnostic debugfs files
75 * @adapter: pointer to adapter for which debugfs files are to be created
76 *
77 * Return: None
78 */
79void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter);
80
81/**
82 * wlan_hdd_debugfs_csr_deinit() - Remove wifi diagnostic debugfs files
83 * @adapter: pointer to adapter for which debugfs files are to be removed
84 *
85 * Return: None
86 */
87void wlan_hdd_debugfs_csr_deinit(struct hdd_adapter *adapter);
88
89/**
90 * wlan_hdd_current_time_info_debugfs() - API to get time into user buffer
91 * @buf: output buffer to hold current time when queried
92 * @buf_avail_len: available buffer length
93 *
94 * Return: No.of bytes copied
95 */
96ssize_t
97wlan_hdd_current_time_info_debugfs(uint8_t *buf, ssize_t buf_avail_len);
98
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +053099/**
100 * wlan_hdd_debugfs_update_connect_info() - API to get connect info
101 * into user buffer
102 * @buf: output buffer to hold connect info
103 * @buf_avail_len: available buffer length
104 *
105 * Return: No.of bytes copied
106 */
107ssize_t
108wlan_hdd_debugfs_update_connect_info(struct hdd_context *hdd_ctx,
109 struct hdd_adapter *adapter,
110 uint8_t *buf, ssize_t buf_avail_len);
111
Rajeev Kumar Sirasanagandla85f8b022018-03-12 12:52:59 +0530112/**
113 * wlan_hdd_debugfs_update_filters_info() - API to get offload info
114 * into user buffer
115 * @buf: output buffer to hold offload info
116 * @buf_avail_len: available buffer length
117 *
118 * Return: No.of bytes copied
119 */
120ssize_t
121wlan_hdd_debugfs_update_filters_info(struct hdd_context *hdd_ctx,
122 struct hdd_adapter *adapter,
123 uint8_t *buf, ssize_t buf_avail_len);
124
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +0530125/**
126 * wlan_hdd_debugfs_update_roam_stats() - API to get roam scan stats info
127 * into user buffer
128 * @buf: output buffer to hold roam scan stats info
129 * @buf_avail_len: available buffer length
130 *
131 * Return: No.of bytes copied
132 */
133ssize_t
134wlan_hdd_debugfs_update_roam_stats(struct hdd_context *hdd_ctx,
135 struct hdd_adapter *adapter,
136 uint8_t *buf, ssize_t buf_avail_len);
137
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +0530138#else
139/**
140 * wlan_hdd_debugfs_csr_init() - Create wifi diagnostic debugfs files
141 * @adapter: pointer to adapter for which debugfs files are to be created
142 *
143 * Return: None
144 */
145static inline void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter)
146{
147}
148
149/**
150 * wlan_hdd_debugfs_csr_deinit() - Remove wifi diagnostic debugfs files
151 * @adapter: pointer to adapter for which debugfs files are to be removed
152 *
153 * Return: None
154 */
155static inline void wlan_hdd_debugfs_csr_deinit(struct hdd_adapter *adapter)
156{
157}
158
159/**
160 * wlan_hdd_current_time_info_debugfs() - API to get time into user buffer
161 * @buf: output buffer to hold current time when queried
162 * @buf_avail_len: available buffer length
163 *
164 * Return: No.of bytes copied
165 */
166static inline ssize_t
167wlan_hdd_current_time_info_debugfs(uint8_t *buf, ssize_t buf_avail_len)
168{
169 return 0;
170}
171
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +0530172/**
173 * wlan_hdd_debugfs_update_connect_info() - API to get connect info
174 * into user buffer
175 * @buf: output buffer to hold connect info
176 * @buf_avail_len: available buffer length
177 *
178 * Return: No.of bytes copied
179 */
180static inline ssize_t
181wlan_hdd_debugfs_update_connect_info(struct hdd_context *hdd_ctx,
182 struct hdd_adapter *adapter,
183 uint8_t *buf, ssize_t buf_avail_len)
184{
185 return 0;
186}
187
Rajeev Kumar Sirasanagandla85f8b022018-03-12 12:52:59 +0530188/**
189 * wlan_hdd_debugfs_update_filters_info() - API to get offload info
190 * into user buffer
191 * @buf: output buffer to hold offload info
192 * @buf_avail_len: available buffer length
193 *
194 * Return: No.of bytes copied
195 */
196static inline ssize_t
197wlan_hdd_debugfs_update_filters_info(struct hdd_context *hdd_ctx,
198 struct hdd_adapter *adapter,
199 uint8_t *buf, ssize_t buf_avail_len)
200{
201 return 0;
202}
203
Rajeev Kumar Sirasanagandla4f20b672018-03-12 13:52:50 +0530204/**
205 * wlan_hdd_debugfs_update_roam_stats() - API to get roam scan stats info
206 * into user buffer
207 * @buf: output buffer to hold roam scan stats info
208 * @buf_avail_len: available buffer length
209 *
210 * Return: No.of bytes copied
211 */
212static inline ssize_t
213wlan_hdd_debugfs_update_roam_stats(struct hdd_context *hdd_ctx,
214 struct hdd_adapter *adapter,
215 uint8_t *buf, ssize_t buf_avail_len)
216{
217 return 0;
218}
219
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +0530220#endif
221
222#endif /* _WLAN_HDD_DEBUGFS_CSR_H */