📄 oidproc.c
字号:
pCap->AuthEncryptSupported[1].EncryptStatus = Ndis802_11Encryption1Enabled;
pCap->AuthEncryptSupported[2].AuthMode = Ndis802_11AuthModeShared;
pCap->AuthEncryptSupported[2].EncryptStatus = Ndis802_11EncryptionDisabled;
pCap->AuthEncryptSupported[3].AuthMode = Ndis802_11AuthModeShared;
pCap->AuthEncryptSupported[3].EncryptStatus = Ndis802_11Encryption1Enabled;
pCap->AuthEncryptSupported[4].AuthMode = Ndis802_11AuthModeWPA;
pCap->AuthEncryptSupported[4].EncryptStatus = Ndis802_11Encryption2Enabled;
pCap->AuthEncryptSupported[5].AuthMode = Ndis802_11AuthModeWPA;
pCap->AuthEncryptSupported[5].EncryptStatus = Ndis802_11Encryption3Enabled;
pCap->AuthEncryptSupported[6].AuthMode = Ndis802_11AuthModeWPAPSK;
pCap->AuthEncryptSupported[6].EncryptStatus = Ndis802_11Encryption2Enabled;
pCap->AuthEncryptSupported[7].AuthMode = Ndis802_11AuthModeWPAPSK;
pCap->AuthEncryptSupported[7].EncryptStatus = Ndis802_11Encryption3Enabled;
pCap->AuthEncryptSupported[8].AuthMode = Ndis802_11AuthModeWPA2;
pCap->AuthEncryptSupported[8].EncryptStatus = Ndis802_11Encryption2Enabled;
pCap->AuthEncryptSupported[9].AuthMode = Ndis802_11AuthModeWPA2;
pCap->AuthEncryptSupported[9].EncryptStatus = Ndis802_11Encryption3Enabled;
pCap->AuthEncryptSupported[10].AuthMode = Ndis802_11AuthModeWPA2PSK;
pCap->AuthEncryptSupported[10].EncryptStatus = Ndis802_11Encryption2Enabled;
pCap->AuthEncryptSupported[11].AuthMode = Ndis802_11AuthModeWPA2PSK;
pCap->AuthEncryptSupported[11].EncryptStatus = Ndis802_11Encryption3Enabled;
*BytesWritten = nNeedLen;
return NDIS_STATUS_SUCCESS;
}
break;
#endif //PMKID_CACHE_CAP
case OID_GEN_MAC_OPTIONS:
// NOTE: Don't set NDIS_MAC_OPTION_RECEIVE_SERIALIZED if we
// are doing multipacket (ndis4) style receives.
GenericULONG = (ULONG)NDIS_MAC_OPTION_NO_LOOPBACK |
NDIS_MAC_OPTION_TRANSFERS_NOT_PEND;
if ( Adapter->EnableQOS )
{
GenericULONG = GenericULONG | NDIS_MAC_OPTION_8021P_PRIORITY;
}
break;
case OID_GEN_CURRENT_PACKET_FILTER:
// Verify the Length
if (InformationBufferLength < 4)
{
*BytesNeeded = 4;
return (NDIS_STATUS_INVALID_LENGTH);
}
// Now call the filter function to set the packet filter.
NdisMoveMemory(InformationBuffer, (PVOID)&(Adapter->CurrentPacketFilter), sizeof(ULONG));
break;
case OID_GEN_SUPPORTED_LIST:
MoveSource = (PVOID) (MrvDrvGlobalSupportedOids);
MoveBytes = sizeof(MrvDrvGlobalSupportedOids);
break;
case OID_GEN_HARDWARE_STATUS:
GenericULONG = (ULONG)Adapter->HardwareStatus;
break;
case OID_GEN_MEDIA_SUPPORTED:
MoveSource = (PVOID)MediaSupported;
MoveBytes = sizeof(NDIS_MEDIUM); // need to change for 802.11
break;
case OID_GEN_MEDIA_IN_USE:
GenericULONG = Adapter->MediaInUse;
// MoveSource = (PVOID)MediaSupported;
// MoveBytes = sizeof(NDIS_MEDIUM);
// need to change for 802.11
break;
case OID_GEN_MAXIMUM_FRAME_SIZE:
// this is a work around for the ping problem.
// GenericULONG = (ULONG)(MRVDRV_MAXIMUM_ETH_PACKET_SIZE - MRVDRV_ETH_HEADER_SIZE);
GenericULONG = (ULONG)CF_MAX_PACKET_SIZE;
break;
case OID_GEN_MAXIMUM_LOOKAHEAD:
GenericULONG = (ULONG)MRVDRV_MAXIMUM_ETH_PACKET_SIZE - MRVDRV_ETH_HEADER_SIZE;
DBGPRINT(DBG_RXDATA, ("OID: Return OID_GEN_MAXIMUM_LOOKAHEAD to %d\n",
MRVDRV_MAXIMUM_ETH_PACKET_SIZE- MRVDRV_ETH_HEADER_SIZE));
break;
case OID_GEN_CURRENT_LOOKAHEAD:
GenericULONG = (ULONG)MRVDRV_MAXIMUM_ETH_PACKET_SIZE - MRVDRV_ETH_HEADER_SIZE;
DBGPRINT(DBG_RXDATA, ("OID: Return OID_GEN_CURRENT_LOOKAHEAD to %d\n",
MRVDRV_MAXIMUM_ETH_PACKET_SIZE- MRVDRV_ETH_HEADER_SIZE));
break;
case OID_GEN_MAXIMUM_TOTAL_SIZE:
case OID_GEN_RECEIVE_BLOCK_SIZE:
case OID_GEN_TRANSMIT_BLOCK_SIZE:
GenericULONG = (ULONG)MRVDRV_MAXIMUM_ETH_PACKET_SIZE;
break;
case OID_GEN_LINK_SPEED:
// should never return 0mbps according to spec
if ( Adapter->LinkSpeed == MRVDRV_LINK_SPEED_0mbps )
{
GenericULONG = (ULONG) MRVDRV_LINK_SPEED_1mbps;
}
else
{
GenericULONG = (ULONG) Adapter->LinkSpeed;
}
break;
case OID_GEN_TRANSMIT_BUFFER_SPACE:
GenericULONG = (ULONG)0;
break;
case OID_GEN_RECEIVE_BUFFER_SPACE:
GenericULONG = (ULONG) MRVDRV_MAXIMUM_ETH_PACKET_SIZE;
break;
case OID_GEN_VENDOR_ID:
MoveSource = (PVOID) (&Adapter->VendorID);
MoveBytes = 4;
break;
case OID_GEN_VENDOR_DESCRIPTION:
MoveSource = (PVOID) VendorDescriptor;
MoveBytes = sizeof(VendorDescriptor);
break;
case OID_GEN_DRIVER_VERSION:
GenericUSHORT = (USHORT) MRVDRV_DRIVER_VERSION;
MoveSource = (PVOID)(&GenericUSHORT);
MoveBytes = sizeof(GenericUSHORT);
break;
case OID_GEN_VENDOR_DRIVER_VERSION:
// CF8381/8385 only uses the last 3 bytes
GenericULONG = Adapter->FWReleaseNumber << 8;
break;
// WMI support
case OID_GEN_SUPPORTED_GUIDS:
MoveSource = (PUCHAR)&GUIDList;
MoveBytes = sizeof(GUIDList);
break;
// Task Offload
// case OID_GEN_TASK_OFFLOAD:
//
// Status = NDIS_STATUS_NOT_SUPPORTED;
// break;
case OID_802_3_MULTICAST_LIST:
DBGPRINT(DBG_OID,("REQUEST - OID_802_3_MULTICAST_LIST \n"));
// The data must be a multiple of the Ethernet address size.
if (InformationBufferLength < (Adapter->NumOfMulticastMACAddr*ETH_LENGTH_OF_ADDRESS))
{
*BytesNeeded = Adapter->NumOfMulticastMACAddr*ETH_LENGTH_OF_ADDRESS;
return NDIS_STATUS_INVALID_LENGTH;
}
// Save these new MC addresses to our adapter object
NdisMoveMemory( InformationBuffer,
Adapter->MulticastList,
Adapter->NumOfMulticastMACAddr*ETH_LENGTH_OF_ADDRESS);
*BytesWritten = Adapter->NumOfMulticastMACAddr*ETH_LENGTH_OF_ADDRESS;
break;
case OID_802_3_PERMANENT_ADDRESS:
if (Adapter->bIsAddress == FALSE)
{
NdisZeroMemory(&(Adapter->PendingMacAddressOid), sizeof(PENDING_OID));
Adapter->PendingMacAddressOid.bIsPendingOID = TRUE;
Adapter->PendingMacAddressOid.PendingOID = Oid;
Adapter->PendingMacAddressOid.InformationBuffer = InformationBuffer;
Adapter->PendingMacAddressOid.InformationBufferLength = InformationBufferLength;
Adapter->PendingMacAddressOid.BytesReadWrite = BytesWritten;
Adapter->PendingMacAddressOid.BytesNeeded = BytesNeeded;
return NDIS_STATUS_PENDING;
}
ETH_COPY_NETWORK_ADDRESS((PCHAR) GenericArray, Adapter->PermanentAddr);
MoveSource = (PVOID) (GenericArray);
MoveBytes = MRVDRV_ETH_ADDR_LEN;
#ifdef DBG
DBGPRINT(DBG_OID,("*** OID return permanent addr: %2x %2x %2x %2x %2x %2x ***\n",
Adapter->PermanentAddr[0],
Adapter->PermanentAddr[1],
Adapter->PermanentAddr[2],
Adapter->PermanentAddr[3],
Adapter->PermanentAddr[4],
Adapter->PermanentAddr[5]));
#endif
break;
case OID_802_3_CURRENT_ADDRESS:
if (Adapter->bIsAddress == FALSE)
{
NdisZeroMemory(&(Adapter->PendingMacAddressOid), sizeof(PENDING_OID));
Adapter->PendingMacAddressOid.bIsPendingOID = TRUE;
Adapter->PendingMacAddressOid.PendingOID = Oid;
Adapter->PendingMacAddressOid.InformationBuffer = InformationBuffer;
Adapter->PendingMacAddressOid.InformationBufferLength = InformationBufferLength;
Adapter->PendingMacAddressOid.BytesReadWrite = BytesWritten;
Adapter->PendingMacAddressOid.BytesNeeded = BytesNeeded;
return NDIS_STATUS_PENDING;
}
// ETH_COPY_NETWORK_ADDRESS(GenericArray, Adapter->CurrentAddr);
ETH_COPY_NETWORK_ADDRESS((PCHAR) GenericArray, Adapter->PermanentAddr);
MoveSource = (PVOID) (GenericArray);
MoveBytes = MRVDRV_ETH_ADDR_LEN;
break;
case OID_802_3_MAXIMUM_LIST_SIZE:
GenericULONG = (ULONG)MRVDRV_MAX_MULTICAST_LIST_SIZE;
break;
case OID_GEN_MAXIMUM_SEND_PACKETS:
GenericULONG = 1;
break;
case OID_GEN_MEDIA_CONNECT_STATUS:
DBGPRINT(DBG_OID, ("Request - OID_GEN_MEDIA_CONNECT_STATUS : %d\n",
Adapter->MediaConnectStatus));
if ((Adapter->bIsReconnectEnable == TRUE) ||
(Adapter->bIsBeaconLoseEvent == TRUE) ||
(Adapter->bIsDeauthenticaticationEvent == TRUE)
#ifdef ACTIVE_ROAMING
||(Adapter->bIsActiveRoaming== TRUE)
#endif
)
{
GenericLONG = (ULONG) NdisMediaStateConnected;
}
else
{
GenericLONG = (ULONG) Adapter->MediaConnectStatus;
}
// RETAILMSG(1, (TEXT("OID_GEN_MEDIA_CONNECT_STATUS %d \r\n"), GenericLONG ));
MoveSource = (PVOID) (&GenericLONG);
MoveBytes = sizeof(GenericLONG);
break;
case OID_PNP_CAPABILITIES:
DBGPRINT(DBG_POWER ,("OID_PNP_CAPABILITIES\n"));
// return NDIS_STATUS_NOT_SUPPORTED;
/*
#ifdef UNDER_CE
*/
PMCap.WakeUpCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
PMCap.WakeUpCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
PMCap.WakeUpCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
/*
#else
// PNP support for XP is broken, return NDIS_STATUS_NOT_SUPPORTED for now
return NDIS_STATUS_NOT_SUPPORTED;
#endif
*/
MoveSource = (PVOID) &PMCap;
MoveBytes = sizeof(NDIS_PNP_CAPABILITIES);
break;
case OID_PNP_QUERY_POWER:
DBGPRINT(DBG_POWER ,("OID_PNP_QUERY_POWER\n"));
//return NDIS_STATUS_NOT_SUPPORTED;
NewPowerState = (NDIS_DEVICE_POWER_STATE)*(PNDIS_DEVICE_POWER_STATE)InformationBuffer;
if ( NewPowerState == NdisDeviceStateUnspecified )
{
DBGPRINT(DBG_POWER ,("Requested power state: NdisDeviceStateUnspecified\n"));
}
else if ( NewPowerState == NdisDeviceStateD0 )
{
DBGPRINT(DBG_POWER ,("Requested power state: NdisDeviceStateD0\n"));
}
else if ( NewPowerState == NdisDeviceStateD1 )
{
DBGPRINT(DBG_POWER ,("Requested power state: NdisDeviceStateD1\n"));
}
else if ( NewPowerState == NdisDeviceStateD2 )
{
DBGPRINT(DBG_POWER ,("Requested power state: NdisDeviceStateD2\n"));
}
else if ( NewPowerState == NdisDeviceStateD3 )
{
DBGPRINT(DBG_POWER ,("Requested power state: NdisDeviceStateD3\n"));
}
else
{
DBGPRINT(DBG_POWER,("UNKNOWN POWER STATE REQUESTED %x\n", NewPowerState));
}
// Determine if Station can suuport this state
if ((NewPowerState == NdisDeviceStateD0 ) ||
(NewPowerState == NdisDeviceStateD3 ) )
{
DBGPRINT(DBG_POWER ,("REQUESTED POWER STATE SUPPORTED!\n"));
return NDIS_STATUS_SUCCESS;
}
else // We don't know hot to handle NdisDeviceState D1, D2 yet
{
DBGPRINT(DBG_POWER ,("REQUESTED POWER STATE NOT SUPPORTED %x\n",NewPowerState ));
return NDIS_STATUS_NOT_SUPPORTED;
}
break;
#ifndef WHQL_FIX
case OID_PNP_WAKE_UP_PATTERN_LIST:
DBGPRINT(DBG_POWER ,("REQUESTED POWER STATE NOT SUPPORTED %x\n",NewPowerState ));
return NDIS_STATUS_NOT_SUPPORTED;
break;
#endif
case OID_GEN_PHYSICAL_MEDIUM:
GenericULONG = (ULONG)NdisPhysicalMediumWirelessLan;
break;
case OID_802_11_NETWORK_TYPES_SUPPORTED:
{
NDIS_802_11_NETWORK_TYPE_LIST *pNetworkTypeList;
DBGPRINT(DBG_OID, ("Requst - OID_802_11_NETWORK_TYPES_SUPPORTED ****\n"));
if ( InformationBufferLength < sizeof(NDIS_802_11_NETWORK_TYPE_LIST) )
{
*BytesNeeded = sizeof(NDIS_802_11_NETWORK_TYPE_LIST);
return NDIS_STATUS_INVALID_LENGTH;
}
// only 1 item
pNetworkTypeList = (NDIS_802_11_NETWORK_TYPE_LIST *)InformationBuffer;
pNetworkTypeList->NumberOfItems = 1;
pNetworkTypeList->NetworkType[0] = Ndis802_11DS;
MoveBytes = sizeof(NDIS_802_11_NETWORK_TYPE_LIST);
}
break;
case OID_802_11_NETWORK_TYPE_IN_USE:
//DBGPRINT(DBG_OID,("REQUEST - OID_802_11_NETWORK_TYPE_IN_USE ****\n"));
if( InformationBufferLength < sizeof(NDIS_802_11_NETWORK_TYPE) )
{
*BytesNeeded = sizeof(NDIS_802_11_NETWORK_TYPE);
return NDIS_STATUS_INVALID_LENGTH;
}
GenericULONG = (ULONG)Ndis802_11DS;
break;
case OID_802_11_BSSID:
//DBGPRINT(DBG_OID,("REQUEST - OID_802_11_BSSID ****\n"));
// if the CurrentBSSID is a NULL string
if ( NdisEqualMemory(Adapter->CurrentBSSID,
Adapter->NullBSSID,
MRVDRV_ETH_ADDR_LEN) )
{
Status = NDIS_STATUS_ADAPTER_NOT_READY;
}
else if( InformationBufferLength < MRVDRV_ETH_ADDR_LEN )
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -