| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * |
|---|
| 3 | + * Copyright (c) 2003-2018, Intel Corporation. All rights reserved. |
|---|
| 3 | 4 | * 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 | | - * |
|---|
| 15 | 5 | */ |
|---|
| 16 | 6 | |
|---|
| 17 | 7 | #ifndef _MEI_CLIENT_H_ |
|---|
| .. | .. |
|---|
| 79 | 69 | return me_cl->props.protocol_version; |
|---|
| 80 | 70 | } |
|---|
| 81 | 71 | |
|---|
| 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 | + |
|---|
| 82 | 120 | /* |
|---|
| 83 | 121 | * MEI IO Functions |
|---|
| 84 | 122 | */ |
|---|
| .. | .. |
|---|
| 95 | 133 | |
|---|
| 96 | 134 | struct mei_cl *mei_cl_alloc_linked(struct mei_device *dev); |
|---|
| 97 | 135 | |
|---|
| 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 | + |
|---|
| 100 | 141 | struct mei_cl_cb *mei_cl_alloc_cb(struct mei_cl *cl, size_t length, |
|---|
| 101 | 142 | enum mei_cb_file_ops type, |
|---|
| 102 | 143 | const struct file *fp); |
|---|
| .. | .. |
|---|
| 105 | 146 | const struct file *fp); |
|---|
| 106 | 147 | int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp); |
|---|
| 107 | 148 | |
|---|
| 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); |
|---|
| 108 | 152 | /* |
|---|
| 109 | 153 | * MEI input output function prototype |
|---|
| 110 | 154 | */ |
|---|