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

Commit 4b922079 authored by Ajit Vaishya's avatar Ajit Vaishya
Browse files

wlan: Update Blacklist WDI Request and Response command

This commits Add new WDI Reques and Response
command i.e WDI_BLACKLIST_REQ and WDI_BLACKLIST_RSP.
This WDI command send Blacklist Bssid info to firmware
and wait for response using WDI Response command.

Change-Id: Iadd2b500560582ee9657fc562ba93b156c74c0a7
CRs-Fixed: 2674237
parent 19ce45de
Loading
Loading
Loading
Loading
+67 −1
Original line number Diff line number Diff line
@@ -358,6 +358,67 @@ VOS_STATUS WDA_ProcessNanRequest(tWDA_CbContext *pWDA,
   return CONVERT_WDI2VOS_STATUS(status) ;
}
/*
 * FUNCTION: WDA_ProcessBlackListReq
 * Process BlackList request
 */
VOS_STATUS WDA_ProcessBlackListReq(tWDA_CbContext *pWDA,
                                   tRoamParams *wdaRequest)
{
   WDI_Status status = WDI_STATUS_SUCCESS;
   tWDA_ReqParams *pWdaParams;
   WDI_BlackListReqType *wdiRequest = NULL;
   size_t wdiReqLength =  sizeof(WDI_BlackListReqType);
   uint8_t i;
   wdiRequest = (WDI_BlackListReqType *)vos_mem_malloc(wdiReqLength);
   if (NULL == wdiRequest) {
      VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                "%s: VOS MEM Alloc Failure, size : %zu", __func__,
                wdiReqLength);
      vos_mem_free(wdaRequest);
      return VOS_STATUS_E_NOMEM;
   }
   VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
             "WDA: Process length of Blacklist data : %zu", wdiReqLength);
   pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ;
   if (NULL == pWdaParams) {
      VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                "%s: VOS MEM Alloc Failure for tWDA_ReqParams", __func__);
      VOS_ASSERT(0);
      vos_mem_free(wdaRequest);
      vos_mem_free(wdiRequest);
      return VOS_STATUS_E_NOMEM;
   }
   wdiRequest->num_bssid_avoid_list = wdaRequest->num_bssid_avoid_list;
   wdiRequest->blacklist_timedout = wdaRequest->blacklist_timedout;
   for (i = 0; i < wdaRequest->num_bssid_avoid_list; i++) {
       vos_mem_copy(wdiRequest->bssid_avoid_list[i],
                    wdaRequest->bssid_avoid_list[i],
                    sizeof(wpt_macAddr));
   }
   vos_mem_free(wdaRequest);
   pWdaParams->pWdaContext = pWDA;
   pWdaParams->wdaMsgParam = NULL;
   pWdaParams->wdaWdiApiMsgParam = wdiRequest;
   status = WDI_BlackListReq(wdiRequest, pWdaParams);
   if (IS_WDI_STATUS_FAILURE(status)) {
      VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                "Failure to request.  Free all the memory ");
      vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
      vos_mem_free(pWdaParams);
   }
   return CONVERT_WDI2VOS_STATUS(status);
}
/**
 * wda_state_info_dump() - prints state information of wda layer
 */
@@ -17671,6 +17732,11 @@ VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg )
         WDA_ProcessNanRequest( pWDA, (tNanRequest *)pMsg->bodyptr);
         break;
      }
      case WDA_BLACKLIST_REQ:
      {
         WDA_ProcessBlackListReq(pWDA, (tRoamParams *)pMsg->bodyptr);
         break;
      }
      case WDA_SET_RTS_CTS_HTVHT:
      {
         WDA_ProcessSetRtsCtsHTVhtInd(pWDA, pMsg->bodyval);
+28 −0
Original line number Diff line number Diff line
@@ -6057,6 +6057,17 @@ typedef struct
    wpt_uint8 request_data[1];
} WDI_NanRequestType;

