update checkpatch.pl to version 0.05
[pv_ops_mirror.git] / drivers / s390 / char / sclp_info.c
blob7bcbe643b0870919b3332be25446e0948e3ff06a
1 /*
2 * drivers/s390/char/sclp_info.c
4 * Copyright IBM Corp. 2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
6 */
8 #include <linux/init.h>
9 #include <linux/errno.h>
10 #include <linux/string.h>
11 #include <asm/sclp.h>
12 #include "sclp.h"
14 struct sclp_readinfo_sccb s390_readinfo_sccb;
16 void __init sclp_readinfo_early(void)
18 sclp_cmdw_t command;
19 struct sccb_header *sccb;
20 int ret;
22 __ctl_set_bit(0, 9); /* enable service signal subclass mask */
24 sccb = &s390_readinfo_sccb.header;
25 command = SCLP_CMDW_READ_SCP_INFO_FORCED;
26 while (1) {
27 u16 response;
29 memset(&s390_readinfo_sccb, 0, sizeof(s390_readinfo_sccb));
30 sccb->length = sizeof(s390_readinfo_sccb);
31 sccb->control_mask[2] = 0x80;
33 ret = sclp_service_call(command, &s390_readinfo_sccb);
35 if (ret == -EIO)
36 goto out;
37 if (ret == -EBUSY)
38 continue;
40 __load_psw_mask(PSW_BASE_BITS | PSW_MASK_EXT |
41 PSW_MASK_WAIT | PSW_DEFAULT_KEY);
42 local_irq_disable();
43 barrier();
45 response = sccb->response_code;
47 if (response == 0x10)
48 break;
50 if (response != 0x1f0 || command == SCLP_CMDW_READ_SCP_INFO)
51 break;
53 command = SCLP_CMDW_READ_SCP_INFO;
55 out:
56 __ctl_clear_bit(0, 9); /* disable service signal subclass mask */