1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2/*
  3 * ioctl interface for /dev/chsc
  4 *
  5 * Copyright IBM Corp. 2008, 2012
  6 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
  7 */
  8
  9#ifndef _ASM_CHSC_H
 10#define _ASM_CHSC_H
 11
 12#include <linux/types.h>
 13#include <linux/ioctl.h>
 14#include <asm/chpid.h>
 15#include <asm/schid.h>
 16
 17#define CHSC_SIZE 0x1000
 18
 19struct chsc_async_header {
 20	__u16 length;
 21	__u16 code;
 22	__u32 cmd_dependend;
 23	__u32 key : 4;
 24	__u32 : 28;
 25	struct subchannel_id sid;
 26};
 27
 28struct chsc_async_area {
 29	struct chsc_async_header header;
 30	__u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
 31};
 32
 33struct chsc_header {
 34	__u16 length;
 35	__u16 code;
 36};
 37
 38struct chsc_sync_area {
 39	struct chsc_header header;
 40	__u8 data[CHSC_SIZE - sizeof(struct chsc_header)];
 41};
 42
 43struct chsc_response_struct {
 44	__u16 length;
 45	__u16 code;
 46	__u32 parms;
 47	__u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)];
 48};
 49
 50struct chsc_chp_cd {
 51	struct chp_id chpid;
 52	int m;
 53	int fmt;
 54	struct chsc_response_struct cpcb;
 55};
 56
 57struct chsc_cu_cd {
 58	__u16 cun;
 59	__u8 cssid;
 60	int m;
 61	int fmt;
 62	struct chsc_response_struct cucb;
 63};
 64
 65struct chsc_sch_cud {
 66	struct subchannel_id schid;
 67	int fmt;
 68	struct chsc_response_struct scub;
 69};
 70
 71struct conf_id {
 72	int m;
 73	__u8 cssid;
 74	__u8 ssid;
 75};
 76
 77struct chsc_conf_info {
 78	struct conf_id id;
 79	int fmt;
 80	struct chsc_response_struct scid;
 81};
 82
 83struct ccl_parm_chpid {
 84	int m;
 85	struct chp_id chp;
 86};
 87
 88struct ccl_parm_cssids {
 89	__u8 f_cssid;
 90	__u8 l_cssid;
 91};
 92
 93struct chsc_comp_list {
 94	struct {
 95		enum {
 96			CCL_CU_ON_CHP = 1,
 97			CCL_CHP_TYPE_CAP = 2,
 98			CCL_CSS_IMG = 4,
 99			CCL_CSS_IMG_CONF_CHAR = 5,
100			CCL_IOP_CHP = 6,
101		} ctype;
102		int fmt;
103		struct ccl_parm_chpid chpid;
104		struct ccl_parm_cssids cssids;
105	} req;
106	struct chsc_response_struct sccl;
107};
108
109struct chsc_dcal {
110	struct {
111		enum {
112			DCAL_CSS_IID_PN = 4,
113		} atype;
114		__u32 list_parm[2];
115		int fmt;
116	} req;
117	struct chsc_response_struct sdcal;
118};
119
120struct chsc_cpd_info {
121	struct chp_id chpid;
122	int m;
123	int fmt;
124	int rfmt;
125	int c;
126	struct chsc_response_struct chpdb;
127};
128
129#define CHSC_IOCTL_MAGIC 'c'
130
131#define CHSC_START _IOWR(CHSC_IOCTL_MAGIC, 0x81, struct chsc_async_area)
132#define CHSC_INFO_CHANNEL_PATH _IOWR(CHSC_IOCTL_MAGIC, 0x82, \
133				    struct chsc_chp_cd)
134#define CHSC_INFO_CU _IOWR(CHSC_IOCTL_MAGIC, 0x83, struct chsc_cu_cd)
135#define CHSC_INFO_SCH_CU _IOWR(CHSC_IOCTL_MAGIC, 0x84, struct chsc_sch_cud)
136#define CHSC_INFO_CI _IOWR(CHSC_IOCTL_MAGIC, 0x85, struct chsc_conf_info)
137#define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
138#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
139#define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
140#define CHSC_START_SYNC _IOWR(CHSC_IOCTL_MAGIC, 0x89, struct chsc_sync_area)
141#define CHSC_ON_CLOSE_SET _IOWR(CHSC_IOCTL_MAGIC, 0x8a, struct chsc_async_area)
142#define CHSC_ON_CLOSE_REMOVE _IO(CHSC_IOCTL_MAGIC, 0x8b)
143
144#endif