History

HID: intel-ish-hid: Move the common functions from client.h

Move the interface functions in client.h to common include. These are already abstracted well to use as is. Also move any associated structures used by these functions.

Srinivas Pandruvada committed 7 years ago

Commit 8991eb31 parent 9a0bc1a3 files · +48 −50Browse files

Unified · Split

3 files
  1. drivers/hid/intel-ish-hid/ishtp/client.h +0 −24
  2. drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h +0 −26
  3. include/linux/intel-ish-client-if.h +48 −0
drivers/hid/intel-ish-hid/ishtp/client.h+0−24
@@ -19,15 +19,6 @@ · 18 unmodified lines
19#include <linux/types.h>19#include <linux/types.h>
20#include "ishtp-dev.h"20#include "ishtp-dev.h"
21 21
22/* Client state */
23enum cl_state {
24 ISHTP_CL_INITIALIZING = 0,
25 ISHTP_CL_CONNECTING,
26 ISHTP_CL_CONNECTED,
27 ISHTP_CL_DISCONNECTING,
28 ISHTP_CL_DISCONNECTED
29};
30
31/* Tx and Rx ring size */22/* Tx and Rx ring size */
32#define CL_DEF_RX_RING_SIZE 223#define CL_DEF_RX_RING_SIZE 2
33#define CL_DEF_TX_RING_SIZE 224#define CL_DEF_TX_RING_SIZE 2
@@ -169,19 +160,4 @@ static inline bool ishtp_cl_cmp_id(const struct ishtp_cl *cl1, · 135 unmodified lines
169 (cl1->fw_client_id == cl2->fw_client_id);160 (cl1->fw_client_id == cl2->fw_client_id);
170}161}
171 162
172/* exported functions from ISHTP under client management scope */
173struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device);
174void ishtp_cl_free(struct ishtp_cl *cl);
175int ishtp_cl_link(struct ishtp_cl *cl);
176void ishtp_cl_unlink(struct ishtp_cl *cl);
177int ishtp_cl_disconnect(struct ishtp_cl *cl);
178int ishtp_cl_connect(struct ishtp_cl *cl);
179int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length);
180int ishtp_cl_flush_queues(struct ishtp_cl *cl);
181
182/* exported functions from ISHTP client buffer management scope */
183int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb);
184bool ishtp_cl_tx_empty(struct ishtp_cl *cl);
185struct ishtp_cl_rb *ishtp_cl_rx_get_rb(struct ishtp_cl *cl);
186
187#endif /* _ISHTP_CLIENT_H_ */163#endif /* _ISHTP_CLIENT_H_ */
drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h+0−26
@@ -79,32 +79,6 @@ struct ishtp_fw_client { · 78 unmodified lines
79 uint8_t client_id;79 uint8_t client_id;
80};80};
81 81
82/**
83 * struct ishtp_msg_data - ISHTP message data struct
84 * @size: Size of data in the *data
85 * @data: Pointer to data
86 */
87struct ishtp_msg_data {
88 uint32_t size;
89 unsigned char *data;
90};
91
92/*
93 * struct ishtp_cl_rb - request block structure
94 * @list: Link to list members
95 * @cl: ISHTP client instance
96 * @buffer: message header
97 * @buf_idx: Index into buffer
98 * @read_time: unused at this time
99 */
100struct ishtp_cl_rb {
101 struct list_head list;
102 struct ishtp_cl *cl;
103 struct ishtp_msg_data buffer;
104 unsigned long buf_idx;
105 unsigned long read_time;
106};
107
108/*82/*
109 * Control info for IPC messages ISHTP/IPC sending FIFO -83 * Control info for IPC messages ISHTP/IPC sending FIFO -
110 * list with inline data buffer84 * list with inline data buffer
include/linux/intel-ish-client-if.h+48−0
@@ -9,6 +9,16 @@ · 8 unmodified lines
9#define _INTEL_ISH_CLIENT_IF_H_9#define _INTEL_ISH_CLIENT_IF_H_
10 10
11struct ishtp_cl_device;11struct ishtp_cl_device;
12struct ishtp_cl;
13
14/* Client state */
15enum cl_state {
16 ISHTP_CL_INITIALIZING = 0,
17 ISHTP_CL_CONNECTING,
18 ISHTP_CL_CONNECTED,
19 ISHTP_CL_DISCONNECTING,
20 ISHTP_CL_DISCONNECTED
21};
12 22
13/**23/**
14 * struct ishtp_cl_device - ISHTP device handle24 * struct ishtp_cl_device - ISHTP device handle
@@ -29,6 +39,32 @@ struct ishtp_cl_driver { · 14 unmodified lines
29 const struct dev_pm_ops *pm;39 const struct dev_pm_ops *pm;
30};40};
31 41
42/**
43 * struct ishtp_msg_data - ISHTP message data struct
44 * @size: Size of data in the *data
45 * @data: Pointer to data
46 */
47struct ishtp_msg_data {
48 uint32_t size;
49 unsigned char *data;
50};
51
52/*
53 * struct ishtp_cl_rb - request block structure
54 * @list: Link to list members
55 * @cl: ISHTP client instance
56 * @buffer: message header
57 * @buf_idx: Index into buffer
58 * @read_time: unused at this time
59 */
60struct ishtp_cl_rb {
61 struct list_head list;
62 struct ishtp_cl *cl;
63 struct ishtp_msg_data buffer;
64 unsigned long buf_idx;
65 unsigned long read_time;
66};
67
32int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,68int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
33 struct module *owner);69 struct module *owner);
34void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);70void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
@@ -40,4 +76,16 @@ struct device *ishtp_device(struct ishtp_cl_device *cl_device); · 5 unmodified lines
40/* Trace interface for clients */76/* Trace interface for clients */
41void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);77void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
42 78
79struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device);
80void ishtp_cl_free(struct ishtp_cl *cl);
81int ishtp_cl_link(struct ishtp_cl *cl);
82void ishtp_cl_unlink(struct ishtp_cl *cl);
83int ishtp_cl_disconnect(struct ishtp_cl *cl);
84int ishtp_cl_connect(struct ishtp_cl *cl);
85int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length);
86int ishtp_cl_flush_queues(struct ishtp_cl *cl);
87int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb);
88bool ishtp_cl_tx_empty(struct ishtp_cl *cl);
89struct ishtp_cl_rb *ishtp_cl_rx_get_rb(struct ishtp_cl *cl);
90
43#endif /* _INTEL_ISH_CLIENT_IF_H_ */91#endif /* _INTEL_ISH_CLIENT_IF_H_ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t