Commit 6ab80c26 authored by Mark A. Allyn's avatar Mark A. Allyn Committed by Greg Kroah-Hartman

staging: sep: Add interfaces for the new functions

[This is picked out of the differences between the upstream driver and
 the staging driver. I'm resolving the differences as a series of updates -AC]
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aca58ec8
...@@ -3067,9 +3067,13 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -3067,9 +3067,13 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
switch (cmd) { switch (cmd) {
case SEP_IOCSENDSEPCOMMAND: case SEP_IOCSENDSEPCOMMAND:
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCSENDSEPCOMMAND start\n",
current->pid);
if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
&call_status->status)) { &call_status->status)) {
dev_dbg(&sep->pdev->dev, "[PID%d] send msg already done\n", dev_warn(&sep->pdev->dev,
"[PID%d] send msg already done\n",
current->pid); current->pid);
error = -EPROTO; error = -EPROTO;
goto end_function; goto end_function;
...@@ -3079,37 +3083,71 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -3079,37 +3083,71 @@ static long sep_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!error) if (!error)
set_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, set_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
&call_status->status); &call_status->status);
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCSENDSEPCOMMAND end\n", dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCSENDSEPCOMMAND end\n",
current->pid); current->pid);
break; break;
case SEP_IOCENDTRANSACTION: case SEP_IOCENDTRANSACTION:
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCENDTRANSACTION start\n",
current->pid);
error = sep_end_transaction_handler(sep, dma_ctx, call_status, error = sep_end_transaction_handler(sep, dma_ctx, call_status,
my_queue_elem); my_queue_elem);
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCENDTRANSACTION end\n", dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCENDTRANSACTION end\n",
current->pid); current->pid);
break; break;
case SEP_IOCPREPAREDCB: case SEP_IOCPREPAREDCB:
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCPREPAREDCB start\n",
current->pid);
case SEP_IOCPREPAREDCB_SECURE_DMA:
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCPREPAREDCB_SECURE_DMA start\n",
current->pid);
if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET,
&call_status->status)) { &call_status->status)) {
dev_dbg(&sep->pdev->dev, dev_warn(&sep->pdev->dev,
"[PID%d] dcb preparation needed before send msg\n", "[PID%d] dcb prep needed before send msg\n",
current->pid); current->pid);
error = -EPROTO; error = -EPROTO;
goto end_function; goto end_function;
} }
if (!arg) { if (!arg) {
dev_dbg(&sep->pdev->dev, dev_warn(&sep->pdev->dev,
"[PID%d] dcb prep null arg\n", current->pid); "[PID%d] dcb null arg\n", current->pid);
error = -EINVAL; error = EINVAL;
goto end_function; goto end_function;
} }
error = sep_prepare_dcb_handler(sep, arg, false, dma_ctx); if (cmd == SEP_IOCPREPAREDCB) {
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCPREPAREDCB end\n", /* No secure dma */
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCPREPAREDCB (no secure_dma)\n",
current->pid);
error = sep_prepare_dcb_handler(sep, arg, false,
dma_ctx);
} else {
/* Secure dma */
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOC_POC (with secure_dma)\n",
current->pid);
error = sep_prepare_dcb_handler(sep, arg, true,
dma_ctx);
}
dev_dbg(&sep->pdev->dev, "[PID%d] dcb's end\n",
current->pid); current->pid);
break; break;
case SEP_IOCFREEDCB: case SEP_IOCFREEDCB:
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB start\n",
current->pid);
case SEP_IOCFREEDCB_SECURE_DMA:
dev_dbg(&sep->pdev->dev,
"[PID%d] SEP_IOCFREEDCB_SECURE_DMA start\n",
current->pid);
error = sep_free_dcb_handler(sep, dma_ctx); error = sep_free_dcb_handler(sep, dma_ctx);
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB end\n", dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB end\n",
current->pid); current->pid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment