void socp_m3_core()
{
	SOCP_BUFFER_RW_STRU sBuff;
	
	bsp_socp_get_write_buff(SOCP_ENCSRC_LPM3_BASE, &sBuff);

	/*printk("sBuff.pBuffer is 0x%x, sBuff.pRbBuffer is 0x%x\n", sBuff.pBuffer, sBuff.pRbBuffer);
	printk("sBuff.u32Size is 0x%x, sBuff.u32RbSize is 0x%x\n", sBuff.u32Size, sBuff.u32RbSize);*/

    if(sBuff.u32Size + sBuff.u32RbSize >= M3_SOCP_ENC_SRC_LGTH)
    {
        if(sBuff.u32Size >= M3_SOCP_ENC_SRC_LGTH)
        {
            memcpy((u8 *)sBuff.pBuffer, (u8 *)aEncSrc, M3_SOCP_ENC_SRC_LGTH);
        }
        else
        {
            memcpy((BSP_U8*)sBuff.pBuffer, (u8 *)aEncSrc, sBuff.u32Size);
            memcpy((BSP_U8*)sBuff.pRbBuffer, (u8 *)aEncSrc+sBuff.u32Size, M3_SOCP_ENC_SRC_LGTH-sBuff.u32Size);
        }
          		
        bsp_socp_write_done(SOCP_ENCSRC_LPM3_BASE, M3_SOCP_ENC_SRC_LGTH);
    } 
	
	/**/
}
u32 bsp_om_send_coder_src(u8 *send_data_virt, u32 send_len)
{
    SOCP_BUFFER_RW_STRU                 bd_buf = {0};
    u32                          ulBDNum;
    SOCP_BD_DATA_STRU                *p_bd_data;
    u32                          send_data_phy = 0;
    u32                         ret;

    osl_sem_down(&socp_opt_sem);

    /*  将用户虚拟地址转换成物理地址*/
    send_data_phy = bsp_om_virt_phy((u32)send_data_virt);

    bsp_socp_get_write_buff(g_bsp_om_socp_chan_info.en_src_chan_id, &bd_buf);

    /* 计算空闲BD的值 */
    ulBDNum = (bd_buf.u32Size + bd_buf.u32RbSize)  / sizeof(SOCP_BD_DATA_STRU);

    /* 判断是否还有空间 */
    if (1 >= ulBDNum)
    {
        bsp_om_debug(BSP_LOG_LEVEL_ERROR," get BD fail,ulBDNum = %d\n",ulBDNum);
        ret =  BSP_ERR_OMS_SOCP_GET_BD_NUM_ERR;
        goto fail;
    }

    /*SOCP给出是虚拟地址*/
    if(NULL == bd_buf.pBuffer )
    {
        bsp_om_debug(BSP_LOG_LEVEL_ERROR," get BD fail,pBuffer = NULL \n");
        ret =  BSP_ERR_OMS_SOCP_BD_ADDR_ERR;
        goto fail;
    }

    p_bd_data = (SOCP_BD_DATA_STRU *)(bd_buf.pBuffer);

    p_bd_data->pucData    = send_data_phy;
    p_bd_data->usMsgLen   = (BSP_U16)send_len;
    p_bd_data->enDataType = SOCP_BD_DATA;

    (void)cacheFlush(DATA_CACHE, bd_buf.pBuffer, sizeof(SOCP_BD_DATA_STRU));
    ret =  (u32)bsp_socp_write_done(g_bsp_om_socp_chan_info.en_src_chan_id, sizeof(SOCP_BD_DATA_STRU)) ;  /* 当前数据写入完毕 */

    if(ret != BSP_OK)
    {
        goto fail;
    }
    else
    {
        goto successful;
    }

fail:
    osl_sem_up(&socp_opt_sem);
    return ret;
successful:
    osl_sem_up(&socp_opt_sem);
    return BSP_OK;
}
/*****************************************************************************
 函 数 名  : DRV_SOCP_WRITE_DONE
 功能描述  : 该接口用于数据的写操作,提供写入数据的长度。
 输入参数  : u32SrcChanID:源通道ID
             u32WrtSize:   已写入数据的长度
 输出参数  : 无。
 返 回 值  : SOCP_OK:写入数据成功。
             SOCP_ERROR:写入数据失败
*****************************************************************************/
BSP_S32 DRV_SOCP_WRITE_DONE(BSP_U32 u32SrcChanID, BSP_U32 u32WrtSize)
{
    return bsp_socp_write_done(u32SrcChanID, u32WrtSize);
}
u32 bsp_om_send_coder_src(u8 *send_data_virt, u32 send_len)
{
    SOCP_BUFFER_RW_STRU                 bd_buf = {0};
    u32                          ulBDNum;
    SOCP_BD_DATA_STRU          bd_data = {0};
    u32                          send_data_phy = 0;
    u32                         ret;

    osl_sem_down(&socp_opt_sem);

    /*  将用户虚拟地址转换成物理地址*/
    send_data_phy = bsp_om_virt_phy((void *)send_data_virt);

    if(send_data_phy == 0)
    {
        ret =  BSP_ERR_OMS_INVALID_PARAM;
        goto fail;
    }

    bsp_socp_get_write_buff(g_bsp_om_socp_chan_info.en_src_chan_id, &bd_buf);

    /* 计算空闲BD的值 */
    ulBDNum = (bd_buf.u32Size + bd_buf.u32RbSize)/ sizeof(SOCP_BD_DATA_STRU);

    /* 判断是否还有空间 */
    if (1 >= ulBDNum)
    {
        bsp_om_debug(BSP_LOG_LEVEL_ERROR," GET BD fail,ulBDNum = %d\n",ulBDNum);
        ret =  BSP_ERR_OMS_SOCP_GET_BD_NUM_ERR;
        goto fail;
    }

    /*SOCP给出的是物理地址*/
    if(NULL == bd_buf.pBuffer )
    {
        bsp_om_debug(BSP_LOG_LEVEL_ERROR," GET BD fail,pBuffer = NULL \n");
        ret =  BSP_ERR_OMS_SOCP_BD_ADDR_ERR;
        goto fail;
    }

    bd_data.pucData    = send_data_phy;
    bd_data.usMsgLen   = (BSP_U16)send_len;
    bd_data.enDataType = SOCP_BD_DATA;

    memcpy((void *)bsp_om_phy_virt(((uintptr_t)bd_buf.pBuffer)),(void*)&bd_data,sizeof(SOCP_BD_DATA_STRU));
    /*lint -save -e713*/
    dma_map_single(NULL, (void*)bsp_om_phy_virt(((uintptr_t)bd_buf.pBuffer)), sizeof(SOCP_BD_DATA_STRU), DMA_TO_DEVICE);
    dma_map_single(NULL, (void *)(send_data_virt), send_len, DMA_TO_DEVICE);
    /*lint -restore*/
    ret =  (u32)bsp_socp_write_done(g_bsp_om_socp_chan_info.en_src_chan_id, sizeof(SOCP_BD_DATA_STRU)) ;  /* 当前数据写入完毕 */

    if(ret != BSP_OK)
    {
        goto fail;
    }
    else
    {
        ret = BSP_OK;
        goto successful;
    }

fail:
    osl_sem_up(&socp_opt_sem);
    return ret;
successful:
    osl_sem_up(&socp_opt_sem);
    return ret;
}