/*==========================================================================
   FUNCTION    WDA_DS_GetTxFlowMask

  DESCRIPTION
    return TX flow mask control value

  DEPENDENCIES

  PARAMETERS

   IN
    pvosGCtx         VOS context

   OUT
    uFlowMask        TX channel mask for flow control
                     Defined in WDA_TXFlowEnumType

  RETURN VALUE
    VOS_STATUS_E_INVAL:  pointer is NULL and other errors 
    VOS_STATUS_SUCCESS:  Everything is good :)

  SIDE EFFECTS

============================================================================*/
VOS_STATUS
WDA_DS_GetTxFlowMask
(
 v_PVOID_t pvosGCtx,
 v_U8_t*   puFlowMask
)
{
   tWDA_CbContext* wdaContext = NULL;
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

   /*------------------------------------------------------------------------
     Sanity check
    ------------------------------------------------------------------------*/
   if ( ( NULL == pvosGCtx ) || ( NULL == puFlowMask ) )
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                 "WDA: Invalid parameter sent on WDA_DS_GetTxFlowMask" );
      return VOS_STATUS_E_INVAL;
   }

   wdaContext = (tWDA_CbContext *)vos_get_context( VOS_MODULE_ID_WDA, pvosGCtx );
   if ( NULL == wdaContext )
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                 "WDA: Invalid context on WDA_DS_GetTxFlowMask" );
      return VOS_STATUS_E_INVAL;
   }

   *puFlowMask = wdaContext->uTxFlowMask;

   return VOS_STATUS_SUCCESS;
}
void epping_driver_exit(v_CONTEXT_t pVosContext)
{
    epping_context_t *pEpping_ctx;

    pr_info("%s: unloading driver\n", __func__);

    pEpping_ctx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);

    if(!pEpping_ctx)
    {
        EPPING_LOG(VOS_TRACE_LEVEL_FATAL,
                   "%s: module exit called before probe",__func__);
    }
    else
    {
        vos_set_unload_in_progress(TRUE);
        vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE);
    }
    hif_unregister_driver();
    vos_mem_free(pEpping_ctx);
    vos_preClose( &pVosContext );
#ifdef MEMORY_DEBUG
    adf_net_buf_debug_exit();
    vos_mem_exit();
#endif
#ifdef TIMER_MANAGER
    vos_timer_exit();
#endif
    pr_info("%s: driver unloaded\n", __func__);
}
// Caller of this function MUST dynamically allocate memory for pBuf
// because this funciton will free the memory.
eHalStatus palSendMBMessage(tHddHandle hHdd, void *pBuf)
{
    eHalStatus halStatus = eHAL_STATUS_FAILURE;
    tSirRetStatus sirStatus;
    v_CONTEXT_t vosContext;
    v_VOID_t *hHal;

    vosContext = vos_get_global_context( VOS_MODULE_ID_HDD, hHdd );
    if (NULL == vosContext)
    {
        VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
                  "%s: invalid vosContext", __func__);
    }
    else
    {
        hHal = vos_get_context( VOS_MODULE_ID_SME, vosContext );
        if (NULL == hHal)
        {
            VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
                      "%s: invalid hHal", __func__);
        }
        else
        {
            sirStatus = uMacPostCtrlMsg( hHal, pBuf );
            if ( eSIR_SUCCESS == sirStatus )
            {
                halStatus = eHAL_STATUS_SUCCESS;
            }
        }
    }

    vos_mem_free( pBuf );

    return( halStatus );
}
Esempio n. 4
0
VOS_STATUS vos_wlanRestart(void)
{
   VOS_STATUS vstatus;
   hdd_context_t *pHddCtx = NULL;
   v_CONTEXT_t pVosContext        = NULL;

   
   if(vos_is_load_unload_in_progress( VOS_MODULE_ID_VOSS, NULL)) 
   {
      VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, 
               "%s: Driver load/unload is in progress, retry later.", __func__);
      return VOS_STATUS_E_AGAIN;
   }

   
   pVosContext = vos_get_global_context(VOS_MODULE_ID_VOSS, NULL);
   if(!pVosContext) {
      VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, 
               "%s: Global VOS context is Null", __func__);
      return VOS_STATUS_E_FAILURE;
   }
    
   
   pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext );
   if(!pHddCtx) {
      VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, 
               "%s: HDD context is Null", __func__);
      return VOS_STATUS_E_FAILURE;
   }

   
   vstatus = wlan_hdd_restart_driver(pHddCtx);
   return vstatus;
}
static VOS_STATUS sys_SendHalInitStartReqMsg( v_CONTEXT_t pVosContext )
{
    VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
    tSirMbMsg msg;

    tSirRetStatus sirStatus = eSIR_SUCCESS;
    tSirMbMsg *pMsg = &msg;
    v_VOID_t *hHal;

    do
    {
        // get the HAL context...
        hHal = vos_get_context( VOS_MODULE_ID_HAL, pVosContext );
        if ( NULL == hHal ) break;

        // format the Init start request message.  This message has
        // the hal handle in the 'data' portion of the message.
        pMsg->type = WDA_INIT_START_REQ;
        pMsg->data[0] = (tANI_U32)hHal;

        // message length is 4 greater than the config data size
        // need to add in an extra 4 for the message header.
        pMsg->msgLen = sizeof( tHalHandle ) + FIELD_OFFSET( tSirMbMsg, data );

        // Send the HAL Init Start Request message...
        sirStatus = uMacPostCtrlMsg( hHal, pMsg );
        if ( eSIR_SUCCESS != sirStatus )
        {
            vosStatus = VOS_STATUS_E_FAILURE;
        }

    } while( 0 );

    return( vosStatus );
}
void *epping_get_adf_ctx(void)
{
   VosContextType *pVosContext = NULL;
   adf_os_device_t *pAdfCtx;
   pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
   pAdfCtx = vos_get_context(VOS_MODULE_ID_ADF, pVosContext);
   return pAdfCtx;
}
void wmi_set_d0wow_flag(wmi_unified_t wmi_handle, A_BOOL flag)
{
	tp_wma_handle wma = wmi_handle->scn_handle;
	struct ol_softc *scn =
		vos_get_context(VOS_MODULE_ID_HIF, wma->vos_context);

	adf_os_atomic_set(&scn->hif_sc->in_d0wow, flag);
}
A_BOOL wmi_get_d0wow_flag(wmi_unified_t wmi_handle)
{
	tp_wma_handle wma = wmi_handle->scn_handle;
	struct ol_softc *scn =
		vos_get_context(VOS_MODULE_ID_HIF, wma->vos_context);

	return adf_os_atomic_read(&scn->hif_sc->in_d0wow);
}
/*==========================================================================

  FUNCTION    WLANBAP_ReadMacConfig

  DESCRIPTION 
    This function sets the MAC config (Address and SSID to BT-AMP context
        
  DEPENDENCIES 
    
  PARAMETERS 

    pvosGCtx:       pointer to the global vos context; a handle to BAP's 
                    control block can be extracted from its context 
   
  RETURN VALUE
    None

  SIDE EFFECTS 
  
============================================================================*/
void
WLANBAP_ReadMacConfig
( 
  ptBtampContext  pBtampCtx 
)
{
  tANI_U32        len = WNI_CFG_BSSID_LEN;
  tHalHandle      pMac = NULL;

  /*------------------------------------------------------------------------
    Temporary method to get the self MAC address
  ------------------------------------------------------------------------*/
  if (NULL == pBtampCtx) 
  {
      VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                   "pBtampCtx is NULL in %s", __func__);

      return;
  }

  pMac = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, pBtampCtx->pvosGCtx);
  if (NULL == pMac) 
  {
      VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                   "pMac is NULL in %s", __func__);

      return;
  }

  ccmCfgGetStr( pMac, WNI_CFG_STA_ID, pBtStaOwnMacAddr, &len );

  VOS_ASSERT( WNI_CFG_BSSID_LEN == len );
  
  /* Form the SSID from Mac address */
  VOS_SNPRINTF( pBtStaOwnSsid, WLAN_BAP_SSID_MAX_LEN,
            "AMP-%02x-%02x-%02x-%02x-%02x-%02x",
            pBtStaOwnMacAddr[0], pBtStaOwnMacAddr[1], pBtStaOwnMacAddr[2], 
            pBtStaOwnMacAddr[3], pBtStaOwnMacAddr[4], pBtStaOwnMacAddr[5]);

  /*------------------------------------------------------------------------
    Set the MAC address for this instance
  ------------------------------------------------------------------------*/
  vos_mem_copy( 
          pBtampCtx->self_mac_addr, 
          pBtStaOwnMacAddr,
          sizeof(pBtampCtx->self_mac_addr)); 
 
  /*------------------------------------------------------------------------
    Set our SSID value
  ------------------------------------------------------------------------*/
  pBtampCtx->ownSsidLen = 21; 
  vos_mem_copy(
          pBtampCtx->ownSsid, 
          pBtStaOwnSsid,
          pBtampCtx->ownSsidLen); 
}
void
WLANBAP_NeedBTCoexPriority
( 
  ptBtampContext  pBtampCtx, 
  v_U32_t         needCoexPriority
)
{
  tHalHandle      pMac = NULL;
  tSmeBtAmpEvent  btAmpEvent;


  /*------------------------------------------------------------------------
    Retrieve the pMac (HAL context)
  ------------------------------------------------------------------------*/
  pMac = (tHalHandle)vos_get_context( VOS_MODULE_ID_SME, pBtampCtx->pvosGCtx);

  // Is re-entrancy protection needed for this?
  if (needCoexPriority != gBapCoexPriority) {
    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_INFO_HIGH, 
            "Calling %s with needCoexPriority=%d.", __func__, needCoexPriority);
 
    gBapCoexPriority = needCoexPriority;
    switch ( needCoexPriority)
    {
      case 0:  /* Idle */
          btAmpEvent.btAmpEventType = BTAMP_EVENT_CONNECTION_TERMINATED;
          pBtampCtx->btamp_session_on = FALSE;
          sme_sendBTAmpEvent(pMac, btAmpEvent);

          break;

      case 1:  /* Associating */
          btAmpEvent.btAmpEventType = BTAMP_EVENT_CONNECTION_START;
          pBtampCtx->btamp_session_on = TRUE;
          sme_sendBTAmpEvent(pMac, btAmpEvent);

          break;

      case 2:  /* Post-assoc */
          btAmpEvent.btAmpEventType = BTAMP_EVENT_CONNECTION_STOP;
          sme_sendBTAmpEvent(pMac, btAmpEvent);

          break;

      default:
        VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                   "%s: Invalid Coexistence priority request: %d",
                   __func__, needCoexPriority);
    }

  }
}
static int hif_usb_suspend(struct usb_interface *interface, pm_message_t state)
{
	HIF_DEVICE_USB *device = usb_get_intfdata(interface);
	struct hif_usb_softc *sc = device->sc;
	void *vos = vos_get_global_context(VOS_MODULE_ID_HIF, NULL);
	v_VOID_t * temp_module;

	if (vos == NULL)
		return 0;
	/* No need to send WMI_PDEV_SUSPEND_CMDID to FW if WOW is enabled */
	temp_module = vos_get_context(VOS_MODULE_ID_WDA, vos);
	if (!temp_module) {
		printk("%s: WDA module is NULL\n", __func__);
		return (-1);
	}

	if (wma_check_scan_in_progress(temp_module)) {
		printk("%s: Scan in progress. Aborting suspend\n", __func__);
		return (-1);
	}
	sc->local_state = state;
	/* No need to send WMI_PDEV_SUSPEND_CMDID to FW if WOW is enabled */
	if (wma_is_wow_mode_selected(temp_module)) {
		if (wma_enable_wow_in_fw(temp_module, 0)) {
			pr_warn("%s[%d]: fail\n", __func__, __LINE__);
			return -1;
		}
	} else if ((PM_EVENT_FREEZE & state.event) == PM_EVENT_FREEZE ||
		(PM_EVENT_SUSPEND & state.event) == PM_EVENT_SUSPEND ||
		(PM_EVENT_HIBERNATE & state.event) == PM_EVENT_HIBERNATE) {
		if (wma_suspend_target
		    (vos_get_context(VOS_MODULE_ID_WDA, vos), 0)) {
			pr_warn("%s[%d]: fail\n", __func__, __LINE__);
			return -1;
		}
	}
	usb_hif_flush_all(device);
	return 0;
}
/* ---------------------------------------------------------
 * FUNCTION:  wdaGetGlobalSystemRole()
 *
 * Get the global HAL system role. 
 * ---------------------------------------------------------
 */
