chpid.h (9807f75955ea7f1877981056755284481873115c) chpid.h (4dcc2a4d6c37c36155ea6d6305f15e599531b862)
1/*
1/*
2 * Copyright IBM Corp. 2007
2 * Copyright IBM Corp. 2007, 2012
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */
5
5#ifndef _ASM_S390_CHPID_H
6#define _ASM_S390_CHPID_H
7
6#ifndef _ASM_S390_CHPID_H
7#define _ASM_S390_CHPID_H
8
8#include <uapi/asm/chpid.h>
9#include <linux/string.h>
10#include <linux/types.h>
11
12#define __MAX_CHPID 255
13
14struct chp_id {
15 __u8 reserved1;
16 __u8 cssid;
17 __u8 reserved2;
18 __u8 id;
19} __attribute__((packed));
20
21#ifdef __KERNEL__
9#include <asm/cio.h>
10
11static inline void chp_id_init(struct chp_id *chpid)
12{
13 memset(chpid, 0, sizeof(struct chp_id));
14}
15
16static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b)

--- 14 unchanged lines hidden (view full) ---

31static inline int chp_id_is_valid(struct chp_id *chpid)
32{
33 return (chpid->cssid <= __MAX_CSSID);
34}
35
36
37#define chp_id_for_each(c) \
38 for (chp_id_init(c); chp_id_is_valid(c); chp_id_next(c))
22#include <asm/cio.h>
23
24static inline void chp_id_init(struct chp_id *chpid)
25{
26 memset(chpid, 0, sizeof(struct chp_id));
27}
28
29static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b)

--- 14 unchanged lines hidden (view full) ---

44static 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#endif /* __KERNEL */
53
39#endif /* _ASM_S390_CHPID_H */
54#endif /* _ASM_S390_CHPID_H */