static void printPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc)
{
	TI_UINT8 rateIndex, maxNumOfRates;
	char ssid[MAX_SSID_LEN + 1];

	
	WLAN_OS_REPORT(("\n^^^^^^^^^^^^^^^	PRIMARY SITE DESCRIPTION	^^^^^^^^^^^^^^^^^^^\n\n")); 

	
	/* MacAddress */		
	WLAN_OS_REPORT(("BSSID				0x%X-0x%X-0x%X-0x%X-0x%X-0x%X\n",	pPrimarySiteDesc->MacAddress[0], 
																	pPrimarySiteDesc->MacAddress[1], 
																	pPrimarySiteDesc->MacAddress[2], 
																	pPrimarySiteDesc->MacAddress[3], 
																	pPrimarySiteDesc->MacAddress[4], 
																	pPrimarySiteDesc->MacAddress[5])); 

	/* Capabilities */
	WLAN_OS_REPORT(("Capabilities		0x%X\n",	pPrimarySiteDesc->Capabilities)); 

	/* SSID */
	os_memoryCopy(pSiteMgr->hOs, ssid, (void *)pPrimarySiteDesc->Ssid.Ssid, pPrimarySiteDesc->Ssid.SsidLength);
	ssid[pPrimarySiteDesc->Ssid.SsidLength] = 0;
	WLAN_OS_REPORT(("SSID				%s\n", ssid));

	/* privacy */
	if (pPrimarySiteDesc->Privacy == TI_TRUE)
		WLAN_OS_REPORT(("Privacy				ON\n"));
	else
		WLAN_OS_REPORT(("Privacy				OFF\n"));

	/* RSSI */				
	WLAN_OS_REPORT(("RSSI					%d\n", ((pPrimarySiteDesc->Rssi)>>16)));

	if (pPrimarySiteDesc->InfrastructureMode == os802_11IBSS)
		WLAN_OS_REPORT(("BSS Type				IBSS\n"));
	else
		WLAN_OS_REPORT(("BSS Type				INFRASTRUCTURE\n"));


	maxNumOfRates = sizeof(pPrimarySiteDesc->SupportedRates) / sizeof(pPrimarySiteDesc->SupportedRates[0]);
	/* SupportedRates */
	for (rateIndex = 0; rateIndex < maxNumOfRates; rateIndex++)
	{
		if (pPrimarySiteDesc->SupportedRates[rateIndex] != 0)
			WLAN_OS_REPORT(("Rate					0x%X\n", pPrimarySiteDesc->SupportedRates[rateIndex]));
	}

	WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n", NULL)); 

}
Ejemplo n.º 2
0
static TI_STATUS TWD_PrintMemoryMapCb(TI_HANDLE hTWD, TI_STATUS status,
				      void *pData)
{
#ifdef TI_DBG
	TTwd *pTWD = (TTwd *) hTWD;
	MemoryMap_t *pMemMap = &pTWD->MemMap;

	/* Print the memory map */
	WLAN_OS_REPORT(("TWD_PrintMemoryMap:\n"));
	WLAN_OS_REPORT(("\tCode  (0x%08x, 0x%08x)\n\tWep  (0x%08x, 0x%08x)\n\tTmpl (0x%08x, 0x%08x)\n " "\tQueue (0x%08x, 0x%08x)\n\tPool (0x%08x, 0x%08x)\n\tTraceBuffer (A = 0x%08x, B = 0x%08x)\n", pMemMap->codeStart, pMemMap->codeEnd, pMemMap->wepDefaultKeyStart, pMemMap->wepDefaultKeyEnd, pMemMap->packetTemplateStart, pMemMap->packetTemplateEnd, pMemMap->queueMemoryStart, pMemMap->queueMemoryEnd, pMemMap->packetMemoryPoolStart, pMemMap->packetMemoryPoolEnd, pMemMap->debugBuffer1Start, pMemMap->debugBuffer2Start));
#endif /* TI_DBG */

	return TI_OK;
}
Ejemplo n.º 3
0
/**
 * \fn     txDataQ_FreeResources
 * \brief  Free resources per Link and per Ac
 *
 */
