示例#1
0
VOID PeerAddBARspAction(
	IN PRTMP_ADAPTER pAd, 
	IN MLME_QUEUE_ELEM *Elem) 

{
	//UCHAR		Idx, i;
	//PUCHAR		   pOutBuffer = NULL;
	PFRAME_ADDBA_RSP    pFrame = NULL;
	//PBA_ORI_ENTRY		pBAEntry;
	
	//ADDBA Response from unknown peer, ignore this.
	if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
		return;
	
	DBGPRINT(RT_DEBUG_TRACE, ("%s ==> Wcid(%d)\n", __FUNCTION__, Elem->Wcid));
	
	//hex_dump("PeerAddBARspAction()", Elem->Msg, Elem->MsgLen);

	if (PeerAddBARspActionSanity(pAd, Elem->Msg, Elem->MsgLen))
	{
		pFrame = (PFRAME_ADDBA_RSP)(&Elem->Msg[0]);

		DBGPRINT(RT_DEBUG_TRACE, ("\t\t StatusCode = %d\n", pFrame->StatusCode));
		switch (pFrame->StatusCode)
		{
			case 0:
				// I want a BAsession with this peer as an originator. 
				BAOriSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid], pFrame);
				break;
			default:
				// check status == USED ??? 
				BAOriSessionTearDown(pAd, Elem->Wcid, pFrame->BaParm.TID, TRUE, FALSE);
				break;
		}
		// Rcv Decline StatusCode
		if ((pFrame->StatusCode == 37) 
#ifdef CONFIG_STA_SUPPORT            
            || ((pAd->OpMode == OPMODE_STA) && STA_TGN_WIFI_ON(pAd) && (pFrame->StatusCode != 0))
#endif // CONFIG_STA_SUPPORT //            
            ) 
		{
			pAd->MacTab.Content[Elem->Wcid].BADeclineBitmap |= 1<<pFrame->BaParm.TID;
		}
	}
}
示例#2
0
void PeerAddBARspAction(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *Elem)
{
	/*u8         Idx, i; */
	/*u8 *                  pOutBuffer = NULL; */
	struct rt_frame_addba_rsp * pFrame = NULL;
	/*struct rt_ba_ori_entry *pBAEntry; */

	/*ADDBA Response from unknown peer, ignore this. */
	if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
		return;

	DBGPRINT(RT_DEBUG_TRACE, ("%s ==> Wcid(%d)\n", __func__, Elem->Wcid));

	/*hex_dump("PeerAddBARspAction()", Elem->Msg, Elem->MsgLen); */

	if (PeerAddBARspActionSanity(pAd, Elem->Msg, Elem->MsgLen)) {
		pFrame = (struct rt_frame_addba_rsp *) (&Elem->Msg[0]);

		DBGPRINT(RT_DEBUG_TRACE,
			 ("\t\t StatusCode = %d\n", pFrame->StatusCode));
		switch (pFrame->StatusCode) {
		case 0:
			/* I want a BAsession with this peer as an originator. */
			BAOriSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid],
					pFrame);
			break;
		default:
			/* check status == USED ??? */
			BAOriSessionTearDown(pAd, Elem->Wcid,
					     pFrame->BaParm.TID, TRUE, FALSE);
			break;
		}
		/* Rcv Decline StatusCode */
		if ((pFrame->StatusCode == 37)
		    || ((pAd->OpMode == OPMODE_STA) && STA_TGN_WIFI_ON(pAd)
			&& (pFrame->StatusCode != 0))
		    ) {
			pAd->MacTab.Content[Elem->Wcid].BADeclineBitmap |=
			    1 << pFrame->BaParm.TID;
		}
	}
}