/* * drivers/s390/cio/device_fsm.c * finite state machine for device handling * * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation * Author(s): Cornelia Huck (cornelia.huck@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com) */#include<linux/module.h>#include<linux/init.h>#include<linux/jiffies.h>#include<linux/string.h>#include<asm/ccwdev.h>#include<asm/cio.h>#include"cio.h"#include"cio_debug.h"#include"css.h"#include"device.h"#include"chsc.h"#include"ioasm.h"intdevice_is_online(structsubchannel*sch){structccw_device*cdev;if(!sch->dev.driver_data)return0;cdev=sch->dev.driver_data;return(cdev->private->state==DEV_STATE_ONLINE);}intdevice_is_disconnected(structsubchannel*sch){structccw_device*cdev;if(!sch->dev.driver_data)return0;cdev=sch->dev.driver_data;return(cdev->private->state==DEV_STATE_DISCONNECTED||cdev->private->state==DEV_STATE_DISCONNECTED_SENSE_ID);}voiddevice_set_disconnected(structsubchannel*sch){structccw_device*cdev;if(!sch->dev.driver_data)return;cdev=sch->dev.driver_data;ccw_device_set_timeout(cdev,0);cdev->private->flags.fake_irb=0;cdev->private->state=DEV_STATE_DISCONNECTED;}voiddevice_set_intretry(structsubchannel*sch){structccw_device*cdev;cdev=sch->dev.driver_data;if(!cdev)return;cdev->private->flags.intretry=1;}intdevice_trigger_verify(structsubchannel*sch){structccw_device*cdev;cdev=sch->dev.driver_data;if(!cdev||!cdev->online)return-EINVAL;dev_fsm_event(cdev,DEV_EVENT_VERIFY);return0;}/* * Timeout function. It just tri