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