tBssSystemRole wdaGetGlobalSystemRole(tpAniSirGlobal pMac)
{
   v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
   tWDA_CbContext *wdaContext = 
                       vos_get_context(VOS_MODULE_ID_WDA, pVosContext);
   if(NULL == wdaContext)
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                           "%s:WDA context is NULL", __func__); 
      VOS_ASSERT(0);
      return eSYSTEM_UNKNOWN_ROLE;
   }
   return  wdaContext->wdaGlobalSystemRole;
}
Esempio n. 13
0
void vos_clear_concurrent_session_count(void)
{
    v_U8_t i = 0;
    hdd_context_t *pHddCtx;
    v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL);

    if (NULL != pVosContext) {
        pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);
        if (NULL != pHddCtx) {
            for (i = 0; i < VOS_MAX_NO_OF_MODE; i++)
                pHddCtx->no_of_active_sessions[i] = 0;
       }
    }
}
Esempio n. 14
0
/**============================================================================
  @brief hdd_tx_complete_cbk() - Callback function invoked by TL
  to indicate that a packet has been transmitted across the SDIO bus
  succesfully. OS packet resources can be released after this cbk.

  @param vosContext   : [in] pointer to VOS context   
  @param pVosPacket   : [in] pointer to VOS packet (containing skb) 
  @param vosStatusIn  : [in] status of the transmission 

  @return             : VOS_STATUS_E_FAILURE if any errors encountered 
                      : VOS_STATUS_SUCCESS otherwise
  ===========================================================================*/
VOS_STATUS hdd_tx_complete_cbk( v_VOID_t *vosContext, 
                                vos_pkt_t *pVosPacket, 
                                VOS_STATUS vosStatusIn )
{
   VOS_STATUS status = VOS_STATUS_SUCCESS;
   hdd_adapter_t *pAdapter = NULL;   
   hdd_context_t *pHddCtx = NULL;
   void* pOsPkt = NULL;
   
   if( ( NULL == vosContext ) || ( NULL == pVosPacket )  )
   {
      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,"%s: Null params being passed", __FUNCTION__);
      return VOS_STATUS_E_FAILURE; 
   }

   //Return the skb to the OS
   status = vos_pkt_get_os_packet( pVosPacket, &pOsPkt, VOS_TRUE );
   if(!VOS_IS_STATUS_SUCCESS( status ))
   {
      //This is bad but still try to free the VOSS resources if we can
      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,"%s: Failure extracting skb from vos pkt", __FUNCTION__);
      vos_pkt_return_packet( pVosPacket );
      return VOS_STATUS_E_FAILURE;
   }
   
   //Get the HDD context.
   pHddCtx = (hdd_context_t *)vos_get_context( VOS_MODULE_ID_HDD, vosContext );
   //Get the Adapter context.
   pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_INFRA_STATION);
   if(pAdapter == NULL)
   {
      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,"%s: HDD adapter context is Null", __FUNCTION__);
   }
   else
   {
      ++pAdapter->hdd_stats.hddTxRxStats.txCompleted;
   }

   kfree_skb((struct sk_buff *)pOsPkt); 

   //Return the VOS packet resources.
   status = vos_pkt_return_packet( pVosPacket );
   if(!VOS_IS_STATUS_SUCCESS( status ))
   {
      VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,"%s: Could not return VOS packet to the pool", __FUNCTION__);
   }

   return status;
}
Esempio n. 15
0
/**---------------------------------------------------------------------------
 *
 *   \brief vos_is_multiple_active_sta_sessions()
 *
 *   This function checks for presence of multiple active sta connections
 *   and it returns TRUE if the more than 1 active sta connection exists.
 *
 *   \param  - None
 *
 *   \return - TRUE or FALSE
 *
 * --------------------------------------------------------------------------*/
v_BOOL_t vos_is_multiple_active_sta_sessions (void)
{
    hdd_context_t *pHddCtx;
    v_U8_t         j = 0;

    v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL);
    if (NULL != pVosContext) {
        pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);
        if (NULL != pHddCtx) {
            j = pHddCtx->no_of_active_sessions[VOS_STA_MODE];
       }
    }

    return (j > 1);
}
Esempio n. 16
0
/**---------------------------------------------------------------------------
 *
 *   \brief vos_is_sta_active_connection_exists()
 *
 *   This function checks for the presence of active sta connection
 *   and it returns TRUE if exists.
 *
 *   \param  - None
 *
 *   \return - VOS_TRUE or VOS_FALSE
 *
 * --------------------------------------------------------------------------*/
v_BOOL_t vos_is_sta_active_connection_exists (void)
{
    hdd_context_t *pHddCtx;
    v_U8_t         j = 0;

    v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL);
    if (NULL != pVosContext) {
        pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);
        if (NULL != pHddCtx) {
            j = pHddCtx->no_of_active_sessions[VOS_STA_MODE];
       }
    }

    return (j ? VOS_TRUE : VOS_FALSE);
}
static void epping_target_suspend_acknowledge(void *context)
{
    void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
    epping_context_t *pEpping_ctx = vos_get_context(VOS_MODULE_ID_HDD,
                                    vos_context);
    int wow_nack = *((int *)context);

    if (NULL == pEpping_ctx) {
        EPPING_LOG(VOS_TRACE_LEVEL_FATAL,
                   "%s: epping_ctx is NULL", __func__);
        return;
    }
    /* EPPING_TODO: do we need wow_nack? */
    pEpping_ctx->wow_nack = wow_nack;
}
Esempio n. 18
0
void regdmn_set_regval(struct regulatory *reg)
{
	void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
	tp_wma_handle wma = vos_get_context(VOS_MODULE_ID_WDA, vos_context);
	u_int32_t modeSelect = 0xFFFFFFFF;

	if (!wma) {
		WMA_LOGE("%s: Unable to get WMA handle", __func__);
		return;
	}

	wma_get_modeselect(wma, &modeSelect);

	regdmn_get_ctl_info(reg, wma->reg_cap.wireless_modes, modeSelect);
	return;
}
Esempio n. 19
0
/* ---------------------------------------------------------
 * FUNCTION:  wdaGetGlobalSystemRole()
 *
 * Get the global HAL system role. 
 * ---------------------------------------------------------
 */
tBssSystemRole wdaGetGlobalSystemRole(tpAniSirGlobal pMac)
{
   v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
   tWDA_CbContext *wdaContext = 
                       vos_get_context(VOS_MODULE_ID_WDA, pVosContext);
   if(NULL == wdaContext)
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                           "%s:WDA context is NULL", __FUNCTION__); 
      VOS_ASSERT(0);
      return eSYSTEM_UNKNOWN_ROLE;
   }
   WDALOG1( wdaLog(pMac, LOG1, FL(" returning  %d role\n"),
             wdaContext->wdaGlobalSystemRole));
   return  wdaContext->wdaGlobalSystemRole;
}
Esempio n. 20
0
/**
 * hdd_state_info_dump() - prints state information of hdd layer
 */
