⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmdsend.c

📁 Windows CE 6.0 BSP for VOIP sample phone. Intel PXA270 platform.
💻 C
📖 第 1 页 / 共 5 页
字号:
                    	pCmdPwk->TkipEncryptKey[1],
                    	pCmdPwk->TkipEncryptKey[2],
                    	pCmdPwk->TkipEncryptKey[3],
                    	pCmdPwk->TkipEncryptKey[4],
                    	pCmdPwk->TkipEncryptKey[5],
                    	pCmdPwk->TkipEncryptKey[6],
                    	pCmdPwk->TkipEncryptKey[7],
                    	pCmdPwk->TkipEncryptKey[8],
                    	pCmdPwk->TkipEncryptKey[9],
                    	pCmdPwk->TkipEncryptKey[10],
                    	pCmdPwk->TkipEncryptKey[11],
                    	pCmdPwk->TkipEncryptKey[12],
                    	pCmdPwk->TkipEncryptKey[13],
                    	pCmdPwk->TkipEncryptKey[14],
                    	pCmdPwk->TkipEncryptKey[15]));

                	DBGPRINT(DBG_WPA, ("\tTX MIC Key: 0x2%x 0x2%x 0x2%x 0x2%x "
                    					      "0x2%x 0x2%x 0x2%x 0x2%x\n",
                    	pCmdPwk->TkipTxMicKey[0],
                    	pCmdPwk->TkipTxMicKey[1],
                    	pCmdPwk->TkipTxMicKey[2],
                    	pCmdPwk->TkipTxMicKey[3],
                    	pCmdPwk->TkipTxMicKey[4],
                    	pCmdPwk->TkipTxMicKey[5],
                    	pCmdPwk->TkipTxMicKey[6],
                    	pCmdPwk->TkipTxMicKey[7]));

                	DBGPRINT(DBG_WPA, ("\tRX MIC Key: 0x2%x 0x2%x 0x2%x 0x2%x "
                    					      "0x2%x 0x2%x 0x2%x 0x2%x\n",
                    	pCmdPwk->TkipRxMicKey[0],
                    	pCmdPwk->TkipRxMicKey[1],
                    	pCmdPwk->TkipRxMicKey[2],
                    	pCmdPwk->TkipRxMicKey[3],
                    	pCmdPwk->TkipRxMicKey[4],
                    	pCmdPwk->TkipRxMicKey[5],
                    	pCmdPwk->TkipRxMicKey[6],
                    	pCmdPwk->TkipRxMicKey[7]));

			break;
		}

        case HostCmd_CMD_802_11_PAIRWISE_TSC:
            	break;

        case HostCmd_CMD_802_11_GROUP_TSC:
            	break;

