forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/misc/mei/client.h
....@@ -1,17 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
2
- *
3
+ * Copyright (c) 2003-2018, Intel Corporation. All rights reserved.
34 * Intel Management Engine Interface (Intel MEI) Linux driver
4
- * Copyright (c) 2003-2012, Intel Corporation.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms and conditions of the GNU General Public License,
8
- * version 2, as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
14
- *
155 */
166
177 #ifndef _MEI_CLIENT_H_
....@@ -79,6 +69,54 @@
7969 return me_cl->props.protocol_version;
8070 }
8171
72
+/**
73
+ * mei_me_cl_max_conn - return me client max number of connections
74
+ *
75
+ * @me_cl: me client
76
+ *
77
+ * Return: me client max number of connections
78
+ */
79
+static inline u8 mei_me_cl_max_conn(const struct mei_me_client *me_cl)
80
+{
81
+ return me_cl->props.max_number_of_connections;
82
+}
83
+
84
+/**
85
+ * mei_me_cl_fixed - return me client fixed address, if any
86
+ *
87
+ * @me_cl: me client
88
+ *
89
+ * Return: me client fixed address
90
+ */
91
+static inline u8 mei_me_cl_fixed(const struct mei_me_client *me_cl)
92
+{
93
+ return me_cl->props.fixed_address;
94
+}
95
+
96
+/**
97
+ * mei_me_cl_vt - return me client vtag supported status
98
+ *
99
+ * @me_cl: me client
100
+ *
101
+ * Return: true if me client supports vt tagging
102
+ */
103
+static inline bool mei_me_cl_vt(const struct mei_me_client *me_cl)
104
+{
105
+ return me_cl->props.vt_supported == 1;
106
+}
107
+
108
+/**
109
+ * mei_me_cl_max_len - return me client max msg length
110
+ *
111
+ * @me_cl: me client
112
+ *
113
+ * Return: me client max msg length
114
+ */
115
+static inline u32 mei_me_cl_max_len(const struct mei_me_client *me_cl)
116
+{
117
+ return me_cl->props.max_msg_length;
118
+}
119
+
82120 /*
83121 * MEI IO Functions
84122 */
....@@ -95,8 +133,11 @@
95133
96134 struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev);
97135
98
-struct mei_cl_cb *mei_cl_read_cb(const struct mei_cl *cl,
99
- const struct file *fp);
136
+struct mei_cl_cb *mei_cl_read_cb(struct mei_cl *cl, const struct file *fp);
137
+
138
+void mei_cl_add_rd_completed(struct mei_cl *cl, struct mei_cl_cb *cb);
139
+void mei_cl_del_rd_completed(struct mei_cl *cl, struct mei_cl_cb *cb);
140
+
100141 struct mei_cl_cb *mei_cl_alloc_cb(struct mei_cl *cl, size_t length,
101142 enum mei_cb_file_ops type,
102143 const struct file *fp);
....@@ -105,6 +146,9 @@
105146 const struct file *fp);
106147 int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp);
107148
149
+struct mei_cl_vtag *mei_cl_vtag_alloc(struct file *fp, u8 vtag);
150
+const struct file *mei_cl_fp_by_vtag(const struct mei_cl *cl, u8 vtag);
151
+int mei_cl_vt_support_check(const struct mei_cl *cl);
108152 /*
109153 * MEI input output function prototype
110154 */