/* Calculate and return the operational path mask (opm) based on the chpids used by the subchannel and the status of the associated channel-paths.  */
u8 chp_get_sch_opm(struct subchannel *sch)
/* Calculate and return the operational path mask (opm) based on the chpids used by the subchannel and the status of the associated channel-paths.  */
u8 chp_get_sch_opm(struct subchannel *sch)
{
	struct chp_id chpid;
	int opm;
	int i;
	opm = 0;
	chp_id_init(&chpid);
	for (i = 0; i < 8; i++) {
		opm <<= 1;
		chpid.id = sch->schib.pmcw.chpid[i];
		if (chp_get_status(chpid) != 0)
			opm |= 1;
	}
	return opm;
}