static void hdd_state_info_dump(void)
{
    v_CONTEXT_t vos_ctx_ptr;
    hdd_context_t *hdd_ctx_ptr = NULL;
    hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
    VOS_STATUS status;
    hdd_station_ctx_t *hdd_sta_ctx = NULL;
    hdd_adapter_t *adapter =NULL;

    /* get the global voss context */
    vos_ctx_ptr = vos_get_global_context(VOS_MODULE_ID_VOSS, NULL);

    if (NULL != vos_ctx_ptr) {
        hdd_ctx_ptr = vos_get_context(VOS_MODULE_ID_HDD, vos_ctx_ptr);
    } else {
        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                  "%s: Invalid Global VOSS Context", __func__);
        VOS_ASSERT(0);
        return;
    }

    hddLog(LOG1,
           FL("mScanPending %d isWlanSuspended %d disable_dfs_flag %d"),
           hdd_ctx_ptr->scan_info.mScanPending,
           hdd_ctx_ptr->isWlanSuspended, hdd_ctx_ptr->disable_dfs_flag);

    status = hdd_get_front_adapter(hdd_ctx_ptr, &adapter_node);

    while (NULL != adapter_node && VOS_STATUS_SUCCESS == status) {
       adapter = adapter_node->pAdapter;
       if (adapter->dev)
           hddLog(LOG1, FL("device name: %s"), adapter->dev->name);
       switch (adapter->device_mode) {
       case WLAN_HDD_INFRA_STATION:
       case WLAN_HDD_P2P_CLIENT:
           hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
           hddLog(LOG1, FL("connState: %d device_mode: %d"),
                  hdd_sta_ctx->conn_info.connState, adapter->device_mode);
           break;

       default:
           break;
       }
       status = hdd_get_next_adapter(hdd_ctx_ptr, adapter_node, &next);
       adapter_node = next;
    }
}
Esempio n. 21
0
v_BOOL_t vos_concurrent_sap_sessions_running(v_VOID_t)
{
    v_U8_t i=0;
    hdd_context_t *pHddCtx;
    v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL );

    if (NULL != pVosContext)
    {
       pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext);
       if (NULL != pHddCtx)
       {
             i = pHddCtx->no_of_open_sessions[VOS_STA_SAP_MODE];
       }
    }

    return (i>1);
}
Esempio n. 22
0
/* ---------------------------------------------------------
 * FUNCTION:  WMAGetGlobalSystemRole()
 *
 * Get the global HAL system role.
 * ---------------------------------------------------------
 */
tBssSystemRole WMAGetGlobalSystemRole(tpAniSirGlobal pMac)
{
   v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WMA, NULL);
   t_wma_handle *wmaContext =
                       vos_get_context(VOS_MODULE_ID_WMA, pVosContext);
   if(NULL == wmaContext)
   {
      VOS_TRACE( VOS_MODULE_ID_WMA, VOS_TRACE_LEVEL_ERROR,
                           "%s:WMA context is NULL", __func__);
      VOS_ASSERT(0);
      return eSYSTEM_UNKNOWN_ROLE;
   }
#ifdef FEATURE_WLAN_INTEGRATED_SOC
   WMA_LOGD(" returning  %d role\n",wmaContext->wmaGlobalSystemRole);
#endif /* #ifdef FEATURE_WLAN_INTEGRATED_SOC */
   return  wmaContext->wmaGlobalSystemRole;
}
Esempio n. 23
0
/**---------------------------------------------------------------------------
 *
 *   \brief vos_max_concurrent_connections_reached()
 *
 *   This function checks for presence of concurrency where more than
 *   one connection exists and it returns TRUE if the max concurrency is
 *   reached.
 *
 *   Example:
 *   STA + STA (wlan0 and wlan1 are connected) - returns TRUE
 *   STA + STA (wlan0 connected and wlan1 disconnected) - returns FALSE
 *   DUT with P2P-GO + P2P-CLIENT connection) - returns TRUE
 *
 *   \param  - None
 *
 *   \return - VOS_TRUE or VOS_FALSE
 *
 * --------------------------------------------------------------------------*/
v_BOOL_t vos_max_concurrent_connections_reached (void)
{
    v_U8_t i = 0, j = 0;
    hdd_context_t *pHddCtx;
    v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL);

    if (NULL != pVosContext) {
        pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);
        if (NULL != pHddCtx) {
            for (i = 0; i < VOS_MAX_NO_OF_MODE; i++)
                j += pHddCtx->no_of_active_sessions[i];

            return (j > (pHddCtx->cfg_ini->gMaxConcurrentActiveSessions - 1));
       }
    }

    return VOS_FALSE;
}
Esempio n. 24
0
/*==========================================================================
   FUNCTION    WDA_DS_GetRssi

  DESCRIPTION
    Get RSSI 

  TODO It returns hardcoded value in the meantime since WDA/WDI does nothing
       support it yet for Prima.

  DEPENDENCIES

  PARAMETERS

   IN
    vosDataBuff      vos data buffer

   OUT
    puRssi           RSSI

  RETURN VALUE
    VOS_STATUS_E_FAULT:  pointer is NULL and other errors 
    VOS_STATUS_SUCCESS:  Everything is good :)

  SIDE EFFECTS

============================================================================*/
VOS_STATUS
WDA_DS_GetRssi
(
  v_PVOID_t pvosGCtx,
  v_S7_t*   puRssi
)
{
#if defined( FEATURE_WLAN_INTEGRATED_SOC )
  VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR,
         "WDA:halPS_GetRssi no longer supported. Need replacement");

  *puRssi = -30;

  return VOS_STATUS_SUCCESS;
