[FOSS_TLK]security: tlk_driver: remove legacy ss support
Scott Long [Tue, 2 Sep 2014 20:11:10 +0000 (13:11 -0700)]
Remove TE_IOCTL_SS_NEW_REQ/TE_IOCTL_SS_REQ_COMPLETE
support as these ioctls are no longer used.

Change-Id: I1cc54ec94e24985ba6de28c24422a363d239cbab
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: http://git-master/r/754999
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

security/tlk_driver/ote_device.c
security/tlk_driver/ote_fs.c
security/tlk_driver/ote_protocol.h

index 4746491..05e01b5 100644 (file)
@@ -713,8 +713,6 @@ static long tlk_device_ioctl(struct file *file, unsigned int ioctl_num,
                mutex_unlock(&smc_lock);
                break;
 
-       case TE_IOCTL_SS_NEW_REQ:
-       case TE_IOCTL_SS_REQ_COMPLETE:
        case TE_IOCTL_SS_CMD:
                err = te_handle_ss_ioctl(file, ioctl_num, ioctl_param);
                break;
index 2d59779..741c1c9 100644 (file)
@@ -37,48 +37,28 @@ int te_handle_ss_ioctl(struct file *file, unsigned int ioctl_num,
 {
        int ss_cmd;
 
-       switch (ioctl_num) {
-       case TE_IOCTL_SS_NEW_REQ:
+       if (ioctl_num != TE_IOCTL_SS_CMD)
+               return -EINVAL;
+
+       if (copy_from_user(&ss_cmd, (void __user *)ioctl_param,
+                               sizeof(ss_cmd))) {
+               pr_err("%s: copy from user space failed\n", __func__);
+               return -EFAULT;
+       }
+
+       switch (ss_cmd) {
+       case TE_IOCTL_SS_CMD_GET_NEW_REQ:
                /* wait for a new request */
                if (wait_for_completion_interruptible(&req_ready))
                        return -ENODATA;
-
-               /* transfer pending request to daemon's buffer */
-               if (copy_to_user((void __user *)ioctl_param, ss_op_shmem->data,
-                                       ss_op_shmem->req_size)) {
-                       pr_err("copy_to_user failed for new request\n");
-                       return -EFAULT;
-               }
                break;
-
-       case TE_IOCTL_SS_REQ_COMPLETE: /* request complete */
-               if (copy_from_user(ss_op_shmem->data,
-                       (void __user *)ioctl_param, ss_op_shmem->req_size)) {
-                       pr_err("copy_from_user failed for request\n");
-                       return -EFAULT;
-               }
-
+       case TE_IOCTL_SS_CMD_REQ_COMPLETE:
                /* signal the producer */
                complete(&req_complete);
                break;
-       case TE_IOCTL_SS_CMD:
-               if (copy_from_user(&ss_cmd, (void __user *)ioctl_param,
-                                       sizeof(ss_cmd))) {
-                       pr_err("%s: copy from user space failed\n", __func__);
-                       return -EFAULT;
-               }
-
-               if (ss_cmd == TE_IOCTL_SS_CMD_GET_NEW_REQ) {
-                       /* wait for a new request */
-                       if (wait_for_completion_interruptible(&req_ready))
-                               return -ENODATA;
-               } else if (ss_cmd == TE_IOCTL_SS_CMD_REQ_COMPLETE) {
-                       /* signal the producer */
-                       complete(&req_complete);
-               } else {
-                       pr_err("%s: unknown ss_cmd 0x%x\n", __func__, ss_cmd);
-                       return -EINVAL;
-               }
+       default:
+               pr_err("%s: unknown ss_cmd 0x%x\n", __func__, ss_cmd);
+               return -EINVAL;
        }
 
        return 0;
index 145febb..3ceefdf 100644 (file)
 #define TE_IOCTL_LAUNCH_OPERATION_COMPAT \
        _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x14, union te_cmd_compat)
 
-#define TE_IOCTL_SS_NEW_REQ_LEGACY \
-       _IOR(TE_IOCTL_MAGIC_NUMBER,  0x20, struct te_ss_op_legacy)
-#define TE_IOCTL_SS_REQ_COMPLETE_LEGACY \
-       _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x21, struct te_ss_op_legacy)
-
-/* ioctls using new SS structs (eventually to replace current SS ioctls) */
-#define TE_IOCTL_SS_NEW_REQ \
-       _IOR(TE_IOCTL_MAGIC_NUMBER,  0x20, struct te_ss_op)
-#define TE_IOCTL_SS_REQ_COMPLETE \
-       _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x21, struct te_ss_op)
-
 /* secure storage ioctl */
 #define TE_IOCTL_SS_CMD \
        _IOR(TE_IOCTL_MAGIC_NUMBER,  0x30, int)