diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-07-14 03:58:56 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 04:02:09 -0400 |
commit | d2fec595511b5718bdb65645b3d5d99800d97943 (patch) | |
tree | a94c3560fc2ad6aa89d61d646f73f4d7c1dfcc9b /drivers | |
parent | 761cdf6aacdb76f819050f4938cdab1f4cdcb945 (diff) |
[S390] stp support.
Add support for clock synchronization with the server time protocol.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/chsc.c | 49 | ||||
-rw-r--r-- | drivers/s390/s390mach.c | 4 | ||||
-rw-r--r-- | drivers/s390/s390mach.h | 3 |
3 files changed, 56 insertions, 0 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index cb36f7929786..62b0b16fe3d3 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -874,3 +874,52 @@ exit: | |||
874 | 874 | ||
875 | EXPORT_SYMBOL_GPL(css_general_characteristics); | 875 | EXPORT_SYMBOL_GPL(css_general_characteristics); |
876 | EXPORT_SYMBOL_GPL(css_chsc_characteristics); | 876 | EXPORT_SYMBOL_GPL(css_chsc_characteristics); |
877 | |||
878 | int chsc_sstpc(void *page, unsigned int op, u16 ctrl) | ||
879 | { | ||
880 | struct { | ||
881 | struct chsc_header request; | ||
882 | unsigned int rsvd0; | ||
883 | unsigned int op : 8; | ||
884 | unsigned int rsvd1 : 8; | ||
885 | unsigned int ctrl : 16; | ||
886 | unsigned int rsvd2[5]; | ||
887 | struct chsc_header response; | ||
888 | unsigned int rsvd3[7]; | ||
889 | } __attribute__ ((packed)) *rr; | ||
890 | int rc; | ||
891 | |||
892 | memset(page, 0, PAGE_SIZE); | ||
893 | rr = page; | ||
894 | rr->request.length = 0x0020; | ||
895 | rr->request.code = 0x0033; | ||
896 | rr->op = op; | ||
897 | rr->ctrl = ctrl; | ||
898 | rc = chsc(rr); | ||
899 | if (rc) | ||
900 | return -EIO; | ||
901 | rc = (rr->response.code == 0x0001) ? 0 : -EIO; | ||
902 | return rc; | ||
903 | } | ||
904 | |||
905 | int chsc_sstpi(void *page, void *result, size_t size) | ||
906 | { | ||
907 | struct { | ||
908 | struct chsc_header request; | ||
909 | unsigned int rsvd0[3]; | ||
910 | struct chsc_header response; | ||
911 | char data[size]; | ||
912 | } __attribute__ ((packed)) *rr; | ||
913 | int rc; | ||
914 | |||
915 | memset(page, 0, PAGE_SIZE); | ||
916 | rr = page; | ||
917 | rr->request.length = 0x0010; | ||
918 | rr->request.code = 0x0038; | ||
919 | rc = chsc(rr); | ||
920 | if (rc) | ||
921 | return -EIO; | ||
922 | memcpy(result, &rr->data, size); | ||
923 | return (rr->response.code == 0x0001) ? 0 : -EIO; | ||
924 | } | ||
925 | |||
diff --git a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c index fe75152a5084..834e9ee7e934 100644 --- a/drivers/s390/s390mach.c +++ b/drivers/s390/s390mach.c | |||
@@ -458,6 +458,10 @@ s390_do_machine_check(struct pt_regs *regs) | |||
458 | etr_sync_check(); | 458 | etr_sync_check(); |
459 | if (S390_lowcore.external_damage_code & (1U << ED_ETR_SWITCH)) | 459 | if (S390_lowcore.external_damage_code & (1U << ED_ETR_SWITCH)) |
460 | etr_switch_to_local(); | 460 | etr_switch_to_local(); |
461 | if (S390_lowcore.external_damage_code & (1U << ED_STP_SYNC)) | ||
462 | stp_sync_check(); | ||
463 | if (S390_lowcore.external_damage_code & (1U << ED_STP_ISLAND)) | ||
464 | stp_island_check(); | ||
461 | } | 465 | } |
462 | 466 | ||
463 | if (mci->se) | 467 | if (mci->se) |
diff --git a/drivers/s390/s390mach.h b/drivers/s390/s390mach.h index f11e574076d8..d39f8b697d27 100644 --- a/drivers/s390/s390mach.h +++ b/drivers/s390/s390mach.h | |||
@@ -112,6 +112,9 @@ static inline int stcrw(struct crw *pcrw ) | |||
112 | #define ED_ETR_SYNC 12 /* External damage ETR sync check */ | 112 | #define ED_ETR_SYNC 12 /* External damage ETR sync check */ |
113 | #define ED_ETR_SWITCH 13 /* External damage ETR switch to local */ | 113 | #define ED_ETR_SWITCH 13 /* External damage ETR switch to local */ |
114 | 114 | ||
115 | #define ED_STP_SYNC 7 /* External damage STP sync check */ | ||
116 | #define ED_STP_ISLAND 6 /* External damage STP island check */ | ||
117 | |||
115 | struct pt_regs; | 118 | struct pt_regs; |
116 | 119 | ||
117 | void s390_handle_mcck(void); | 120 | void s390_handle_mcck(void); |