Even Xu a3a44d2d3a HID: Intel-ish-hid: Ishtp: Add helper functions for client connection
For every ishtp client driver during initialization state, the flow is:
1 - Allocate an ISHTP client instance
2 - Reserve a host id and link the client instance
3 - Search a firmware client using UUID and get related
    client information
4 - Bind firmware client id to the ISHTP client instance
5 - Set the state the ISHTP client instance to CONNECTING
6 - Send connect request to firmware
7 - Register event callback for messages from the firmware

During deinitizalization state, the flow is:
9 - Set the state the ISHTP client instance to ISHTP_CL_DISCONNECTING
10 - Issue disconnect request to firmware
11 - Unlike the client instance
12 - Flush message queue
13 - Free ISHTP client instance

Step 2-7 are identical to the steps of client driver initialization
and driver reset flow, but reallocation of the RX/TX ring buffers
can be avoided in reset flow.

Also for step 9-12, they are identical to the steps of client driver
failure handling after connect request, driver reset flow and
driver removing.

So, add two helper functions to simplify client driver code.
ishtp_cl_establish_connection()
ishtp_cl_destroy_connection()

No functional changes are expected.

Signed-off-by: Even Xu <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
2023-12-06 11:33:45 +01:00
..
2023-11-02 14:05:18 -10:00
2023-11-07 16:56:10 -08:00
2023-11-07 08:14:57 -07:00
2023-11-01 14:46:51 -10:00
2023-11-01 14:46:51 -10:00
2023-11-07 20:45:12 +01:00
2023-11-03 18:56:51 -10:00
2023-10-30 19:09:55 -10:00
2023-11-09 13:47:52 -08:00
2023-11-17 13:58:26 -08:00
2023-10-31 18:32:51 -10:00
2023-11-03 15:44:25 -10:00
2023-10-31 17:44:17 -10:00
2023-11-04 16:25:36 -10:00
2023-11-02 15:20:30 -10:00
2023-11-09 14:18:42 -08:00
2023-11-09 13:37:28 -08:00
2023-10-30 19:09:55 -10:00
2023-11-09 13:47:52 -08:00
2023-11-03 10:07:39 -10:00
2023-11-05 18:45:32 -08:00
2023-11-06 15:06:06 -08:00
2023-11-09 13:37:28 -08:00
2023-11-02 14:40:51 -10:00
2023-11-10 09:19:46 -08:00
2023-11-04 16:20:36 -10:00
2023-11-10 12:22:14 -08:00
2023-11-03 19:06:12 -10:00
2023-11-01 14:46:51 -10:00
2023-11-03 16:00:42 -10:00
2023-10-30 13:14:27 +00:00
2023-11-05 18:49:40 -08:00
2023-10-25 16:50:11 +02:00
2023-11-03 10:07:39 -10:00
2023-11-03 19:10:41 -10:00
2023-11-10 11:44:38 -08:00
2023-11-09 13:47:52 -08:00
2023-11-02 15:13:50 -10:00
2023-11-10 09:19:46 -08:00
2023-11-03 16:00:42 -10:00
2023-11-04 15:58:13 -10:00
2023-11-10 09:19:46 -08:00
2023-11-10 09:19:46 -08:00
2023-11-10 09:19:46 -08:00