ap_bus.h (50501936288d6a29d7ef78f25d00e33240fad45f) ap_bus.h (5ac8c72462cdad56e37981eb2172c5baa1ea40d6)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright IBM Corp. 2006, 2019
3 * Copyright IBM Corp. 2006, 2023
4 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
5 * Martin Schwidefsky <schwidefsky@de.ibm.com>
6 * Ralph Wuerthner <rwuerthn@de.ibm.com>
7 * Felix Beck <felix.beck@de.ibm.com>
8 * Holger Dengler <hd@linux.vnet.ibm.com>
9 *
10 * Adjunct processor bus header file.
11 */

--- 50 unchanged lines hidden (view full) ---

62#define AP_RESPONSE_Q_NOT_EMPTY 0x32
63#define AP_RESPONSE_BIND_LIMIT_EXCEEDED 0x33
64#define AP_RESPONSE_INVALID_ASSOC_SECRET 0x34
65#define AP_RESPONSE_ASSOC_SECRET_NOT_UNIQUE 0x35
66#define AP_RESPONSE_ASSOC_FAILED 0x36
67#define AP_RESPONSE_INVALID_DOMAIN 0x42
68
69/*
4 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
5 * Martin Schwidefsky <schwidefsky@de.ibm.com>
6 * Ralph Wuerthner <rwuerthn@de.ibm.com>
7 * Felix Beck <felix.beck@de.ibm.com>
8 * Holger Dengler <hd@linux.vnet.ibm.com>
9 *
10 * Adjunct processor bus header file.
11 */

--- 50 unchanged lines hidden (view full) ---

62#define AP_RESPONSE_Q_NOT_EMPTY 0x32
63#define AP_RESPONSE_BIND_LIMIT_EXCEEDED 0x33
64#define AP_RESPONSE_INVALID_ASSOC_SECRET 0x34
65#define AP_RESPONSE_ASSOC_SECRET_NOT_UNIQUE 0x35
66#define AP_RESPONSE_ASSOC_FAILED 0x36
67#define AP_RESPONSE_INVALID_DOMAIN 0x42
68
69/*
70 * Known device types
70 * Supported AP device types
71 */
71 */
72#define AP_DEVICE_TYPE_PCICC 3
73#define AP_DEVICE_TYPE_PCICA 4
74#define AP_DEVICE_TYPE_PCIXCC 5
75#define AP_DEVICE_TYPE_CEX2A 6
76#define AP_DEVICE_TYPE_CEX2C 7
77#define AP_DEVICE_TYPE_CEX3A 8
78#define AP_DEVICE_TYPE_CEX3C 9
79#define AP_DEVICE_TYPE_CEX4 10
80#define AP_DEVICE_TYPE_CEX5 11
81#define AP_DEVICE_TYPE_CEX6 12
82#define AP_DEVICE_TYPE_CEX7 13
83#define AP_DEVICE_TYPE_CEX8 14
84
85/*
86 * Known function facilities

--- 141 unchanged lines hidden (view full) ---

228 int rapq_fbit; /* fbit arg for next rapq invocation */
229 int last_err_rc; /* last error state response code */
230};
231
232#define to_ap_queue(x) container_of((x), struct ap_queue, ap_dev.device)
233
234typedef enum ap_sm_wait (ap_func_t)(struct ap_queue *queue);
235
72#define AP_DEVICE_TYPE_CEX4 10
73#define AP_DEVICE_TYPE_CEX5 11
74#define AP_DEVICE_TYPE_CEX6 12
75#define AP_DEVICE_TYPE_CEX7 13
76#define AP_DEVICE_TYPE_CEX8 14
77
78/*
79 * Known function facilities

--- 141 unchanged lines hidden (view full) ---

221 int rapq_fbit; /* fbit arg for next rapq invocation */
222 int last_err_rc; /* last error state response code */
223};
224
225#define to_ap_queue(x) container_of((x), struct ap_queue, ap_dev.device)
226
227typedef enum ap_sm_wait (ap_func_t)(struct ap_queue *queue);
228
236/* failure injection cmd struct */
237struct ap_fi {
238 union {
239 u16 cmd; /* fi flags + action */
240 struct {
241 u8 flags; /* fi flags only */
242 u8 action; /* fi action only */
243 };
244 };
245};
246
247/* all currently known fi actions */
248enum ap_fi_actions {
249 AP_FI_ACTION_CCA_AGENT_FF = 0x01,
250 AP_FI_ACTION_CCA_DOM_INVAL = 0x02,
251 AP_FI_ACTION_NQAP_QID_INVAL = 0x03,
252};
253
254/* all currently known fi flags */
255enum ap_fi_flags {
256 AP_FI_FLAG_NO_RETRY = 0x01,
257 AP_FI_FLAG_TOGGLE_SPECIAL = 0x02,
258};
259
260struct ap_message {
261 struct list_head list; /* Request queueing. */
262 unsigned long psmid; /* Message id. */
263 void *msg; /* Pointer to message buffer. */
264 size_t len; /* actual msg len in msg buffer */
265 size_t bufsize; /* allocated msg buffer size */
266 u16 flags; /* Flags, see AP_MSG_FLAG_xxx */
229struct ap_message {
230 struct list_head list; /* Request queueing. */
231 unsigned long psmid; /* Message id. */
232 void *msg; /* Pointer to message buffer. */
233 size_t len; /* actual msg len in msg buffer */
234 size_t bufsize; /* allocated msg buffer size */
235 u16 flags; /* Flags, see AP_MSG_FLAG_xxx */
267 struct ap_fi fi; /* Failure Injection cmd */
268 int rc; /* Return code for this message */
269 void *private; /* ap driver private pointer. */
270 /* receive is called from tasklet context */
271 void (*receive)(struct ap_queue *, struct ap_message *,
272 struct ap_message *);
273};
274
275#define AP_MSG_FLAG_SPECIAL 0x0001 /* flag msg as 'special' with NQAP */

--- 16 unchanged lines hidden (view full) ---

292 * Currently this is the message and private field.
293 */
294static inline void ap_release_message(struct ap_message *ap_msg)
295{
296 kfree_sensitive(ap_msg->msg);
297 kfree_sensitive(ap_msg->private);
298}
299
236 int rc; /* Return code for this message */
237 void *private; /* ap driver private pointer. */
238 /* receive is called from tasklet context */
239 void (*receive)(struct ap_queue *, struct ap_message *,
240 struct ap_message *);
241};
242
243#define AP_MSG_FLAG_SPECIAL 0x0001 /* flag msg as 'special' with NQAP */

