18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * hvcserver.h
48c2ecf20Sopenharmony_ci * Copyright (C) 2004 Ryan S Arnold, IBM Corporation
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * PPC64 virtual I/O console server support.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _PPC64_HVCSERVER_H
108c2ecf20Sopenharmony_ci#define _PPC64_HVCSERVER_H
118c2ecf20Sopenharmony_ci#ifdef __KERNEL__
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/list.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* Converged Location Code length */
168c2ecf20Sopenharmony_ci#define HVCS_CLC_LENGTH	79
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/**
198c2ecf20Sopenharmony_ci * hvcs_partner_info - an element in a list of partner info
208c2ecf20Sopenharmony_ci * @node: list_head denoting this partner_info struct's position in the list of
218c2ecf20Sopenharmony_ci *	partner info.
228c2ecf20Sopenharmony_ci * @unit_address: The partner unit address of this entry.
238c2ecf20Sopenharmony_ci * @partition_ID: The partner partition ID of this entry.
248c2ecf20Sopenharmony_ci * @location_code: The converged location code of this entry + 1 char for the
258c2ecf20Sopenharmony_ci *	null-term.
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci * This structure outlines the format that partner info is presented to a caller
288c2ecf20Sopenharmony_ci * of the hvcs partner info fetching functions.  These are strung together into
298c2ecf20Sopenharmony_ci * a list using linux kernel lists.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_cistruct hvcs_partner_info {
328c2ecf20Sopenharmony_ci	struct list_head node;
338c2ecf20Sopenharmony_ci	uint32_t unit_address;
348c2ecf20Sopenharmony_ci	uint32_t partition_ID;
358c2ecf20Sopenharmony_ci	char location_code[HVCS_CLC_LENGTH + 1]; /* CLC + 1 null-term char */
368c2ecf20Sopenharmony_ci};
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciextern int hvcs_free_partner_info(struct list_head *head);
398c2ecf20Sopenharmony_ciextern int hvcs_get_partner_info(uint32_t unit_address,
408c2ecf20Sopenharmony_ci		struct list_head *head, unsigned long *pi_buff);
418c2ecf20Sopenharmony_ciextern int hvcs_register_connection(uint32_t unit_address,
428c2ecf20Sopenharmony_ci		uint32_t p_partition_ID, uint32_t p_unit_address);
438c2ecf20Sopenharmony_ciextern int hvcs_free_connection(uint32_t unit_address);
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
468c2ecf20Sopenharmony_ci#endif /* _PPC64_HVCSERVER_H */
47