#else  /* FEATURE_WLAN_INTEGRATED_SOC */
  halPS_GetRssi(vos_get_context(VOS_MODULE_ID_SME, pvosGCtx), puRssi);
  return VOS_STATUS_SUCCESS;
#endif /* FEATURE_WLAN_INTEGRATED_SOC */
}
v_VOID_t 
WDA_DS_TxCompleteCB
(
 v_PVOID_t pvosGCtx, 
 v_PVOID_t pFrameDataBuff
)
{
  tWDA_CbContext*        wdaContext = NULL;
  WDI_DS_TxMetaInfoType* pTxMetadata;
  VOS_STATUS             vosStatus;
  /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

  /*------------------------------------------------------------------------
    Sanity check
    ------------------------------------------------------------------------*/

  if ( ( NULL == pvosGCtx ) || ( NULL == pFrameDataBuff ) )
  {
    VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "WDA: Invalid parameter sent on WDA_DS_TxCompleteCB" );
    return;
  }

  wdaContext = (tWDA_CbContext *)vos_get_context( VOS_MODULE_ID_WDA, pvosGCtx );
  if ( NULL == wdaContext )
  {
    VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "WDA: Invalid context on WDA_DS_TxCompleteCB" );
    return;
  }

  // extract metadata from PAL packet
  pTxMetadata = WDI_DS_ExtractTxMetaData( (wpt_packet*)pFrameDataBuff );
  
  if ( eWLAN_PAL_STATUS_SUCCESS == pTxMetadata->txCompleteStatus )
    vosStatus = VOS_STATUS_SUCCESS;
  else 
    vosStatus = VOS_STATUS_E_FAILURE;

  wdaContext->pfnTxCompleteCallback( pvosGCtx, pFrameDataBuff, vosStatus );
}
Esempio n. 26
0
v_BOOL_t vos_concurrent_open_sessions_running(void)
{
    v_U8_t i=0;
    v_U8_t j=0;
    hdd_context_t *pHddCtx;
    v_CONTEXT_t pVosContext = vos_get_global_context( VOS_MODULE_ID_HDD, NULL );

    if (NULL != pVosContext)
    {
       pHddCtx = vos_get_context( VOS_MODULE_ID_HDD, pVosContext);
       if (NULL != pHddCtx)
       {
          for (i=0; i < VOS_MAX_NO_OF_MODE; i++)
          {
             j += pHddCtx->no_of_open_sessions[i];
          }
       }
    }

    return (j>1);
}
Esempio n. 27
0
void vos_abort_mac_scan(void)
{
    hdd_context_t *pHddCtx = NULL;
    v_CONTEXT_t pVosContext        = NULL;

    
    pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
    if(!pVosContext) {
       hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Global VOS context is Null", __func__);
       return;
    }
    
    
    pHddCtx = (hdd_context_t *)vos_get_context(VOS_MODULE_ID_HDD, pVosContext );
    if(!pHddCtx) {
       hddLog(VOS_TRACE_LEVEL_FATAL, "%s: HDD context is Null", __func__);
       return;
    }

    hdd_abort_mac_scan(pHddCtx, eCSR_SCAN_ABORT_DEFAULT);
    return;
}
void epping_exit(v_CONTEXT_t pVosContext)
{
    epping_context_t *pEpping_ctx;
    VosContextType *gpVosContext;

    pEpping_ctx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext);
    if (pEpping_ctx == NULL) {
        EPPING_LOG(VOS_TRACE_LEVEL_FATAL,
                   "%s: error: pEpping_ctx  = NULL",
                   __func__);
        return;
    }
    gpVosContext = pEpping_ctx->pVosContext;
    if (pVosContext == NULL) {
        EPPING_LOG(VOS_TRACE_LEVEL_FATAL,
                   "%s: error: pVosContext  = NULL",
                   __func__);
        return;
    }
    if (pEpping_ctx->epping_adapter) {
        epping_destroy_adapter(pEpping_ctx->epping_adapter);
        pEpping_ctx->epping_adapter = NULL;
    }
    hif_disable_isr(gpVosContext->pHIFContext);
    hif_reset_soc(gpVosContext->pHIFContext);
    HTCStop(gpVosContext->htc_ctx);
    HTCDestroy(gpVosContext->htc_ctx);
    gpVosContext->htc_ctx = NULL;
