📄 cmdsend.c
字号:
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:
{
Size = (USHORT)(sizeof(HostCmd_DS_802_11_RSSI));
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:
{
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))
{
SetupScanOneChannelCommand (Adapter);
}
else
#endif
{
SetupScanCommand (Adapter);
}
return NDIS_STATUS_SUCCESS;
}
case HostCmd_CMD_802_11_SET_WEP:
{
pSetWEP = (PHostCmd_DS_802_11_SET_WEP)pCmdPtr;
pNewWEP = (PNDIS_802_11_WEP)InformationBuffer;
Size = (USHORT)(sizeof(HostCmd_DS_802_11_SET_WEP));
SetupWepKeys( PendingOID,
pSetWEP,
pNewWEP,
InformationBuffer,
Adapter,
CmdOption);
break;
}
case HostCmd_CMD_802_11_SNMP_MIB:
{
switch (PendingOID)
{
case OID_802_11_INFRASTRUCTURE_MODE:
{
Size = (USHORT)(sizeof(HostCmd_DS_802_11_SNMP_MIB));
pSNMPMIB = (PHostCmd_DS_802_11_SNMP_MIB)pCmdPtr;
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->OID = (USHORT)DesiredBssType_i; // InfrastructureMode Index = 0
pSNMPMIB->BufSize = sizeof(UCHAR);
if( Adapter->InfrastructureMode == Ndis802_11Infrastructure )
ucTemp = 1; // Infrastructure mode
else
ucTemp = 2; // Ad hoc mode
NdisMoveMemory(pSNMPMIB->Value, &ucTemp, sizeof(UCHAR));
break;
}
case OID_802_11_FRAGMENTATION_THRESHOLD:
{
NDIS_802_11_FRAGMENTATION_THRESHOLD ulTemp;
USHORT usTemp;
Size = (USHORT)(sizeof(HostCmd_DS_802_11_SNMP_MIB));
pSNMPMIB = (PHostCmd_DS_802_11_SNMP_MIB)pCmdPtr;
pSNMPMIB->OID = (USHORT)FragThresh_i;
if(PendingInfo==HostCmd_PENDING_ON_GET_OID){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_GET;
}
else if(PendingInfo==HostCmd_PENDING_ON_SET_OID){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->BufSize = sizeof(USHORT);
ulTemp=*((NDIS_802_11_FRAGMENTATION_THRESHOLD *)InformationBuffer);
*((PUSHORT)(pSNMPMIB->Value))=(USHORT)ulTemp;
DBGPRINT(DBG_OID,("OID: Setting Fragmentation threshold to %d\n", ulTemp ));
}
else if(PendingInfo==HostCmd_PENDING_ON_NONE){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->BufSize = sizeof(USHORT);
usTemp=(USHORT)Adapter->FragThsd;
NdisMoveMemory(pSNMPMIB->Value, &usTemp, sizeof(USHORT));
}
break;
}
case OID_802_11_RTS_THRESHOLD:
{
USHORT usTemp;
NDIS_802_11_RTS_THRESHOLD ulTemp;
Size = (USHORT)(sizeof(HostCmd_DS_802_11_SNMP_MIB));
pSNMPMIB = (PHostCmd_DS_802_11_SNMP_MIB)pCmdPtr;
pSNMPMIB->OID = (USHORT)RtsThresh_i;
if(PendingInfo==HostCmd_PENDING_ON_GET_OID){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_GET;
}
else if(PendingInfo==HostCmd_PENDING_ON_SET_OID){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->BufSize = sizeof(USHORT);
ulTemp=*((NDIS_802_11_RTS_THRESHOLD *)InformationBuffer);
*((PUSHORT)(pSNMPMIB->Value))=(USHORT)ulTemp;
DBGPRINT(DBG_OID,("OID: Setting RTS threshold to %d\n", ulTemp ));
}
else if(PendingInfo==HostCmd_PENDING_ON_NONE){
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->BufSize = sizeof(USHORT);
usTemp=(USHORT)Adapter->RTSThsd;
NdisMoveMemory(pSNMPMIB->Value, &usTemp, sizeof(USHORT));
}
break;
}
#ifdef ENABLE_802_11D
case OID_802_11D_ENABLE:
{
USHORT usTemp;
Size = (USHORT)(sizeof(HostCmd_DS_802_11_SNMP_MIB));
pSNMPMIB = (PHostCmd_DS_802_11_SNMP_MIB)pCmdPtr;
pSNMPMIB->OID = Dot11D_i;
pSNMPMIB->QueryType = HostCmd_ACT_GEN_SET;
pSNMPMIB->BufSize = sizeof(USHORT);
usTemp = *(USHORT*) InformationBuffer;
*((USHORT *) (pSNMPMIB->Value)) = usTemp;
}
break;
#endif
default:
break;
}
}
break;
case HostCmd_CMD_802_11_AUTHENTICATE:
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -