int inc_seq_no = 1; 
zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer){	struct zfcp_adapter *adapter;	struct zfcp_qdio_queue *req_queue;	volatile struct qdio_buffer_element *sbale;	int new_distance_from_int;	unsigned long flags;	int inc_seq_no = 1;	int retval = 0;	adapter = fsf_req->adapter;	req_queue = &adapter->request_queue,	/* FIXME(debug): remove it later */	sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_first, 0);	ZFCP_LOG_DEBUG("SBALE0 flags=0x%x\n", sbale[0].flags);	ZFCP_LOG_TRACE("HEX DUMP OF SBALE1 PAYLOAD:\n");	ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) sbale[1].addr,		      sbale[1].length);	/* set sequence counter in QTCB */	if (likely(fsf_req->qtcb)) {		fsf_req->qtcb->prefix.req_seq_no = adapter->fsf_req_seq_no;		fsf_req->seq_no = adapter->fsf_req_seq_no;		ZFCP_LOG_TRACE("FSF request %p of adapter %s gets "			       "FSF sequence counter value of %i\n",			       fsf_req,			       zfcp_get_busid_by_adapter(adapter),			       fsf_req->qtcb->prefix.req_seq_no);	} else		inc_seq_no = 0;	/* put allocated FSF request at list tail */	spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);	list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head);	spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);	/* figure out expiration time of timeout and start timeout */	if (unlikely(timer)) {		timer->expires += jiffies;		add_timer(timer);	}	ZFCP_LOG_TRACE("request queue of adapter %s: "		       "next free SBAL is %i, %i free SBALs\n",		       zfcp_get_busid_by_adapter(adapter),		       req_queue->free_index,		       atomic_read(&req_queue->free_count));	ZFCP_LOG_DEBUG("calling do_QDIO adapter %s, flags=0x%x, queue_no=%i, "		       "index_in_queue=%i, count=%i, buffers=%p\n",		       zfcp_get_busid_by_adapter(adapter),		       QDIO_FLAG_SYNC_OUTPUT,		       0, fsf_req->sbal_first, fsf_req->sbal_number,		       &req_queue->buffer[fsf_req->sbal_first]);	/*	 * adjust the number of free SBALs in request queue as well as	 * position of first one	 */	atomic_sub(fsf_req->sbal_number, &req_queue->free_count);	ZFCP_LOG_TRACE("free_count=%d\n", atomic_read(&req_queue->free_count));	req_queue->free_index += fsf_req->sbal_number;	  /* increase */	req_queue->free_index %= QDIO_MAX_BUFFERS_PER_Q;  /* wrap if needed */	new_distance_from_int = zfcp_qdio_determine_pci(req_queue, fsf_req);	retval = do_QDIO(adapter->ccw_device,			 QDIO_FLAG_SYNC_OUTPUT,			 0, fsf_req->sbal_first, fsf_req->sbal_number, NULL);	if (unlikely(retval)) {		/* Queues are down..... */		retval = -EIO;		/*		 * FIXME(potential race):		 * timer might be expired (absolutely unlikely)		 */		if (timer)			del_timer(timer);		spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);		list_del(&fsf_req->list);		spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);		/*		 * adjust the number of free SBALs in request queue as well as		 * position of first one		 */		zfcp_qdio_zero_sbals(req_queue->buffer,				     fsf_req->sbal_first, fsf_req->sbal_number);		atomic_add(fsf_req->sbal_number, &req_queue->free_count);		req_queue->free_index -= fsf_req->sbal_number;	 /* increase */		req_queue->free_index += QDIO_MAX_BUFFERS_PER_Q;		req_queue->free_index %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */		ZFCP_LOG_DEBUG			("error: do_QDIO failed. Buffers could not be enqueued "			 "to request queue.\n");	} else {		req_queue->distance_from_int = new_distance_from_int;		/*		 * increase FSF sequence counter -		 * this must only be done for request successfully enqueued to		 * QDIO this rejected requests may be cleaned up by calling		 * routines  resulting in missing sequence counter values		 * otherwise,		 */		/* Don't increase for unsolicited status */		if (likely(inc_seq_no)) {			adapter->fsf_req_seq_no++;			ZFCP_LOG_TRACE			    ("FSF sequence counter value of adapter %s "			     "increased to %i\n",			     zfcp_get_busid_by_adapter(adapter),			     adapter->fsf_req_seq_no);		}		/* count FSF requests pending */		atomic_inc(&adapter->fsf_reqs_active);	}	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8a36e4532ea10471f0a8605207d071361d7be2c3/zfcp_fsf.c/clean/drivers/s390/scsi/zfcp_fsf.c