Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * s390 diagnose functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright IBM Corp. 2007
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Author(s): Michael Holzheu <holzheu@de.ibm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #ifndef _ASM_S390_DIAG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #define _ASM_S390_DIAG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/if_ether.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/percpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) enum diag_stat_enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	DIAG_STAT_X008,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	DIAG_STAT_X00C,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	DIAG_STAT_X010,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	DIAG_STAT_X014,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	DIAG_STAT_X044,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	DIAG_STAT_X064,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	DIAG_STAT_X09C,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	DIAG_STAT_X0DC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	DIAG_STAT_X204,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	DIAG_STAT_X210,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	DIAG_STAT_X224,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	DIAG_STAT_X250,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	DIAG_STAT_X258,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	DIAG_STAT_X26C,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	DIAG_STAT_X288,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	DIAG_STAT_X2C4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	DIAG_STAT_X2FC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	DIAG_STAT_X304,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	DIAG_STAT_X308,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	DIAG_STAT_X318,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	DIAG_STAT_X500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	NR_DIAG_STAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) void diag_stat_inc(enum diag_stat_enum nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) void diag_stat_inc_norecursion(enum diag_stat_enum nr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * Diagnose 10: Release page range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	unsigned long start_addr, end_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	start_addr = start_pfn << PAGE_SHIFT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	diag_stat_inc(DIAG_STAT_X010);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	asm volatile(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		"0:	diag	%0,%1,0x10\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		"1:	nopr	%%r7\n"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		EX_TABLE(0b, 1b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		EX_TABLE(1b, 1b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		: : "a" (start_addr), "a" (end_addr));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * Diagnose 14: Input spool file manipulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  * Diagnose 210: Get information about a virtual device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) struct diag210 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	u16 vrdcdvno;	/* device number (input) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	u16 vrdclen;	/* data block length (input) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	u8 vrdcvcla;	/* virtual device class (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	u8 vrdcvtyp;	/* virtual device type (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	u8 vrdcvsta;	/* virtual device status (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	u8 vrdcvfla;	/* virtual device flags (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	u8 vrdcrccl;	/* real device class (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	u8 vrdccrty;	/* real device type (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	u8 vrdccrmd;	/* real device model (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	u8 vrdccrft;	/* real device feature (output) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) } __attribute__((packed, aligned(4)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) extern int diag210(struct diag210 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) /* bit is set in flags, when physical cpu info is included in diag 204 data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) #define DIAG204_LPAR_PHYS_FLG 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) #define DIAG204_LPAR_NAME_LEN 8		/* lpar name len in diag 204 data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) #define DIAG204_CPU_NAME_LEN 16		/* type name len of cpus in diag224 name table */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) /* diag 204 subcodes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) enum diag204_sc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	DIAG204_SUBC_STIB4 = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	DIAG204_SUBC_RSI = 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	DIAG204_SUBC_STIB6 = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	DIAG204_SUBC_STIB7 = 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) /* The two available diag 204 data formats */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) enum diag204_format {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	DIAG204_INFO_SIMPLE = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	DIAG204_INFO_EXT = 0x00010000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) enum diag204_cpu_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	DIAG204_CPU_ONLINE = 0x20,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	DIAG204_CPU_CAPPED = 0x40,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) struct diag204_info_blk_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	__u8  npar;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	__u8  flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	__u16 tslice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	__u16 phys_cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	__u16 this_part;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	__u64 curtod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) struct diag204_x_info_blk_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	__u8  npar;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	__u8  flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	__u16 tslice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	__u16 phys_cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	__u16 this_part;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	__u64 curtod1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	__u64 curtod2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	char reserved[40];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) struct diag204_part_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	__u8 pn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	__u8 cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	char reserved[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	char part_name[DIAG204_LPAR_NAME_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) struct diag204_x_part_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	__u8  pn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	__u8  cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	__u8  rcpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	__u8  pflag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	__u32 mlu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	char  part_name[DIAG204_LPAR_NAME_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	char  lpc_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	char  os_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	__u64 online_cs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	__u64 online_es;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	__u8  upid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	__u8  reserved:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	__u8  mtid:5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	char  reserved1[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	__u32 group_mlu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	char  group_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	char  hardware_group_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	char  reserved2[24];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) struct diag204_cpu_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	__u16 cpu_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	char  reserved1[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	__u8  ctidx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	__u8  cflag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	__u16 weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	__u64 acc_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	__u64 lp_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) struct diag204_x_cpu_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	__u16 cpu_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	char  reserved1[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	__u8  ctidx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	__u8  cflag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	__u16 weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	__u64 acc_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	__u64 lp_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	__u16 min_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	__u16 cur_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	__u16 max_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	char  reseved2[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	__u64 online_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	__u64 wait_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	__u32 pma_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	__u32 polar_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	__u32 cpu_type_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	__u32 group_cpu_type_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	char  reserved3[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) struct diag204_phys_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	char reserved1[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	__u8 cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	char reserved2[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	char mgm_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) struct diag204_x_phys_hdr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	char reserved1[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	__u8 cpus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	char reserved2[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	char mgm_name[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	char reserved3[80];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) struct diag204_phys_cpu {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	__u16 cpu_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	char  reserved1[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	__u8  ctidx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	char  reserved2[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	__u64 mgm_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	char  reserved3[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) struct diag204_x_phys_cpu {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	__u16 cpu_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	char  reserved1[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	__u8  ctidx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	char  reserved2[1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	__u16 weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	__u64 mgm_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	char  reserved3[80];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) struct diag204_x_part_block {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	struct diag204_x_part_hdr hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	struct diag204_x_cpu_info cpus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct diag204_x_phys_block {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	struct diag204_x_phys_hdr hdr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	struct diag204_x_phys_cpu cpus[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) enum diag26c_sc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	DIAG26C_PORT_VNIC    = 0x00000024,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	DIAG26C_MAC_SERVICES = 0x00000030
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) enum diag26c_version {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	DIAG26C_VERSION2	 = 0x00000002,	/* z/VM 5.4.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	DIAG26C_VERSION6_VM65918 = 0x00020006	/* z/VM 6.4.0 + VM65918 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #define DIAG26C_VNIC_INFO	0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) struct diag26c_vnic_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	u32	resp_buf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	u32	resp_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	u16	req_format;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	u16	vlan_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	u64	sys_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	u8	res[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	u16	devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) } __packed __aligned(8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #define VNIC_INFO_PROT_L3	1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) #define VNIC_INFO_PROT_L2	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) /* Note: this is the bare minimum, use it for uninitialized VNICs only. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) struct diag26c_vnic_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	u32	version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	u32	entry_cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	/* VNIC info: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	u32	next_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	u64	owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	u16	devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	u8	status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	u8	type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	u64	lan_owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	u64	lan_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	u64	port_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	u8	port_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	u8	ext_status:6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	u8	protocol:2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	u16	base_devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	u32	port_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	u32	ifindex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	u32	maxinfo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	u32	dev_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	/* 3x device info: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	u8	dev_info1[28];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	u8	dev_info2[28];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	u8	dev_info3[28];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) } __packed __aligned(8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #define DIAG26C_GET_MAC	0x0000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) struct diag26c_mac_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	u32	resp_buf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	u32	resp_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	u16	op_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	u16	devno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	u8	res[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) struct diag26c_mac_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	u32	version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	u8	mac[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	u8	res[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) } __aligned(8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) #define CPNC_LINUX		0x4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) union diag318_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 	unsigned long val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 	struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 		unsigned long cpnc : 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 		unsigned long cpvc : 56;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) int diag204(unsigned long subcode, unsigned long size, void *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) int diag224(void *ptr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) int diag26c(void *req, void *resp, enum diag26c_sc subcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) struct hypfs_diag0c_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) struct diag_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	int (*diag210)(struct diag210 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	int (*diag26c)(void *req, void *resp, enum diag26c_sc subcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	int (*diag14)(unsigned long rx, unsigned long ry1, unsigned long subcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	void (*diag0c)(struct hypfs_diag0c_entry *entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	void (*diag308_reset)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) extern struct diag_ops diag_dma_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) extern struct diag210 *__diag210_tmp_dma;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) #endif /* _ASM_S390_DIAG_H */