blob: d1b561f8cdc307339d8d0ee931a9038a09b07211 [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 Sirasanagandla4c8edc02018-03-12 08:44:51 +053044
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +053045/**
46 * struct wlan_hdd_debugfs_buffer_info - Debugfs buffer info
47 * @length: current length of the debugfs buffer
48 * @max_buf_len: maximum buffer length of the debugfs buffer
49 * @id: id from enum hdd_debugfs_file_id used to identify file
50 * @data: start of debugfs buffer from which file read starts
51 * @adapter: pointer to adapter
52 *
53 * This structure is used to hold the debugfs buffer details and is stored in
54 * private data of file argument in file open operation.
55 */
56struct wlan_hdd_debugfs_buffer_info {
57 ssize_t length;
58 ssize_t max_buf_len;
59 enum hdd_debugfs_file_id id;
60 uint8_t *data;
61 struct hdd_adapter *adapter;
62};
63
64/**
65 * wlan_hdd_debugfs_csr_init() - Create wifi diagnostic debugfs files
66 * @adapter: pointer to adapter for which debugfs files are to be created
67 *
68 * Return: None
69 */
70void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter);
71
72/**
73 * wlan_hdd_debugfs_csr_deinit() - Remove wifi diagnostic debugfs files
74 * @adapter: pointer to adapter for which debugfs files are to be removed
75 *
76 * Return: None
77 */
78void wlan_hdd_debugfs_csr_deinit(struct hdd_adapter *adapter);
79
80/**
81 * wlan_hdd_current_time_info_debugfs() - API to get time into user buffer
82 * @buf: output buffer to hold current time when queried
83 * @buf_avail_len: available buffer length
84 *
85 * Return: No.of bytes copied
86 */
87ssize_t
88wlan_hdd_current_time_info_debugfs(uint8_t *buf, ssize_t buf_avail_len);
89
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +053090/**
91 * wlan_hdd_debugfs_update_connect_info() - API to get connect info
92 * into user buffer
93 * @buf: output buffer to hold connect info
94 * @buf_avail_len: available buffer length
95 *
96 * Return: No.of bytes copied
97 */
98ssize_t
99wlan_hdd_debugfs_update_connect_info(struct hdd_context *hdd_ctx,
100 struct hdd_adapter *adapter,
101 uint8_t *buf, ssize_t buf_avail_len);
102
Rajeev Kumar Sirasanagandla85f8b022018-03-12 12:52:59 +0530103/**
104 * wlan_hdd_debugfs_update_filters_info() - API to get offload info
105 * into user buffer
106 * @buf: output buffer to hold offload info
107 * @buf_avail_len: available buffer length
108 *
109 * Return: No.of bytes copied
110 */
111ssize_t
112wlan_hdd_debugfs_update_filters_info(struct hdd_context *hdd_ctx,
113 struct hdd_adapter *adapter,
114 uint8_t *buf, ssize_t buf_avail_len);
115
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +0530116#else
117/**
118 * wlan_hdd_debugfs_csr_init() - Create wifi diagnostic debugfs files
119 * @adapter: pointer to adapter for which debugfs files are to be created
120 *
121 * Return: None
122 */
123static inline void wlan_hdd_debugfs_csr_init(struct hdd_adapter *adapter)
124{
125}
126
127/**
128 * wlan_hdd_debugfs_csr_deinit() - Remove wifi diagnostic debugfs files
129 * @adapter: pointer to adapter for which debugfs files are to be removed
130 *
131 * Return: None
132 */
133static inline void wlan_hdd_debugfs_csr_deinit(struct hdd_adapter *adapter)
134{
135}
136
137/**
138 * wlan_hdd_current_time_info_debugfs() - API to get time into user buffer
139 * @buf: output buffer to hold current time when queried
140 * @buf_avail_len: available buffer length
141 *
142 * Return: No.of bytes copied
143 */
144static inline ssize_t
145wlan_hdd_current_time_info_debugfs(uint8_t *buf, ssize_t buf_avail_len)
146{
147 return 0;
148}
149
Rajeev Kumar Sirasanagandla4c8edc02018-03-12 08:44:51 +0530150/**
151 * wlan_hdd_debugfs_update_connect_info() - API to get connect info
152 * into user buffer
153 * @buf: output buffer to hold connect info
154 * @buf_avail_len: available buffer length
155 *
156 * Return: No.of bytes copied
157 */
158static inline ssize_t
159wlan_hdd_debugfs_update_connect_info(struct hdd_context *hdd_ctx,
160 struct hdd_adapter *adapter,
161 uint8_t *buf, ssize_t buf_avail_len)
162{
163 return 0;
164}
165
Rajeev Kumar Sirasanagandla85f8b022018-03-12 12:52:59 +0530166/**
167 * wlan_hdd_debugfs_update_filters_info() - API to get offload info
168 * into user buffer
169 * @buf: output buffer to hold offload info
170 * @buf_avail_len: available buffer length
171 *
172 * Return: No.of bytes copied
173 */
174static inline ssize_t
175wlan_hdd_debugfs_update_filters_info(struct hdd_context *hdd_ctx,
176 struct hdd_adapter *adapter,
177 uint8_t *buf, ssize_t buf_avail_len)
178{
179 return 0;
180}
181
Rajeev Kumar Sirasanagandla197d4172018-02-15 19:03:29 +0530182#endif
183
184#endif /* _WLAN_HDD_DEBUGFS_CSR_H */