void txDataQ_FreeResources (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk)
{
	TTxDataQ *pTxDataQ = (TTxDataQ *)hTxDataQ;
	TDataResources *pDataRsrc = &pTxDataQ->tDataRsrc;
	TI_UINT32 uHlid = pPktCtrlBlk->tTxDescriptor.hlid;
	TI_UINT32 uAc;

	/* Free TxData resources only if previous allocated by txDataQ_AllocCheckResources */
	if (!IS_TX_CTRL_FLAG_RSRC_ALLOCATED(pPktCtrlBlk)) {
		return;
	}

	/* Enter critical section to protect classifier data and queue access */
	context_EnterCriticalSection (pTxDataQ->hContext);

	/* Extract original AC (saved by txDataQ_AllocCheckResources) from tx ctrl block */
	uAc = GET_TX_CTRL_FLAG_RSRC_AC(pPktCtrlBlk);

	/* new packet, Increment packet in use counters */
	pDataRsrc->uPktInUse_PerAc[uAc]--;
	pDataRsrc->uPktInUse_PerLink[uHlid]--;

	/* Update Effective totals = Sum of Max ( PktInUse_PerAc [uAc],  Min_PerAc[uAc] ), uAc=0..MAX_AC */
	/* no need to calculate Sum of Max on every packet, just small check for this ac only */
	if (pDataRsrc->uPktInUse_PerAc[uAc] >= pDataRsrc->uMinGuarantee_PerAc[uAc]) {
		pDataRsrc->uEffectiveTotal_Ac--;
#ifdef TI_DBG
		/* sanity check */
		if (pDataRsrc->uEffectiveTotal_Ac < pDataRsrc->uEffectiveTotal_Ac_Min ) {
			WLAN_OS_REPORT(("%s: uEffectiveTotal_Ac=%d is below MIN=%d\n", __FUNCTION__, pDataRsrc->uEffectiveTotal_Ac, pDataRsrc->uEffectiveTotal_Ac_Min));
		}
#endif
	}

	/* Update Effective totals = Sum of Max ( PktInUse_PerLik [uHlid],  Min_PerLink[uHlid] ), uHlid=0..MAX_LINK */
	/* no need to calculate Sum of Max on every packet, just small check for this link only*/
	if (pDataRsrc->uPktInUse_PerLink[uHlid] >= pDataRsrc->uMinGuarantee_PerLink) {
		pDataRsrc->uEffectiveTotal_Link--;
#ifdef TI_DBG
		/* sanity check */
		if (pDataRsrc->uEffectiveTotal_Link < pDataRsrc->uEffectiveTotal_Link_Min ) {
			WLAN_OS_REPORT(("%s: uEffectiveTotal_Ac=%d is below MIN=%d\n", __FUNCTION__, pDataRsrc->uEffectiveTotal_Link, pDataRsrc->uEffectiveTotal_Link_Min));
		}
#endif
	}

	/* Leave critical section */
	context_LeaveCriticalSection (pTxDataQ->hContext);
}
Ejemplo n.º 4
0
/*
 * ----------------------------------------------------------------------------
 * Function : whalCtrl_PrintHwStatus
 *
 * Input    : 
 * Output   :
 * Process  :
 *		Print the Recovery status
 * Note(s)  : Done 
 * -----------------------------------------------------------------------------
 */
int whalCtrl_PrintHwStatus(TI_HANDLE hWhalCtrl)
{
#ifdef REPORT_LOG

    WHAL_CTRL *pWhalCtrl = (WHAL_CTRL *)hWhalCtrl;
	whalCtrl_hwStatus_t *pHwStatus = &pWhalCtrl->pHwCtrl->HwStatus;

    WLAN_OS_REPORT(("--------------- whalCtrl_PrintHwStatus ---------------\n\n"));
	WLAN_OS_REPORT(("NumMboxErrDueToPeriodicBuiltInTestCheck = %d\n", pHwStatus->NumMboxErrDueToPeriodicBuiltInTestCheck));
	WLAN_OS_REPORT(("NumMboxFailures = %d\n", pHwStatus->NumMboxFailures));

#endif
	
	return OK;
}
Ejemplo n.º 5
0
/**
 * \author Ronen Kalish\n
 * \date 05-December-2005\n
 * \brief Creates a buffer pool object
 *
 * Function Scope \e Public.\n
 * \param hOS - handle to the OS object.\n
 * \param numOfBuffers - the number of buffers to allocate for this pool.\n
 * \param bufferSize - the size of each buffer in this pool.\n
 * \return a handle to a buffer pool object, NULL if an error occurred.\n
 */
TI_HANDLE bufferPool_create( TI_HANDLE hOS, UINT32 numOfBuffers, UINT32 bufferSize )
{
    /* allocate the buffer pool object */
    bufferPool_t *pBufferPool = os_memoryAlloc( hOS, sizeof(bufferPool_t) );
    if ( NULL == pBufferPool )
    {
        WLAN_OS_REPORT( ("ERROR: Failed to create buffer pool object") );
        return NULL;
    }

    /* 
     * adjust buffer size if necessary - the buffer must at least store the pointer to the
     * next free buffer when it is free.
     */
    if ( sizeof( bufferPool_buffer_t ) > bufferSize )
    {
        bufferSize = sizeof( bufferPool_buffer_t );
    }

    /* nullify the buffer pool object */
    os_memoryZero( hOS, pBufferPool, sizeof( bufferPool_t ) );

    /* allocate the buffers */
    pBufferPool->firstBuffer = pBufferPool->firstFreeBuffer = os_memoryAlloc( hOS, numOfBuffers * bufferSize );
    if ( NULL == pBufferPool->firstBuffer )
    {
        WLAN_OS_REPORT( ("ERROR: Failed to allocate buffer storage space") );
        bufferPool_destroy( (TI_HANDLE)pBufferPool );
        return NULL;
    }

    /* store the OS handle */
    pBufferPool->hOS = hOS;

    /* store buffer pool information */
    pBufferPool->bufferSize = bufferSize;
    pBufferPool->numberOfBuffers = numOfBuffers;

    /* initialize the free buffers list */
    bufferPool_reinit( (TI_HANDLE)pBufferPool );

#ifdef TI_DBG
	/* initialize debug information */
	os_memoryZero( pBufferPool->hOS, &(pBufferPool->bufferPoolDbg), sizeof( bufferPoolDbg_t ) );
#endif /* TI_DBG */

    return pBufferPool;
}
Ejemplo n.º 6
0
/**
 * \fn     wlanDrvIf_Open
 * \brief  Start driver
 *
 * Called by network stack upon opening network interface (ifconfig up).
 * Can also be called from user application or CLI for flight mode.
 * Start the driver initialization process up to OPERATIONAL state.
 *
 * \note
 * \param  dev - The driver network-interface handle
 * \return 0 if succeeded, error if driver not available
 * \sa     wlanDrvIf_Release
 */
