tape_handle_killed_request(device, request); 
__tape_end_request(device, request, -EIO); 
__tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb){	struct tape_device *device;	struct tape_request *request;	int final;	int rc;	device = (struct tape_device *) cdev->dev.driver_data;	if (device == NULL) {		PRINT_ERR("could not get device structure for %s "			  "in interrupt\n", cdev->dev.bus_id);		return;	}	request = (struct tape_request *) intparm;	DBF_LH(6, "__tape_do_irq(device=%p, request=%p)\n", device, request);	/* On special conditions irb is an error pointer */	if (IS_ERR(irb)) {		switch (PTR_ERR(irb)) {			case -ETIMEDOUT:				PRINT_WARN("(%s): Request timed out\n",					cdev->dev.bus_id);			case -EIO:				tape_handle_killed_request(device, request);				break;			default:				PRINT_ERR("(%s): Unexpected i/o error %li\n",					cdev->dev.bus_id,					PTR_ERR(irb));		}		return;	}	/* May be an unsolicited irq */	if(request != NULL)		request->rescnt = irb->scsw.count;	if (irb->scsw.dstat != 0x0c) {		/* Set the 'ONLINE' flag depending on sense byte 1 */		if(*(((__u8 *) irb->ecw) + 1) & SENSE_DRIVE_ONLINE)			device->tape_generic_status |= GMT_ONLINE(~0);		else			device->tape_generic_status &= ~GMT_ONLINE(~0);		/*		 * Any request that does not come back with channel end		 * and device end is unusual. Log the sense data.		 */		DBF_EVENT(3,"-- Tape Interrupthandler --\n");		tape_dump_sense_dbf(device, request, irb);	} else {		/* Upon normal completion the device _is_ online */		device->tape_generic_status |= GMT_ONLINE(~0);	}	if (device->tape_state == TS_NOT_OPER) {		DBF_EVENT(6, "tape:device is not operational\n");		return;	}	/*	 * Request that were canceled still come back with an interrupt.	 * To detect these request the state will be set to TAPE_REQUEST_DONE.	 */	if(request != NULL && request->status == TAPE_REQUEST_DONE) {		__tape_remove_request(device, request);		return;	}	rc = device->discipline->irq(device, request, irb);	/*	 * rc < 0 : request finished unsuccessfully.	 * rc == TAPE_IO_SUCCESS: request finished successfully.	 * rc == TAPE_IO_PENDING: request is still running. Ignore rc.	 * rc == TAPE_IO_RETRY: request finished but needs another go.	 * rc == TAPE_IO_STOP: request needs to get terminated.	 */	final = 0;	switch (rc) {	case TAPE_IO_SUCCESS:		/* Upon normal completion the device _is_ online */		device->tape_generic_status |= GMT_ONLINE(~0);		final = 1;		break;	case TAPE_IO_PENDING:		break;	case TAPE_IO_RETRY:#ifdef CONFIG_S390_TAPE_BLOCK		if (request->op == TO_BLOCK)			device->discipline->check_locate(device, request);#endif		rc = ccw_device_start(cdev, request->cpaddr,				      (unsigned long) request, 0x00,				      request->options);		if (rc) {			DBF_EVENT(1, "tape: DOIO failed with er = %i\n", rc);			final = 1;		}		break;	case TAPE_IO_STOP:		__tape_halt_io(device, request);		break;	default:		if (rc > 0) {			DBF_EVENT(6, "xunknownrc\n");			PRINT_ERR("Invalid return code from discipline "				  "interrupt function.\n");			rc = -EIO;		}		final = 1;		break;	}	if (final) {		/* May be an unsolicited irq */		if(request != NULL) {			/* Set ending status. */			request->rc = rc;			request->status = TAPE_REQUEST_DONE;			__tape_remove_request(device, request);		} else {			__tape_do_io_list(device);		}	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4111796d89b8cfa36054d65d9858460b5ec0e8c7/tape_core.c/buggy/drivers/s390/char/tape_core.c