/* Called to flush a packing buffer if no more pci flags are on the queue. Checks if there is a packing buffer and prepares it to be flushed. In that case returns 1, otherwise zero.  */
static int qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue)
/* Called to flush a packing buffer if no more pci flags are on the queue. Checks if there is a packing buffer and prepares it to be flushed. In that case returns 1, otherwise zero.  */
static int qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue)
{
	struct qeth_qdio_out_buffer *buffer;
	buffer = &queue->bufs[queue->next_buf_to_fill];
	if ((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
	   (buffer->next_element_to_fill > 0)) {
		atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
		queue->next_buf_to_fill =
			(queue->next_buf_to_fill + 1) % QDIO_MAX_BUFFERS_PER_Q;
		return 1;
	}
	return 0;
}