#define SEP_IOCENDTRANSACTION \
_IO(SEP_IOC_MAGIC_NUMBER, 15)
+#define SEP_DRIVER_INSERT_SHARE_ADDR_CMD \
+ _IO(SEP_IOC_MAGIC_NUMBER, 0x30)
+
#define SEP_IOCPREPAREDCB \
_IOW(SEP_IOC_MAGIC_NUMBER, 35, struct build_dcb_struct)
/* message area offset */
#define SEP_DRIVER_MESSAGE_AREA_OFFSET_IN_BYTES 0
+#define SEP_DRIVER_MESSAGE_START_AFTER_OPCODE 5
+
+#define SEP_SHARED_AREA_PHYSADDRESS_OFFSET \
+ (SEP_DRIVER_MESSAGE_START_AFTER_OPCODE + 6)
+
/* static pool area offset */
#define SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES \
(SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES)
struct sep_dma_context **dma_ctx = &private_data->dma_ctx;
struct sep_queue_info **my_queue_elem = &private_data->my_queue_elem;
int error = 0;
+ u32 *shared_place = NULL; /* used only for secure dma operation */
dev_dbg(&sep->pdev->dev, "[PID%d] ioctl cmd 0x%x\n",
current->pid, cmd);
dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB end\n",
current->pid);
break;
+ case SEP_DRIVER_INSERT_SHARE_ADDR_CMD:
+
+ /**
+ * This is used only for some secure dma operations
+ * Where the physical location of the shared memory
+ * area is to be inserted into a specific location
+ * of the message pool
+ */
+ dev_dbg(&sep->pdev->dev, "Inserting shared memory physical\n");
+ shared_place = (u32 *)sep->shared_addr;
+ shared_place += SEP_SHARED_AREA_PHYSADDRESS_OFFSET;
+ *shared_place = (u32)sep->shared_bus;
+ dev_dbg(&sep->pdev->dev, "addr inserted %x by %x wd offset\n",
+ SEP_SHARED_AREA_PHYSADDRESS_OFFSET * 4,
+ SEP_SHARED_AREA_PHYSADDRESS_OFFSET);
+ break;
default:
error = -ENOTTY;
dev_dbg(&sep->pdev->dev, "[PID%d] default end\n",
end_function:
dev_dbg(&sep->pdev->dev, "[PID%d] ioctl end\n", current->pid);
+ dev_dbg(&sep->pdev->dev, "[PID%d] SEP_DRIVER_INSERT_SHARE_ADDR_CMD %x\n",
+ SEP_DRIVER_INSERT_SHARE_ADDR_CMD);
return error;
}