if (rc == -EOPNOTSUPP && MACHINE_IS_VM) return __raw3270_size_device_vm(rp); 
__raw3270_size_device(struct raw3270 *rp){	static const unsigned char wbuf[] =		{ 0x00, 0x07, 0x01, 0xff, 0x03, 0x00, 0x81 };	struct raw3270_ua *uap;	unsigned short count;	int rc;	/*	 * To determine the size of the 3270 device we need to do:	 * 1) send a 'read partition' data stream to the device	 * 2) wait for the attn interrupt that preceeds the query reply	 * 3) do a read modified to get the query reply	 * To make things worse we have to cope with intervention	 * required (3270 device switched to 'stand-by') and command	 * rejects (old devices that can't do 'read partition').	 */	memset(&raw3270_init_request, 0, sizeof(raw3270_init_request));	memset(raw3270_init_data, 0, sizeof(raw3270_init_data));	/* Store 'read partition' data stream to raw3270_init_data */	memcpy(raw3270_init_data, wbuf, sizeof(wbuf));	INIT_LIST_HEAD(&raw3270_init_request.list);	raw3270_init_request.ccw.cmd_code = TC_WRITESF;	raw3270_init_request.ccw.flags = CCW_FLAG_SLI;	raw3270_init_request.ccw.count = sizeof(wbuf);	raw3270_init_request.ccw.cda = (__u32) __pa(raw3270_init_data);	rc = raw3270_start_init(rp, &raw3270_init_view, &raw3270_init_request);	if (rc) {		/* Check error cases: -ERESTARTSYS, -EIO and -EOPNOTSUPP */		if (rc == -EOPNOTSUPP && MACHINE_IS_VM)			return __raw3270_size_device_vm(rp);		return rc;	}	/* Wait for attention interrupt. */#ifdef CONFIG_TN3270_CONSOLE	if (raw3270_registered == 0) {		unsigned long flags;		spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);		while (!test_and_clear_bit(RAW3270_FLAGS_ATTN, &rp->flags))			wait_cons_dev();		spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);	} else#endif		rc = wait_event_interruptible(raw3270_wait_queue,			test_and_clear_bit(RAW3270_FLAGS_ATTN, &rp->flags));	if (rc)		return rc;	/*	 * The device accepted the 'read partition' command. Now	 * set up a read ccw and issue it.	 */	raw3270_init_request.ccw.cmd_code = TC_READMOD;	raw3270_init_request.ccw.flags = CCW_FLAG_SLI;	raw3270_init_request.ccw.count = sizeof(raw3270_init_data);	raw3270_init_request.ccw.cda = (__u32) __pa(raw3270_init_data);	rc = raw3270_start_init(rp, &raw3270_init_view, &raw3270_init_request);	if (rc)		return rc;	/* Got a Query Reply */	count = sizeof(raw3270_init_data) - raw3270_init_request.rescnt;	uap = (struct raw3270_ua *) (raw3270_init_data + 1);	/* Paranoia check. */	if (raw3270_init_data[0] != 0x88 || uap->uab.qcode != 0x81)		return -EOPNOTSUPP;	/* Copy rows/columns of default Usable Area */	rp->rows = uap->uab.h;	rp->cols = uap->uab.w;	/* Check for 14 bit addressing */	if ((uap->uab.flags0 & 0x0d) == 0x01)		set_bit(RAW3270_FLAGS_14BITADDR, &rp->flags);	/* Check for Alternate Usable Area */	if (uap->uab.l == sizeof(struct raw3270_ua) &&	    uap->aua.sdpid == 0x02) {		rp->rows = uap->aua.hauai;		rp->cols = uap->aua.wauai;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/3863e72414fa2ebf5f3b615d1bf99de32e59980a/raw3270.c/clean/drivers/s390/char/raw3270.c