#endif // #ifdef WPA

        // TX and RX commands are the same
        case HostCmd_CMD_802_11_TX_MODE:
        case HostCmd_CMD_802_11_TX_CONTROL_MODE:
       

		{
              	POID_MRVL_DS_TX_MODE        pUserBuffer;
                	PHostCmd_DS_CMD_TXRX_MODE   pCmd;

                	// set only
                	if ( CmdOption != HostCmd_ACT_SET )
                    		return NDIS_STATUS_NOT_ACCEPTED;

                	// TX and RX mode command does not check for valid mode value
                	// Check should be done before calling this function
                	pCmd = (PHostCmd_DS_CMD_TXRX_MODE)pCmdPtr;
                	pUserBuffer = (POID_MRVL_DS_TX_MODE) InformationBuffer;
                	pCmd->Mode = (UCHAR)pUserBuffer->ulMode;
                	Size = sizeof(HostCmd_DS_CMD_TXRX_MODE);
					
			 break;
		}
           
        case HostCmd_CMD_REGION_CODE:
			
		{
#ifndef ENABLE_802_11D

              	POID_MRVL_DS_REGION_CODE    pUserBuffer;
                	PHostCmd_DS_CMD_REGION_CODE pCmd;

                	pCmd = (PHostCmd_DS_CMD_REGION_CODE)pCmdPtr;
                	pCmd->Action = CmdOption;
                	pUserBuffer = (POID_MRVL_DS_REGION_CODE)InformationBuffer;
                	pCmd->RegionCode = (USHORT)pUserBuffer->ulRegionCode;
				
                	/* 
                	DBGPRINT(DBG_OID, ("region code = %d\n",pCmd->RegionCode));
                	HexDump(DBG_OID, "RegionCode CMD:", (PUCHAR)pCmd, s
                     			       izeof(HostCmd_DS_CMD_REGION_CODE));
                	*/

		  	Size = sizeof(HostCmd_DS_CMD_REGION_CODE);				
#endif //ENABLE_802_11D	  
			break;
		}
		
        case HostCmd_CMD_MAC_ADDRESS:

		{
                	PHostCmd_DS_CMD_MAC_ADDRESS     pCmd;
                	POID_MRVL_DS_MAC_ADDRESS    pUserBuffer;

                	pCmd = (PHostCmd_DS_CMD_MAC_ADDRESS)pCmdPtr;
                	pCmd->Action = CmdOption;
                	pUserBuffer = (POID_MRVL_DS_MAC_ADDRESS)InformationBuffer;
                	NdisMoveMemory( pCmd->MacAddress,
                     		             pUserBuffer->EthAddr,
                                		      MRVDRV_ETH_ADDR_LEN);
                	Size = sizeof(HostCmd_DS_CMD_MAC_ADDRESS);       

            		break;
		}
		
        case HostCmd_CMD_BBP_REG_ACCESS:

		{
              	PHostCmd_DS_CMD_BBP_REG_ACCESS pCmd;
                	POID_MRVL_DS_BBP_REGISTER_ACCESS pUserBuffer;

                	pCmd = (PHostCmd_DS_CMD_BBP_REG_ACCESS)pCmdPtr;
                	pCmd->Action = CmdOption;

                	pUserBuffer = (POID_MRVL_DS_BBP_REGISTER_ACCESS)InformationBuffer;
                	pCmd->Offset = pUserBuffer->usOffset;

                	// no harm in setting the value if it is a read
                	pCmd->Value = (UCHAR)pUserBuffer->ulValue; 

                	Size = sizeof(HostCmd_DS_CMD_BBP_REG_ACCESS);

			break;
            	}

        case HostCmd_CMD_MAC_REG_ACCESS:
			
            	{
                	PHostCmd_DS_CMD_MAC_REG_ACCESS pCmd;
                	POID_MRVL_DS_MAC_REGISTER_ACCESS pUserBuffer;

                	pCmd = (PHostCmd_DS_CMD_MAC_REG_ACCESS)pCmdPtr;
                	pCmd->Action = CmdOption;

                	pUserBuffer = (POID_MRVL_DS_MAC_REGISTER_ACCESS)InformationBuffer;
                	pCmd->Offset = pUserBuffer->usOffset;

                	// no harm in setting the value if it is a read
                	pCmd->Value = pUserBuffer->ulValue; 

                	Size = sizeof(HostCmd_DS_CMD_MAC_REG_ACCESS);
            
            		break;
            	}		

        case HostCmd_CMD_RF_REG_ACCESS:

		{
                	PHostCmd_DS_CMD_RF_REG_ACCESS pCmd;
                	POID_MRVL_DS_RF_REGISTER_ACCESS pUserBuffer;

               	pCmd = (PHostCmd_DS_CMD_RF_REG_ACCESS)pCmdPtr;
                	pCmd->Action = CmdOption;

                	pUserBuffer = (POID_MRVL_DS_RF_REGISTER_ACCESS)InformationBuffer;
                	pCmd->Offset = pUserBuffer->usOffset;

                	// no harm in setting the value if it is a read
                	pCmd->Value = (UCHAR)pUserBuffer->ulValue; 

                	Size = sizeof(HostCmd_DS_CMD_RF_REG_ACCESS);
       
            		break;
        	}    
		
	case HostCmd_CMD_802_11_ENABLE_QOS_WME:
		
		{
		//	Size = (USHORT)(sizeof(HostCmd_CMD_QOS_WME_ENABLE_STATE));	
		//	PHostCmd_CMD_QOS_WME_ENABLE_STATE pCmd;

		//	pCmd = (PHostCmd_CMD_QOS_WME_ENABLE_STATE)pCmdPtr;		
		//	pCmd->Action = CmdOption;

		//	if ( pCmd->Action == HostCmd_ACT_SET )
		//	{
		//		pCmd->Enabled = (USHORT)Adapter->EnableQOS;
		//	}
		
			break;
		}
		
	case HostCmd_CMD_802_11_WME_AC_PARAMS :

		{
		//	Size = (USHORT)sizeof(HostCmd_CMD_QOS_WME_ACCESS_CATEGORY_PARAMETERS);
		//						PHostCmd_CMD_QOS_WME_ACCESS_CATEGORY_PARAMETERS pCmd;

		//	pCmd = (PHostCmd_CMD_QOS_WME_ACCESS_CATEGORY_PARAMETERS)pCmdPtr;
		//	pCmd->Action = CmdOption;

		//	if ( pCmd->Action == HostCmd_ACT_SET )
		//	{
		//		pCmd->AC_BE = Adapter->QOSParams.AC_BE;
		//		pCmd->AC_BE_XTRA = Adapter->QOSParams.AC_BE_XTRA;
		//		pCmd->AC_BK = Adapter->QOSParams.AC_BK;
		//		pCmd->AC_BK_XTRA = Adapter->QOSParams.AC_BK_XTRA;
		//		pCmd->AC_VI = Adapter->QOSParams.AC_VI;
		//		pCmd->AC_VI_XTRA = Adapter->QOSParams.AC_VI_XTRA;
		//		pCmd->AC_VO = Adapter->QOSParams.AC_VO;
		//		pCmd->AC_VO_XTRA = Adapter->QOSParams.AC_VO_XTRA;
		//	}

			break;
		}

	case HostCmd_CMD_802_11_RSSI:
		{
			PHostCmd_DS_802_11_RSSI pCmdRssi;
			
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_RSSI));
			pCmdRssi = (PHostCmd_DS_802_11_RSSI)pCmdPtr;
			pCmdRssi->N = Adapter->bcn_avg_factor;

			Adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = 0;
			Adapter->SNR[TYPE_BEACON][TYPE_AVG] = 0;
			Adapter->NF[TYPE_BEACON][TYPE_NOAVG] = 0;
			Adapter->NF[TYPE_BEACON][TYPE_AVG] = 0;
			Adapter->RSSI[TYPE_BEACON][TYPE_NOAVG] = 0;
			Adapter->RSSI[TYPE_BEACON][TYPE_AVG] = 0;
			
			break;
		}
	
	case HostCmd_CMD_802_11_GET_LOG:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_GET_LOG));
			break;
		}
	
	case HostCmd_CMD_GET_HW_SPEC:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_GET_HW_SPEC));
			pHWSpec = (PHostCmd_DS_GET_HW_SPEC)pCmdPtr;
			
			// Move Adapter->CurrentAddr to address field
			NdisMoveMemory(pHWSpec->PermanentAddr, Adapter->CurrentAddr, MRVDRV_ETH_ADDR_LEN);
		
			DBGPRINT(DBG_CMDRESP,("*** set f/w permanent addr : %2x %2x %2x %2x %2x %2x ***\n", 
							pHWSpec->PermanentAddr[0],
							pHWSpec->PermanentAddr[1],
							pHWSpec->PermanentAddr[2],
							pHWSpec->PermanentAddr[3],
							pHWSpec->PermanentAddr[4],
							pHWSpec->PermanentAddr[5]));        
			break;
		}
	
	case HostCmd_CMD_802_11_RESET:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_RESET));
			pReset = (PHostCmd_DS_802_11_RESET)pCmdPtr;
			pReset->Action = CmdOption;
			break;
		}
	
	case HostCmd_CMD_802_11_QUERY_STATUS:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_QUERY_STATUS));
			pStatus = (PHostCmd_DS_802_11_QUERY_STATUS)pCmdPtr;
			break;
		}

	case HostCmd_CMD_802_11_QUERY_TRAFFIC:
	
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_QUERY_TRAFFIC));
			pTraffic = (PHostCmd_DS_802_11_QUERY_TRAFFIC)pCmdPtr;
			break;
		}

	case HostCmd_CMD_MAC_CONTROL:
		{

#ifdef TT_WEP_1
			if ( Adapter->bTurnWepBit )
 				CmdOption |= HostCmd_ACT_MAC_WEP_ENABLE;
			else
				CmdOption &= ~HostCmd_ACT_MAC_WEP_ENABLE;
#endif			
			Size = (USHORT)(sizeof(HostCmd_DS_MAC_CONTROL));
			pControl = (PHostCmd_DS_MAC_CONTROL)pCmdPtr;
			pControl->Action = CmdOption;
			break;
		}

	case HostCmd_CMD_MAC_MULTICAST_ADR:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_MAC_MULTICAST_ADR));
			pMCastAdr = (PHostCmd_DS_MAC_MULTICAST_ADR)pCmdPtr;
			pMCastAdr->Action = CmdOption;
			pMCastAdr->NumOfAdrs = (USHORT)Adapter->NumOfMulticastMACAddr;
			
			NdisMoveMemory(
				(PVOID)pMCastAdr->MACList, 
				(PVOID)Adapter->MulticastList,
				Adapter->NumOfMulticastMACAddr*ETH_LENGTH_OF_ADDRESS);
			break;
		}

	case HostCmd_CMD_802_11_GET_STAT:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_GET_STAT));
			p11Stat = (PHostCmd_DS_802_11_GET_STAT)pCmdPtr;
			break;
		}
	
	case HostCmd_CMD_802_3_GET_STAT:	
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_3_GET_STAT));
			p3Stat = (PHostCmd_DS_802_3_GET_STAT)pCmdPtr;
		
			break;
		}

	case HostCmd_CMD_802_11_PS_MODE:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_PS_MODE));
			pPSMode = (PHostCmd_DS_802_11_PS_MODE)pCmdPtr;

			pPSMode->SubCommand = (USHORT)InformationBuffer;

