1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright IBM Corp. 2007, 2012
6 #ifndef _ASM_S390_CHPID_H
7 #define _ASM_S390_CHPID_H
9 #include <uapi/asm/chpid.h>
12 struct channel_path_desc_fmt0 {
23 static inline void chp_id_init(struct chp_id *chpid)
25 memset(chpid, 0, sizeof(struct chp_id));
28 static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b)
30 return (a->id == b->id) && (a->cssid == b->cssid);
33 static inline void chp_id_next(struct chp_id *chpid)
35 if (chpid->id < __MAX_CHPID)
43 static inline int chp_id_is_valid(struct chp_id *chpid)
45 return (chpid->cssid <= __MAX_CSSID);
49 #define chp_id_for_each(c) \
50 for (chp_id_init(c); chp_id_is_valid(c); chp_id_next(c))
51 #endif /* _ASM_S390_CHPID_H */