From a05ca360cf04d7a01eb2a5cde61c90bde48e1bff Mon Sep 17 00:00:00 2001 From: Mark Allyn Date: Thu, 9 Dec 2010 09:32:38 -0800 Subject: [PATCH] --- yaml --- r: 228359 b: refs/heads/master c: 653bf0cfa55896b74d8cbe7e561401813ca359ad h: refs/heads/master i: 228357: 539c86f4b0c2c5f8e75f234489efe89fa26f29ce 228355: 3bd5715d88d6a0cabb299001342403948efbce5b 228351: 89afbffab92f4e63674e117fecc1c12bba3127fd v: v3 --- [refs] | 2 +- trunk/drivers/staging/sep/sep_driver.c | 8 ++++++++ trunk/drivers/staging/sep/sep_driver_config.h | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f72ceece79dc..8525ee97a53c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c100fa4d6142271cc6d228fd84a5da2390ec5ec1 +refs/heads/master: 653bf0cfa55896b74d8cbe7e561401813ca359ad diff --git a/trunk/drivers/staging/sep/sep_driver.c b/trunk/drivers/staging/sep/sep_driver.c index 903d6106c0d3..bb42b048f46a 100644 --- a/trunk/drivers/staging/sep/sep_driver.c +++ b/trunk/drivers/staging/sep/sep_driver.c @@ -897,6 +897,7 @@ static int sep_set_caller_id_handler(struct sep_device *sep, unsigned long arg) static int sep_set_current_caller_id(struct sep_device *sep) { int i; + u32 *hash_buf_ptr; dev_dbg(&sep->pdev->dev, "sep_set_current_caller_id start\n"); dev_dbg(&sep->pdev->dev, "current process is %d\n", current->pid); @@ -915,6 +916,13 @@ static int sep_set_current_caller_id(struct sep_device *sep) break; } } + /* Ensure data is in little endian */ + hash_buf_ptr = (u32 *)sep->shared_addr + + SEP_CALLER_ID_OFFSET_BYTES; + + for (i = 0; i < SEP_CALLER_ID_HASH_SIZE_IN_WORDS; i++) + hash_buf_ptr[i] = cpu_to_le32(hash_buf_ptr[i]); + dev_dbg(&sep->pdev->dev, "sep_set_current_caller_id end\n"); return 0; } diff --git a/trunk/drivers/staging/sep/sep_driver_config.h b/trunk/drivers/staging/sep/sep_driver_config.h index 92338c0f6bd2..b18625d2f7f4 100644 --- a/trunk/drivers/staging/sep/sep_driver_config.h +++ b/trunk/drivers/staging/sep/sep_driver_config.h @@ -201,6 +201,9 @@ held by the proccess (struct file) */ /* size of the caller id hash (sha2) */ #define SEP_CALLER_ID_HASH_SIZE_IN_BYTES 32 +/* size of the caller id hash (sha2) in 32 bit words */ +#define SEP_CALLER_ID_HASH_SIZE_IN_WORDS 8 + /* maximum number of entries in the caller id table */ #define SEP_CALLER_ID_TABLE_NUM_ENTRIES 20