#ifdef MRV_CHIP_8385PN
#ifdef MRVL_USE_MULTIPLE_DTIM
			pPSMode->PSNumDtims = Adapter->DTIMNum;
#else
            		pPSMode->PSNumDtims = 0x1;
#endif
#endif				
			break;
		}
	
	case HostCmd_CMD_802_11_DATA_RATE:
		{
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_DATA_RATE));
			pDataRate = (PHostCmd_DS_802_11_DATA_RATE)pCmdPtr;
			
			SetupDataRate(CmdOption, pDataRate, Adapter,InformationBuffer);
			break;
		}
	
	case HostCmd_CMD_802_11_BAND_CONFIG:
		{
			PHostCmd_DS_802_11_BAND_CONFIG bc;

			bc = (PHostCmd_DS_802_11_BAND_CONFIG)InformationBuffer;
			Size = (USHORT)(sizeof(HostCmd_DS_802_11_BAND_CONFIG));
			pBandConfig = (PHostCmd_DS_802_11_BAND_CONFIG)pCmdPtr;

			pBandConfig->Action = CmdOption;
			pBandConfig->Channel = bc->Channel;
			pBandConfig->BandSelection = bc->BandSelection;	
		
        		break;
		}

   	case HostCmd_CMD_802_11_SCAN:
   	    	{
			Adapter->SeqNum--; 
	        	ReturnCmdNode(Adapter, pTempCmd);
            		pTempCmd = NULL;

#ifdef ACTIVE_ROAMING
          		if ((Adapter->bIsActiveRoaming == TRUE && Adapter->bActiveRoamingScanOneChannel==TRUE) ||
		           (Adapter->bIsBeaconLoseEvent== TRUE && Adapter->bLinkLostScanOneChannel==TRUE))
          		{
				///AllenDBGPRINT(DBG_OID,("bIsActiveRoaming %d, bIsBeaconLoseEvent %d\n ", 
				///	                                   Adapter->bIsActiveRoaming, 
				///	                                   Adapter->bIsBeaconLoseEvent ));
				
          	       	SetupScanOneChannelCommand (Adapter);
          		}
			else	
#endif	
			{
	        	       SetupScanCommand (Adapter);
			}
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -