/* Perform an interrogate function on the given ccw device. Return zero on success, non-zero otherwise.  */
int ccw_device_tm_intrg(struct ccw_device *cdev)
/* Perform an interrogate function on the given ccw device. Return zero on success, non-zero otherwise.  */
int ccw_device_tm_intrg(struct ccw_device *cdev)
{
	struct subchannel *sch = to_subchannel(cdev->dev.parent);
	if (!sch->schib.pmcw.ena)
		return -EINVAL;
	if (cdev->private->state != DEV_STATE_ONLINE)
		return -EIO;
	if (!scsw_is_tm(&sch->schib.scsw) ||
	    !(scsw_actl(&sch->schib.scsw) & SCSW_ACTL_START_PEND))
		return -EINVAL;
	return cio_tm_intrg(sch);
}