diff options
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/chpid.h | 53 | ||||
-rw-r--r-- | include/asm-s390/cio.h | 1 | ||||
-rw-r--r-- | include/asm-s390/sclp.h | 12 |
3 files changed, 66 insertions, 0 deletions
diff --git a/include/asm-s390/chpid.h b/include/asm-s390/chpid.h new file mode 100644 index 000000000000..b203336fd892 --- /dev/null +++ b/include/asm-s390/chpid.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * drivers/s390/cio/chpid.h | ||
3 | * | ||
4 | * Copyright IBM Corp. 2007 | ||
5 | * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef _ASM_S390_CHPID_H | ||
9 | #define _ASM_S390_CHPID_H _ASM_S390_CHPID_H | ||
10 | |||
11 | #include <linux/string.h> | ||
12 | #include <asm/types.h> | ||
13 | #include <asm/cio.h> | ||
14 | |||
15 | #define __MAX_CHPID 255 | ||
16 | |||
17 | struct chp_id { | ||
18 | u8 reserved1; | ||
19 | u8 cssid; | ||
20 | u8 reserved2; | ||
21 | u8 id; | ||
22 | } __attribute__((packed)); | ||
23 | |||
24 | static inline void chp_id_init(struct chp_id *chpid) | ||
25 | { | ||
26 | memset(chpid, 0, sizeof(struct chp_id)); | ||
27 | } | ||
28 | |||
29 | static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b) | ||
30 | { | ||
31 | return (a->id == b->id) && (a->cssid == b->cssid); | ||
32 | } | ||
33 | |||
34 | static inline void chp_id_next(struct chp_id *chpid) | ||
35 | { | ||
36 | if (chpid->id < __MAX_CHPID) | ||
37 | chpid->id++; | ||
38 | else { | ||
39 | chpid->id = 0; | ||
40 | chpid->cssid++; | ||
41 | } | ||
42 | } | ||
43 | |||
44 | static inline int chp_id_is_valid(struct chp_id *chpid) | ||
45 | { | ||
46 | return (chpid->cssid <= __MAX_CSSID); | ||
47 | } | ||
48 | |||
49 | |||
50 | #define chp_id_for_each(c) \ | ||
51 | for (chp_id_init(c); chp_id_is_valid(c); chp_id_next(c)) | ||
52 | |||
53 | #endif /* _ASM_S390_CHPID_H */ | ||
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h index 0db017bc7d09..f738d2827582 100644 --- a/include/asm-s390/cio.h +++ b/include/asm-s390/cio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | 14 | ||
15 | #define LPM_ANYPATH 0xff | 15 | #define LPM_ANYPATH 0xff |
16 | #define __MAX_CSSID 0 | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * subchannel status word | 19 | * subchannel status word |
diff --git a/include/asm-s390/sclp.h b/include/asm-s390/sclp.h index 468b97018405..3996daaa8f54 100644 --- a/include/asm-s390/sclp.h +++ b/include/asm-s390/sclp.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define _ASM_S390_SCLP_H | 9 | #define _ASM_S390_SCLP_H |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <asm/chpid.h> | ||
12 | 13 | ||
13 | struct sccb_header { | 14 | struct sccb_header { |
14 | u16 length; | 15 | u16 length; |
@@ -33,7 +34,18 @@ struct sclp_readinfo_sccb { | |||
33 | u8 _reserved3[4096 - 112]; /* 112-4095 */ | 34 | u8 _reserved3[4096 - 112]; /* 112-4095 */ |
34 | } __attribute__((packed, aligned(4096))); | 35 | } __attribute__((packed, aligned(4096))); |
35 | 36 | ||
37 | #define SCLP_CHP_INFO_MASK_SIZE 32 | ||
38 | |||
39 | struct sclp_chp_info { | ||
40 | u8 recognized[SCLP_CHP_INFO_MASK_SIZE]; | ||
41 | u8 standby[SCLP_CHP_INFO_MASK_SIZE]; | ||
42 | u8 configured[SCLP_CHP_INFO_MASK_SIZE]; | ||
43 | }; | ||
44 | |||
36 | extern struct sclp_readinfo_sccb s390_readinfo_sccb; | 45 | extern struct sclp_readinfo_sccb s390_readinfo_sccb; |
37 | extern void sclp_readinfo_early(void); | 46 | extern void sclp_readinfo_early(void); |
47 | extern int sclp_chp_configure(struct chp_id chpid); | ||
48 | extern int sclp_chp_deconfigure(struct chp_id chpid); | ||
49 | extern int sclp_chp_read_info(struct sclp_chp_info *info); | ||
38 | 50 | ||
39 | #endif /* _ASM_S390_SCLP_H */ | 51 | #endif /* _ASM_S390_SCLP_H */ |