diff options
Diffstat (limited to 'drivers/staging/epl/EplApiProcessImage.c')
-rw-r--r-- | drivers/staging/epl/EplApiProcessImage.c | 281 |
1 files changed, 127 insertions, 154 deletions
diff --git a/drivers/staging/epl/EplApiProcessImage.c b/drivers/staging/epl/EplApiProcessImage.c index b433369..2b2fdf2 100644 --- a/drivers/staging/epl/EplApiProcessImage.c +++ b/drivers/staging/epl/EplApiProcessImage.c @@ -75,7 +75,6 @@ #include <asm/uaccess.h> #endif - /***************************************************************************/ /* */ /* */ @@ -100,7 +99,6 @@ // local function prototypes //--------------------------------------------------------------------------- - /***************************************************************************/ /* */ /* */ @@ -114,7 +112,6 @@ // /***************************************************************************/ - //=========================================================================// // // // P R I V A T E D E F I N I T I O N S // @@ -130,36 +127,33 @@ //--------------------------------------------------------------------------- #if ((EPL_API_PROCESS_IMAGE_SIZE_IN > 0) || (EPL_API_PROCESS_IMAGE_SIZE_OUT > 0)) - typedef struct - { - #if EPL_API_PROCESS_IMAGE_SIZE_IN > 0 - BYTE m_abProcessImageInput[EPL_API_PROCESS_IMAGE_SIZE_IN]; - #endif - #if EPL_API_PROCESS_IMAGE_SIZE_OUT > 0 - BYTE m_abProcessImageOutput[EPL_API_PROCESS_IMAGE_SIZE_OUT]; - #endif +typedef struct { +#if EPL_API_PROCESS_IMAGE_SIZE_IN > 0 + BYTE m_abProcessImageInput[EPL_API_PROCESS_IMAGE_SIZE_IN]; +#endif +#if EPL_API_PROCESS_IMAGE_SIZE_OUT > 0 + BYTE m_abProcessImageOutput[EPL_API_PROCESS_IMAGE_SIZE_OUT]; +#endif - } tEplApiProcessImageInstance; +} tEplApiProcessImageInstance; //--------------------------------------------------------------------------- // local vars //--------------------------------------------------------------------------- -static tEplApiProcessImageInstance EplApiProcessImageInstance_g; +static tEplApiProcessImageInstance EplApiProcessImageInstance_g; #endif //--------------------------------------------------------------------------- // local function prototypes //--------------------------------------------------------------------------- - //=========================================================================// // // // P U B L I C F U N C T I O N S // // // //=========================================================================// - //--------------------------------------------------------------------------- // // Function: EplApiProcessImageSetup() @@ -177,125 +171,101 @@ static tEplApiProcessImageInstance EplApiProcessImageInstance_g; tEplKernel PUBLIC EplApiProcessImageSetup(void) { -tEplKernel Ret = kEplSuccessful; + tEplKernel Ret = kEplSuccessful; #if ((EPL_API_PROCESS_IMAGE_SIZE_IN > 0) || (EPL_API_PROCESS_IMAGE_SIZE_OUT > 0)) -unsigned int uiVarEntries; -tEplObdSize ObdSize; + unsigned int uiVarEntries; + tEplObdSize ObdSize; #endif #if EPL_API_PROCESS_IMAGE_SIZE_IN > 0 - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN; - ObdSize = 1; - Ret = EplApiLinkObject( - 0x2000, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); - - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN; - ObdSize = 1; - Ret = EplApiLinkObject( - 0x2001, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 2; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; - Ret = EplApiLinkObject( - 0x2010, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 2; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; - Ret = EplApiLinkObject( - 0x2011, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 4; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; - Ret = EplApiLinkObject( - 0x2020, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 4; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; - Ret = EplApiLinkObject( - 0x2021, - EplApiProcessImageInstance_g.m_abProcessImageInput, - &uiVarEntries, - &ObdSize, - 1); + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN; + ObdSize = 1; + Ret = EplApiLinkObject(0x2000, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); + + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN; + ObdSize = 1; + Ret = EplApiLinkObject(0x2001, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 2; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; + Ret = EplApiLinkObject(0x2010, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 2; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; + Ret = EplApiLinkObject(0x2011, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 4; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; + Ret = EplApiLinkObject(0x2020, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 4; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_IN / ObdSize; + Ret = EplApiLinkObject(0x2021, + EplApiProcessImageInstance_g. + m_abProcessImageInput, &uiVarEntries, &ObdSize, + 1); #endif #if EPL_API_PROCESS_IMAGE_SIZE_OUT > 0 - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT; - ObdSize = 1; - Ret = EplApiLinkObject( - 0x2030, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); - - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT; - ObdSize = 1; - Ret = EplApiLinkObject( - 0x2031, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 2; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; - Ret = EplApiLinkObject( - 0x2040, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 2; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; - Ret = EplApiLinkObject( - 0x2041, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 4; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; - Ret = EplApiLinkObject( - 0x2050, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); - - ObdSize = 4; - uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; - Ret = EplApiLinkObject( - 0x2051, - EplApiProcessImageInstance_g.m_abProcessImageOutput, - &uiVarEntries, - &ObdSize, - 1); + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT; + ObdSize = 1; + Ret = EplApiLinkObject(0x2030, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); + + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT; + ObdSize = 1; + Ret = EplApiLinkObject(0x2031, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 2; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; + Ret = EplApiLinkObject(0x2040, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 2; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; + Ret = EplApiLinkObject(0x2041, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 4; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; + Ret = EplApiLinkObject(0x2050, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); + + ObdSize = 4; + uiVarEntries = EPL_API_PROCESS_IMAGE_SIZE_OUT / ObdSize; + Ret = EplApiLinkObject(0x2051, + EplApiProcessImageInstance_g. + m_abProcessImageOutput, &uiVarEntries, &ObdSize, + 1); #endif - return Ret; + return Ret; } //---------------------------------------------------------------------------- @@ -310,26 +280,29 @@ tEplObdSize ObdSize; // State: //---------------------------------------------------------------------------- -tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage* pPI_p) +tEplKernel PUBLIC EplApiProcessImageExchangeIn(tEplApiProcessImage * pPI_p) { -tEplKernel Ret = kEplSuccessful; + tEplKernel Ret = kEplSuccessful; #if EPL_API_PROCESS_IMAGE_SIZE_IN > 0 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) - copy_to_user(pPI_p->m_pImage, - EplApiProcessImageInstance_g.m_abProcessImageInput, - min(pPI_p->m_uiSize, sizeof (EplApiProcessImageInstance_g.m_abProcessImageInput))); - #else - EPL_MEMCPY(pPI_p->m_pImage, - EplApiProcessImageInstance_g.m_abProcessImageInput, - min(pPI_p->m_uiSize, sizeof (EplApiProcessImageInstance_g.m_abProcessImageInput))); - #endif +#if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) + copy_to_user(pPI_p->m_pImage, + EplApiProcessImageInstance_g.m_abProcessImageInput, + min(pPI_p->m_uiSize, + sizeof(EplApiProcessImageInstance_g. + m_abProcessImageInput))); +#else + EPL_MEMCPY(pPI_p->m_pImage, + EplApiProcessImageInstance_g.m_abProcessImageInput, + min(pPI_p->m_uiSize, + sizeof(EplApiProcessImageInstance_g. + m_abProcessImageInput))); +#endif #endif - return Ret; + return Ret; } - //---------------------------------------------------------------------------- // Function: EplApiProcessImageExchangeOut() // @@ -342,33 +315,33 @@ tEplKernel Ret = kEplSuccessful; // State: //---------------------------------------------------------------------------- -tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage* pPI_p) +tEplKernel PUBLIC EplApiProcessImageExchangeOut(tEplApiProcessImage * pPI_p) { -tEplKernel Ret = kEplSuccessful; + tEplKernel Ret = kEplSuccessful; #if EPL_API_PROCESS_IMAGE_SIZE_OUT > 0 - #if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) - copy_from_user(EplApiProcessImageInstance_g.m_abProcessImageOutput, - pPI_p->m_pImage, - min(pPI_p->m_uiSize, sizeof (EplApiProcessImageInstance_g.m_abProcessImageOutput))); - #else - EPL_MEMCPY(EplApiProcessImageInstance_g.m_abProcessImageOutput, - pPI_p->m_pImage, - min(pPI_p->m_uiSize, sizeof (EplApiProcessImageInstance_g.m_abProcessImageOutput))); - #endif +#if (TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__) + copy_from_user(EplApiProcessImageInstance_g.m_abProcessImageOutput, + pPI_p->m_pImage, + min(pPI_p->m_uiSize, + sizeof(EplApiProcessImageInstance_g. + m_abProcessImageOutput))); +#else + EPL_MEMCPY(EplApiProcessImageInstance_g.m_abProcessImageOutput, + pPI_p->m_pImage, + min(pPI_p->m_uiSize, + sizeof(EplApiProcessImageInstance_g. + m_abProcessImageOutput))); +#endif #endif - return Ret; + return Ret; } - //=========================================================================// // // // P R I V A T E F U N C T I O N S // // // //=========================================================================// - - // EOF - |