int wlanDrvIf_Open (struct net_device *dev)
{
    TWlanDrvIfObj *drv = (TWlanDrvIfObj *)NETDEV_GET_PRIVATE(dev);
    int status = 0;
    WLAN_OS_REPORT(("wlanDrvIf_Open()\n"));

    if (!drv->tCommon.hDrvMain)
    {
        ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Open() Driver not created!\n");
        return -ENODEV;
    }
    if (drv->tCommon.eDriverState == DRV_STATE_FAILED)
    {
        ti_dprintf (TIWLAN_LOG_ERROR, "Driver in FAILED state!\n");
        return -EPERM;
    }
    if (drv->tCommon.eDriverState != DRV_STATE_RUNNING)
    {
	status = wlanDrvIf_Start(dev);
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31))
	drv->netdev->hard_start_xmit = wlanDrvIf_Xmit;
#else
	drv->netdev->netdev_ops = &tiwlan_ops_pri;
#endif
	drv->netdev->addr_len = MAC_ADDR_LEN;
    netif_start_queue (dev);

    }
	return status;
}
TI_HANDLE roamingMngr_create(TI_HANDLE hOs)
{
	roamingMngr_t   *pRoamingMngr;
	TI_UINT32          initVec;

	initVec = 0;

	pRoamingMngr = os_memoryAlloc(hOs, sizeof(roamingMngr_t));
	if (pRoamingMngr == NULL)
		return NULL;

	initVec |= (1 << ROAMING_MNGR_CONTEXT_INIT_BIT);
	pRoamingMngr->hOs   = hOs;

	/* allocate the state machine object */
	pRoamingMngr->hRoamingSm = genSM_Create(hOs);

	if (pRoamingMngr->hRoamingSm == NULL) {
		roamingMngr_releaseModule(pRoamingMngr, initVec);
		WLAN_OS_REPORT(("FATAL ERROR: roamingMngr_create(): Error Creating pRoamingSm - Aborting\n"));
		return NULL;
	}
	initVec |= (1 << ROAMING_MNGR_SM_INIT_BIT);


	return pRoamingMngr;
}
Ejemplo n.º 8
0
/**
*
* \b Description:
*
* This procedure is called by the config manager when the driver is created.
* It creates the SwitchChannel object.
*
* \b ARGS:
*
*  I - hOs - OS context \n
*
* \b RETURNS:
*
*  Handle to the SwitchChannel object.
*
* \sa
*/
TI_HANDLE switchChannel_create(TI_HANDLE hOs)
{
	switchChannel_t           *pSwitchChannel = NULL;
	TI_UINT32          initVec = 0;
	TI_STATUS       status;

	/* allocating the SwitchChannel object */
	pSwitchChannel = os_memoryAlloc(hOs,sizeof(switchChannel_t));

	if (pSwitchChannel == NULL)
		return NULL;

	initVec |= (1 << SC_INIT_BIT);

	os_memoryZero(hOs, pSwitchChannel, sizeof(switchChannel_t));

	pSwitchChannel->hOs = hOs;

	status = fsm_Create(hOs, &pSwitchChannel->pSwitchChannelSm, SC_NUM_STATES, SC_NUM_EVENTS);
	if (status != TI_OK) {
		release_module(pSwitchChannel, initVec);
		WLAN_OS_REPORT(("FATAL ERROR: switchChannel_create(): Error Creating pSwitchChannelSm - Aborting\n"));
		return NULL;
	}
	initVec |= (1 << SC_SM_INIT_BIT);

	return(pSwitchChannel);
}
Ejemplo n.º 9
0
/**
 * \author Ronen Kalish\n
 * \date 05-December-2005\n
 * \brief Returns a buffer to the pool.\n
 *
 * Function Scope \e Public.\n
 * \param hbufferPool - handle to a buffer pool object.\n
 * \param buffer - the buffer object to return to the pool.\n
 */
void bufferPool_releaseBuffer( TI_HANDLE hBufferPool, bufferPool_buffer_t buffer )
{
    bufferPool_t* pBufferPool = (bufferPool_t*)hBufferPool;
#ifdef TI_DBG
	UINT32 bufferIndex;

	/* check if the buffer is currently allocated */
	bufferIndex = ((UINT8*)buffer - (UINT8*)pBufferPool->firstBuffer) / pBufferPool->bufferSize;

	if ( (bufferIndex < BUFFER_POOL_MAX_NUM_OF_BUFFERS_FOR_DBG) &&
		 (FALSE == pBufferPool->bufferPoolDbg.bAllocated[ bufferIndex ]) )
	{
		/* count number of free attempts for already free buffers */
		pBufferPool->bufferPoolDbg.NumberOfFreeBufferRefreed++;

		WLAN_OS_REPORT(("%s: Trying to re-free Buffer %d\n", __FUNCTION__, bufferIndex));
		return;
	}
	else
	{
		/* decrease the buffers in use count */
		pBufferPool->bufferPoolDbg.numberOfUsedBuffers--;

		/* mark that the specific buffer is not in use */
		pBufferPool->bufferPoolDbg.bAllocated[ bufferIndex ] = FALSE;
	}
#endif /* TI_DBG */

    /* make the newly released buffer point to the current first free buffer */
    *((bufferPool_buffer_t*)buffer) = pBufferPool->firstFreeBuffer;

    /* make the newly release buffer the first free buffer */
    pBufferPool->firstFreeBuffer = buffer;
}
void PrintElertStus()
{
	TrafficMonitor_t *TrafficMonitor =(TrafficMonitor_t*)TestTrafficMonitor;
	TrafficAlertElement_t *AlertElement  = (TrafficAlertElement_t*)List_GetFirst(TrafficMonitor->NotificationRegList);

	/* go over all the Down elements and check for alert ResetElment that ref to TrafficAlertElement*/
	while (AlertElement) {
		if (AlertElement->CurrentState == ALERT_WAIT_FOR_RESET)
			WLAN_OS_REPORT(("TRAFF - ALERT ALERT_WAIT_FOR_RESET"));
		else
			WLAN_OS_REPORT(("TRAFF - ALERT ENABLED"));


		AlertElement = (TrafficAlertElement_t*)List_GetNext(TrafficMonitor->NotificationRegList);
	}
}
Ejemplo n.º 11
0
/**
 * \fn     tmr_GetExpiry
 * \brief  Called by OS-API upon any timer expiry
 *
 * This is the common callback function called upon expiartion of any timer.
 * It is called by the OS-API in timer expiry context and handles the transition
 *   to the driver's context for handling the expiry event.
 *
 * \note
 * \param  hTimerInfo - The specific timer handle
 * \return void
 * \sa     tmr_HandleExpiry
 */
void tmr_GetExpiry (TI_HANDLE hTimerInfo)
{
	TTimerInfo   *pTimerInfo   = (TTimerInfo *)hTimerInfo;                 /* The timer handle */
	TTimerModule *pTimerModule = (TTimerModule *)pTimerInfo->hTimerModule; /* The timer module handle */
	if (!pTimerModule) {
		WLAN_OS_REPORT (("tmr_GetExpiry(): ERROR - NULL timer!\n"));
		return;
	}

	/* Enter critical section */
	context_EnterCriticalSection (pTimerModule->hContext);

	/*
	 * If the expired timer was started when the driver's state was Operational,
	 *   insert it to the Operational-queue
	 */
	if (pTimerInfo->bOperStateWhenStarted) {
		que_Enqueue (pTimerModule->hOperQueue, hTimerInfo);
	}

	/*
	 * Else (started when driver's state was NOT-Operational), if now the state is still
	 *   NOT Operational insert it to the Init-queue.
	 *   (If state changed from non-operational to operational the event is ignored)
	 */
	else if (!pTimerModule->bOperState) {
		que_Enqueue (pTimerModule->hInitQueue, hTimerInfo);
	}

	/* Leave critical section */
	context_LeaveCriticalSection (pTimerModule->hContext);

	/* Request switch to driver context for handling timer events */
	context_RequestSchedule (pTimerModule->hContext, pTimerModule->uContextId);
}
Ejemplo n.º 12
0
void sme_printBssidList(TI_HANDLE hSme)
{
	TSme *sme = (TSme *) hSme;
	TI_UINT32 length;
	TI_UINT8 *blist;
	TMacAddr temp_bssid = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };

	length =
	    scanResultTable_CalculateBssidListSize(sme->hScanResultTable,
						   TI_FALSE);

	blist = os_memoryAlloc(NULL, length);

	if (!blist) {
		WLAN_OS_REPORT(("ERROR. sme_printBssidList(): Cannot allocate memory!! length = %d\n", length));
		return;
	}

	scanResultTable_GetBssidList(sme->hScanResultTable,
				     (POS_802_11_BSSID_LIST_EX) blist, &length,
				     TI_FALSE);

	PrintBssidList((OS_802_11_BSSID_LIST_EX *) blist, 0, temp_bssid);

	os_memoryFree(NULL, blist, length);
}
 /****************************************************************************************
 *                        MacServices_init                                                   *
 *****************************************************************************************
DESCRIPTION: Initializes the MacServices module
                                                                                                                               
INPUT:    hMacServices - handle to the Mac Services object.\n   
        hReport - handle to the report object.\n
        hHalCtrl - handle to the HAL ctrl object.\n
OUTPUT:     
RETURN:     
****************************************************************************************/
void MacServices_init (TI_HANDLE hMacServices, 
                       TI_HANDLE hReport, 
                       TI_HANDLE hTWD, 
                       TI_HANDLE hCmdBld, 
                       TI_HANDLE hEventMbox, 
                       TI_HANDLE hTimer) 
{
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;

    MacServices_scanSRV_init (hMacServices, hReport, hTWD, hTimer, hEventMbox, hCmdBld);

    MacServices_measurementSRV_init (pMacServices->hMeasurementSRV, 
                                     hReport, 
                                     hCmdBld, 
                                     hEventMbox, 
                                     pMacServices->hPowerSrv,
                                     hTimer);
    
    if (powerSrv_init (pMacServices->hPowerSrv, 
                       hReport, 
                       hEventMbox, 
                       hCmdBld,
                       hTimer) != TI_OK)
    {
        WLAN_OS_REPORT(("\n.....PowerSRV_init configuration failure \n"));
        /*return TI_NOK;*/
    }
}
Ejemplo n.º 14
0
/** 
 * \fn     cmdDispatch_GetParam
 * \brief  Get a driver parameter
 * 
 * Called by the OS abstraction layer in order to get a parameter the driver.
 * If the parameter can not be get from outside the driver it returns a failure status.
 * The parameter is get from the module that uses as its father in the system
 *    (refer to the file paramOut.h for more explanations).
 * 
 * \note   
 * \param  hCmdDispatch - The object                                          
 * \param  param        - The parameter information                                          
 * \return result of parameter getting 
 * \sa     
 */ 
