📄 prism2mib.c
字号:
HFA384x_RID_STA_CFIACTRANGES, HFA384x_RID_CFIACTRANGES2_LEN, 0, prism2mib_uint32array }, /* p2MAC MIB's */ { DIDmib_p2_p2MAC_p2PortStatus, F_STA | F_READ, HFA384x_RID_PORTSTATUS, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentSSID, F_STA | F_READ, HFA384x_RID_CURRENTSSID, HFA384x_RID_CURRENTSSID_LEN, 0, prism2mib_bytestr2pstr }, { DIDmib_p2_p2MAC_p2CurrentBSSID, F_STA | F_READ, HFA384x_RID_CURRENTBSSID, HFA384x_RID_CURRENTBSSID_LEN, 0, prism2mib_bytearea2pstr }, { DIDmib_p2_p2MAC_p2CommsQuality, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2CommsQualityCQ, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CommsQualityASL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CommsQualityANL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQuality, F_STA | F_READ, HFA384x_RID_DBMCOMMSQUALITY, HFA384x_RID_DBMCOMMSQUALITY_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2dbmCommsQualityCQ, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 0, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQualityASL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 1, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2dbmCommsQualityANL, F_STA | F_READ, HFA384x_RID_COMMSQUALITY, HFA384x_RID_COMMSQUALITY_LEN, 2, prism2mib_uint32offset }, { DIDmib_p2_p2MAC_p2CurrentTxRate, F_STA | F_READ, HFA384x_RID_CURRENTTXRATE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentBeaconInterval, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTBCNINT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2StaCurrentScaleThresholds, F_STA | F_READ, HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_STACURSCALETHRESH_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2APCurrentScaleThresholds, F_AP | F_READ, HFA384x_RID_CURRENTSCALETHRESH, HFA384x_RID_APCURSCALETHRESH_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2ProtocolRspTime, F_AP | F_STA | F_READ, HFA384x_RID_PROTOCOLRSPTIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2ShortRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_SHORTRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2LongRetryLimit, F_AP | F_STA | F_READ, HFA384x_RID_LONGRETRYLIMIT, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2MaxTransmitLifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXTXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2MaxReceiveLifetime, F_AP | F_STA | F_READ, HFA384x_RID_MAXRXLIFETIME, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CFPollable, F_STA | F_READ, HFA384x_RID_CFPOLLABLE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2AuthenticationAlgorithms, F_AP | F_STA | F_READ, HFA384x_RID_AUTHALGORITHMS, HFA384x_RID_AUTHALGORITHMS_LEN, 0, prism2mib_uint32array }, { DIDmib_p2_p2MAC_p2PrivacyOptionImplemented, F_AP | F_STA | F_READ, HFA384x_RID_PRIVACYOPTIMP, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate1, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE1, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate2, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE2, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate3, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE3, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate4, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE4, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate5, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE5, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2CurrentTxRate6, F_AP | F_READ, HFA384x_RID_CURRENTTXRATE6, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2MAC_p2OwnMACAddress, F_AP | F_READ, HFA384x_RID_OWNMACADDRESS, HFA384x_RID_OWNMACADDRESS_LEN, 0, prism2mib_bytearea2pstr }, /* p2Modem MIB's */ { DIDmib_p2_p2Modem_p2PHYType, F_AP | F_STA | F_READ, HFA384x_RID_PHYTYPE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CurrentChannel, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTCHANNEL, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CurrentPowerState, F_AP | F_STA | F_READ, HFA384x_RID_CURRENTPOWERSTATE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2CCAMode, F_AP | F_STA | F_READ, HFA384x_RID_CCAMODE, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2TxPowerMax, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_TXPOWERMAX, 0, 0, prism2mib_uint32 }, { DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel, F_AP | F_STA | F_READ | F_WRITE, HFA384x_RID_TXPOWERMAX, 0, 0, prism2mib_uint32 }, { DIDmib_p2_p2Modem_p2SupportedDataRates, F_AP | F_STA | F_READ, HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0, prism2mib_bytestr2pstr }, /* And finally, lnx mibs */ { DIDmib_lnx_lnxConfigTable_lnxRSNAIE, F_STA | F_READ | F_WRITE, HFA384x_RID_CNFWPADATA, 0, 0, prism2mib_priv }, { 0, 0, 0, 0, 0, NULL}};/*----------------------------------------------------------------These MIB's are not supported at this time:DIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityPresentDIDmib_dot11phy_dot11PhyOperationTable_dot11ChannelAgilityEnabledDIDmib_dot11phy_dot11PhyDSSSTable_dot11PBCCOptionImplementedDIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportIndexDIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxIndexDIDmib_dot11phy_dot11SupportedDataRatesTxTable_dot11SupportedDataRatesTxValueDIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxIndexDIDmib_dot11phy_dot11SupportedDataRatesRxTable_dot11SupportedDataRatesRxValueDIDmib_dot11phy_dot11RegDomainsSupportedTable_dot11RegDomainsSupportValueTODO: need to investigate why wlan has this as enumerated and Prism2 has this as btye str.DIDmib_dot11phy_dot11PhyDSSSTable_dot11ShortPreambleOptionImplementedTODO: Find out the firmware version number(s) for identifying whether the firmware is capable of short preamble. TRUE or FALSE will be returned based on the version of the firmware.WEP Key mappings aren't supported in the f/w.DIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingIndexDIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingAddressDIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingWEPOnDIDmib_dot11smt_dot11WEPKeyMappingsTable_dot11WEPKeyMappingValueDIDmib_dot11smt_dot11PrivacyTable_dot11WEPKeyMappingLengthTODO: implement counters.DIDmib_dot11smt_dot11PrivacyTable_dot11WEPICVErrorCountDIDmib_dot11smt_dot11PrivacyTable_dot11WEPExcludedCountDIDmib_dot11mac_dot11CountersTable_dot11TransmittedFragmentCountDIDmib_dot11mac_dot11CountersTable_dot11MulticastTransmittedFrameCountDIDmib_dot11mac_dot11CountersTable_dot11FailedCountDIDmib_dot11mac_dot11CountersTable_dot11RetryCountDIDmib_dot11mac_dot11CountersTable_dot11MultipleRetryCountDIDmib_dot11mac_dot11CountersTable_dot11FrameDuplicateCountDIDmib_dot11mac_dot11CountersTable_dot11RTSSuccessCountDIDmib_dot11mac_dot11CountersTable_dot11RTSFailureCountDIDmib_dot11mac_dot11CountersTable_dot11ACKFailureCountDIDmib_dot11mac_dot11CountersTable_dot11ReceivedFragmentCountDIDmib_dot11mac_dot11CountersTable_dot11MulticastReceivedFrameCountDIDmib_dot11mac_dot11CountersTable_dot11FCSErrorCountDIDmib_dot11mac_dot11CountersTable_dot11TransmittedFrameCountDIDmib_dot11mac_dot11CountersTable_dot11WEPUndecryptableCountTODO: implement sane values for these.DIDmib_dot11mac_dot11OperationTable_dot11ManufacturerIDDIDmib_dot11mac_dot11OperationTable_dot11ProductIDNot too worried about these at the moment.DIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentTxAntennaDIDmib_dot11phy_dot11PhyAntennaTable_dot11DiversitySupportDIDmib_dot11phy_dot11PhyAntennaTable_dot11CurrentRxAntennaDIDmib_dot11phy_dot11PhyTxPowerTable_dot11NumberSupportedPowerLevelsDIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel1DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel2DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel3DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel4DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel5DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel6DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel7DIDmib_dot11phy_dot11PhyTxPowerTable_dot11TxPowerLevel8DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevelUmmm, FH and IR don't applyDIDmib_dot11phy_dot11PhyFHSSTable_dot11HopTimeDIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentChannelNumberDIDmib_dot11phy_dot11PhyFHSSTable_dot11MaxDwellTimeDIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentDwellTimeDIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentSetDIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentPatternDIDmib_dot11phy_dot11PhyFHSSTable_dot11CurrentIndexDIDmib_dot11phy_dot11PhyDSSSTable_dot11CCAModeSupportedDIDmib_dot11phy_dot11PhyDSSSTable_dot11EDThresholdDIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMaxDIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMaxDIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogTimerMinDIDmib_dot11phy_dot11PhyIRTable_dot11CCAWatchdogCountMinWe just don't have enough antennas right now to worry about this.DIDmib_dot11phy_dot11AntennasListTable_dot11AntennaListIndexDIDmib_dot11phy_dot11AntennasListTable_dot11SupportedTxAntennaDIDmib_dot11phy_dot11AntennasListTable_dot11SupportedRxAntennaDIDmib_dot11phy_dot11AntennasListTable_dot11DiversitySelectionRx------------------------------------------------------------------*//*================================================================*//* Function Definitions *//*----------------------------------------------------------------* prism2mgmt_mibset_mibget** Set the value of a mib item.** Arguments:* wlandev wlan device structure* msgp ptr to msg buffer** Returns: * 0 success and done* <0 success, but we're waiting for something to finish.* >0 an error occurred while handling the message.* Side effects:** Call context:* process thread (usually)* interrupt----------------------------------------------------------------*/int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp){ hfa384x_t *hw = wlandev->priv; int result, isget; mibrec_t *mib; UINT16 which; p80211msg_dot11req_mibset_t *msg = msgp; p80211itemd_t *mibitem; DBFENTER; msg->resultcode.status = P80211ENUM_msgitem_status_data_ok; msg->resultcode.data = P80211ENUM_resultcode_success; /* ** Determine if this is an Access Point or a station. */ which = hw->ap ? F_AP : F_STA; /* ** Find the MIB in the MIB table. Note that a MIB may be in the ** table twice...once for an AP and once for a station. Make sure ** to get the correct one. Note that DID=0 marks the end of the ** MIB table. */ mibitem = (p80211itemd_t *) msg->mibattribute.data; for (mib = mibtab; mib->did != 0; mib++) if (mib->did == mibitem->did && (mib->flag & which)) break; if (mib->did == 0) { msg->resultcode.data = P80211ENUM_resultcode_not_supported; goto done; } /* ** Determine if this is a "mibget" or a "mibset". If this is a ** "mibget", then make sure that the MIB may be read. Otherwise, ** this is a "mibset" so make make sure that the MIB may be written. */ isget = (msg->msgcode == DIDmsg_dot11req_mibget); if (isget) { if (!(mib->flag & F_READ)) { msg->resultcode.data = P80211ENUM_resultcode_cant_get_writeonly_mib; goto done; } } else { if (!(mib->flag & F_WRITE)) { msg->resultcode.data = P80211ENUM_resultcode_cant_set_readonly_mib; goto done; } } /* ** Execute the MIB function. If things worked okay, then make ** sure that the MIB function also worked okay. If so, and this ** is a "mibget", then the status value must be set for both the ** "mibattribute" parameter and the mib item within the data ** portion of the "mibattribute". */ result = mib->func(mib, isget, wlandev, hw, msg, (void *) mibitem->data); if (msg->resultcode.data == P80211ENUM_resultcode_success) { if (result != 0) { WLAN_LOG_DEBUG(1, "get/set failure, result=%d\n", result); msg->resultcode.data = P80211ENUM_resultcode_implementation_failure; } else { if (isget) { msg->mibattribute.status = P80211ENUM_msgitem_status_data_ok; mibitem->status = P80211ENUM_msgitem_status_data_ok; } } }done: DBFEXIT; return(0);}/*----------------------------------------------------------------* prism2mib_bytestr2pstr** Get/set pstr data to/from a byte string.** MIB record parameters:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -