]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
security: tlk_driver: remove non-compat support
authorScott Long <scottl@nvidia.com>
Fri, 5 Sep 2014 22:48:03 +0000 (15:48 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Tue, 16 Sep 2014 03:41:23 +0000 (20:41 -0700)
Now that OTE lib and TLK kernel have shifted over to 64bit
support the non-compat support in tlk_driver is no longer
needed.

This change removes the non-compat structs/routines and
removes "_compat" from the 64bit structs/routines to make
it clear they are being used.

Change-Id: I74ef915d6f1ec95ade10b075e5d0e0028ce2c9d4
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: http://git-master/r/496249
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
security/tlk_driver/ote_comms.c
security/tlk_driver/ote_device.c
security/tlk_driver/ote_protocol.h

index 37f9f72d14c3ceeae64aa49092357dd6ad7b8940..bc711ab85e1278cbecd835a075744977b804d042 100644 (file)
@@ -117,47 +117,9 @@ static int te_prep_mem_buffers(struct te_request *request,
 {
        uint32_t i;
        int ret = OTE_SUCCESS;
-       struct te_oper_param *params = request->params;
+       struct te_oper_param *params;
 
-       for (i = 0; i < request->params_size; i++) {
-               switch (params[i].type) {
-               case TE_PARAM_TYPE_NONE:
-               case TE_PARAM_TYPE_INT_RO:
-               case TE_PARAM_TYPE_INT_RW:
-                       break;
-               case TE_PARAM_TYPE_MEM_RO:
-               case TE_PARAM_TYPE_MEM_RW:
-               case TE_PARAM_TYPE_PERSIST_MEM_RO:
-               case TE_PARAM_TYPE_PERSIST_MEM_RW:
-                       ret = te_prep_mem_buffer(request->session_id,
-                               params[i].u.Mem.base,
-                               params[i].u.Mem.len,
-                               params[i].type,
-                               context);
-                       if (ret < 0) {
-                               pr_err("%s failed with err (%d)\n",
-                                       __func__, ret);
-                               ret = OTE_ERROR_BAD_PARAMETERS;
-                               break;
-                       }
-                       break;
-               default:
-                       pr_err("%s: OTE_ERROR_BAD_PARAMETERS\n", __func__);
-                       ret = OTE_ERROR_BAD_PARAMETERS;
-                       break;
-               }
-       }
-       return ret;
-}
-
-static int te_prep_mem_buffers_compat(struct te_request_compat *request,
-                       struct tlk_context *context)
-{
-       uint32_t i;
-       int ret = OTE_SUCCESS;
-       struct te_oper_param_compat *params;
-
-       params = (struct te_oper_param_compat *)(uintptr_t)request->params;
+       params = (struct te_oper_param *)(uintptr_t)request->params;
        for (i = 0; i < request->params_size; i++) {
                switch (params[i].type) {
                case TE_PARAM_TYPE_NONE:
@@ -332,29 +294,6 @@ static void do_smc(struct te_request *request, struct tlk_device *dev)
        uint32_t smc_args;
        uint32_t smc_params = 0;
 
-       if (dev->req_param_buf) {
-               smc_args = (char *)request - dev->req_param_buf;
-               if (request->params)
-                       smc_params = (char *)request->params -
-                                               dev->req_param_buf;
-       } else {
-               smc_args = (uint32_t)virt_to_phys(request);
-               if (request->params)
-                       smc_params = (uint32_t)virt_to_phys(request->params);
-       }
-
-       tlk_generic_smc(request->type, smc_args, smc_params);
-}
-
-/*
- * Do an SMC call
- */
-static void do_smc_compat(struct te_request_compat *request,
-                         struct tlk_device *dev)
-{
-       uint32_t smc_args;
-       uint32_t smc_params = 0;
-
        smc_args = (char *)request - dev->req_param_buf;
        if (request->params) {
                smc_params =
@@ -434,13 +373,12 @@ int te_set_vpr_params(void *vpr_base, size_t vpr_size)
 }
 EXPORT_SYMBOL(te_set_vpr_params);
 
-
 /*
  * Open session SMC (supporting client-based te_open_session() calls)
  */
 void te_open_session(struct te_opensession *cmd,
-                    struct te_request *request,
-                    struct tlk_context *context)
+                   struct te_request *request,
+                   struct tlk_context *context)
 {
        int ret;
 
@@ -481,8 +419,8 @@ void te_open_session(struct te_opensession *cmd,
  * Close session SMC (supporting client-based te_close_session() calls)
  */
 void te_close_session(struct te_closesession *cmd,
-                     struct te_request *request,
-                     struct tlk_context *context)
+                    struct te_request *request,
+                    struct tlk_context *context)
 {
        request->session_id = cmd->session_id;
        request->type = TE_SMC_CLOSE_SESSION;
@@ -500,8 +438,8 @@ void te_close_session(struct te_closesession *cmd,
  * Launch operation SMC (supporting client-based te_launch_operation() calls)
  */
 void te_launch_operation(struct te_launchop *cmd,
-                        struct te_request *request,
-                        struct tlk_context *context)
+                       struct te_request *request,
+                       struct tlk_context *context)
 {
        int ret;
 
@@ -529,98 +467,3 @@ void te_launch_operation(struct te_launchop *cmd,
 
        te_release_temp_mem_buffers(context);
 }
-
-/*
- * Open session SMC (supporting client-based te_open_session() calls)
- */
-void te_open_session_compat(struct te_opensession_compat *cmd,
-                           struct te_request_compat *request,
-                           struct tlk_context *context)
-{
-       int ret;
-
-       request->type = TE_SMC_OPEN_SESSION;
-
-       ret = te_prep_mem_buffers_compat(request, context);
-       if (ret != OTE_SUCCESS) {
-               pr_err("%s: te_prep_mem_buffers failed err (0x%x)\n",
-                       __func__, ret);
-               SET_RESULT(request, ret, OTE_RESULT_ORIGIN_API);
-               return;
-       }
-
-       memcpy(&request->dest_uuid,
-              &cmd->dest_uuid,
-              sizeof(struct te_service_id));
-
-       pr_info("OPEN_CLIENT_SESSION_COMPAT: 0x%x 0x%x 0x%x 0x%x\n",
-               request->dest_uuid[0],
-               request->dest_uuid[1],
-               request->dest_uuid[2],
-               request->dest_uuid[3]);
-
-       do_smc_compat(request, context->dev);
-
-       if (request->result) {
-               /* release any persistent mem buffers if we failed */
-               te_release_persist_mem_buffers(request->session_id, context);
-       } else {
-               /* mark active any persistent mem buffers */
-               te_update_persist_mem_buffers(request->session_id, context);
-       }
-
-       te_release_temp_mem_buffers(context);
-}
-
-/*
- * Close session SMC (supporting client-based te_close_session() calls)
- */
-void te_close_session_compat(struct te_closesession_compat *cmd,
-                            struct te_request_compat *request,
-                            struct tlk_context *context)
-{
-       request->session_id = cmd->session_id;
-       request->type = TE_SMC_CLOSE_SESSION;
-
-       do_smc_compat(request, context->dev);
-       if (request->result)
-               pr_info("%s: error closing session: %08x\n",
-                       __func__, request->result);
-
-       /* release any peristent mem buffers */
-       te_release_persist_mem_buffers(request->session_id, context);
-}
-
-/*
- * Launch operation SMC (supporting client-based te_launch_operation() calls)
- */
-void te_launch_operation_compat(struct te_launchop_compat *cmd,
-                               struct te_request_compat *request,
-                               struct tlk_context *context)
-{
-       int ret;
-
-       request->session_id = cmd->session_id;
-       request->command_id = cmd->operation.command;
-       request->type = TE_SMC_LAUNCH_OPERATION;
-
-       ret = te_prep_mem_buffers_compat(request, context);
-       if (ret != OTE_SUCCESS) {
-               pr_err("%s: te_prep_mem_buffers failed err (0x%x)\n",
-                       __func__, ret);
-               SET_RESULT(request, ret, OTE_RESULT_ORIGIN_API);
-               return;
-       }
-
-       do_smc_compat(request, context->dev);
-
-       if (request->result) {
-               /* release any persistent mem buffers if we failed */
-               te_release_persist_mem_buffers(request->session_id, context);
-       } else {
-               /* mark active any persistent mem buffers */
-               te_update_persist_mem_buffers(request->session_id, context);
-       }
-
-       te_release_temp_mem_buffers(context);
-}
index 05e01b5879d00935316afe20772765b52f9f5118..57cf2ee52292ec5874638ea45e3c89640a666942 100644 (file)
@@ -41,7 +41,6 @@ static int te_create_free_cmd_list(struct tlk_device *dev)
 {
        int cmd_desc_count, ret = 0;
        struct te_cmd_req_desc *req_desc;
-       struct te_cmd_req_desc_compat *req_desc_compat;
        int bitmap_size;
        bool use_reqbuf;
 
@@ -81,12 +80,6 @@ static int te_create_free_cmd_list(struct tlk_device *dev)
                goto error;
        }
 
-       /* requests in the first page, params in the second */
-       dev->req_addr_compat   = (struct te_request_compat *)
-                                       dev->req_param_buf;
-       dev->param_addr_compat = (struct te_oper_param_compat *)
-                                       (dev->req_param_buf + PAGE_SIZE);
-
        /* alloc param bitmap allocator */
        bitmap_size = BITS_TO_LONGS(TE_PARAM_MAX) * sizeof(long);
        dev->param_bitmap = kzalloc(bitmap_size, GFP_KERNEL);
@@ -107,24 +100,6 @@ static int te_create_free_cmd_list(struct tlk_device *dev)
                list_add_tail(&req_desc->list, &(dev->free_cmd_list));
        }
 
-       for (cmd_desc_count = 0;
-               cmd_desc_count < TE_CMD_DESC_MAX_COMPAT; cmd_desc_count++) {
-
-               req_desc_compat = kzalloc(sizeof(struct te_cmd_req_desc_compat),
-                               GFP_KERNEL);
-               if (req_desc_compat == NULL) {
-                       pr_err("Failed to allocate cmd req descriptor\n");
-                       ret = -ENOMEM;
-                       goto error;
-               }
-               req_desc_compat->req_addr =
-                       dev->req_addr_compat + cmd_desc_count;
-               INIT_LIST_HEAD(&(req_desc_compat->list));
-
-               /* Add the cmd param descriptor to free list */
-               list_add_tail(&req_desc_compat->list, &(dev->free_cmd_list));
-       }
-
 error:
        return ret;
 }
@@ -155,32 +130,6 @@ static void te_put_free_params(struct tlk_device *dev,
        bitmap_release_region(dev->param_bitmap, idx, nbits);
 }
 
-static struct te_oper_param_compat *
-       te_get_free_params_compat(struct tlk_device *dev, unsigned int nparams)
-{
-       struct te_oper_param_compat *params = NULL;
-       int idx, nbits;
-
-       if (nparams) {
-               nbits = get_count_order(nparams);
-               idx = bitmap_find_free_region(dev->param_bitmap,
-                               TE_PARAM_MAX, nbits);
-               if (idx >= 0)
-                       params = dev->param_addr_compat + idx;
-       }
-       return params;
-}
-
-static void te_put_free_params_compat(struct tlk_device *dev,
-       struct te_oper_param_compat *params, uint32_t nparams)
-{
-       int idx, nbits;
-
-       idx = (params - dev->param_addr_compat);
-       nbits = get_count_order(nparams);
-       bitmap_release_region(dev->param_bitmap, idx, nbits);
-}
-
 static struct te_cmd_req_desc *te_get_free_cmd_desc(struct tlk_device *dev)
 {
        struct te_cmd_req_desc *cmd_desc = NULL;
@@ -211,37 +160,6 @@ static void te_put_used_cmd_desc(struct tlk_device *dev,
        }
 }
 
-static struct te_cmd_req_desc_compat *
-te_get_free_cmd_desc_compat(struct tlk_device *dev)
-{
-       struct te_cmd_req_desc_compat *cmd_desc = NULL;
-
-       if (!(list_empty(&(dev->free_cmd_list)))) {
-               cmd_desc = list_first_entry(&(dev->free_cmd_list),
-                               struct te_cmd_req_desc_compat, list);
-               list_del(&(cmd_desc->list));
-               list_add_tail(&cmd_desc->list, &(dev->used_cmd_list));
-       }
-       return cmd_desc;
-}
-
-static void te_put_used_cmd_desc_compat(struct tlk_device *dev,
-       struct te_cmd_req_desc_compat *cmd_desc)
-{
-       struct te_cmd_req_desc_compat *param_desc, *tmp_param_desc;
-
-       if (cmd_desc) {
-               list_for_each_entry_safe(param_desc, tmp_param_desc,
-                               &(dev->used_cmd_list), list) {
-                       if (cmd_desc->req_addr == param_desc->req_addr) {
-                               list_del(&param_desc->list);
-                               list_add_tail(&param_desc->list,
-                                       &(dev->free_cmd_list));
-                       }
-               }
-       }
-}
-
 static void __attribute__((unused)) te_print_cmd_list(
        struct tlk_device *dev, int used_list)
 {
@@ -303,13 +221,13 @@ static int copy_params_from_user(struct te_request *req,
        if (operation->list_count == 0)
                return 0;
 
-       param_array = req->params;
+       param_array = (struct te_oper_param *)(uintptr_t)req->params;
        if (param_array == NULL) {
                pr_err("param_array empty\n");
                return 1;
        }
 
-       user_param = operation->list_head;
+       user_param = (struct te_oper_param *)(uintptr_t)operation->list_head;
        for (i = 0; i < operation->list_count && user_param != NULL; i++) {
                if (copy_from_user(param_array + i, user_param,
                                        sizeof(struct te_oper_param))) {
@@ -318,7 +236,8 @@ static int copy_params_from_user(struct te_request *req,
                                        i, user_param, operation->list_count);
                        return 1;
                }
-               user_param = param_array[i].next_ptr_user;
+               user_param = (struct te_oper_param *)(uintptr_t)
+                       param_array[i].next_ptr_user;
        }
        return 0;
 }
@@ -333,13 +252,14 @@ static int copy_params_to_user(struct te_request *req,
        if (operation->list_count == 0)
                return 0;
 
-       param_array = req->params;
+       param_array = (struct te_oper_param *)(uintptr_t)req->params;
        if (param_array == NULL) {
                pr_err("param_array empty\n");
                return 1;
        }
 
-       user_param = operation->list_head;
+       user_param =
+               (struct te_oper_param *)(uintptr_t)operation->list_head;
        for (i = 0; i < req->params_size; i++) {
                if (copy_to_user(user_param, param_array + i,
                                        sizeof(struct te_oper_param))) {
@@ -347,7 +267,8 @@ static int copy_params_to_user(struct te_request *req,
                                        user_param);
                        return 1;
                }
-               user_param = param_array[i].next_ptr_user;
+               user_param = (struct te_oper_param *)(uintptr_t)
+                       param_array[i].next_ptr_user;
        }
        return 0;
 }
@@ -357,12 +278,11 @@ static long te_handle_trustedapp_ioctl(struct file *file,
 {
        long err = 0;
        union te_cmd cmd;
-       void *ptr_user_answer = NULL;
        struct te_operation *operation = NULL;
        struct te_oper_param *params = NULL;
-       struct te_answer answer;
        struct te_request *request;
-
+       void __user *ptr_user_answer = NULL;
+       struct te_answer answer;
        struct te_cmd_req_desc *cmd_desc = NULL;
        struct tlk_context *context = file->private_data;
        struct tlk_device *dev = context->dev;
@@ -379,7 +299,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
        switch (ioctl_num) {
        case TE_IOCTL_OPEN_CLIENT_SESSION:
                operation = &cmd.opensession.operation;
-               ptr_user_answer = (void *)cmd.opensession.answer;
+               ptr_user_answer = (void *)(uintptr_t)cmd.opensession.answer;
 
                cmd_desc = te_get_free_cmd_desc(dev);
                params = te_get_free_params(dev, operation->list_count);
@@ -395,7 +315,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                request = cmd_desc->req_addr;
                memset(request, 0, sizeof(struct te_request));
 
-               request->params = params;
+               request->params = (uintptr_t)params;
                request->params_size = operation->list_count;
 
                if (copy_params_from_user(request, operation)) {
@@ -411,7 +331,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                break;
 
        case TE_IOCTL_CLOSE_CLIENT_SESSION:
-               ptr_user_answer = (void *)cmd.closesession.answer;
+               ptr_user_answer = (void *)(uintptr_t)cmd.closesession.answer;
                cmd_desc = te_get_free_cmd_desc(dev);
                if (!cmd_desc) {
                        SET_ANSWER(answer,
@@ -430,7 +350,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
 
        case TE_IOCTL_LAUNCH_OPERATION:
                operation = &cmd.launchop.operation;
-               ptr_user_answer = (void *)cmd.launchop.answer;
+               ptr_user_answer = (void *)(uintptr_t)cmd.launchop.answer;
 
                cmd_desc = te_get_free_cmd_desc(dev);
                params = te_get_free_params(dev, operation->list_count);
@@ -446,7 +366,7 @@ static long te_handle_trustedapp_ioctl(struct file *file,
                request = cmd_desc->req_addr;
                memset(request, 0, sizeof(struct te_request));
 
-               request->params = params;
+               request->params = (uintptr_t)params;
                request->params_size = operation->list_count;
 
                if (copy_params_from_user(request, operation)) {
@@ -487,209 +407,6 @@ error:
        return err;
 }
 
-static int copy_params_from_user_compat(struct te_request_compat *req,
-       struct te_operation_compat *operation)
-{
-       struct te_oper_param_compat *param_array;
-       struct te_oper_param_compat *user_param;
-       uint32_t i;
-
-       if (operation->list_count == 0)
-               return 0;
-
-       param_array = (struct te_oper_param_compat *)(uintptr_t)req->params;
-       if (param_array == NULL) {
-               pr_err("param_array empty\n");
-               return 1;
-       }
-
-       user_param = (struct te_oper_param_compat *)(uintptr_t)
-               operation->list_head;
-       for (i = 0; i < operation->list_count && user_param != NULL; i++) {
-               if (copy_from_user(param_array + i, user_param,
-                                       sizeof(struct te_oper_param_compat))) {
-                       pr_err("Failed to copy operation parameter:%d, %p, " \
-                                       "list_count: %d\n",
-                                       i, user_param, operation->list_count);
-                       return 1;
-               }
-               user_param = (struct te_oper_param_compat *)(uintptr_t)
-                       param_array[i].next_ptr_user;
-       }
-       return 0;
-}
-
-static int copy_params_to_user_compat(struct te_request_compat *req,
-       struct te_operation_compat *operation)
-{
-       struct te_oper_param_compat *param_array;
-       struct te_oper_param_compat *user_param;
-       uint32_t i;
-
-       if (operation->list_count == 0)
-               return 0;
-
-       param_array =
-               (struct te_oper_param_compat *)(uintptr_t)req->params;
-       if (param_array == NULL) {
-               pr_err("param_array empty\n");
-               return 1;
-       }
-
-       user_param =
-               (struct te_oper_param_compat *)(uintptr_t)operation->list_head;
-       for (i = 0; i < req->params_size; i++) {
-               if (copy_to_user(user_param, param_array + i,
-                                       sizeof(struct te_oper_param_compat))) {
-                       pr_err("Failed to copy back parameter:%d %p\n", i,
-                                       user_param);
-                       return 1;
-               }
-               user_param = (struct te_oper_param_compat *)(uintptr_t)
-                       param_array[i].next_ptr_user;
-       }
-       return 0;
-}
-
-static long te_handle_trustedapp_ioctl_compat(struct file *file,
-       unsigned int ioctl_num, unsigned long ioctl_param)
-{
-       long err = 0;
-       union te_cmd_compat cmd_compat;
-       struct te_operation_compat *operation = NULL;
-       struct te_oper_param_compat *params = NULL;
-       struct te_request_compat *request;
-       void __user *ptr_user_answer = NULL;
-       struct te_answer answer;
-       struct te_cmd_req_desc_compat *cmd_desc = NULL;
-       struct tlk_context *context = file->private_data;
-       struct tlk_device *dev = context->dev;
-
-       if (copy_from_user(&cmd_compat, (void __user *)ioctl_param,
-                               sizeof(union te_cmd_compat))) {
-               pr_err("Failed to copy command request\n");
-               err = -EFAULT;
-               goto error;
-       }
-
-       memset(&answer, 0, sizeof(struct te_answer));
-
-       switch (ioctl_num) {
-       case TE_IOCTL_OPEN_CLIENT_SESSION_COMPAT:
-               operation = &cmd_compat.opensession.operation;
-               ptr_user_answer = (void *)(uintptr_t)
-                                       cmd_compat.opensession.answer;
-
-               cmd_desc = te_get_free_cmd_desc_compat(dev);
-               params = te_get_free_params_compat(dev, operation->list_count);
-
-               if (!cmd_desc || (operation->list_count && !params)) {
-                       SET_ANSWER(answer,
-                                  OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_RESULT_ORIGIN_COMMS);
-                       pr_err("failed to get cmd_desc/params\n");
-                       goto error;
-               }
-
-               request = cmd_desc->req_addr;
-               memset(request, 0, sizeof(struct te_request_compat));
-
-               request->params = (uintptr_t)params;
-               request->params_size = operation->list_count;
-
-               if (copy_params_from_user_compat(request, operation)) {
-                       err = -EFAULT;
-                       pr_info("failed to copy params from user\n");
-                       goto error;
-               }
-
-               te_open_session_compat(&cmd_compat.opensession,
-                                       request, context);
-
-               SET_ANSWER(answer, request->result, request->result_origin);
-               answer.session_id = request->session_id;
-               break;
-
-       case TE_IOCTL_CLOSE_CLIENT_SESSION_COMPAT:
-               ptr_user_answer = (void *)(uintptr_t)
-                                       cmd_compat.closesession.answer;
-               cmd_desc = te_get_free_cmd_desc_compat(dev);
-               if (!cmd_desc) {
-                       SET_ANSWER(answer,
-                                  OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_RESULT_ORIGIN_COMMS);
-                       pr_err("failed to get cmd_desc\n");
-                       goto error;
-               }
-
-               request = cmd_desc->req_addr;
-               memset(request, 0, sizeof(struct te_request_compat));
-
-               /* close session cannot fail */
-               te_close_session_compat(&cmd_compat.closesession,
-                                       request, context);
-               break;
-
-       case TE_IOCTL_LAUNCH_OPERATION_COMPAT:
-               operation = &cmd_compat.launchop.operation;
-               ptr_user_answer = (void *)(uintptr_t)cmd_compat.launchop.answer;
-
-               cmd_desc = te_get_free_cmd_desc_compat(dev);
-               params = te_get_free_params_compat(dev, operation->list_count);
-
-               if (!cmd_desc || (operation->list_count && !params)) {
-                       SET_ANSWER(answer,
-                                  OTE_ERROR_OUT_OF_MEMORY,
-                                  OTE_RESULT_ORIGIN_COMMS);
-                       pr_err("failed to get cmd_desc/params\n");
-                       goto error;
-               }
-
-               request = cmd_desc->req_addr;
-               memset(request, 0, sizeof(struct te_request_compat));
-
-               request->params = (uintptr_t)params;
-               request->params_size = operation->list_count;
-
-               if (copy_params_from_user_compat(request, operation)) {
-                       err = -EFAULT;
-                       pr_info("failed to copy params from user\n");
-                       goto error;
-               }
-
-               te_launch_operation_compat(&cmd_compat.launchop,
-                                               request, context);
-
-               SET_ANSWER(answer, request->result, request->result_origin);
-               break;
-
-       default:
-               pr_err("Invalid IOCTL Cmd\n");
-               err = -EINVAL;
-               goto error;
-       }
-       if (ptr_user_answer && !err) {
-               if (copy_to_user(ptr_user_answer, &answer,
-                       sizeof(struct te_answer))) {
-                       pr_err("Failed to copy answer\n");
-                       err = -EFAULT;
-               }
-       }
-       if (request->params && !err) {
-               if (copy_params_to_user_compat(request, operation)) {
-                       pr_err("Failed to copy return params\n");
-                       err = -EFAULT;
-               }
-       }
-
-error:
-       if (cmd_desc)
-               te_put_used_cmd_desc_compat(dev, cmd_desc);
-       if (params)
-               te_put_free_params_compat(dev, params, operation->list_count);
-       return err;
-}
-
 static long tlk_device_ioctl(struct file *file, unsigned int ioctl_num,
        unsigned long ioctl_param)
 {
@@ -704,15 +421,6 @@ static long tlk_device_ioctl(struct file *file, unsigned int ioctl_num,
                mutex_unlock(&smc_lock);
                break;
 
-       case TE_IOCTL_OPEN_CLIENT_SESSION_COMPAT:
-       case TE_IOCTL_CLOSE_CLIENT_SESSION_COMPAT:
-       case TE_IOCTL_LAUNCH_OPERATION_COMPAT:
-               mutex_lock(&smc_lock);
-               err = te_handle_trustedapp_ioctl_compat(file, ioctl_num,
-                                                       ioctl_param);
-               mutex_unlock(&smc_lock);
-               break;
-
        case TE_IOCTL_SS_CMD:
                err = te_handle_ss_ioctl(file, ioctl_num, ioctl_param);
                break;
index 3ceefdf23bc342996b8691c1a5a7d220861b3fbe..864bf8f2b801f77faac13edacfa2f4cecedcd106 100644 (file)
 #define TE_IOCTL_LAUNCH_OPERATION \
        _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x14, union te_cmd)
 
-/* ioctls using new structs (eventually to replace current ioctls) */
-#define TE_IOCTL_OPEN_CLIENT_SESSION_COMPAT \
-       _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x10, union te_cmd_compat)
-#define TE_IOCTL_CLOSE_CLIENT_SESSION_COMPAT \
-       _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x11, union te_cmd_compat)
-#define TE_IOCTL_LAUNCH_OPERATION_COMPAT \
-       _IOWR(TE_IOCTL_MAGIC_NUMBER, 0x14, union te_cmd_compat)
-
 /* secure storage ioctl */
 #define TE_IOCTL_SS_CMD \
        _IOR(TE_IOCTL_MAGIC_NUMBER,  0x30, int)
 #define TE_CMD_DESC_MAX        (PAGE_SIZE / sizeof(struct te_request))
 #define TE_PARAM_MAX   (PAGE_SIZE / sizeof(struct te_oper_param))
 
-#define TE_CMD_DESC_MAX_COMPAT \
-       (PAGE_SIZE / sizeof(struct te_request_compat))
-#define TE_PARAM_MAX_COMPAT \
-       (PAGE_SIZE / sizeof(struct te_oper_param_compat))
-
 #define MAX_EXT_SMC_ARGS       12
 
 extern struct mutex smc_lock;
@@ -79,9 +66,6 @@ struct tlk_device {
        struct te_oper_param *param_addr;
        dma_addr_t param_addr_phys;
 
-       struct te_request_compat *req_addr_compat;
-       struct te_oper_param_compat *param_addr_compat;
-
        char *req_param_buf;
 
        unsigned long *param_bitmap;
@@ -95,11 +79,6 @@ struct te_cmd_req_desc {
        struct list_head list;
 };
 
-struct te_cmd_req_desc_compat {
-       struct te_request_compat *req_addr;
-       struct list_head list;
-};
-
 struct te_shmem_desc {
        struct list_head list;
        uint32_t type;
@@ -145,21 +124,6 @@ enum {
 };
 
 struct te_oper_param {
-       uint32_t index;
-       uint32_t type;
-       union {
-               struct {
-                       uint32_t val;
-               } Int;
-               struct {
-                       void  *base;
-                       uint32_t len;
-               } Mem;
-       } u;
-       void *next_ptr_user;
-};
-
-struct te_oper_param_compat {
        uint32_t index;
        uint32_t type;
        union {
@@ -174,16 +138,6 @@ struct te_oper_param_compat {
        uint64_t next_ptr_user;
 };
 
-struct te_operation {
-       uint32_t command;
-       struct te_oper_param *list_head;
-       /* Maintain a pointer to tail of list to easily add new param node */
-       struct te_oper_param *list_tail;
-       uint32_t list_count;
-       uint32_t status;
-       uint32_t iterface_side;
-};
-
 struct te_service_id {
        uint32_t time_low;
        uint16_t time_mid;
@@ -191,43 +145,7 @@ struct te_service_id {
        uint8_t clock_seq_and_node[8];
 };
 
-/*
- * OpenSession
- */
-struct te_opensession {
-       struct te_service_id dest_uuid;
-       struct te_operation operation;
-       uint32_t answer;
-};
-
-/*
- * CloseSession
- */
-struct te_closesession {
-       uint32_t        session_id;
-       uint32_t        answer;
-};
-
-/*
- * LaunchOperation
- */
-struct te_launchop {
-       uint32_t                session_id;
-       struct te_operation     operation;
-       uint32_t                answer;
-};
-
-union te_cmd {
-       struct te_opensession   opensession;
-       struct te_closesession  closesession;
-       struct te_launchop      launchop;
-};
-
-/*
- * Compat versions of the original structs (eventually to replace
- * the old structs, once the lib/TLK kernel changes are in).
- */
-struct te_operation_compat {
+struct te_operation {
        uint32_t        command;
        uint32_t        status;
        uint64_t        list_head;
@@ -239,16 +157,16 @@ struct te_operation_compat {
 /*
  * OpenSession
  */
-struct te_opensession_compat {
-       struct te_service_id            dest_uuid;
-       struct te_operation_compat      operation;
-       uint64_t                        answer;
+struct te_opensession {
+       struct te_service_id    dest_uuid;
+       struct te_operation     operation;
+       uint64_t                answer;
 };
 
 /*
  * CloseSession
  */
-struct te_closesession_compat {
+struct te_closesession {
        uint32_t        session_id;
        uint64_t        answer;
 };
@@ -256,30 +174,19 @@ struct te_closesession_compat {
 /*
  * LaunchOperation
  */
-struct te_launchop_compat {
-       uint32_t                        session_id;
-       struct te_operation_compat      operation;
-       uint64_t                        answer;
+struct te_launchop {
+       uint32_t                session_id;
+       struct te_operation     operation;
+       uint64_t                answer;
 };
 
-union te_cmd_compat {
-       struct te_opensession_compat    opensession;
-       struct te_closesession_compat   closesession;
-       struct te_launchop_compat       launchop;
+union te_cmd {
+       struct te_opensession   opensession;
+       struct te_closesession  closesession;
+       struct te_launchop      launchop;
 };
 
 struct te_request {
-       uint32_t                type;
-       uint32_t                session_id;
-       uint32_t                command_id;
-       struct te_oper_param    *params;
-       uint32_t                params_size;
-       uint32_t                dest_uuid[4];
-       uint32_t                result;
-       uint32_t                result_origin;
-};
-
-struct te_request_compat {
        uint32_t                type;
        uint32_t                session_id;
        uint32_t                command_id;
@@ -308,28 +215,12 @@ void te_launch_operation(struct te_launchop *cmd,
        struct te_request *request,
        struct tlk_context *context);
 
-void te_open_session_compat(struct te_opensession_compat *cmd,
-       struct te_request_compat *request,
-       struct tlk_context *context);
-
-void te_close_session_compat(struct te_closesession_compat *cmd,
-       struct te_request_compat *request,
-       struct tlk_context *context);
-
-void te_launch_operation_compat(struct te_launchop_compat *cmd,
-       struct te_request_compat *request,
-       struct tlk_context *context);
-
 #define SS_OP_MAX_DATA_SIZE    0x1000
 struct te_ss_op {
        uint32_t        req_size;
        uint8_t         data[SS_OP_MAX_DATA_SIZE];
 };
 
-struct te_ss_op_legacy {
-       uint8_t         data[SS_OP_MAX_DATA_SIZE];
-};
-
 int te_handle_ss_ioctl(struct file *file, unsigned int ioctl_num,
                unsigned long ioctl_param);
 void ote_print_logs(void);