TI_STATUS cmdDispatch_GetParam (TI_HANDLE hCmdDispatch, void *param)
{
    TCmdDispatchObj *pCmdDispatch = (TCmdDispatchObj *) hCmdDispatch;
    paramInfo_t     *pParam = (paramInfo_t *) param;
    TI_UINT32        moduleNumber;
    TI_STATUS        status;

    moduleNumber = GET_PARAM_MODULE_NUMBER(pParam->paramType);

    if  (moduleNumber > MAX_PARAM_MODULE_NUMBER)
    {
        return PARAM_MODULE_NUMBER_INVALID;
    }

	if ((pCmdDispatch->paramAccessTable[moduleNumber - 1].set == 0) ||
		(pCmdDispatch->paramAccessTable[moduleNumber - 1].get == 0) ||
		(pCmdDispatch->paramAccessTable[moduleNumber - 1].handle == 0))
	{
	    WLAN_OS_REPORT(("cmdDispatch_GetParam(): NULL pointers!!!, return, ParamType=0x%x\n", pParam->paramType));
		return TI_NOK;
	}

    TRACE2(pCmdDispatch->hReport, REPORT_SEVERITY_INFORMATION , "cmdDispatch_GetParam(): ParamType=0x%x, ModuleNumber=0x%x\n",							 pParam->paramType, moduleNumber);

    status = pCmdDispatch->paramAccessTable[moduleNumber - 1].get(pCmdDispatch->paramAccessTable[moduleNumber - 1].handle, pParam);

    return status;    
}
Ejemplo n.º 15
0
/**
 * \fn     tmr_DestroyTimer
 * \brief  Destroy the specified timer
 *
 * Destroy the specified timer object, icluding the timer in the OS-API.
 *
 * \note   This timer destruction function should be used before tmr_Destroy() is executed!!
 * \param  hTimerInfo - The timer handle
 * \return TI_OK on success or TI_NOK on failure
 * \sa     tmr_CreateTimer
 */
TI_STATUS tmr_DestroyTimer (TI_HANDLE hTimerInfo)
{
	TTimerInfo *pTimerInfo = (TTimerInfo *)hTimerInfo;  /* The timer handle */
	TTimerModule *pTimerModule;                  /* The timer module handle */

	if (!pTimerInfo) {
		return TI_NOK;
	}
	pTimerModule = (TTimerModule *)pTimerInfo->hTimerModule;
	if (!pTimerModule) {
		WLAN_OS_REPORT (("tmr_DestroyTimer(): ERROR - NULL timer!\n"));
		/* Free the timer object */
		os_memoryFree (NULL, hTimerInfo, sizeof(TTimerInfo));
		return TI_NOK;
	}

	/* Free the OS-API timer */
	if (pTimerInfo->hOsTimerObj) {
		os_timerDestroy (pTimerModule->hOs, pTimerInfo->hOsTimerObj);
		pTimerModule->uTimersCount--;  /* update created timers number */
	}
	/* Free the timer object */
	os_memoryFree (pTimerModule->hOs, hTimerInfo, sizeof(TTimerInfo));
	return TI_OK;
}
Ejemplo n.º 16
0
void MibDebugFunction(TI_HANDLE hTWD ,TI_UINT32 funcType, void* pParam)
{
	if (hTWD == NULL) 
	{
		return;
	}

	switch (funcType)
	{
	case DBG_MIB_PRINT_HELP:
		mibDbgPrintFunctions();
		break;
	case DBG_MIB_GET_ARP_TABLE:
		mibDbgGetArpIpTable(hTWD);
		break;
	case DBG_MIB_GET_GROUP_ADDRESS_TABLE:
		mibDbgGetGroupAddressTable(hTWD);
		break;
	case DBG_MIB_GET_COUNTER_TABLE:
		mibDbgGetCounterTable(hTWD);
		break;
	case DBG_MIB_MODIFY_CTS_TO_SELF:
		mibDbgModifyCtsToSelf(hTWD, pParam);
		break;
	case DBG_MIB_GET_CTS_TO_SELF:
		mibDbgGetCtsToSelf(hTWD);
		break;
	case DBG_MIB_SET_MAX_RX_LIFE_TIME:
		mibDbgSetMaxRxLifetime(hTWD, pParam);
		break;
	default:
        WLAN_OS_REPORT(("MIB Debug: Invalid function type in MIB Debug function: %d\n", funcType));
		break;
	}
}
Ejemplo n.º 17
0
/** 
 * \fn     que_Create 
 * \brief  Create a queue. 
 * 
 * Allocate and init a queue object.
 * 
 * \note    
 * \param  hOs               - Handle to Os Abstraction Layer
 * \param  hReport           - Handle to report module
 * \param  uLimit            - Maximum items to store in queue
 * \param  uNodeHeaderOffset - Offset of NodeHeader field from the entry of the queued item.
 * \return Handle to the allocated queue 
 * \sa     que_Destroy
 */ 
TI_HANDLE que_Create (TI_HANDLE hOs, TI_HANDLE hReport, TI_UINT32 uLimit, TI_UINT32 uNodeHeaderOffset)
{
	TQueue *pQue;

	/* allocate queue module */
	pQue = os_memoryAlloc (hOs, sizeof(TQueue));
	
	if (!pQue)
	{
		WLAN_OS_REPORT (("Error allocating the Queue Module\n"));
		return NULL;
	}
	
    os_memoryZero (hOs, pQue, sizeof(TQueue));

	/* Intialize the queue header */
    pQue->tHead.pNext = pQue->tHead.pPrev = &pQue->tHead;

	/* Set the Queue parameters */
    pQue->hOs               = hOs;
    pQue->hReport           = hReport;
	pQue->uLimit            = uLimit;
	pQue->uNodeHeaderOffset = uNodeHeaderOffset;

	return (TI_HANDLE)pQue;
}
Ejemplo n.º 18
0
/** 
 * \fn     txDataQ_SetDefaults
 * \brief  Configure module with default settings
 * 
 * Init the Tx Data queues.
 * Register as the context-engine client.
 * 
 * \note   
 * \param  hTxDataQ - The object                                          
 * \param  Other modules handles                              
 * \return TI_OK on success or TI_NOK on failure 
 * \sa     
 */ 
TI_STATUS txDataQ_SetDefaults (TI_HANDLE  hTxDataQ, txDataInitParams_t *pTxDataInitParams)
{
    TTxDataQ  *pTxDataQ = (TTxDataQ *)hTxDataQ;
	TI_STATUS  eStatus;

    /* configure the classifier sub-module */
    eStatus = txDataClsfr_Config (hTxDataQ, &pTxDataInitParams->ClsfrInitParam);
    if (eStatus != TI_OK)
    {  
        TRACE0(pTxDataQ->hReport, REPORT_SEVERITY_CONSOLE ,"FATAL ERROR: txDataQ_SetDefaults(): txDataClsfr_Config failed - Aborting\n");
        WLAN_OS_REPORT(("FATAL ERROR: txDataQ_SetDefaults(): txDataClsfr_Config failed - Aborting\n"));
        return eStatus;
    }

    /* Save the module's parameters settings */
	pTxDataQ->bStopNetStackTx              = pTxDataInitParams->bStopNetStackTx;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_BE] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_BK] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_VI] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_VO] = 1;     /* Don't delay voice packts! */

    TRACE0(pTxDataQ->hReport, REPORT_SEVERITY_INIT, ".....Tx Data Queue configured successfully\n");
	
    return TI_OK;
}
Ejemplo n.º 19
0
/*
 * \brief	Print the command queue
 * 
 * \param  pCmdQueue - Pointer to TCmdQueue
 * \return void
 * 
 * \par Description
 * Used for debugging purposes
 *
 * \sa cmdQueue_Print, cmdQueue_GetCmdString, cmdQueue_GetIEString
 */
static void cmdQueue_PrintQueue (TCmdQueue *pCmdQueue)
{
    TI_UINT32 uCurrentCmdIndex;
    TI_UINT32 first = pCmdQueue->head;
    TCmdQueueNode* pHead;
    TI_UINT32 NumberOfCommand = pCmdQueue->uNumberOfCommandInQueue;

    for(uCurrentCmdIndex = 0 ; uCurrentCmdIndex < NumberOfCommand ; uCurrentCmdIndex++)
    {
        pHead = &pCmdQueue->aCmdQueue[first];

        WLAN_OS_REPORT(("Cmd index %d CmdType = %s %s, Len = %d, Place in Queue = %d \n",
                       uCurrentCmdIndex, 
                       cmdQueue_GetCmdString(pHead->cmdType),
                       cmdQueue_GetIEString(pHead->cmdType, (((pHead->cmdType == CMD_INTERROGATE)||(pHead->cmdType == CMD_CONFIGURE)) ? *(TI_UINT16 *)pHead->aParamsBuf : 0)),
                       pHead->uParamsLen, 
                       first));    

        first++;
        if (first == CMDQUEUE_QUEUE_DEPTH)
        {
            first = 0;
        }
    } 
}
Ejemplo n.º 20
0
/** 
 * \fn     smeDebugFunction
 * \brief  Main SME debug function
 * 
 * Main SME debug function
 * 
 * \param  hSme - handle to the SME object
 * \param  funcType - the specific debug function
 * \param  pParam - parameters for the debug function
 * \return None
 */
void smeDebugFunction(TI_HANDLE hSme, TI_UINT32 funcType, void *pParam)
{
	switch (funcType) {
	case DBG_SME_PRINT_HELP:
		printSmeDbgFunctions();
		break;

	case DBG_SME_PRINT_OBJECT:
		sme_dbgPrintObject(hSme);
		break;

	case DBG_SME_PRINT_STATS:
		sme_printStats(hSme);
		break;

	case DBG_SME_CLEAR_STATS:
		sme_resetStats(hSme);
		break;

	case DBG_SME_BSSID_LIST:
		sme_printBssidList(hSme);
		break;

	default:
		WLAN_OS_REPORT(("Invalid function type in SME debug function: %d\n", funcType));
		break;
	}
}
Ejemplo n.º 21
0
/**
 * \fn     txDataQ_SetDefaults
 * \brief  Configure module with default settings
 *
 * Init the Tx Data queues.
 * Register as the context-engine client.
 *
 * \note
 * \param  hTxDataQ - The object
 * \param  Other modules handles
 * \return TI_OK on success or TI_NOK on failure
 * \sa
 */
