Beispiel #1
0
CMD_STATUS CmdSetTxPowerLevel(PWLAN_ADAPTER pAdapter, USHORT nPowerLevel)
{
	CMD_STATUS stat = CmdQueryBuffer(pAdapter);
	WORD nRet;

	if (1) {
		OID_MRVL_DS_TPC_CFG cfg;
		POID_MRVL_DS_TPC_CFG pTpcCfg = &cfg;
		PHostCmd_DS_802_11_TPC_CFG pCmd = (PHostCmd_DS_802_11_TPC_CFG)&pAdapter->m_ucCmdBuffer[0];
		
		ZeroMemory(&cfg,sizeof(cfg));
		pCmd->Action = CMD_ACT_SET;
		MoveMemory(&pCmd->Enable, &pTpcCfg->Enable,sizeof(*pCmd)-MEMBER_OFFSET(HostCmd_DS_802_11_TPC_CFG,Enable));

		CmdSetCmdInfo(pAdapter, HostCmd_CMD_802_11_TPC_CFG, pCmd, sizeof(*pCmd), pCmd, ADAPTER_CMD_BUFFER_LENGTH);
		nRet = CmdProcessCmd(pAdapter, CMD_TIMEOUT_MAX);
		if (nRet != sizeof(*pCmd))
			stat = CMD_ERROR_UNKNOWN;
	}

	if(1) { //stat == CMD_ERROR_SUCCESS) {
		USHORT bEnablePA=TRUE;
		int nTxSize;
		MrvlIEtypes_PowerAdapt_Group_t iePag;
		MrvlIEtypes_PowerAdapt_Group_t* pIePag = &iePag;
		PHostCmd_DS_802_11_POWER_ADAPT_CFG_EXT pCmd = (PHostCmd_DS_802_11_POWER_ADAPT_CFG_EXT)&pAdapter->m_ucCmdBuffer[0];

		iePag.Header.Type=0x114;
		iePag.Header.Len=sizeof(PA_Group_t)*3;
		iePag.PA_Group[0].PowerAdaptLevel = nPowerLevel;
		iePag.PA_Group[0].RateBitmap=0x1800;
		iePag.PA_Group[1].PowerAdaptLevel = nPowerLevel;
		iePag.PA_Group[1].RateBitmap=0x07e0;
		iePag.PA_Group[2].PowerAdaptLevel = nPowerLevel;
		iePag.PA_Group[2].RateBitmap=0x000f;
	
		pCmd->Action = CMD_ACT_SET;
		pCmd->EnablePA = bEnablePA;
		MoveMemory(&pCmd->PowerAdaptGroup,pIePag,sizeof(*pIePag));
		nTxSize = MEMBER_OFFSET(HostCmd_DS_802_11_POWER_ADAPT_CFG_EXT,PowerAdaptGroup);
		nTxSize+=sizeof(pCmd->PowerAdaptGroup.Header)+pCmd->PowerAdaptGroup.Header.Len;

		CmdSetCmdInfo(pAdapter, HostCmd_CMD_802_11_POWER_ADAPT_CFG_EXT, pCmd, nTxSize, pCmd, ADAPTER_CMD_BUFFER_LENGTH);
		nRet = CmdProcessCmd(pAdapter, CMD_TIMEOUT_MAX);
		if (nRet != nTxSize)
			stat = CMD_ERROR_UNKNOWN;
	}

	CmdReleaseBuffer(pAdapter);

	return stat;
}
Beispiel #2
0
static void get_rchan_offsets(void)
{
	rchan_offsets.subbuf_size = MEMBER_OFFSET("rchan", "subbuf_size");
	if (rchan_offsets.subbuf_size < 0)
		goto ERR;
	rchan_offsets.n_subbufs = MEMBER_OFFSET("rchan", "n_subbufs");
	if (rchan_offsets.n_subbufs < 0)
		goto ERR;
	rchan_offsets.buf = MEMBER_OFFSET("rchan", "buf");
	if (rchan_offsets.buf < 0)
		goto ERR;
	rchan_offsets.buf_start = MEMBER_OFFSET("rchan_buf", "start");
	if (rchan_offsets.buf_start < 0)
		goto ERR;
	rchan_offsets.buf_offset = MEMBER_OFFSET("rchan_buf", "offset");
	if (rchan_offsets.buf_offset < 0)
		goto ERR;
	rchan_offsets.buf_subbufs_produced
		= MEMBER_OFFSET("rchan_buf", "subbufs_produced");
	if (rchan_offsets.buf_subbufs_produced < 0)
		goto ERR;
	rchan_offsets.buf_padding = MEMBER_OFFSET("rchan_buf", "padding");
	if (rchan_offsets.buf_padding < 0)
		goto ERR;
	return;
ERR:
	error(FATAL, "cannot get rchan offset\n");
}
INTERFACE[ppc32]:

