hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hid/intel-ish-hid/ishtp/client.h
....@@ -1,16 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * ISHTP client logic
34 *
45 * Copyright (c) 2003-2016, 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.
146 */
157
168 #ifndef _ISHTP_CLIENT_H_
....@@ -18,15 +10,6 @@
1810
1911 #include <linux/types.h>
2012 #include "ishtp-dev.h"
21
-
22
-/* Client state */
23
-enum cl_state {
24
- ISHTP_CL_INITIALIZING = 0,
25
- ISHTP_CL_CONNECTING,
26
- ISHTP_CL_CONNECTED,
27
- ISHTP_CL_DISCONNECTING,
28
- ISHTP_CL_DISCONNECTED
29
-};
3013
3114 /* Tx and Rx ring size */
3215 #define CL_DEF_RX_RING_SIZE 2
....@@ -84,6 +67,7 @@
8467 /* Client Tx buffers list */
8568 unsigned int tx_ring_size;
8669 struct ishtp_cl_tx_ring tx_list, tx_free_list;
70
+ int tx_ring_free_size;
8771 spinlock_t tx_list_spinlock;
8872 spinlock_t tx_free_list_spinlock;
8973 size_t tx_offs; /* Offset in buffer at head of 'tx_list' */
....@@ -125,7 +109,7 @@
125109 };
126110
127111 /* Client connection managenment internal functions */
128
-int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, uuid_le *uuid);
112
+int ishtp_can_client_connect(struct ishtp_device *ishtp_dev, guid_t *uuid);
129113 int ishtp_fw_cl_by_id(struct ishtp_device *dev, uint8_t client_id);
130114 void ishtp_cl_send_msg(struct ishtp_device *dev, struct ishtp_cl *cl);
131115 void recv_ishtp_cl_msg(struct ishtp_device *dev,
....@@ -137,6 +121,8 @@
137121 int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl);
138122 void ishtp_cl_free_rx_ring(struct ishtp_cl *cl);
139123 void ishtp_cl_free_tx_ring(struct ishtp_cl *cl);
124
+int ishtp_cl_get_tx_free_buffer_size(struct ishtp_cl *cl);
125
+int ishtp_cl_get_tx_free_rings(struct ishtp_cl *cl);
140126
141127 /* DMA I/F functions */
142128 void recv_ishtp_cl_msg_dma(struct ishtp_device *dev, void *msg,
....@@ -165,18 +151,5 @@
165151 (cl1->host_client_id == cl2->host_client_id) &&
166152 (cl1->fw_client_id == cl2->fw_client_id);
167153 }
168
-
169
-/* exported functions from ISHTP under client management scope */
170
-struct ishtp_cl *ishtp_cl_allocate(struct ishtp_device *dev);
171
-void ishtp_cl_free(struct ishtp_cl *cl);
172
-int ishtp_cl_link(struct ishtp_cl *cl, int id);
173
-void ishtp_cl_unlink(struct ishtp_cl *cl);
174
-int ishtp_cl_disconnect(struct ishtp_cl *cl);
175
-int ishtp_cl_connect(struct ishtp_cl *cl);
176
-int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length);
177
-int ishtp_cl_flush_queues(struct ishtp_cl *cl);
178
-
179
-/* exported functions from ISHTP client buffer management scope */
180
-int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb);
181154
182155 #endif /* _ISHTP_CLIENT_H_ */