.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
37 | 37 | * kbase_debugfs_helper_set_attr_from_string - Parse a string to reconfigure an |
---|
38 | 38 | * array |
---|
39 | 39 | * |
---|
| 40 | + * @buf: Input string to parse. Must be nul-terminated! |
---|
| 41 | + * @array: Address of an object that can be accessed like an array. |
---|
| 42 | + * @nelems: Number of elements in the array. |
---|
| 43 | + * @set_attr_fn: Function to be called back for each array element. |
---|
| 44 | + * |
---|
40 | 45 | * The given function is called once for each attribute value found in the |
---|
41 | 46 | * input string. It is not an error if the string specifies fewer attribute |
---|
42 | 47 | * values than the specified number of array elements. |
---|
.. | .. |
---|
45 | 50 | * according to the standard rules (e.g. prefix "0x" for hexadecimal). |
---|
46 | 51 | * Attribute values are separated by one or more space characters. |
---|
47 | 52 | * Additional leading and trailing spaces are ignored. |
---|
48 | | - * |
---|
49 | | - * @buf: Input string to parse. Must be nul-terminated! |
---|
50 | | - * @array: Address of an object that can be accessed like an array. |
---|
51 | | - * @nelems: Number of elements in the array. |
---|
52 | | - * @set_attr_fn: Function to be called back for each array element. |
---|
53 | 53 | * |
---|
54 | 54 | * Return: 0 if success, negative error code otherwise. |
---|
55 | 55 | */ |
---|
.. | .. |
---|
62 | 62 | * debugfs file for any incorrect formats |
---|
63 | 63 | * or wrong values. |
---|
64 | 64 | * |
---|
| 65 | + * @buf: Null-terminated string to validate. |
---|
| 66 | + * |
---|
65 | 67 | * This function is to be used before any writes to debugfs values are done |
---|
66 | 68 | * such that any strings with erroneous values (such as octal 09 or |
---|
67 | 69 | * hexadecimal 0xGH are fully ignored) - without this validation, any correct |
---|
.. | .. |
---|
72 | 74 | * It is largely similar to set_attr_from_string to iterate through the values |
---|
73 | 75 | * of the input string. This function also requires the input string to be |
---|
74 | 76 | * writable. |
---|
75 | | - * |
---|
76 | | - * @buf: Null-terminated string to validate. |
---|
77 | 77 | * |
---|
78 | 78 | * Return: 0 with no error, else -22 (the invalid return value of kstrtoul) if |
---|
79 | 79 | * any value in the string was wrong or with an incorrect format. |
---|
.. | .. |
---|
95 | 95 | * kbase_debugfs_helper_get_attr_to_string - Construct a formatted string |
---|
96 | 96 | * from elements in an array |
---|
97 | 97 | * |
---|
98 | | - * The given function is called once for each array element to get the |
---|
99 | | - * value of the attribute to be inspected. The attribute values are |
---|
100 | | - * written to the buffer as a formatted string of decimal numbers |
---|
101 | | - * separated by spaces and terminated by a linefeed. |
---|
102 | | - * |
---|
103 | 98 | * @buf: Buffer in which to store the formatted output string. |
---|
104 | 99 | * @size: The size of the buffer, in bytes. |
---|
105 | 100 | * @array: Address of an object that can be accessed like an array. |
---|
106 | 101 | * @nelems: Number of elements in the array. |
---|
107 | 102 | * @get_attr_fn: Function to be called back for each array element. |
---|
| 103 | + * |
---|
| 104 | + * The given function is called once for each array element to get the |
---|
| 105 | + * value of the attribute to be inspected. The attribute values are |
---|
| 106 | + * written to the buffer as a formatted string of decimal numbers |
---|
| 107 | + * separated by spaces and terminated by a linefeed. |
---|
108 | 108 | * |
---|
109 | 109 | * Return: Number of characters written excluding the nul terminator. |
---|
110 | 110 | */ |
---|
.. | .. |
---|
116 | 116 | * kbase_debugfs_helper_seq_read - Implements reads from a virtual file for an |
---|
117 | 117 | * array |
---|
118 | 118 | * |
---|
| 119 | + * @sfile: A virtual file previously opened by calling single_open. |
---|
| 120 | + * @nelems: Number of elements in the array. |
---|
| 121 | + * @get_attr_fn: Function to be called back for each array element. |
---|
| 122 | + * |
---|
119 | 123 | * The virtual file must have been opened by calling single_open and passing |
---|
120 | 124 | * the address of an object that can be accessed like an array. |
---|
121 | 125 | * |
---|
.. | .. |
---|
123 | 127 | * value of the attribute to be inspected. The attribute values are |
---|
124 | 128 | * written to the buffer as a formatted string of decimal numbers |
---|
125 | 129 | * separated by spaces and terminated by a linefeed. |
---|
126 | | - * |
---|
127 | | - * @sfile: A virtual file previously opened by calling single_open. |
---|
128 | | - * @nelems: Number of elements in the array. |
---|
129 | | - * @get_attr_fn: Function to be called back for each array element. |
---|
130 | 130 | * |
---|
131 | 131 | * Return: 0 if success, negative error code otherwise. |
---|
132 | 132 | */ |
---|
.. | .. |
---|
138 | 138 | * kbase_debugfs_helper_seq_write - Implements writes to a virtual file for an |
---|
139 | 139 | * array |
---|
140 | 140 | * |
---|
| 141 | + * @file: A virtual file previously opened by calling single_open. |
---|
| 142 | + * @ubuf: Source address in user space. |
---|
| 143 | + * @count: Number of bytes written to the virtual file. |
---|
| 144 | + * @nelems: Number of elements in the array. |
---|
| 145 | + * @set_attr_fn: Function to be called back for each array element. |
---|
| 146 | + * |
---|
141 | 147 | * The virtual file must have been opened by calling single_open and passing |
---|
142 | 148 | * the address of an object that can be accessed like an array. |
---|
143 | 149 | * |
---|
144 | 150 | * The given function is called once for each attribute value found in the |
---|
145 | 151 | * data written to the virtual file. For further details, refer to the |
---|
146 | 152 | * description of set_attr_from_string. |
---|
147 | | - * |
---|
148 | | - * @file: A virtual file previously opened by calling single_open. |
---|
149 | | - * @ubuf: Source address in user space. |
---|
150 | | - * @count: Number of bytes written to the virtual file. |
---|
151 | | - * @nelems: Number of elements in the array. |
---|
152 | | - * @set_attr_fn: Function to be called back for each array element. |
---|
153 | 153 | * |
---|
154 | 154 | * Return: 0 if success, negative error code otherwise. |
---|
155 | 155 | */ |
---|