prism2mib.c

来自「Linux的无线局域网方案是一个Linux设备驱动程序和子系统 一揽子方案的用」· C语言 代码 · 共 1,855 行 · 第 1/5 页

C
1,855
字号
          F_AP | F_STA | F_READ,          HFA384x_RID_PRI_CFIACTRANGES, HFA384x_RID_CFIACTRANGES_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2BuildSequence,          F_AP | F_STA | F_READ,          HFA384x_RID_BUILDSEQ, HFA384x_RID_BUILDSEQ_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2PrimaryFWID,          F_AP | F_STA | F_READ,          0, 0, 0,          prism2mib_fwid },    { DIDmib_p2_p2NIC_p2SecondaryFWID,          F_AP | F_STA | F_READ,          0, 0, 0,          prism2mib_fwid },    { DIDmib_p2_p2NIC_p2TertiaryFWID,          F_AP | F_READ,          0, 0, 0,          prism2mib_fwid },    { DIDmib_p2_p2NIC_p2NICSerialNumber,          F_AP | F_STA | F_READ,          HFA384x_RID_NICSERIALNUMBER, HFA384x_RID_NICSERIALNUMBER_LEN, 0,          prism2mib_bytearea2pstr },    { DIDmib_p2_p2NIC_p2NICIdentity,          F_AP | F_STA | F_READ,          HFA384x_RID_NICIDENTITY, HFA384x_RID_NICIDENTITY_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2MFISupRange,          F_AP | F_STA | F_READ,          HFA384x_RID_MFISUPRANGE, HFA384x_RID_MFISUPRANGE_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2CFISupRange,          F_AP | F_STA | F_READ,          HFA384x_RID_CFISUPRANGE, HFA384x_RID_CFISUPRANGE_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2ChannelList,          F_AP | F_STA | F_READ,          HFA384x_RID_CHANNELLIST, 0, 0,          prism2mib_uint32 },    { DIDmib_p2_p2NIC_p2RegulatoryDomains,          F_AP | F_STA | F_READ,          HFA384x_RID_REGULATORYDOMAINS, HFA384x_RID_REGULATORYDOMAINS_LEN, 0,          prism2mib_regulatorydomains },    { DIDmib_p2_p2NIC_p2TempType,          F_AP | F_STA | F_READ,          HFA384x_RID_TEMPTYPE, 0, 0,          prism2mib_uint32 },    { DIDmib_p2_p2NIC_p2STAIdentity,          F_AP | F_STA | F_READ,          HFA384x_RID_STAIDENTITY, HFA384x_RID_STAIDENTITY_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2STASupRange,          F_AP | F_STA | F_READ,          HFA384x_RID_STASUPRANGE, HFA384x_RID_STASUPRANGE_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2MFIActRanges,          F_AP | F_STA | F_READ,          HFA384x_RID_STA_MFIACTRANGES, HFA384x_RID_MFIACTRANGES_LEN, 0,          prism2mib_uint32array },    { DIDmib_p2_p2NIC_p2STACFIActRanges,          F_AP | F_STA | F_READ,          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_p2SupportedDataRates,          F_AP | F_STA | F_READ,          HFA384x_RID_SUPPORTEDDATARATES, HFA384x_RID_SUPPORTEDDATARATES_LEN, 0,          prism2mib_bytestr2pstr },    { 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){	prism2sta_priv_t	*priv = (prism2sta_priv_t *) wlandev->priv;	hfa384x_t		*hw = priv->hw;	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 = priv->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) {

⌨️ 快捷键说明

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