]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: sep: update driver to SEP version 3.4.5
authorMark Allyn <mark.a.allyn@intel.com>
Tue, 4 Jan 2011 22:16:59 +0000 (14:16 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 21 Jan 2011 20:11:58 +0000 (12:11 -0800)
These changes enable the driver to work with SEP
version 3.4.5

Major change is to use non DMA access for any data
comming from a function that uses the external application
service on the SEP.

Signed-off-by: Mark Allyn <mark.a.allyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/sep/sep_driver.c
drivers/staging/sep/sep_driver_api.h
drivers/staging/sep/sep_driver_config.h

index a1b0bfe5e0035e0d5702532a45982ba1e883e4e7..ee234547c87781713627cf9200399fd756efe24e 100644 (file)
@@ -29,7 +29,6 @@
  *  2010.09.14  Upgrade to Medfield
  *
  */
-#define DEBUG
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/miscdevice.h>
@@ -2177,22 +2176,6 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
        dcb_table_ptr->out_vr_tail_pt = 0;
 
        if (isapplet == true) {
-               tail_size = data_in_size % block_size;
-               if (tail_size) {
-                       if (data_in_size < tail_block_size) {
-                               dev_warn(&sep->pdev->dev, "data in size smaller than tail block size\n");
-                               error = -ENOSPC;
-                               goto end_function;
-                       }
-                       if (tail_block_size)
-                               /*
-                                * Case the tail size should be
-                                * bigger than the real block size
-                                */
-                               tail_size = tail_block_size +
-                                       ((data_in_size -
-                                               tail_block_size) % block_size);
-               }
 
                /* Check if there is enough data for DMA operation */
                if (data_in_size < SEP_DRIVER_MIN_DATA_SIZE_PER_TABLE) {
@@ -2213,7 +2196,7 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
                        /* Set the output user-space address for mem2mem op */
                        if (app_out_address)
                                dcb_table_ptr->out_vr_tail_pt =
-                                                       (u32)app_out_address;
+                                                       (aligned_u64)app_out_address;
 
                        /*
                         * Update both data length parameters in order to avoid
@@ -2222,6 +2205,17 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
                         */
                        tail_size = 0x0;
                        data_in_size = 0x0;
+
+               } else {
+                       if (!app_out_address) {
+                               tail_size = data_in_size % block_size;
+                               if (!tail_size) {
+                                       if (tail_block_size == block_size)
+                                               tail_size = block_size;
+                               }
+                       } else {
+                               tail_size = 0;
+                       }
                }
                if (tail_size) {
                        if (is_kva == true) {
@@ -2243,7 +2237,7 @@ static int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
                                 * according to tail data size
                                 */
                                dcb_table_ptr->out_vr_tail_pt =
-                                       (u32)app_out_address + data_in_size
+                                       (aligned_u64)app_out_address + data_in_size
                                        - tail_size;
 
                        /* Save the real tail data size */
index fbbfa2396555e417281a514ba103707cfdb36c05..0f38d619842e7b54b4022ba57a0a8bafdc8d5c3d 100644 (file)
@@ -141,11 +141,11 @@ struct sep_dcblock {
        /* size of data in the first output mlli */
        u32     output_mlli_data_size;
        /* pointer to the output virtual tail */
-       u32     out_vr_tail_pt;
+       aligned_u64 out_vr_tail_pt;
        /* size of tail data */
        u32     tail_data_size;
        /* input tail data array */
-       u8      tail_data[64];
+       u8      tail_data[68];
 };
 
 struct sep_caller_id_entry {
index b18625d2f7f423a79e4b2fe582a6c768db273a01..d3b9220f396333eaabfa7bc6cfac5177c12e420f 100644 (file)
@@ -76,6 +76,10 @@ held by the proccess (struct file) */
 #define SEP_REQUEST_DAEMON_MAPPED 1
 #define SEP_REQUEST_DAEMON_UNMAPPED 0
 
+#define SEP_DEV_NAME "sep_sec_driver"
+#define SEP_DEV_SINGLETON "sep_sec_singleton_driver"
+#define SEP_DEV_DAEMON "sep_req_daemon_driver"
+
 /*--------------------------------------------------------
        SHARED AREA  memory total size is 36K
        it is divided is following: