1 /*
2 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
3 *
4 * 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
19 /**
20 * DOC: qdf_vfs
21 * QCA driver framework (QDF) virtual filesystem management APIs
22 */
23
24 #if !defined(__QDF_VFS_H)
25 #define __QDF_VFS_H
26
27 /* Include Files */
28 #include <qdf_types.h>
29
30 struct qdf_vfs_attr;
31 struct qdf_vf_bin_attr;
32 struct qdf_dev_obj;
33
34 #ifdef ENHANCED_OS_ABSTRACTION
35 /**
36 * qdf_vfs_set_file_attributes() - set file attributes
37 * @devobj: Device object
38 * @attr: File attribute
39 *
40 * This function will set the attributes of a file
41 *
42 * Return: QDF_STATUS_SUCCESS on success
43 */
44 QDF_STATUS
45 qdf_vfs_set_file_attributes(struct qdf_dev_obj *devobj,
46 struct qdf_vfs_attr *attr);
47
48 /**
49 * qdf_vfs_clear_file_attributes() - clear file attributes
50 * @devobj: Device object
51 * @attr: File attribute
52 *
53 * This function will clear the attributes of a file
54 *
55 * Return: QDF_STATUS_SUCCESS on success
56 */
57 QDF_STATUS
58 qdf_vfs_clear_file_attributes(struct qdf_dev_obj *devobj,
59 struct qdf_vfs_attr *attr);
60
61 /**
62 * qdf_vfs_create_binfile() - create binfile
63 * @devobj: Device object
64 * @attr: File attribute
65 *
66 * This function will create a binary file
67 *
68 * Return: QDF_STATUS_SUCCESS on success
69 */
70 QDF_STATUS
71 qdf_vfs_create_binfile(struct qdf_dev_obj *devobj,
72 struct qdf_vf_bin_attr *attr);
73
74 /**
75 * qdf_vfs_delete_binfile() - delete binfile
76 * @devobj: Device object
77 * @attr: File attribute
78 *
79 * This function will delete a binary file
80 *
81 * Return: QDF_STATUS_SUCCESS on success
82 */
83 QDF_STATUS
84 qdf_vfs_delete_binfile(struct qdf_dev_obj *devobj,
85 struct qdf_vf_bin_attr *attr);
86 #else
87 static inline QDF_STATUS
qdf_vfs_set_file_attributes(struct qdf_dev_obj * devobj,struct qdf_vfs_attr * attr)88 qdf_vfs_set_file_attributes(struct qdf_dev_obj *devobj,
89 struct qdf_vfs_attr *attr)
90 {
91 return __qdf_vfs_set_file_attributes(devobj, attr);
92 }
93
94 static inline QDF_STATUS
qdf_vfs_clear_file_attributes(struct qdf_dev_obj * devobj,struct qdf_vfs_attr * attr)95 qdf_vfs_clear_file_attributes(struct qdf_dev_obj *devobj,
96 struct qdf_vfs_attr *attr)
97 {
98 return __qdf_vfs_clear_file_attributes(devobj, attr);
99 }
100
101 static inline QDF_STATUS
qdf_vfs_create_binfile(struct qdf_dev_obj * devobj,struct qdf_vf_bin_attr * attr)102 qdf_vfs_create_binfile(struct qdf_dev_obj *devobj,
103 struct qdf_vf_bin_attr *attr)
104 {
105 return __qdf_vfs_create_binfile(devobj, attr);
106 }
107
108 static inline QDF_STATUS
qdf_vfs_delete_binfile(struct qdf_dev_obj * devobj,struct qdf_vf_bin_attr * attr)109 qdf_vfs_delete_binfile(struct qdf_dev_obj *devobj,
110 struct qdf_vf_bin_attr *attr)
111 {
112 return __qdf_vfs_delete_binfile(devobj, attr);
113 }
114 #endif
115 #endif /* __QDF_VFS_H */
116