11a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2b8b572e1SStephen Rothwell /*
3b8b572e1SStephen Rothwell  * hvcserver.h
4b8b572e1SStephen Rothwell  * Copyright (C) 2004 Ryan S Arnold, IBM Corporation
5b8b572e1SStephen Rothwell  *
6b8b572e1SStephen Rothwell  * PPC64 virtual I/O console server support.
7b8b572e1SStephen Rothwell  */
8b8b572e1SStephen Rothwell 
9b8b572e1SStephen Rothwell #ifndef _PPC64_HVCSERVER_H
10b8b572e1SStephen Rothwell #define _PPC64_HVCSERVER_H
11b8b572e1SStephen Rothwell #ifdef __KERNEL__
12b8b572e1SStephen Rothwell 
13b8b572e1SStephen Rothwell #include <linux/list.h>
14b8b572e1SStephen Rothwell 
15b8b572e1SStephen Rothwell /* Converged Location Code length */
16b8b572e1SStephen Rothwell #define HVCS_CLC_LENGTH	79
17b8b572e1SStephen Rothwell 
18b8b572e1SStephen Rothwell /**
19b8b572e1SStephen Rothwell  * hvcs_partner_info - an element in a list of partner info
20b8b572e1SStephen Rothwell  * @node: list_head denoting this partner_info struct's position in the list of
21b8b572e1SStephen Rothwell  *	partner info.
22b8b572e1SStephen Rothwell  * @unit_address: The partner unit address of this entry.
23b8b572e1SStephen Rothwell  * @partition_ID: The partner partition ID of this entry.
24b8b572e1SStephen Rothwell  * @location_code: The converged location code of this entry + 1 char for the
25b8b572e1SStephen Rothwell  *	null-term.
26b8b572e1SStephen Rothwell  *
27b8b572e1SStephen Rothwell  * This structure outlines the format that partner info is presented to a caller
28b8b572e1SStephen Rothwell  * of the hvcs partner info fetching functions.  These are strung together into
29b8b572e1SStephen Rothwell  * a list using linux kernel lists.
30b8b572e1SStephen Rothwell  */
31b8b572e1SStephen Rothwell struct hvcs_partner_info {
32b8b572e1SStephen Rothwell 	struct list_head node;
33b8b572e1SStephen Rothwell 	uint32_t unit_address;
34b8b572e1SStephen Rothwell 	uint32_t partition_ID;
35b8b572e1SStephen Rothwell 	char location_code[HVCS_CLC_LENGTH + 1]; /* CLC + 1 null-term char */
36b8b572e1SStephen Rothwell };
37b8b572e1SStephen Rothwell 
38b8b572e1SStephen Rothwell extern int hvcs_free_partner_info(struct list_head *head);
39b8b572e1SStephen Rothwell extern int hvcs_get_partner_info(uint32_t unit_address,
40b8b572e1SStephen Rothwell 		struct list_head *head, unsigned long *pi_buff);
41b8b572e1SStephen Rothwell extern int hvcs_register_connection(uint32_t unit_address,
42b8b572e1SStephen Rothwell 		uint32_t p_partition_ID, uint32_t p_unit_address);
43b8b572e1SStephen Rothwell extern int hvcs_free_connection(uint32_t unit_address);
44b8b572e1SStephen Rothwell 
45b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
46b8b572e1SStephen Rothwell #endif /* _PPC64_HVCSERVER_H */
47