#ifdef HIF_PCI
    {
        int i;
        for (i = 0; i < EPPING_MAX_NUM_EPIDS; i++) {
            epping_unregister_tx_copier(i, pEpping_ctx);
        }
    }
#endif /* HIF_PCI */
    epping_cookie_cleanup(pEpping_ctx);
}
Esempio n. 29
0
/*==========================================================================
   FUNCTION    WDA_DS_GetTxFlowMask

  DESCRIPTION
    return TX flow mask control value

  DEPENDENCIES

  PARAMETERS

   IN
    pvosGCtx         VOS context

   OUT
    uFlowMask        TX channel mask for flow control
                     Defined in WDA_TXFlowEnumType

  RETURN VALUE
    VOS_STATUS_E_INVAL:  pointer is NULL and other errors 
    VOS_STATUS_SUCCESS:  Everything is good :)

  SIDE EFFECTS

============================================================================*/
VOS_STATUS
WDA_DS_GetTxFlowMask
(
 v_PVOID_t pvosGCtx,
 v_U8_t*   puFlowMask
)
{
#if defined( FEATURE_WLAN_INTEGRATED_SOC )
   tWDA_CbContext* wdaContext = NULL;
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

   /*------------------------------------------------------------------------
     Sanity check
    ------------------------------------------------------------------------*/
   if ( ( NULL == pvosGCtx ) || ( NULL == puFlowMask ) )
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                 "WDA: Invalid parameter sent on WDA_DS_GetTxFlowMask" );
      return VOS_STATUS_E_INVAL;
   }

   wdaContext = (tWDA_CbContext *)vos_get_context( VOS_MODULE_ID_WDA, pvosGCtx );
   if ( NULL == wdaContext )
   {
      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                 "WDA: Invalid context on WDA_DS_GetTxFlowMask" );
      return VOS_STATUS_E_INVAL;
   }

   *puFlowMask = wdaContext->uTxFlowMask;

   return VOS_STATUS_SUCCESS;
#else
   *puFlowMask = WDA_TXFLOWMASK;
   return VOS_STATUS_SUCCESS;
#endif  /* FEATURE_WLAN_INTEGRATED_SOC */
}
static int hif_usb_resume(struct usb_interface *interface)
{
	HIF_DEVICE_USB *device = usb_get_intfdata(interface);
	struct hif_usb_softc *sc = device->sc;
	void *vos = vos_get_global_context(VOS_MODULE_ID_HIF, NULL);
	v_VOID_t * temp_module;

	if (vos == NULL)
		return 0;
	/* No need to send WMI_PDEV_SUSPEND_CMDID to FW if WOW is enabled */
	temp_module = vos_get_context(VOS_MODULE_ID_WDA, vos);
	if (!temp_module) {
		printk("%s: WDA module is NULL\n", __func__);
		return (-1);
	}

	if (wma_check_scan_in_progress(temp_module)) {
		printk("%s: Scan in progress. Aborting suspend\n", __func__);
		return (-1);
	}
	sc->local_state.event = 0;
	usb_hif_start_recv_pipes(device);

#ifdef USB_HIF_TEST_INTERRUPT_IN
	usb_hif_post_recv_transfers(&device->pipes[HIF_RX_INT_PIPE],
				    HIF_USB_RX_BUFFER_SIZE);
#endif
	/* No need to send WMI_PDEV_RESUME_CMDID to FW if WOW is enabled */
	if (!wma_is_wow_mode_selected(temp_module)) {
		wma_resume_target(temp_module, 0);
	} else if (wma_disable_wow_in_fw(temp_module, 0)) {
		pr_warn("%s[%d]: fail\n", __func__, __LINE__);
		return (-1);
	}

	return 0;
}