Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t sah_add_in_out_desc ( uint32_t  header,
const uint8_t *  in,
uint32_t  in_length,
uint8_t *  out,
uint32_t  out_length,
const sah_Mem_Util mu,
sah_Head_Desc **  desc_chain 
)

Add a descriptor with an input and output pointer

Add descriptor where link1 is input buffer, link2 is output buffer.

Parameters:
header The Sahara header value for the descriptor.
in The input buffer
in_length Size of the input buffer
[out] out The output buffer
out_length Size of the output buffer
mu Memory functions
[in,out] desc_chain Chain to start or append to
Returns:
A return code of type fsl_shw_return_t.

Definition at line 1199 of file sf_util.c.

References FSL_RETURN_OK_S, sah_Append_Desc(), sah_Create_Link(), sah_Destroy_Link(), SAH_OUTPUT_LINK, and SAH_USES_LINK_DATA.

{
    fsl_shw_return_t status = FSL_RETURN_OK_S;
    sah_Link         *link1 = NULL;
    sah_Link         *link2 = NULL;

      if (in != NULL) {
        status = sah_Create_Link(mu, &link1,
                                 (sah_Oct_Str) in, in_length,
                                 SAH_USES_LINK_DATA);
    }

    if ((status == FSL_RETURN_OK_S) && (out != NULL))  {
        status = sah_Create_Link(mu, &link2,
                                 (sah_Oct_Str) out, out_length,
                                 SAH_OUTPUT_LINK |
                                 SAH_USES_LINK_DATA);
    }

    if (status != FSL_RETURN_OK_S) {
        if (link1 != NULL) {
            sah_Destroy_Link(mu, link1);
        }
        if (link2 != NULL) {
            sah_Destroy_Link(mu, link2);
        }
    } else {
        status = sah_Append_Desc(mu, desc_chain, header, link1, link2);
    }

    return status;
}


Generated by  Doxygen 1.6.0   Back to index