/* do_QDIO - process input or output buffers @cdev: associated ccw_device for the qdio subchannel @callflags: input or output and special flags from the program @q_nr: queue number @bufnr: buffer number @count: how many buffers to process  */
int do_QDIO(struct ccw_device *cdev, unsigned int callflags, int q_nr, unsigned int bufnr, unsigned int count)
/* do_QDIO - process input or output buffers @cdev: associated ccw_device for the qdio subchannel @callflags: input or output and special flags from the program @q_nr: queue number @bufnr: buffer number @count: how many buffers to process  */
int do_QDIO(struct ccw_device *cdev, unsigned int callflags, int q_nr, unsigned int bufnr, unsigned int count)
{
	struct qdio_irq *irq_ptr;
	if (bufnr >= QDIO_MAX_BUFFERS_PER_Q || count > QDIO_MAX_BUFFERS_PER_Q)
		return -EINVAL;
	irq_ptr = cdev->private->qdio_data;
	if (!irq_ptr)
		return -ENODEV;
	DBF_DEV_EVENT(DBF_INFO, irq_ptr,
		      "do%02x b:%02x c:%02x", callflags, bufnr, count);
	if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)
		return -EBUSY;
	if (callflags & QDIO_FLAG_SYNC_INPUT)
		return handle_inbound(irq_ptr->input_qs[q_nr],
				      callflags, bufnr, count);
	else if (callflags & QDIO_FLAG_SYNC_OUTPUT)
		return handle_outbound(irq_ptr->output_qs[q_nr],
				       callflags, bufnr, count);
	return -EINVAL;
}