/*---------------------------------------------------------------------------
  WDI_BlackListReqType
---------------------------------------------------------------------------*/
#define MAX_BSSID_AVOID_LIST 16

typedef struct
{
    wpt_uint8 blacklist_timedout;
    wpt_uint8 num_bssid_avoid_list;
    wpt_macAddr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
} WDI_BlackListReqType;

/*---------------------------------------------------------------------------
  WDI_DelPeriodicTxPtrnParamsType
@@ -12277,6 +12288,23 @@ WDI_NanRequest
    void                         *usrData
);

/**
 @brief WDI_BlackListReq
        BlackList request

 @param pwdiBlackListReq: data

        usrData: user data will be passed back with the
        callback

 @return Result of the function call
*/
WDI_Status
WDI_BlackListReq
(
    WDI_BlackListReqType          *pwdiBlackListReq,
    void                         *usrData
);
/**
 @brief WDI_SetRtsCtsHTVhtInd
        Set RTS/CTS indication for diff modes.
+37 −0
Original line number Diff line number Diff line
@@ -505,6 +505,8 @@ typedef enum
  WDI_FW_ARP_STATS_REQ                           = 125,
  WDI_FW_GET_ARP_STATS_REQ                       = 126,

  /* BLACKLIST Request */
  WDI_BLACKLIST_REQ                              = 127,
  WDI_MAX_REQ,

  /*Send a suspend Indication down to HAL*/
@@ -893,6 +895,9 @@ typedef enum
  WDI_CAPTURE_GET_TSF_TSTAMP_RSP                 = 123,
  WDI_FW_ARP_STATS_RSP                           = 124,
  WDI_FW_GET_ARP_STATS_RSP                       = 125,

  /* BLACKLIST Response */
  WDI_BLACKLIST_RSP                              = 126,
  /*-------------------------------------------------------------------------
    Indications
     !! Keep these last in the enum if possible
@@ -6499,6 +6504,38 @@ WDI_ProcessNanEvent
  WDI_EventInfoType*     pEventData
);

/**
 @brief Process BlackList Request

 @param  pWDICtx:         pointer to the WLAN DAL context
         pEventData:      pointer to the event information structure

 @see
 @return Result of the function call
*/
WDI_Status
WDI_ProcessBlackListReq
(
  WDI_ControlBlockType *pWDICtx,
  WDI_EventInfoType    *pEventData
);

/**
 @brief Process BlackList Response

 @param  pWDICtx:         pointer to the WLAN DAL context
         pEventData:      pointer to the event information structure

 @see
 @return Result of the function call
*/
WDI_Status
WDI_ProcessBlackListResp
(
  WDI_ControlBlockType  *pWDICtx,
  WDI_EventInfoType     *pEventData
);


/**
*@brief Process Lost Link param function (called when
+147 −1
Original line number Diff line number Diff line
@@ -548,6 +548,7 @@ WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] =
  WDI_ProcessSetArpStatsReq,          /* WDI_FW_ARP_STATS_REQ */
  WDI_ProcessGetArpStatsReq,          /* WDI_FW_GET_ARP_STATS_REQ */
  WDI_ProcessBlackListReq,            /* WDI_BLACKLIST_REQ*/
  /*-------------------------------------------------------------------------
    Indications
  -------------------------------------------------------------------------*/
@@ -902,6 +903,7 @@ WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] =
   WDI_ProcessSetArpStatsResp,          /* WDI_FW_ARP_STATS_RSP */
   WDI_ProcessGetArpStatsResp,          /* WDI_FW_GET_ARP_STATS_RSP */
   WDI_ProcessBlackListResp,              /* WDI_BLACKLIST_RSP */
  /*---------------------------------------------------------------------
    Indications
  ---------------------------------------------------------------------*/