--- 16 unchanged lines hidden (view full) ---

260 * Currently this is the message and private field.
261 */
262static inline void ap_release_message(struct ap_message *ap_msg)
263{
264 kfree_sensitive(ap_msg->msg);
265 kfree_sensitive(ap_msg->private);
266}
267
300/*
301 * Note: don't use ap_send/ap_recv after using ap_queue_message
302 * for the first time. Otherwise the ap message queue will get
303 * confused.
304 */
305int ap_send(ap_qid_t qid, unsigned long psmid, void *msg, size_t msglen);
306int ap_recv(ap_qid_t qid, unsigned long *psmid, void *msg, size_t msglen);
307
308enum ap_sm_wait ap_sm_event(struct ap_queue *aq, enum ap_sm_event event);
309enum ap_sm_wait ap_sm_event_loop(struct ap_queue *aq, enum ap_sm_event event);
310
311int ap_queue_message(struct ap_queue *aq, struct ap_message *ap_msg);
312void ap_cancel_message(struct ap_queue *aq, struct ap_message *ap_msg);
313void ap_flush_queue(struct ap_queue *aq);
314
315void *ap_airq_ptr(void);

--- 63 unchanged lines hidden (view full) ---

379/*
380 * ap_parse_mask_str() - helper function to parse a bitmap string
381 * and clear/set the bits in the bitmap accordingly. The string may be
382 * given as absolute value, a hex string like 0x1F2E3D4C5B6A" simple
383 * overwriting the current content of the bitmap. Or as relative string
384 * like "+1-16,-32,-0x40,+128" where only single bits or ranges of
385 * bits are cleared or set. Distinction is done based on the very
386 * first character which may be '+' or '-' for the relative string
268enum ap_sm_wait ap_sm_event(struct ap_queue *aq, enum ap_sm_event event);
269enum ap_sm_wait ap_sm_event_loop(struct ap_queue *aq, enum ap_sm_event event);
270
271int ap_queue_message(struct ap_queue *aq, struct ap_message *ap_msg);
272void ap_cancel_message(struct ap_queue *aq, struct ap_message *ap_msg);
273void ap_flush_queue(struct ap_queue *aq);
274
275void *ap_airq_ptr(void);

--- 63 unchanged lines hidden (view full) ---

339/*
340 * ap_parse_mask_str() - helper function to parse a bitmap string
341 * and clear/set the bits in the bitmap accordingly. The string may be
342 * given as absolute value, a hex string like 0x1F2E3D4C5B6A" simple
343 * overwriting the current content of the bitmap. Or as relative string
344 * like "+1-16,-32,-0x40,+128" where only single bits or ranges of
345 * bits are cleared or set. Distinction is done based on the very
346 * first character which may be '+' or '-' for the relative string
387 * and othewise assume to be an absolute value string. If parsing fails
347 * and otherwise assume to be an absolute value string. If parsing fails
388 * a negative errno value is returned. All arguments and bitmaps are
389 * big endian order.
390 */
391int ap_parse_mask_str(const char *str,
392 unsigned long *bitmap, int bits,
393 struct mutex *lock);
394
395/*

--- 15 unchanged lines hidden ---
348 * a negative errno value is returned. All arguments and bitmaps are
349 * big endian order.
350 */
351int ap_parse_mask_str(const char *str,
352 unsigned long *bitmap, int bits,
353 struct mutex *lock);
354
355/*

--- 15 unchanged lines hidden ---