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

Commit 5cbf9dae authored by CNSS_WLAN Service's avatar CNSS_WLAN Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wlan: Add driver command for low power mode" into wlan-driver.lnx.1.0

parents ec6a13ea 9d963285
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ static int hdd_ParseUserParams(tANI_U8 *pValue, tANI_U8 **ppArg);
void wlan_hdd_restart_timer_cb(v_PVOID_t usrDataForCallback);
void hdd_set_wlan_suspend_mode(bool suspend);
void hdd_set_vowifi_mode(hdd_context_t *hdd_ctx, bool enable);
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power);
v_U16_t hdd_select_queue(struct net_device *dev,
    struct sk_buff *skb
@@ -877,6 +878,25 @@ static int hdd_parse_setrmcactionperiod_command(tANI_U8 *pValue,
    return 0;
}
/*
 * hdd_set_olpc_mode() - Process the OLPCMODE command and invoke the SME api
 *
 * @hHal: context handler
 * @low_power: Value to be sent as a part of the OLPCMODE command
 *
 * Return: void
 */
void hdd_set_olpc_mode(tHalHandle hHal, bool low_power)
{
    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
    if (!pMac) {
	    hddLog(LOGE, "pMac is NULL");
	    return;
    }
    sme_set_olpc_mode(pMac, low_power);
}
/**
 * hdd_set_vowifi_mode() - Process VOWIFI command.
@@ -4080,6 +4100,21 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter,
           hdd_set_vowifi_mode(pHddCtx, *ptr - '0');
       }
       else if (strncmp(command, "OLPCMODE", 8) == 0)
       {
           tANI_U8 *ptr;
           ret = hdd_drv_cmd_validate(command, 8);
           if (ret)
               goto exit;
           VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
                      " Received Command to go to low power mode in %s", __func__);
           ptr = (tANI_U8*)command + 9;
           hdd_set_olpc_mode((tHalHandle)(pHddCtx->hHal), *ptr - '0');
        }
       else if(strncmp(command, "SETSUSPENDMODE", 14) == 0)
       {
           int suspend = 0;
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, 2019-2020 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -826,6 +826,7 @@ struct sir_mgmt_msg {
/* ARP Debug stats */
#define SIR_HAL_SET_ARP_STATS_REQ          (SIR_HAL_ITC_MSG_TYPES_BEGIN + 303)
#define SIR_HAL_GET_ARP_STATS_REQ          (SIR_HAL_ITC_MSG_TYPES_BEGIN + 304)
#define SIR_HAL_LOW_POWER_MODE             (SIR_HAL_ITC_MSG_TYPES_BEGIN + 305)
#define SIR_HAL_VOWIFI_MODE                (SIR_HAL_ITC_MSG_TYPES_BEGIN + 306)
#define SIR_HAL_QPOWER                     (SIR_HAL_ITC_MSG_TYPES_BEGIN + 307)

+1 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ sme_SetLinkLayerStatsIndCB

void sme_set_vowifi_mode(tpAniSirGlobal pMac, bool enable);
void sme_set_qpower(tpAniSirGlobal pMac, uint8_t enable);
void sme_set_olpc_mode(tpAniSirGlobal pMac, bool enable);

#ifdef WLAN_FEATURE_EXTSCAN
/* ---------------------------------------------------------------------------
+31 −0
Original line number Diff line number Diff line
@@ -991,6 +991,37 @@ void sme_set_vowifi_mode(tpAniSirGlobal pMac, bool enable)
    }
}
/*
 * sme_set_olpc_mode() - Set OLPC (low power)
 * @pMac - context handler
 * @enable - boolean value that determines the state
 *
 * The function sends the low power mode to firmware received
 * via driver command
 */
void sme_set_olpc_mode(tpAniSirGlobal pMac, bool enable)
{
    tSirMsgQ msgQ;
    tSirRetStatus retCode = eSIR_SUCCESS;
    vos_mem_zero(&msgQ, sizeof(tSirMsgQ));
    msgQ.type = WDA_LOW_POWER_MODE;
    msgQ.reserved = 0;
    msgQ.bodyval = enable;
    retCode = wdaPostCtrlMsg(pMac, &msgQ);
    if(eSIR_SUCCESS != retCode)
    {
        smsLog(pMac, LOGE,
           FL("Posting WDA_LOW_POWER_MODE to WDA failed, reason=%X"),
           retCode);
    }
    else
    {
        smsLog(pMac, LOG1, FL("posted WDA_LOW_POWER_MODE command"));
    }
}
tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac )
{
    tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE;
+1 −0
Original line number Diff line number Diff line
@@ -1112,6 +1112,7 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb);
#define WDA_BEACON_FILTER_IND          SIR_HAL_BEACON_FILTER_IND
#define WDA_VOWIFI_MODE                SIR_HAL_VOWIFI_MODE
#define WDA_QPOWER                     SIR_HAL_QPOWER
#define WDA_LOW_POWER_MODE             SIR_HAL_LOW_POWER_MODE

/// PE <-> HAL WOWL messages
#define WDA_WOWL_ADD_BCAST_PTRN        SIR_HAL_WOWL_ADD_BCAST_PTRN
Loading