#include "entry_frame.h"
#include "member_offs.h"
#include "types.h"

class Continuation
{
  MEMBER_OFFSET();

private:
INTERFACE [sched_fp_wfq]:

#include "ready_queue_fp.h"
#include "ready_queue_wfq.h"


class Sched_context
{
  MEMBER_OFFSET();
  friend class Jdb_list_timeouts;
  friend class Jdb_thread_list;

public:
Beispiel #5
0
static void CmdSetupScanCmd(PWLAN_ADAPTER pAdapter, char* pszSsid)
{
	PBYTE pCur = &pAdapter->m_ucCmdBuffer[0];
	PHostCmd_DS_802_11_SCAN pCmd = (PHostCmd_DS_802_11_SCAN) pCur;

	pCmd->BSSType = HostCmd_BSS_TYPE_ANY;
	FillMemory(pCmd->BSSID, 0xff, sizeof(pCmd->BSSID));
	pCur += MEMBER_OFFSET(HostCmd_DS_802_11_SCAN, SsIdParamSet);

	if (strlen(pszSsid) > 0) {
		MrvlIEtypes_SsIdParamSet_t* pSsid = (MrvlIEtypes_SsIdParamSet_t*)pCur;

		pSsid->Header.Type = TLV_TYPE_SSID;
		pSsid->Header.Len = (USHORT)strlen(pszSsid);
		MoveMemory(pSsid->SsId, pszSsid, strlen(pszSsid));

		pCur += sizeof(pSsid->Header) + pSsid->Header.Len;
	}
	if (1) {
		int i;
		MrvlIEtypes_ChanListParamSet_t* pChanList = (MrvlIEtypes_ChanListParamSet_t*)pCur;
		ChanScanParamSet_t* pChanScan;

		pChanList->Header.Type = TLV_TYPE_CHANLIST;
		pChanList->Header.Len = 0;
		pCur += sizeof(pChanList->Header);
		for (i = CMD_SCAN_CHANNEL_MIN; i <= CMD_SCAN_CHANNEL_MAX; i++) {
			pChanScan = (ChanScanParamSet_t*)pCur;
			pChanScan->ChanNumber = i;
			pChanScan->RadioType = HostCmd_SCAN_RADIO_TYPE_BG;
			pChanScan->ScanType = HostCmd_SCAN_TYPE_ACTIVE;
			pChanScan->MinScanTime = HostCmd_SCAN_MIN_CH_TIME;
			pChanScan->ScanTime = HostCmd_SCAN_MIN_CH_TIME;
			pChanList->Header.Len += sizeof(ChanScanParamSet_t);
			pCur += sizeof(ChanScanParamSet_t);
		}
	}
	if(1) {
		MrvlIEtypes_RatesParamSet_t* pRates=(MrvlIEtypes_RatesParamSet_t*)pCur;

		pRates->Header.Type=TLV_TYPE_RATES;
		pRates->Header.Len=sizeof(m_aSupportRate_G);
		MoveMemory(pRates->Rates, m_aSupportRate_G, pRates->Header.Len);

		pCur+=sizeof(pRates->Header)+pRates->Header.Len;
	}

	CmdSetCmdInfo(pAdapter, HostCmd_CMD_802_11_SCAN, pCmd, pCur - (PBYTE)pCmd, pCmd, ADAPTER_CMD_BUFFER_LENGTH);

	return ;
}
INTERFACE [sched_fixed_prio]:

#include <dlist>
#include "member_offs.h"
#include "types.h"
#include "globals.h"
#include "ready_queue_fp.h"


class Sched_context : public cxx::D_list_item
{
    MEMBER_OFFSET();
    friend class Jdb_list_timeouts;
    friend class Jdb_thread_list;
INTERFACE[ux]:

#include "gdt.h"
#include "emulation.h"
#include "entry_frame.h"
#include "member_offs.h"
#include "regdefs.h"
#include "types.h"

class Continuation
{
  MEMBER_OFFSET();

private:
Beispiel #8
0
static ulong get_rchan_addr(ulong stp_relay_data)
{
	long offset;

	/*
	 * If we can get the member offset of struct
	 * stp_relay_data.flushing, we'll assume this is a system
	 * using STP_TRANSPORT_VERSION 1.  Note that this will fail if
	 * the debuginfo of the trace module isn't available.
	 */
	if ((offset = MEMBER_OFFSET("_stp_relay_data_type", "flushing")) > 0) {
		old_format = 1;
	}

	/*
	 * If we can't get the member offset of struct
	 * stp_relay_data.rchan, i.e. the debuginfo of the trace
	 * module isn't available, we use 0 as the offset
	 * instead. Currently struct _stp_relay_data_type is defined
	 * as below:
	 *
	 *     struct _stp_relay_data_type {
	 *             struct rchan *rchan;
	 *             ...
	 *     }
	 *
	 * If the definision of struct _stp_relay_data_type changes,
	 * we must check if this code is correct.
	 */
	if ((offset = MEMBER_OFFSET("_stp_relay_data_type", "rchan")) < 0) {
		error(WARNING, "The debuginfo of the trace module hasn't been loaded.\n"
		      "You may not be able to retrieve the correct trace data.\n");
		offset = 0;
	}

	return (stp_relay_data + (ulong)offset);
}
Beispiel #9
0
CMD_STATUS CmdAssociateExt(PWLAN_ADAPTER pAdapter, PBSSINFO pBssInfo)
{
	CMD_STATUS stat = CmdQueryBuffer(pAdapter);
	WORD nRet;

	if (stat != CMD_ERROR_SUCCESS)
		return stat;

	TRACE("+CmdAssociateExt()\r\n");

	// Setup command
	CmdSetupAssociateCmd(pAdapter, pBssInfo);
	nRet = CmdProcessCmd(pAdapter, CMD_TIMEOUT_MAX);
	if (nRet) {
		PHostCmd_DS_802_11_ASSOCIATE_RESULT pCmdR = (PHostCmd_DS_802_11_ASSOCIATE_RESULT)&pAdapter->m_ucCmdBuffer[0];

		//TRACEDATA("CmdAssocData",pCmd,pCur-PBYTE(pCmd));
		stat = (nRet >= sizeof(*pCmdR) && pCmdR->StatusCode == 0) ? CMD_ERROR_SUCCESS : CMD_ERROR_UNKNOWN;
		TRACE("Wlan.CmdAssociateExt: rc=%08x,SC=%04x,AID=%04x\r\n", nRet, pCmdR->StatusCode, pCmdR->AssociationID, pCmdR->AssociationID);
		if (stat == CMD_ERROR_SUCCESS) {
			PNDIS_802_11_ASSOCIATION_INFORMATION pAI = (PNDIS_802_11_ASSOCIATION_INFORMATION)pAdapter->m_ucAssocInfo;
			int nBufLen, nIeLen = (int)pCmdR->Size - MEMBER_OFFSET(HostCmd_DS_802_11_ASSOCIATE_RESULT, IELength);

			pAI->ResponseFixedIEs.Capabilities = pCmdR->CapInfo;
			pAI->ResponseFixedIEs.StatusCode = pCmdR->StatusCode;
			pAI->ResponseFixedIEs.AssociationId = pCmdR->AssociationID;
			pAI->AvailableResponseFixedIEs |= NDIS_802_11_AI_RESFI_CAPABILITIES;
			pAI->AvailableResponseFixedIEs |= NDIS_802_11_AI_RESFI_STATUSCODE;
			pAI->AvailableResponseFixedIEs |= NDIS_802_11_AI_RESFI_ASSOCIATIONID;

			nBufLen = (int)sizeof(pAdapter->m_ucAssocInfo) - (int)pAI->OffsetResponseIEs;
			nIeLen = MAX(0, MIN(nBufLen, nIeLen));
			MoveMemory((void*)((PBYTE)pAI + pAI->OffsetResponseIEs), (void*)&pCmdR->IELength, nIeLen);
			pAI->ResponseIELength = (ULONG)nIeLen;

			WIFI_SET_FLAG(pAdapter, FLAG_MEDIA_CONNECTED);
		}
	}
	else
		stat = CMD_ERROR_UNKNOWN;

	CmdReleaseBuffer(pAdapter);

	TRACE("-CmdAssociateExt()\r\n");

	return stat;
}
static void
get_diskdump_regs_ppc(struct bt_info *bt, ulong *eip, ulong *esp)
{
	Elf32_Nhdr *note;
	int len;

	if (KDUMP_CMPRS_VALID() &&
		(bt->task == tt->panic_task || 
		(is_task_active(bt->task) && dd->num_prstatus_notes > 1))) {
		note  = (Elf32_Nhdr*) dd->nt_prstatus_percpu[bt->tc->processor];
		if (!note)
			error(FATAL,
				    "cannot determine NT_PRSTATUS ELF note "
				    "for %s task: %lx\n",
					(bt->task == tt->panic_task) ?
					"panic" : "active", bt->task);
		len = sizeof(Elf32_Nhdr);
		len = roundup(len + note->n_namesz, 4);
		 bt->machdep = (void *)((char *)note + len +
			MEMBER_OFFSET("elf_prstatus", "pr_reg"));
	}

	machdep->get_stack_frame(bt, eip, esp);
}
Beispiel #11
0
CMD_STATUS CmdAdHocStart(PWLAN_ADAPTER pAdapter, PBSSINFO pBssInfo)
{
	CMD_STATUS stat = CmdQueryBuffer(pAdapter);
	PHostCmd_DS_802_11_AD_HOC_START pCmd = (PHostCmd_DS_802_11_AD_HOC_START)&pAdapter->m_ucCmdBuffer[0];
	PHostCmd_DS_802_11_AD_HOC_RESULT pCmdR = (PHostCmd_DS_802_11_AD_HOC_RESULT)(pCmd+1);
	PNDIS_WLAN_BSSID_EX pBid = (PNDIS_WLAN_BSSID_EX)(&pBssInfo->Bssid);
	PNDIS_802_11_FIXED_IEs pFie = &pBssInfo->IEsFixed;
	WORD nRet;

	ZeroMemory(pCmd,sizeof(*pCmd));
	//Configure Cmd Parameters
	strcpy((char*)pCmd->SSID, pAdapter->m_CurProfile.szSSID);
	pCmd->BSSType = HostCmd_BSS_TYPE_IBSS;
	pCmd->BeaconPeriod = cmdAdhocBacconPeriod;
	pCmd->DTIMPeriod = (UCHAR)cmdPsNumDtims;
	pCmd->SsParamSet.IbssParamSet.ElementId = IBSS_PARAM_SET;
	pCmd->SsParamSet.IbssParamSet.Len = 2;
	pCmd->SsParamSet.IbssParamSet.AtimWindow = cmdAdhocAtimWindow;
	pCmd->PhyParamSet.DsParamSet.ElementId = DS_PARAM_SET;
	pCmd->PhyParamSet.DsParamSet.Len = 1;
	pCmd->PhyParamSet.DsParamSet.CurrentChan = cmdAdhocChannel;
	pCmd->ProbeDelay = HostCmd_SCAN_PROBE_DELAY_TIME; 
	pCmd->Cap.Ibss = 1;
	pCmd->Cap.ShortPreamble = 1;
	pCmd->Cap.Privacy = (pAdapter->m_CurProfile.EncMode== EncryMode_WEP?1:0);
	MoveMemory(pCmd->BasicDataRates, m_aSupportRate_G, sizeof(m_aSupportRate_G));  

	CmdSetCmdInfo(pAdapter, HostCmd_CMD_802_11_AD_HOC_START, pCmd, sizeof(*pCmd), pCmd + 1, ADAPTER_CMD_BUFFER_LENGTH - sizeof(*pCmd));

	nRet = CmdProcessCmd(pAdapter, CMD_TIMEOUT_MAX);
	if (nRet < sizeof(*pCmdR))
		stat = CMD_ERROR_UNKNOWN;

	if(stat == CMD_ERROR_SUCCESS) {
		ZeroMemory(pBssInfo,sizeof(*pBssInfo));
		//Configure BssInfo
		MoveMemory(pBid->MacAddress,pCmdR->BSSID,sizeof(pBid->MacAddress));
		pBssInfo->nScanCounter = 0; //////???
		pBssInfo->IELength=sizeof(*pFie);
		pBid->Rssi = -10;
		pBid->Configuration.Length=sizeof(NDIS_802_11_CONFIGURATION);
		MoveMemory(&pFie->Capabilities,&pCmd->Cap,sizeof(pFie->Capabilities));
		pBid->Privacy = pAdapter->m_CurProfile.EncMode== EncryMode_WEP?
			Ndis802_11PrivFilter8021xWEP:Ndis802_11PrivFilterAcceptAll;
		pBid->InfrastructureMode = Ndis802_11IBSS;
		pBid->Ssid.SsidLength = strlen(pAdapter->m_CurProfile.szSSID);
		MoveMemory(pBid->Ssid.Ssid, pAdapter->m_CurProfile.szSSID, strlen(pAdapter->m_CurProfile.szSSID));
		if(1) {
			INT nLen = 2 + pCmd->PhyParamSet.DsParamSet.Len;
			PBYTE pCur = (PBYTE)(&pBssInfo->IEsFixed) + pBssInfo->IELength;
			IEEEtypes_DsParamSet_t* pDS = (IEEEtypes_DsParamSet_t *)pCur;

			MoveMemory(pDS, &pCmd->PhyParamSet.DsParamSet, nLen);
			pBid->NetworkTypeInUse = Ndis802_11OFDM24;
			pBid->Configuration.DSConfig = 2407+(pDS->CurrentChan*5);
			pBssInfo->nChannel = pDS->CurrentChan;
			pBssInfo->IELength += nLen;
		}
		if(1) {
			INT nLen = 2 + pCmd->SsParamSet.IbssParamSet.Len;
			PBYTE pCur = (PBYTE)(&pBssInfo->IEsFixed) + pBssInfo->IELength;
			IEEEtypes_IbssParamSet_t* pIbss = (IEEEtypes_IbssParamSet_t*)pCur;

			MoveMemory(pIbss,&pCmd->SsParamSet.IbssParamSet,nLen);
			pBssInfo->pIbssParamSet = pIbss;
			pBssInfo->IELength += nLen;
		}
		pBid->Length = MEMBER_OFFSET(NDIS_WLAN_BSSID_EX, IEs)+pBssInfo->IELength;
		pBid->Length = (pBid->Length+3) & ~3;
	}

	CmdReleaseBuffer(pAdapter);
	
	return stat;
}
Beispiel #12
0
static void CmdScanInterpret2(PWLAN_ADAPTER pAdapter, PBYTE pCur, PBYTE pEnd, PBSSINFO pBssInfo)
{
	PSrBssDesc pbd = (PSrBssDesc)pCur;
	PNDIS_WLAN_BSSID_EX pBid = (PNDIS_WLAN_BSSID_EX)&pBssInfo->Bssid;
	PNDIS_802_11_FIXED_IEs pFie = &pBssInfo->IEsFixed;
	int nRateCnt = 0;

	TRACE("+CmdScanInterpret2()\r\n");

	TRACE("CmdScanInterpret2: Rssi=%d TsInterval=%04x Cap=%04x\n"
	      "\r\nAP Address=%02x%02x%02x-%02x%02x%02x\n",
	      -(int)(pbd->nRssi & 0x7f), pbd->nTsInterval, pbd->nCapability,
	      pbd->aApPhyAddr[0], pbd->aApPhyAddr[1], pbd->aApPhyAddr[2],
	      pbd->aApPhyAddr[3], pbd->aApPhyAddr[4], pbd->aApPhyAddr[5]);

	MoveMemory(pBid->MacAddress, pbd->aApPhyAddr, sizeof(pBid->MacAddress));
	pBid->Rssi = -(LONG)(pbd->nRssi & 0x7f);
	MoveMemory(pFie->Timestamp, pbd->aTimeStamp, sizeof(pFie->Timestamp));
	pFie->BeaconInterval = pbd->nTsInterval;
	pBid->Configuration.Length = sizeof(NDIS_802_11_CONFIGURATION);
	pBid->Configuration.BeaconPeriod = pbd->nTsInterval;
	pFie->Capabilities = pbd->nCapability;
	if (1) {
		IEEEtypes_CapInfo_t cap;

		*(PUSHORT)(&cap) = pbd->nCapability;
		MoveMemory((void*)&cap, (void*)&pbd->nCapability, sizeof(cap));
		pBid->Privacy = cap.Privacy ? Ndis802_11PrivFilter8021xWEP : Ndis802_11PrivFilterAcceptAll;
		pBid->InfrastructureMode = cap.Ibss ? Ndis802_11IBSS : Ndis802_11Infrastructure;
	}
	pCur += sizeof(SrBssDesc);
	pBssInfo->IELength = sizeof(*pFie);
	if (pCur + 2 < pEnd) {
		ULONG nLen = MIN(pEnd - pCur, sizeof(pBssInfo->IEsVariable));

		pBssInfo->IELength += nLen;
		MoveMemory(pBssInfo->IEsVariable, pCur, nLen);
		pCur = pBssInfo->IEsVariable;
		pEnd = pCur + nLen;
	}
	pBid->Length = MEMBER_OFFSET(NDIS_WLAN_BSSID_EX, IEs) + pBssInfo->IELength;
	pBid->Length = ALIGN_UP(pBid->Length, 4);

	while (pCur + (2 + pCur[1]) <= pEnd) {
		switch (pCur[0]) { //IE Type
			case SSID:
			{
				char szSsid[33];
				
				CopyMemory(szSsid, pCur + 2, pCur[1]);
				szSsid[pCur[1]] = 0;
				TRACE("CmdScanInterpret2: Find SSID(%d,%s)\r\n", pCur[1], szSsid);
				if (pCur[1]) {
					pBid->Ssid.SsidLength = MIN(pCur[1], sizeof(pBid->Ssid.Ssid));
					MoveMemory(pBid->Ssid.Ssid, pCur + 2, pBid->Ssid.SsidLength);
					pBid->Ssid.Ssid[pBid->Ssid.SsidLength] = 0;
				}
				break;
			}
			case SUPPORTED_RATES:
				TRACE("CmdScanInterpret2: Find Rates(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					nRateCnt = MIN(pCur[1], sizeof(pBid->SupportedRates));
					MoveMemory(pBid->SupportedRates, pCur + 2, nRateCnt);
				}
				break;
			case FH_PARAM_SET:
				TRACE("CmdScanInterpret2: Find Frequency Hopping(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					IEEEtypes_FhParamSet_t* pFH = (IEEEtypes_FhParamSet_t*)pCur;
					pBid->NetworkTypeInUse = Ndis802_11FH;
					pBid->Configuration.DSConfig = 0;
					pBid->Configuration.FHConfig.Length = sizeof(NDIS_802_11_CONFIGURATION_FH);
					pBid->Configuration.FHConfig.HopPattern = pFH->HopPattern;
					pBid->Configuration.FHConfig.HopSet = pFH->HopSet;
					pBid->Configuration.FHConfig.DwellTime = pFH->DwellTime;
					pBssInfo->nChannel = 0;
				}
				break;
			case DS_PARAM_SET:
				TRACE("CmdScanInterpret2: Find Direct Spectrum(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					//should add A B G support
					IEEEtypes_DsParamSet_t* pDS = (IEEEtypes_DsParamSet_t *)pCur;
					pBid->NetworkTypeInUse = Ndis802_11OFDM24;
					pBid->Configuration.DSConfig = 2407 + (pDS->CurrentChan * 5);
					pBssInfo->nChannel = pDS->CurrentChan;
					TRACE("CmdScanInterpret2: Find DS Channel %d(%s)\r\n", pDS->CurrentChan, pBid->Ssid.Ssid);
					break;
				}
				break;
			case CF_PARAM_SET:
				TRACE("CmdScanInterpret2: CF(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					pBssInfo->pCfParamSet = (IEEEtypes_CfParamSet_t*)pCur;
				}
				break;
			case IBSS_PARAM_SET:
				TRACE("CmdScanInterpret2: IBSS(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					IEEEtypes_IbssParamSet_t* pIbss = (IEEEtypes_IbssParamSet_t*)pCur;
					pBid->Configuration.ATIMWindow = pIbss->AtimWindow;
					pBssInfo->pIbssParamSet = pIbss;
				}
				break;
			case COUNTRY_INFO:
				TRACE("CmdScanInterpret2: Country(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					pBssInfo->pCountryInfo = (IEEEtypes_CountryInfoFullSet_t*)pCur;
				}
				break;
			case ERP_INFO:
				TRACE("CmdScanInterpret2: ERP(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					IEEEtypes_ERPInfo_t* pERP = (IEEEtypes_ERPInfo_t*)pCur;
					pBssInfo->nERPFlags = pERP->ERPFlags;
				}
				break;
			case EXTENDED_SUPPORTED_RATES:
				TRACE("CmdScanInterpret2: Extend supported rates(%d)\r\n", pCur[1]);
				if (pCur[1] && nRateCnt) {
					int nRateCnt2 = MIN(pCur[1], sizeof(pBid->SupportedRates) - nRateCnt);
					MoveMemory((PBYTE)(pBid->SupportedRates) + nRateCnt, pCur + 2, nRateCnt2);
				}
				break;
			case ELE_CISCO_CLIENT_TX_PWR:
				TRACE("CmdScanInterpret2: ccx tpc(%d)\r\n", pCur[1]);
				if (pCur[1]) {
					// need to do
				}
				break;
		}
		pCur += 2 + pCur[1]; //IE Length;
	}
	TRACE("-CmdScanInterpret2()\r\n");
}
Beispiel #13
0
static void CmdSetupAssociateCmd(PWLAN_ADAPTER pAdapter, PBSSINFO pBssInfo)
{
	PBYTE pCur = &pAdapter->m_ucCmdBuffer[0];
	PHostCmd_DS_802_11_ASSOCIATE_EXT pCmd = (PHostCmd_DS_802_11_ASSOCIATE_EXT)pCur;

	if (1) {
		IEEEtypes_CapInfo_t cap = *(IEEEtypes_CapInfo_t*)&pBssInfo->IEsFixed.Capabilities;

		cap.QoS = 0;
		MoveMemory(&pCmd->PeerStaAddr, &pBssInfo->Bssid.MacAddress, sizeof(pCmd->PeerStaAddr));
		pCmd->CapInfo = cap;
		pCmd->ListenInterval = 0x14;
		pCmd->BcnPeriod = pBssInfo->IEsFixed.BeaconInterval;
		pCmd->DtimPeriod = 3;

		pCur += MEMBER_OFFSET(HostCmd_DS_802_11_ASSOCIATE_EXT, SsIdParamSet);
	}
	if (1) {
		MrvlIEtypes_SsIdParamSet_t* pSsid = (MrvlIEtypes_SsIdParamSet_t*)pCur;

		pSsid->Header.Type = TLV_TYPE_SSID;
		pSsid->Header.Len = (USHORT)pBssInfo->Bssid.Ssid.SsidLength;
		MoveMemory(pSsid->SsId, pBssInfo->Bssid.Ssid.Ssid, pSsid->Header.Len);

		pCur += sizeof(pSsid->Header) + pSsid->Header.Len;
	}
	if (1) {
		MrvlIEtypes_PhyParamSet_t* pPhy = (MrvlIEtypes_PhyParamSet_t*)pCur;

		pPhy->Header.Type = TLV_TYPE_PHY_DS;
		pPhy->Header.Len = sizeof(pPhy->fh_ds.DsParamSet);
		MoveMemory(&pPhy->fh_ds.DsParamSet, &pBssInfo->nChannel,
		           sizeof(pPhy->fh_ds.DsParamSet));

		pCur += sizeof(pPhy->Header) + pPhy->Header.Len;
	}
	if (1) {
		int f, cbDest;
		PBYTE pDest;
		MrvlIEtypes_RatesParamSet_t* pRate = (MrvlIEtypes_RatesParamSet_t*)pCur;

		pDest = pRate->Rates;
		cbDest = 0;
		for (f = 0; f < sizeof(m_aSupportRate_G); f++)
			pDest[cbDest++] = m_aSupportRate_G[f];
		
		pRate->Header.Type = TLV_TYPE_RATES;
		pRate->Header.Len = cbDest;

		pCur += sizeof(pRate->Header) + pRate->Header.Len;
	}
	if (1)   {
		MrvlIEtypesHeader_t* pHead = (MrvlIEtypesHeader_t*)pCur;

		pHead->Type = TLV_TYPE_TSFTIMESTAMP;
		pHead->Len = sizeof(ULONGLONG) * 2;
		pCur += sizeof(*pHead);
		MoveMemory(pCur, &pBssInfo->nNetworkTSF, sizeof(ULONGLONG));
		pCur += sizeof(ULONGLONG);
		MoveMemory(pCur, &pBssInfo->IEsFixed.Timestamp, sizeof(ULONGLONG));
		pCur += sizeof(ULONGLONG);
	}
	if (1)   {
		MrvlIEtypes_AuthType_t* pAt = (MrvlIEtypes_AuthType_t*)pCur;

		pAt->Header.Type = TLV_TYPE_AUTH_TYPE;
		pAt->Header.Len = sizeof(pAt->AuthType);
		switch (pAdapter->m_CurProfile.AuthMode) {
			case AuthMode_Open:
				pAt->AuthType = Wlan802_11AuthModeOpen;
				break;
			case AuthMode_Shared:
				pAt->AuthType = Wlan802_11AuthModeShared;
				break;
			default:
				pAt->AuthType = (USHORT) - 1;
		}

		pCur += sizeof(pAt->Header) + pAt->Header.Len;
	}

	CmdSetCmdInfo(pAdapter, HostCmd_CMD_802_11_ASSOCIATE_EXT, pCmd, pCur - (PBYTE)pCmd, pCmd, ADAPTER_CMD_BUFFER_LENGTH);
}
static inline uint32_t KL_INT(void* ptr, char* struct_name, char* member_name)
{
	return UINT(ptr+MEMBER_OFFSET(struct_name,member_name));
}
static inline unsigned long KL_ULONG(void* ptr, char* struct_name, char*
				     member_name)
{
	return ULONG(ptr+MEMBER_OFFSET(struct_name,member_name));
}
static inline void* K_PTR(void* addr, char* struct_name, char* member_name)
{
	return addr+MEMBER_OFFSET(struct_name,member_name);
}