} 
} 
qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,		      struct qeth_eddp_context *ctx,		      int index){	struct qeth_qdio_out_buffer *buf = NULL;	struct qdio_buffer *buffer;	int elements = ctx->num_elements;	int element = 0;	int flush_cnt = 0;	int must_refcnt = 1;	int i;	QETH_DBF_TEXT(trace, 5, "eddpfibu");	while (elements > 0) {		buf = &queue->bufs[index];		if (atomic_read(&buf->state) != QETH_QDIO_BUF_EMPTY){			/* normally this should not happen since we checked for			 * available elements in qeth_check_elements_for_context			 */			if (element == 0)				return -EBUSY;			else {				PRINT_WARN("could only partially fill eddp "					   "buffer!\n");				goto out;			}		}		/* check if the whole next skb fits into current buffer */		if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) -					buf->next_element_to_fill)				< ctx->elements_per_skb){			/* no -> go to next buffer */			atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);			index = (index + 1) % QDIO_MAX_BUFFERS_PER_Q;			flush_cnt++;			/* new buffer, so we have to add ctx to buffer'ctx_list			 * and increment ctx's refcnt */			must_refcnt = 1;			continue;		}		if (must_refcnt){			must_refcnt = 0;			if (qeth_eddp_buf_ref_context(buf, ctx)){				PRINT_WARN("no memory to create eddp context "					   "reference\n");				goto out_check;			}		}		buffer = buf->buffer;		/* fill one skb into buffer */		for (i = 0; i < ctx->elements_per_skb; ++i){			buffer->element[buf->next_element_to_fill].addr =				ctx->elements[element].addr;			buffer->element[buf->next_element_to_fill].length =				ctx->elements[element].length;			buffer->element[buf->next_element_to_fill].flags =				ctx->elements[element].flags;			buf->next_element_to_fill++;			element++;			elements--;		}	}out_check:	if (!queue->do_pack) {		QETH_DBF_TEXT(trace, 6, "fillbfnp");		/* set state to PRIMED -> will be flushed */		if (buf->next_element_to_fill > 0){			atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);			flush_cnt++;		}	} else {#ifdef CONFIG_QETH_PERF_STATS		queue->card->perf_stats.skbs_sent_pack++;#endif		QETH_DBF_TEXT(trace, 6, "fillbfpa");		if (buf->next_element_to_fill >=				QETH_MAX_BUFFER_ELEMENTS(queue->card)) {			/*			 * packed buffer if full -> set state PRIMED			 * -> will be flushed			 */			atomic_set(&buf->state, QETH_QDIO_BUF_PRIMED);			flush_cnt++;		}	}out:	return flush_cnt;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/05e08a2a297371564020f76d1bf8b3a931d5e1ed/qeth_eddp.c/buggy/drivers/s390/net/qeth_eddp.c