@@ -1353,6 +1355,7 @@ static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId)
    CASE_RETURN_STRING( WDI_FW_LOGGING_INIT_REQ);
    CASE_RETURN_STRING( WDI_GET_FRAME_LOG_REQ);
    CASE_RETURN_STRING( WDI_NAN_REQUEST );
    CASE_RETURN_STRING( WDI_BLACKLIST_REQ );
    CASE_RETURN_STRING( WDI_SET_RTS_CTS_HTVHT_IND );
    CASE_RETURN_STRING( WDI_MON_START_REQ );
    CASE_RETURN_STRING( WDI_MON_STOP_REQ );
@@ -1811,6 +1814,7 @@ static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId)
    CASE_RETURN_STRING (WDI_DHCP_SERVER_OFFLOAD_RSP);
#endif /* DHCP_SERVER_OFFLOAD */
    CASE_RETURN_STRING (WDI_CAPTURE_GET_TSF_TSTAMP_RSP);
    CASE_RETURN_STRING (WDI_BLACKLIST_RSP);
    default:
        return "Unknown WDI MessageId";
  }
@@ -25334,6 +25338,8 @@ WDI_2_HAL_REQ_TYPE
       return WLAN_HAL_GET_FRAME_LOG_REQ;
  case WDI_NAN_REQUEST:
       return WLAN_HAL_NAN_REQ;
  case WDI_BLACKLIST_REQ:
       return WLAN_HAL_BLACK_LIST_SSID_REQ;
  case WDI_SET_RTS_CTS_HTVHT_IND:
       return WLAN_HAL_SET_RTS_CTS_HTVHT_IND;
  case WDI_SET_VOWIFI_IND:
@@ -25731,6 +25737,8 @@ case WLAN_HAL_DEL_STA_SELF_RSP:
       return WDI_GET_FRAME_LOG_RSP;
  case WLAN_HAL_NAN_RSP:
       return WDI_NAN_RESPONSE;
  case WLAN_HAL_BLACK_LIST_SSID_RSP:
       return WDI_BLACKLIST_RSP;
  case WLAN_HAL_NAN_EVT:
       return WDI_HAL_NAN_EVENT;
  case WLAN_HAL_LOST_LINK_PARAMETERS_IND:
