Пример #1
0
tSirRetStatus macClose(tHalHandle hHal)
{

    tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;
    uint8_t i =0;

    if (!pMac)
        return eHAL_STATUS_FAILURE;

    peClose(pMac);
    pMac->psOffloadEnabled = FALSE;

    /* Call routine to free-up all CFG data structures */
    cfgDeInit(pMac);

    logDeinit(pMac);

    /* Free the DumpTableEntry */
    for(i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
    {
        vos_mem_free(pMac->dumpTableEntry[i]);
    }

    // Finally, de-allocate the global MAC datastructure:
    vos_mem_free( pMac );

    return eSIR_SUCCESS;
}
Пример #2
0
tSirRetStatus macClose(tHalHandle hHal)
{

    tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;

#ifndef GEN6_ONWARDS
    if(pMac->hal.pHalDxe){
#ifdef RTL8652
        extern void * rtlglue_is_data_scratchpad_memory(void *);
        if(rtlglue_is_data_scratchpad_memory(pMac->hal.pHalDxe))
            ;
        else
#endif
            palFreeMemory(pMac, pMac->hal.pHalDxe);
    }
#endif //GEN6_ONWARDS

    peClose(pMac);
#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
    halClose(hHal);
#endif

    /* Call routine to free-up all CFG data structures */
    cfgDeInit(pMac);

    logDeinit(pMac);

    // Finally, de-allocate the global MAC datastructure:
    palFreeMemory( pMac->hHdd, pMac );

    return eSIR_SUCCESS;
}
tSirRetStatus macClose(tHalHandle hHal)
{

    tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;

    peClose(pMac);

    /* Call routine to free-up all CFG data structures */
    cfgDeInit(pMac);

    logDeinit(pMac);

    // Finally, de-allocate the global MAC datastructure:
    vos_mem_free( pMac );

    return eSIR_SUCCESS;
}
Пример #4
0
tSirRetStatus macClose(tHalHandle hHal)
{

    tpAniSirGlobal pMac = (tpAniSirGlobal) hHal;

    peClose(pMac);

    
    cfgDeInit(pMac);

    logDeinit(pMac);

    
    vos_mem_free( pMac );

    return eSIR_SUCCESS;
}
Пример #5
0
tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameters *pMacOpenParms)
{
    tpAniSirGlobal p_mac = NULL;
    tSirRetStatus status = eSIR_SUCCESS;
    uint8_t i =0;
    bool mem_alloc_failed = false;

    if(pHalHandle == NULL)
        return eSIR_FAILURE;

    /*
     * Make sure this adapter is not already opened. (Compare pAdapter pointer in already
     * allocated p_mac structures.)
     * If it is opened just return pointer to previously allocated p_mac pointer.
     * Or should this result in error?
     */

    /* Allocate p_mac */
    p_mac = vos_mem_malloc(sizeof(tAniSirGlobal));
    if (NULL == p_mac)
        return eSIR_FAILURE;

    /* Initialize the p_mac structure */
    vos_mem_set(p_mac, sizeof(tAniSirGlobal), 0);

    /*
     * Set various global fields of p_mac here
     * (Could be platform dependant as some variables in p_mac are platform
     * dependant)
     */
    p_mac->hHdd      = hHdd;
    *pHalHandle     = (tHalHandle)p_mac;

    {
        /* Call various PE (and other layer init here) */
        if (eSIR_SUCCESS != logInit(p_mac)) {
            vos_mem_free(p_mac);
            return eSIR_FAILURE;
        }

        /* Call routine to initialize CFG data structures */
        if (eSIR_SUCCESS != cfgInit(p_mac)) {
            vos_mem_free(p_mac);
            return eSIR_FAILURE;
        }

        sysInitGlobals(p_mac);
    }

    /* Set the Powersave Offload Capability to TRUE irrespective of
     * INI param as it should be always enabled for qca-cld driver
     */
    p_mac->psOffloadEnabled = TRUE;

    p_mac->scan.nextScanID = FIRST_SCAN_ID;
    /* FW: 0 to 2047 and Host: 2048 to 4095 */
    p_mac->mgmtSeqNum = WLAN_HOST_SEQ_NUM_MIN-1;
    p_mac->first_scan_done = false;

    status = peOpen(p_mac, pMacOpenParms);

    if (eSIR_SUCCESS != status) {
        sysLog(p_mac, LOGE, FL("macOpen failure\n"));
        vos_mem_free(p_mac);
        return status;
    }

    for (i=0; i<MAX_DUMP_TABLE_ENTRY; i++)
    {
        p_mac->dumpTableEntry[i] = vos_mem_malloc(sizeof(tDumpModuleEntry));
        if (NULL == p_mac->dumpTableEntry[i])
        {
            mem_alloc_failed = eANI_BOOLEAN_TRUE;
            break;
        }
        else
        {
            vos_mem_set(p_mac->dumpTableEntry[i], sizeof(tSirMbMsg), 0);
        }
    }

    if (mem_alloc_failed)
    {
        while (i>0)
        {
            i--;
            vos_mem_free(p_mac->dumpTableEntry[i]);
        }

        peClose(p_mac);
        vos_mem_free(p_mac);
        return eSIR_FAILURE;
    }

    return status;
}