static VOS_STATUS bapRsnTxFrame( v_PVOID_t pvosGCtx, vos_pkt_t *pPacket )
{
    VOS_STATUS status;
    WLANTL_MetaInfoType metaInfo;

    vos_mem_zero( &metaInfo, sizeof( WLANTL_MetaInfoType ) );
    metaInfo.ucIsEapol = 1; //only send eapol frame
    status = WLANTL_TxBAPFrm( pvosGCtx, pPacket, &metaInfo, bapRsnTxCompleteCallback );
    if( !VOS_IS_STATUS_SUCCESS( status ) )
    {
        VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                "bapRsnTxFrame failed to send vos_pkt status = %d\n", status );
    }

    return ( status );
}
Esempio n. 2
0
/*===========================================================================

  FUNCTION    WLANBAP_TxLinkSupervision

  DESCRIPTION 

    This API will be called to process Link Supervision Request received

  PARAMETERS 

    btampHandle: The BT-AMP PAL handle returned in WLANBAP_GetNewHndl.
    pucAC:       Pointer to return the access category 
    vosDataBuff: The data buffer containing the 802.3 frame to be 
                 translated to BT HCI Data Packet
   
  RETURN VALUE     

    The result code associated with performing the operation  

    VOS_STATUS_E_INVAL:  Input parameters are invalid 
    VOS_STATUS_E_FAULT:  BAP handle is NULL  
    VOS_STATUS_SUCCESS:  Everything is good :) 

  SIDE EFFECTS 
  
============================================================================*/
VOS_STATUS
WLANBAP_TxLinkSupervision
( 
  ptBtampHandle     btampHandle, 
  v_U8_t            phy_link_handle,  /* Used by BAP to indentify the WLAN assoc. (StaId) */
  vos_pkt_t         *pPacket,
  v_U16_t           protoType
)
{
    ptBtampContext             pBtampCtx = (ptBtampContext)btampHandle;
    VOS_STATUS                 vosStatus = VOS_STATUS_E_FAILURE;
    v_PVOID_t                  pvosGCtx;
    v_U8_t                     ucSTAId;  /* The StaId (used by TL, PE, and HAL) */
    v_PVOID_t                  pHddHdl; /* Handle to return BSL context in */
    WLANTL_MetaInfoType        metaInfo;


    VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                         "In  : %s protoType=%x", __FUNCTION__,protoType);

        // Retrieve the VOSS context
    pvosGCtx = pBtampCtx->pvosGCtx;

    /* Lookup the StaId using the phy_link_handle and the BAP context */ 

    vosStatus = WLANBAP_GetStaIdFromLinkCtx ( 
            btampHandle,  /* btampHandle value in  */ 
            phy_link_handle,  /* phy_link_handle value in */
            &ucSTAId,  /* The StaId (used by TL, PE, and HAL) */
            &pHddHdl); /* Handle to return BSL context */
    
    if ( VOS_STATUS_SUCCESS != vosStatus ) 
    {
      VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                   "Unable to retrieve STA Id from BAP context and phy_link_handle in WLANBAP_TxLinKSupervisionReq");
      return VOS_STATUS_E_FAULT;
    }

    vos_mem_zero( &metaInfo, sizeof( WLANTL_MetaInfoType ) );
    
    metaInfo.ucTID = 0x00 ;
    metaInfo.ucUP = 0x00;
    metaInfo.ucIsEapol =  VOS_FALSE;//Notify TL that this is NOT an EAPOL frame
    metaInfo.ucDisableFrmXtl = VOS_FALSE;
    metaInfo.ucType = 0x00;
    pBtampCtx->metaInfo = metaInfo;
    
    vosStatus = WLANTL_TxBAPFrm( pvosGCtx, pPacket, &metaInfo, WLANBAP_TxLinkSupervisionCB );
    if( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
    {
        VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                        "Tx: Packet rejected by TL in WLANBAP_TxLinkSupervisionReq");
        return vosStatus;
    }
    
    if(protoType ==  WLANTL_BT_AMP_TYPE_LS_REQ)
    {
        pBtampCtx->lsReqPktPending = TRUE;
        pBtampCtx->retries++;
    }
   
    if (pBtampCtx->bapLinkSupervisionTimerInterval)
    {
        /* Restart the LS timer */
        WLANBAP_StopLinkSupervisionTimer(pBtampCtx);
        vosStatus = WLANBAP_StartLinkSupervisionTimer (pBtampCtx,
               pBtampCtx->bapLinkSupervisionTimerInterval * WLANBAP_BREDR_BASEBAND_SLOT_TIME);
    }

   if( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
   {
        VOS_TRACE( VOS_MODULE_ID_BAP, VOS_TRACE_LEVEL_ERROR,
                "WLANBAP_TxLinkSupervisionReq failed to Start LinkSupervision Timer\n" );
        return vosStatus;
   }
   
   return vosStatus;
} /* WLANBAP_RxLinkSupervisionReq */