@@ -38172,6 +38180,145 @@ WDI_ProcessNanEvent
}/*WDI_ProcessNanEvent*/
WDI_Status
WDI_BlackListReq
(
   WDI_BlackListReqType       *pwdiBlackListReq,
   void                       *usrData
)
{
  WDI_EventInfoType      wdiEventData;
  /*------------------------------------------------------------------------
    Sanity Check
  ------------------------------------------------------------------------*/
  if (eWLAN_PAL_FALSE == gWDIInitialized) {
     WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
                "WDI API call before module is initialized - Fail request");
     return WDI_STATUS_E_NOT_ALLOWED;
  }
  VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
            "WDI_BlackListReq %zu %zu", sizeof(*pwdiBlackListReq),
            sizeof(WDI_BlackListReqType));
  /*------------------------------------------------------------------------
    Fill in Event data and post to the Main FSM
  ------------------------------------------------------------------------*/
  wdiEventData.wdiRequest      = WDI_BLACKLIST_REQ;
  wdiEventData.pEventData      = pwdiBlackListReq;
  wdiEventData.uEventDataSize  = sizeof(WDI_BlackListReqType);
  wdiEventData.pUserData       = usrData;
  wdiEventData.pCBfnc          = NULL;
  return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
}
WDI_Status
WDI_ProcessBlackListReq
(
  WDI_ControlBlockType  *pWDICtx,
  WDI_EventInfoType     *pEventData
)
{
  WDI_BlackListReqType             *pwdiBlackListReq = NULL;
  wpt_uint8                        *pSendBuffer       = NULL;
  wpt_uint16                       usDataOffset      = 0;
  wpt_uint16                       usSendSize        = 0;
  WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO,
             "WDI_ProcessBlackListReq");
  /*-------------------------------------------------------------------------
    Sanity check
  -------------------------------------------------------------------------*/
  if ((NULL == pEventData) ||
      (NULL ==
       (pwdiBlackListReq = (WDI_BlackListReqType*)pEventData->pEventData))) {
        WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                   "%s: Invalid parameters", __FUNCTION__);
        WDI_ASSERT(0);
        return WDI_STATUS_E_FAILURE;
  }
  /*-----------------------------------------------------------------------
    Get message buffer
  -----------------------------------------------------------------------*/
  if ((WDI_STATUS_SUCCESS
       != WDI_GetMessageBuffer(pWDICtx,
                               WDI_BLACKLIST_REQ,
                               sizeof(WDI_BlackListReqType),
                               &pSendBuffer,
                               &usDataOffset,
                               &usSendSize)) ||
      (usSendSize < (usDataOffset + sizeof(WDI_BlackListReqType)))) {
     WPAL_TRACE(eWLAN_MODULE_DAL_CTRL,  eWLAN_PAL_TRACE_LEVEL_WARN,
                "Unable to get send buffer in BlackList request %pK %pK",
                pEventData, pwdiBlackListReq);
     WDI_ASSERT(0);
     return WDI_STATUS_E_FAILURE;
  }
  wpalMemoryCopy(pSendBuffer+usDataOffset,
                 pwdiBlackListReq,
                 sizeof(WDI_BlackListReqType));
  pWDICtx->pReqStatusUserData = NULL;
  pWDICtx->pfncRspCB = NULL;
  vos_mem_free(pEventData->pUserData);
  /*-------------------------------------------------------------------------
    Send BLACKLIST Request to HAL
  -------------------------------------------------------------------------*/
  return WDI_SendMsg(pWDICtx,
                     pSendBuffer,
                     usSendSize,
                     NULL,
                     NULL,
                     WDI_BLACKLIST_RSP);
}
/**
 @brief Process BLACKLIST Response function (called when a
        response is being received over the bus from HAL)
 @param  pWDICtx:         pointer to the WLAN DAL context
         pEventData:      pointer to the event information structure
 @see
 @return Result of the function call
*/
WDI_Status
WDI_ProcessBlackListResp
(
  WDI_ControlBlockType  *pWDICtx,
  WDI_EventInfoType     *pEventData
)
{
  WDI_Status wdiStatus;
  eHalStatus halStatus;
  /*-------------------------------------------------------------------------
    Sanity check
  -------------------------------------------------------------------------*/
  if ((NULL == pWDICtx ) || ( NULL == pEventData ) ||
      (NULL == pEventData->pEventData)) {
       WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                  "%s: Invalid parameters", __func__);
       WDI_ASSERT(0);
       return WDI_STATUS_E_FAILURE;
  }
  halStatus = *((eHalStatus*)pEventData->pEventData);
  wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus);
  VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
            "%s : Received BLACKLIST response, status : %d", __FUNCTION__, wdiStatus);
  return WDI_STATUS_SUCCESS;
}/*WDI_ProcessBlackListResp*/
WDI_Status
WDI_Process_RssiBreachedInd
(
@@ -38224,7 +38371,6 @@ WDI_Process_RssiBreachedInd
}
WDI_Status
WDI_Process_LostLinkParamInd
(
+2 −0
Original line number Diff line number Diff line
@@ -633,6 +633,8 @@ typedef enum

   WLAN_HAL_VOWIFI_IND                       = 360,
   WLAN_HAL_QPOWER_ENABLE_BY_HOST_IND        = 361,
   WLAN_HAL_BLACK_LIST_SSID_REQ              = 362,
   WLAN_HAL_BLACK_LIST_SSID_RSP              = 363,

   WLAN_HAL_MSG_MAX = WLAN_HAL_MSG_TYPE_MAX_ENUM_SIZE
}tHalHostMsgType;