if (is_send_isr) {
memcpy(data->rx_buf, payload + TX_PAYLOAD(idx),
data->rx_size);
- } else
+ } else {
+ data->rx_size =
+ readl(mbox_base + RX_STATUS(idx));
memcpy(data->rx_buf, payload + RX_PAYLOAD(idx),
data->rx_size);
+ }
}
mbox_chan_received_data(link, data);
if (!is_send_isr)
void __iomem *payload = ctlr->payload_base;
struct mhu_data_buf *data = (struct mhu_data_buf *)msg;
int idx = chan->index;
+ u8 datatmp[512] = {0};
if (!data)
return -EINVAL;
else
idx = 0;
}
+ memcpy(datatmp, data->tx_buf, data->tx_size);
if (data->tx_buf)
- memcpy(payload + TX_PAYLOAD(idx), data->tx_buf, data->tx_size);
+ memcpy(payload + TX_PAYLOAD(idx), datatmp, data->tx_size);
+
writel(data->cmd, mbox_base + TX_SET(idx));
return 0;
SCPI_SETUP_DBUF_SIZE(sdata, mdata, SCPI_CL_NONE,
cmd, bl40_buf->buf, bl40_buf->size,
- bl40_buf, sizeof(struct bl40_msg_buf));
+ bl40_buf->buf, sizeof(bl40_buf->buf));
return scpi_execute_cmd(&sdata);
}