Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64c1b494 authored by Kiet Lam's avatar Kiet Lam
Browse files

wlan : To remove PAL memory wrapper in SME.

This is to remove the PAL memory wrapper in SME and replace with
vos calls. The replacement aims to optimize the code while
retaining the functionality, with the final goal of making pal
memory as a feature that can be enabled/disabled at will.

CRs-Fixed: 520321
Change-Id: I026c7160cf628444df900d4814b17764ca7690f5
parent 623403f2
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static tANI_U32 * encodeCfgReq(tHddHandle hHdd, tANI_U32 *pl, tANI_U32 cfgId, tA
    }
    else
    {
        palCopyMemory(hHdd, (void *)pl, (void *)pBuf, length);
        vos_mem_copy((void *)pl, (void *)pBuf, length);
        pl += (CFGOBJ_ALIGN(length) / CFGOBJ_ALIGNTO);
    }
    return pl ;
@@ -124,8 +124,8 @@ static eHalStatus sendCfg(tpAniSirGlobal pMac, tHddHandle hHdd, tCfgReq *req, tA
                                 CFGOBJ_LEN_SIZE +
                                 CFGOBJ_ALIGN(req->length)) ;

    status = palAllocateMemory(hHdd, (void **)&msg, msgLen);
    if (status == eHAL_STATUS_SUCCESS)
    msg = vos_mem_malloc(msgLen);
    if ( NULL != msg )
    {
        if( fRsp )
        {
@@ -148,7 +148,8 @@ static eHalStatus sendCfg(tpAniSirGlobal pMac, tHddHandle hHdd, tCfgReq *req, tA
    }
    else
    {
        smsLog( pMac, LOGW, FL("palAllocateMemory(len=%d)"), msgLen );
        smsLog( pMac, LOGW, FL("failed to allocate memory(len=%d)"), msgLen );
        status = eHAL_STATUS_FAILURE;
    }

    return status ;
@@ -164,7 +165,8 @@ static tCfgReq * allocateCfgReq(tHddHandle hHdd, tANI_U32 type, tANI_S32 length)
        alloc_len += length ;
    }

    if (palAllocateMemory(hHdd, (void **)&req, alloc_len) != eHAL_STATUS_SUCCESS)
    req = vos_mem_malloc(alloc_len);
    if ( NULL == req )
    {
        return NULL ;
    }
@@ -176,7 +178,7 @@ static tCfgReq * allocateCfgReq(tHddHandle hHdd, tANI_U32 type, tANI_S32 length)

static void freeCfgReq(tHddHandle hHdd, tCfgReq *req)
{
    palFreeMemory(hHdd, (void*)req) ;
    vos_mem_free(req);
}

static void add_req_tail(tCfgReq *req, struct ccmlink *q)
@@ -305,7 +307,7 @@ static eHalStatus cfgSetSub(tpAniSirGlobal pMac, tHddHandle hHdd, tANI_U32 cfgId
        }
        else
        {
            palCopyMemory(hHdd, (void*)req->ccmPtr, (void*)ccmPtr, length); 
            vos_mem_copy((void *)req->ccmPtr, (void *)ccmPtr, length);
        }

        palSpinLockTake(hHdd, pMac->ccm.lock);
@@ -413,7 +415,7 @@ eHalStatus ccmOpen(tHalHandle hHal)
    tHddHandle hHdd = halHandle2HddHandle(hHal);
    tpAniSirGlobal pMac = PMAC_STRUCT( hHal );

    (void)palZeroMemory(hHdd, &pMac->ccm, sizeof(tCcm)) ;
    vos_mem_set(&pMac->ccm, sizeof(tCcm), 0);
    return palSpinLockAlloc(hHdd, &pMac->ccm.lock);
}

@@ -682,7 +684,7 @@ eHalStatus ccmCfgGetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pBuf, tANI_U32
    if (req && req->state == eCCM_REQ_DONE && (tANI_U32)req->length <= *pLength)
    {
        *pLength = req->length ; 
        palCopyMemory(hHdd, (void*)pBuf, (void*)req->ccmPtr, req->length); 
        vos_mem_copy((void *)pBuf, (void *)req->ccmPtr, req->length);
    }
    else
    {
@@ -751,10 +753,11 @@ static eHalStatus cfgUpdate(tpAniSirGlobal pMac, tHddHandle hHdd, tCcmCfgSetCall
    pMac->ccm.replay.callback    = callback ;
    pMac->ccm.replay.done        = NULL ;

    status = palAllocateMemory(hHdd, (void **)&msg, msgLen) ;
    if (status != eHAL_STATUS_SUCCESS)
    msg = vos_mem_malloc(msgLen);
    if ( NULL == msg )
    {
        pMac->ccm.replay.started = 0 ;
        status = eHAL_STATUS_FAILURE;
        goto end; 
    }

+1072 −772

File changed.

File size exceeds preview limit.

Loading