TI_STATUS txDataQ_SetDefaults (TI_HANDLE  hTxDataQ, txDataInitParams_t *pTxDataInitParams)
{
	TTxDataQ  *pTxDataQ = (TTxDataQ *)hTxDataQ;
	TI_STATUS  eStatus;

	/* configure the classifier sub-module */
	eStatus = txDataClsfr_Config (hTxDataQ, &pTxDataInitParams->ClsfrInitParam);
	if (eStatus != TI_OK) {
		WLAN_OS_REPORT(("FATAL ERROR: txDataQ_SetDefaults(): txDataClsfr_Config failed - Aborting\n"));
		return eStatus;
	}

	/* Save the module's parameters settings */
	pTxDataQ->bStopNetStackTx              = pTxDataInitParams->bStopNetStackTx;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_BE] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_BK] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_VI] = pTxDataInitParams->uTxSendPaceThresh;
	pTxDataQ->aTxSendPaceThresh[QOS_AC_VO] = 1;     /* Don't delay voice packts! */

	/* configure the classifier sub-module */
	txDataQ_InitResources (pTxDataQ, &pTxDataInitParams->tDataRsrcParam);


	return TI_OK;
}
Ejemplo n.º 22
0
/**
 * \fn    utilsDebugFunction
 * \brief Utils debug function
 *
 * \param pDrvMain - handle to the DrvMain object.\n
 * \param funcType - the specific debug function.\n
 * \param pParam - parameters for the debug function.\n
 */
static void utilsDebugFunction (TStadHandlesList *pStadHandles, TI_UINT32 funcType, void *pParam)
{
    switch (funcType)
    {
        case DBG_UTILS_PRINT_HELP:
            printUtilsDbgFunctions ();
            break;
    
        case DBG_UTILS_PRINT_CONTEXT_INFO:
            context_Print (pStadHandles->hContext);
            break;
    
        case DBG_UTILS_PRINT_TIMER_MODULE_INFO:
            tmr_PrintModule (pStadHandles->hTimer);
            break;
    
        case DBG_UTILS_PRINT_TRACE_BUFFER:
/*          tb_printf(); */
            break;
    
        default:
       		WLAN_OS_REPORT(("utilsDebugFunction(): Invalid function type: %d\n", funcType));
            break;
    }
}
Ejemplo n.º 23
0
/**
 * \fn     tmr_StartTimer
 * \brief  Start a timer
 *
 * Start the specified timer running.
 *
 * \note   Periodic-Timer may be used by applications that serve the timer expiry
 *           in a single context.
 *         If an application can't finish serving the timer expiry in a single context,
 *           e.g. periodic scan, then it isn't recommended to use the periodic timer service.
 *         If such an application uses the periodic timer then it should protect itself from cases
 *            where the timer expires again before the previous timer expiry processing is finished!!
 * \param  hTimerInfo    - The specific timer handle
 * \param  fExpiryCbFunc - The timer's expiry callback function.
 * \param  hExpiryCbHndl - The client's expiry callback function handle.
 * \param  uIntervalMsec - The timer's duration in Msec.
 * \param  bPeriodic     - If TRUE, the timer is restarted after expiry.
 * \return void
 * \sa     tmr_StopTimer, tmr_GetExpiry
 */
void tmr_StartTimer (TI_HANDLE     hTimerInfo,
                     TTimerCbFunc  fExpiryCbFunc,
                     TI_HANDLE     hExpiryCbHndl,
                     TI_UINT32     uIntervalMsec,
                     TI_BOOL       bPeriodic)
{
	TTimerInfo   *pTimerInfo   = (TTimerInfo *)hTimerInfo;                 /* The timer handle */
	TTimerModule *pTimerModule = (TTimerModule *)pTimerInfo->hTimerModule; /* The timer module handle */

	if (!pTimerModule) {
		WLAN_OS_REPORT (("tmr_StartTimer(): ERROR - NULL timer!\n"));
		return;
	}

	/* Save the timer parameters. */
	pTimerInfo->fExpiryCbFunc            = fExpiryCbFunc;
	pTimerInfo->hExpiryCbHndl            = hExpiryCbHndl;
	pTimerInfo->uIntervalMsec            = uIntervalMsec;
	pTimerInfo->bPeriodic                = bPeriodic;
	pTimerInfo->bOperStateWhenStarted    = pTimerModule->bOperState;
	pTimerInfo->uTwdInitCountWhenStarted = pTimerModule->uTwdInitCount;

	/* Start OS-API timer running */
	os_timerStart(pTimerModule->hOs, pTimerInfo->hOsTimerObj, uIntervalMsec);
}
Ejemplo n.º 24
0
/**
 * \\n
 * \date 01-May-2005\n
 * \brief Stops continuous scan process.\n
 *
 * Function Scope \e Public.\n
 * \param hScr - handle to the SCR object.\n
 * \param client - the client to release as.\n
 * \param eResource - the released resource.\n
 */
void releaseAsClient(TI_HANDLE hScr, EScrClientId client,
		     EScrResourceId eResource)
{
	scr_clientComplete(hScr, client, eResource);
	WLAN_OS_REPORT(("Resource %s was released as client %s\n",
			resourceDesc[eResource], clientDesc[client]));
}
/*
 * \brief	Called when a command timeout occur
 *
 * \param  hCmdQueue - Handle to CmdQueue
 * \return TI_OK
 *
 * \par Description
 *
 * \sa cmdQueue_Init, cmdMbox_TimeOut
 */
