^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) * Copyright IBM Corp. 2006
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __S390_STP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __S390_STP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/compiler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /* notifier for syncs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) extern struct atomic_notifier_head s390_epoch_delta_notifier;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* STP interruption parameter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct stp_irq_parm {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) u32 : 14;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u32 tsc : 1; /* Timing status change */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) u32 lac : 1; /* Link availability change */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u32 tcpc : 1; /* Time control parameter change */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) u32 : 15;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define STP_OP_SYNC 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define STP_OP_CTRL 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct stp_sstpi {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u32 : 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u32 tu : 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) u32 lu : 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) u32 : 6;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) u32 stratum : 8;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) u32 vbits : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u32 leaps : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u32 tmd : 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) u32 ctn : 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) u32 : 3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) u32 c : 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) u32 tst : 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) u32 tzo : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) u32 dsto : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) u32 ctrl : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) u32 : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) u32 tto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) u32 : 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) u32 ctnid[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) u32 : 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) u32 todoff[4];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) u32 rsvd[48];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct stp_tzib {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) u32 tzan : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) u32 : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) u32 tzo : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) u32 dsto : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) u32 stn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) u32 dstn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) u64 dst_on_alg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) u64 dst_off_alg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) struct stp_tcpib {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) u32 atcode : 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) u32 ntcode : 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) u32 d : 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) u32 : 23;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) s32 tto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) struct stp_tzib atzib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) struct stp_tzib ntzib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) s32 adst_offset : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) s32 ndst_offset : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) u32 rsvd1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) u64 ntzib_update;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) u64 ndsto_update;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct stp_lsoib {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) u32 p : 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) u32 : 31;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) s32 also : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) s32 nlso : 16;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) u64 nlsout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) struct stp_stzi {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) u32 rsvd0[3];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) u64 data_ts;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) u32 rsvd1[22];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) struct stp_tcpib tcpib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) struct stp_lsoib lsoib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) } __packed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) /* Functions needed by the machine check handler */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) int stp_sync_check(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) int stp_island_check(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) void stp_queue_work(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) #endif /* __S390_STP_H */