예제 #1
0
static int send_xfer(int size)
{
	struct pollfd fds;
	int offset, ret;

	if (verify)
		format_buf(buf, size - 1);

	if (use_async) {
		fds.fd = rs;
		fds.events = POLLOUT;
	}

	for (offset = 0; offset < size; ) {
		if (use_async) {
			ret = do_poll(&fds, poll_timeout);
			if (ret)
				return ret;
		}

		ret = riowrite(rs, buf + offset, size - offset, offset, flags);
		if (ret > 0) {
			offset += ret;
		} else if (errno != EWOULDBLOCK && errno != EAGAIN) {
			perror("riowrite");
			return ret;
		}
	}

	return 0;
}
예제 #2
0
void ipc_dbg_dump_spi_tfr(struct ipc_link_context *context)
{
#ifdef DUMP_SPI_TFRS
	struct spi_transfer *tfr = &context->spi_transfer;
	struct spi_message *msg = &context->spi_message;

	if (tfr->tx_buf != NULL)
		dev_info(&context->sdev->dev, "link%d TX %4d bytes:%s\n",
			context->link->id, msg->actual_length,
			format_buf(tfr->tx_buf, msg->actual_length));

	if (tfr->rx_buf != NULL)
		dev_info(&context->sdev->dev, "link%d RX %4d bytes:%s\n",
			context->link->id, msg->actual_length,
			format_buf(tfr->rx_buf, msg->actual_length));
#endif
}
예제 #3
0
void ipc_dbg_dump_frame(struct device *dev, int linkid,
	struct ipc_tx_queue *frame, bool tx)
{
#ifdef CONFIG_MODEM_M6718_SPI_ENABLE_FEATURE_FRAME_DUMP
	if (frame->actual_len == 0)
		return;

	/*
#ifdef CONFIG_DEBUG_PRINTK
	 * Use printk(KERN_DEBUG... directly to ensure these are printed even
	 * when DEBUG is not defined for this device - we want to be able to
	 * dump the frames independently from the debug logging.
	 */
	printk(KERN_DEBUG "IPC link%d %s %3d %4d bytes:%s\n",
		linkid, (tx ? "TX" : "RX"), frame->counter, frame->len,
		format_buf(frame->data, frame->len));
#else
	 * Use ;
#endif
#endif
}