TI_STATUS cmdQueue_Error (TI_HANDLE hCmdQueue, TI_UINT32 command, TI_UINT32 status, void *param)
{
	TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;

	if (status == CMD_STATUS_UNKNOWN_CMD) {
		TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: Unknown Cmd  (%d)\n", command);
	} else if (status == CMD_STATUS_UNKNOWN_IE) {
		TRACE4(pCmdQueue->hReport, REPORT_SEVERITY_CONSOLE,"cmdQueue_Error: Unknown IE, cmdType : %d (%d) IE: %d (%d)\n", command, command, (param) ? *(TI_UINT16 *) param : 0, *((TI_UINT16 *) param));

		WLAN_OS_REPORT(("cmdQueue_Error: Unknown IE, cmdType : %s (%d) IE: %s (%d)\n",
		                cmdQueue_GetCmdString (command),
		                command,
		                (param) ? cmdQueue_GetIEString (command, *((TI_UINT16 *) param)) : "",
		                *((TI_UINT16 *) param)));
	} else {
		TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: CmdMbox status is %d\n", status);
	}

	if (status != CMD_STATUS_UNKNOWN_CMD && status != CMD_STATUS_UNKNOWN_IE) {
#ifdef TI_DBG

		TCmdQueueNode* pHead = &pCmdQueue->aCmdQueue[pCmdQueue->head];
		TI_UINT32 TimeStamp = os_timeStampMs(pCmdQueue->hOs);

		WLAN_OS_REPORT(("cmdQueue_Error: **ERROR**  Command Occured \n"
		                "                                        Cmd = %s %s, Len = %d \n"
		                "                                        NumOfCmd = %d\n"
		                "                                        MAC TimeStamp on timeout = %d\n",
		                cmdQueue_GetCmdString(pHead->cmdType),
		                (pHead->aParamsBuf) ? cmdQueue_GetIEString(pHead->cmdType, *(TI_UINT16 *)pHead->aParamsBuf) : "",
		                pHead->uParamsLen,
		                pCmdQueue->uNumberOfCommandInQueue,
		                TimeStamp));

		/* Print The command that was sent before the timeout occur */
		cmdQueue_PrintHistory(pCmdQueue, CMDQUEUE_HISTORY_DEPTH);

#endif /* TI_DBG */

		/* preform Recovery */
		if (pCmdQueue->fFailureCb) {
			pCmdQueue->fFailureCb (pCmdQueue->hFailureCb, TI_NOK);
		}
	}

	return TI_OK;
}
Ejemplo n.º 26
0
void measurement_channelLoadCallBackDbg(TI_HANDLE hMeasurementMgr, TI_STATUS status, 
                                        TI_UINT8* CB_buf)
{
    TMediumOccupancy *pMediumOccupancy = (TMediumOccupancy*)(CB_buf+4);
    
    WLAN_OS_REPORT(("MediumUsage = %d\nPeriod = %d\n", 
					pMediumOccupancy->MediumUsage/1000, pMediumOccupancy->Period/1000));            
}
Ejemplo n.º 27
0
/**
 * \fn     wlanDrvIf_Release
 * \brief  Stop driver
 *
 * Called by network stack upon closing network interface (ifconfig down).
 * Can also be called from user application or CLI for flight mode.
 * Stop the driver and turn off the device.
 *
 * \note
 * \param  dev - The driver network-interface handle
 * \return 0 (OK)
 * \sa     wlanDrvIf_Open
 */
int wlanDrvIf_Release (struct net_device *dev)
{
    WLAN_OS_REPORT(("wlanDrvIf_Release()\n"));

    /* Disable network interface queue */
    netif_stop_queue (dev);
    return 0;
}
Ejemplo n.º 28
0
void printRsnDbgFunctions(void)
{
	WLAN_OS_REPORT(("   Rsn Debug Functions   \n"));
	WLAN_OS_REPORT(("-------------------------\n"));

	WLAN_OS_REPORT(("702 - Set default key id \n"));
	WLAN_OS_REPORT(("703 - Set desired Authentication suite \n"));
	WLAN_OS_REPORT(("704 - Set desired cipher suite \n"));

	WLAN_OS_REPORT(("706 - Generate MIC FAILURE report (after 2 clicks less then 1 minute - disassociate)\n"));
	WLAN_OS_REPORT(("707 - Get 802.11 authentication/encryption capability\n"));
	WLAN_OS_REPORT(("708 - Get PMKID cache \n"));
	WLAN_OS_REPORT(("709 - ReSet PMKID cache  \n"));
	WLAN_OS_REPORT(("710 - Print Rogue AP table\n"));


}
Ejemplo n.º 29
0
void switchChannelDebug_printStatus(TI_HANDLE hSwitchChannel)
{
	switchChannel_t       *pSwitchChannel = (switchChannel_t*)hSwitchChannel;

	if (pSwitchChannel == NULL) {
		return;
	}

	WLAN_OS_REPORT(("SwitchChannel debug params are: channelNumber=%d, channelSwitchCount=%d , channelSwitchMode=%d \n",
	                pSwitchChannel->debugChannelSwitchCmdParams.channelNumber,
	                pSwitchChannel->debugChannelSwitchCmdParams.channelSwitchCount,
	                pSwitchChannel->debugChannelSwitchCmdParams.channelSwitchMode));

	WLAN_OS_REPORT(("SwitchChannel state=%d, currentChannel=%d \n", pSwitchChannel->currentState, pSwitchChannel->currentChannel));


}
Ejemplo n.º 30
0
void que_Print(TI_HANDLE hQue)
{
    TQueue *pQue = (TQueue *)hQue;

    WLAN_OS_REPORT(("que_Print: Count=%u MaxCount=%u Limit=%u Overflow=%u NodeHeaderOffset=%u Next=0x%x Prev=0x%x\n",
                    pQue->uCount, pQue->uMaxCount, pQue->uLimit, pQue->uOverflow,
                    pQue->uNodeHeaderOffset, (TI_UINT32)pQue->tHead.pNext, (TI_UINT32)pQue->tHead.pPrev));
}