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

📄 skgepnmi.c

📁 u-boot-1.1.6 源码包
💻 C
📖 第 1 页 / 共 5 页
字号:
/***************************************************************************** * * Name:	skgepnmi.c * Project:	GEnesis, PCI Gigabit Ethernet Adapter * Version:	$Revision: 1.102 $ * Date:	$Date: 2002/12/16 14:03:24 $ * Purpose:	Private Network Management Interface * ****************************************************************************//****************************************************************************** * *	(C)Copyright 1998-2002 SysKonnect GmbH. * *	This program is free software; you can redistribute it and/or modify *	it under the terms of the GNU General Public License as published by *	the Free Software Foundation; either version 2 of the License, or *	(at your option) any later version. * *	The information in this file is provided "AS IS" without warranty. * ******************************************************************************//***************************************************************************** * * History: * *	$Log: skgepnmi.c,v $ *	Revision 1.102  2002/12/16 14:03:24  tschilli *	VCT code in Vct() changed. * *	Revision 1.101  2002/12/16 09:04:10  tschilli *	Code for VCT handling added. * *	Revision 1.100  2002/09/26 14:28:13  tschilli *	For XMAC the values in the SK_PNMI_PORT Port struct are copied to *	the new SK_PNMI_PORT BufPort struct during a MacUpdate() call. *	These values are used when GetPhysStatVal() is called. With this *	mechanism you get the best results when software corrections for *	counters are needed. Example: RX_LONGFRAMES. * *	Revision 1.99  2002/09/17 12:31:19  tschilli *	OID_SKGE_TX_HW_ERROR_CTS, OID_SKGE_OUT_ERROR_CTS, OID_GEN_XMIT_ERROR: *	Double count of SK_PNMI_HTX_EXCESS_COL in function General() removed. *	OID_PNP_CAPABILITIES: sizeof(SK_PM_WAKE_UP_CAPABILITIES) changed to *	sizeof(SK_PNP_CAPABILITIES) in function PowerManagement(). * *	Revision 1.98  2002/09/10 09:00:03  rwahl *	Adapted boolean definitions according sktypes. * *	Revision 1.97  2002/09/05 15:07:03  rwahl *	Editorial changes. * *	Revision 1.96  2002/09/05 11:04:14  rwahl *	- Rx/Tx packets statistics of virtual port were zero on link down (#10750) *	- For GMAC the overflow IRQ for Rx longframe counter was not counted. *	- Incorrect calculation for oids OID_SKGE_RX_HW_ERROR_CTS, *	  OID_SKGE_IN_ERRORS_CTS,  OID_GEN_RCV_ERROR. *	- Moved correction for OID_SKGE_STAT_RX_TOO_LONG to GetPhysStatVal(). *	- Editorial changes. * *	Revision 1.95  2002/09/04 08:53:37  rwahl *	- Incorrect statistics for Rx_too_long counter with jumbo frame (#10751) *	- StatRxFrameTooLong & StatRxPMaccErr counters were not reset. *	- Fixed compiler warning for debug msg arg types. * *	Revision 1.94  2002/08/09 15:42:14  rwahl *	- Fixed StatAddr table for GMAC. *	- VirtualConf(): returned indeterminated status for speed oids if no *	  active port. * *	Revision 1.93  2002/08/09 11:04:59  rwahl *	Added handler for link speed caps. * *	Revision 1.92  2002/08/09 09:43:03  rwahl *	- Added handler for NDIS OID_PNP_xxx ids. * *	Revision 1.91  2002/07/17 19:53:03  rwahl *	- Added StatOvrflwBit table for XMAC & GMAC. *	- Extended StatAddr table for GMAC. Added check of number of counters *	  in enumeration and size of StatAddr table on init level. *	- Added use of GIFunc table. *	- ChipSet is not static anymore, *	- Extended SIRQ event handler for both mac types. *	- Fixed rx short counter bug (#10620) *	- Added handler for oids SKGE_SPEED_MODE & SKGE_SPEED_STATUS. *	- Extendet GetPhysStatVal() for GMAC. *	- Editorial changes. * *	Revision 1.90  2002/05/22 08:56:25  rwahl *	- Moved OID table to separate source file. *	- Fix: TX_DEFFERAL counter incremented in full-duplex mode. *	- Use string definitions for error msgs. * *	Revision 1.89  2001/09/18 10:01:30  mkunz *	some OID's fixed for dualnetmode * *	Revision 1.88  2001/08/02 07:58:08  rwahl *	- Fixed NetIndex to csum module at ResetCounter(). * *	Revision 1.87  2001/04/06 13:35:09  mkunz *	-Bugs fixed in handling of OID_SKGE_MTU and the VPD OID's * *	Revision 1.86  2001/03/09 09:18:03  mkunz *	Changes in SK_DBG_MSG * *	Revision 1.85  2001/03/08 09:37:31  mkunz *	Bugfix in ResetCounter for Pnmi.Port structure * *	Revision 1.84  2001/03/06 09:04:55  mkunz *	Made some changes in instance calculation * *	Revision 1.83  2001/02/15 09:15:32  mkunz *	Necessary changes for dual net mode added * *	Revision 1.82  2001/02/07 08:24:19  mkunz *	-Made changes in handling of OID_SKGE_MTU * *	Revision 1.81  2001/02/06 09:58:00  mkunz *	-Vpd bug fixed *	-OID_SKGE_MTU added *	-pnmi support for dual net mode. Interface function and macros extended * *	Revision 1.80  2001/01/22 13:41:35  rassmann *	Supporting two nets on dual-port adapters. * *	Revision 1.79  2000/12/05 14:57:40  cgoos *	SetStruct failed before first Link Up (link mode of virtual *	port "INDETERMINATED"). * *	Revision 1.78  2000/09/12 10:44:58  cgoos *	Fixed SK_PNMI_STORE_U32 calls with typecasted argument. * *	Revision 1.77  2000/09/07 08:10:19  rwahl *	- Modified algorithm for 64bit NDIS statistic counters; *	  returns 64bit or 32bit value depending on passed buffer *	  size. Indicate capability for 64bit NDIS counter, if passed *	  buffer size is zero. OID_GEN_XMIT_ERROR, OID_GEN_RCV_ERROR, *	  and OID_GEN_RCV_NO_BUFFER handled as 64bit counter, too. *	- corrected OID_SKGE_RLMT_PORT_PREFERRED. * *	Revision 1.76  2000/08/03 15:23:39  rwahl *	- Correction for FrameTooLong counter has to be moved to OID handling *	  routines (instead of statistic counter routine). *	- Fix in XMAC Reset Event handling: Only offset counter for hardware *	  statistic registers are updated. * *	Revision 1.75  2000/08/01 16:46:05  rwahl *	- Added StatRxLongFrames counter and correction of FrameTooLong counter. *	- Added directive to control width (default = 32bit) of NDIS statistic *	  counters (SK_NDIS_64BIT_CTR). * *	Revision 1.74  2000/07/04 11:41:53  rwahl *	- Added volition connector type. * *	Revision 1.73  2000/03/15 16:33:10  rwahl *	Fixed bug 10510; wrong reset of virtual port statistic counters. * *	Revision 1.72  1999/12/06 16:15:53  rwahl *	Fixed problem of instance range for current and factory MAC address. * *	Revision 1.71  1999/12/06 10:14:20  rwahl *	Fixed bug 10476; set operation for PHY_OPERATION_MODE. * *	Revision 1.70  1999/11/22 13:33:34  cgoos *	Changed license header to GPL. * *	Revision 1.69  1999/10/18 11:42:15  rwahl *	Added typecasts for checking event dependent param (debug only). * *	Revision 1.68  1999/10/06 09:35:59  cgoos *	Added state check to PHY_READ call (hanged if called during startup). * *	Revision 1.67  1999/09/22 09:53:20  rwahl *	- Read Broadcom register for updating fcs error counter (1000Base-T). * *	Revision 1.66  1999/08/26 13:47:56  rwahl *	Added SK_DRIVER_SENDEVENT when queueing RLMT_CHANGE_THRES trap. * *	Revision 1.65  1999/07/26 07:49:35  cgoos *	Added two typecasts to avoid compiler warnings. * *	Revision 1.64  1999/05/20 09:24:12  cgoos *	Changes for 1000Base-T (sensors, Master/Slave). * *	Revision 1.63  1999/04/13 15:11:58  mhaveman *	Moved include of rlmt.h to header skgepnmi.h because some macros *	are needed there. * *	Revision 1.62  1999/04/13 15:08:07  mhaveman *	Replaced again SK_RLMT_CHECK_LINK with SK_PNMI_RLMT_MODE_CHK_LINK *	to grant unified interface by only using the PNMI header file. *	SK_PNMI_RLMT_MODE_CHK_LINK is defined the same as SK_RLMT_CHECK_LINK. * *	Revision 1.61  1999/04/13 15:02:48  mhaveman *	Changes caused by review: *	-Changed some comments *	-Removed redundant check for OID_SKGE_PHYS_FAC_ADDR *	-Optimized PRESET check. *	-Meaning of error SK_ADDR_DUPLICATE_ADDRESS changed. Set of same *	 address will now not cause this error. Removed corresponding check. * *	Revision 1.60  1999/03/23 10:41:23  mhaveman *	Added comments. * *	Revision 1.59  1999/02/19 08:01:28  mhaveman *	Fixed bug 10372 that after counter reset all ports were displayed *	as inactive. * *	Revision 1.58  1999/02/16 18:04:47  mhaveman *	Fixed problem of twisted OIDs SENSOR_WAR_TIME and SENSOR_ERR_TIME. * *	Revision 1.56  1999/01/27 12:29:11  mhaveman *	SkTimerStart was called with time value in milli seconds but needs *	micro seconds. * *	Revision 1.55  1999/01/25 15:00:38  mhaveman *	Added support to allow multiple ports to be active. If this feature in *	future will be used, the Management Data Base variables PORT_ACTIVE *	and PORT_PREFERED should be moved to the port specific part of RLMT. *	Currently they return the values of the first active physical port *	found. A set to the virtual port will actually change all active *	physical ports. A get returns the melted values of all active physical *	ports. If the port values differ a return value INDETERMINATED will *	be returned. This effects especially the CONF group. * *	Revision 1.54  1999/01/19 10:10:22  mhaveman *	-Fixed bug 10354: Counter values of virtual port were wrong after port *	 switches *	-Added check if a switch to the same port is notified. * *	Revision 1.53  1999/01/07 09:25:21  mhaveman *	Forgot to initialize a variable. * *	Revision 1.52  1999/01/05 10:34:33  mhaveman *	Fixed little error in RlmtChangeEstimate calculation. * *	Revision 1.51  1999/01/05 09:59:07  mhaveman *	-Moved timer start to init level 2 *	-Redesigned port switch average calculation to avoid 64bit *	 arithmetic. * *	Revision 1.50  1998/12/10 15:13:59  mhaveman *	-Fixed: PHYS_CUR_ADDR returned wrong addresses *	-Fixed: RLMT_PORT_PREFERED and RLMT_CHANGE_THRES preset returned *	        always BAD_VALUE. *	-Fixed: TRAP buffer seemed to sometimes suddenly empty * *	Revision 1.49  1998/12/09 16:17:07  mhaveman *	Fixed: Couldnot delete VPD keys on UNIX. * *	Revision 1.48  1998/12/09 14:11:10  mhaveman *	-Add: Debugmessage for XMAC_RESET supressed to minimize output. *	-Fixed: RlmtChangeThreshold will now be initialized. *	-Fixed: VPD_ENTRIES_LIST extended value with unnecessary space char. *	-Fixed: On VPD key creation an invalid key name could be created *	        (e.g. A5) *	-Some minor changes in comments and code. * *	Revision 1.47  1998/12/08 16:00:31  mhaveman *	-Fixed: For RLMT_PORT_ACTIVE will now be returned a 0 if no port *		is active. *	-Fixed: For the RLMT statistics group only the last value was *		returned and the rest of the buffer was filled with 0xff *	-Fixed: Mysteriously the preset on RLMT_MODE still returned *		BAD_VALUE. *	Revision 1.46  1998/12/08 10:04:56  mhaveman *	-Fixed: Preset on RLMT_MODE returned always BAD_VALUE error. *	-Fixed: Alignment error in GetStruct *	-Fixed: If for Get/Preset/SetStruct the buffer size is equal or *	        larger than SK_PNMI_MIN_STRUCT_SIZE the return value is stored *		to the buffer. In this case the caller should always return *	        ok to its upper routines. Only if the buffer size is less *	        than SK_PNMI_MIN_STRUCT_SIZE and the return value is unequal *	        to 0, an error should be returned by the caller. *	-Fixed: Wrong number of instances with RLMT statistic. *	-Fixed: Return now SK_LMODE_STAT_UNKNOWN if the LinkModeStatus is 0. * *	Revision 1.45  1998/12/03 17:17:24  mhaveman *	-Removed for VPD create action the buffer size limitation to 4 bytes. *	-Pass now physical/active physical port to ADDR for CUR_ADDR set * *	Revision 1.44  1998/12/03 15:14:35  mhaveman *	Another change to Vpd instance evaluation. * *	Revision 1.43  1998/12/03 14:18:10  mhaveman *	-Fixed problem in PnmiSetStruct. It was impossible to set any value. *	-Removed VPD key evaluation for VPD_FREE_BYTES and VPD_ACTION. * *	Revision 1.42  1998/12/03 11:31:47  mhaveman *	Inserted cast to satisfy lint. * *	Revision 1.41  1998/12/03 11:28:16  mhaveman *	Removed SK_PNMI_CHECKPTR * *	Revision 1.40  1998/12/03 11:19:07  mhaveman *	Fixed problems *	-A set to virtual port will now be ignored. A set with broadcast *	 address to any port will be ignored. *	-GetStruct function made VPD instance calculation wrong. *	-Prefered port returned -1 instead of 0. * *	Revision 1.39  1998/11/26 15:30:29  mhaveman *	Added sense mode to link mode. * *	Revision 1.38  1998/11/23 15:34:00  mhaveman *	-Fixed bug for RX counters. On an RX overflow interrupt the high *	 words of all RX counters were incremented. *	-SET operations on FLOWCTRL_MODE and LINK_MODE accept now the *	 value 0, which has no effect. It is usefull for multiple instance *	 SETs. * *	Revision 1.37  1998/11/20 08:02:04  mhaveman *	-Fixed: Ports were compared with MAX_SENSORS *	-Fixed: Crash in GetTrapEntry with MEMSET macro *	-Fixed: Conversions between physical, logical port index and instance * *	Revision 1.36  1998/11/16 07:48:53  mhaveman *	Casted SK_DRIVER_SENDEVENT with (void) to eleminate compiler warnings *	on Solaris. * *	Revision 1.35  1998/11/16 07:45:34  mhaveman *	SkAddrOverride now returns value and will be checked. * *	Revision 1.34  1998/11/10 13:40:37  mhaveman *	Needed to change interface, because NT driver needs a return value *	of needed buffer space on TOO_SHORT errors. Therefore all *	SkPnmiGet/Preset/Set functions now have a pointer to the length *	parameter, where the needed space on error is returned. * *	Revision 1.33  1998/11/03 13:52:46  mhaveman *	Made file lint conform. * *	Revision 1.32  1998/11/03 13:19:07  mhaveman *	The events SK_HWEV_SET_LMODE and SK_HWEV_SET_FLOWMODE pass now in *	Para32[0] the physical MAC index and in Para32[1] the new mode. * *	Revision 1.31  1998/11/03 12:30:40  gklug *	fix: compiler warning memset * *	Revision 1.30  1998/11/03 12:04:46  mhaveman *	Fixed problem in SENSOR_VALUE, which wrote beyond the buffer end *	Fixed alignment problem with CHIPSET. * *	Revision 1.29  1998/11/02 11:23:54  mhaveman *	Corrected SK_ERROR_LOG to SK_ERR_LOG. Sorry. * *	Revision 1.28  1998/11/02 10:47:16  mhaveman *	Added syslog messages for internal errors. * *	Revision 1.27  1998/10/30 15:48:06  mhaveman *	Fixed problems after simulation of SK_PNMI_EVT_CHG_EST_TIMER and *	RlmtChangeThreshold calculation. * *	Revision 1.26  1998/10/29 15:36:55  mhaveman *	-Fixed bug in trap buffer handling. *	-OID_SKGE_DRIVER_DESCR, OID_SKGE_DRIVER_VERSION, OID_SKGE_HW_DESCR, *	 OID_SKGE_HW_VERSION, OID_SKGE_VPD_ENTRIES_LIST, OID_SKGE_VPD_KEY, *	 OID_SKGE_VPD_VALUE, and OID_SKGE_SENSOR_DESCR return values with *	 a leading octet before each string storing the string length. *	-Perform a RlmtUpdate during SK_PNMI_EVT_XMAC_RESET to minimize *	 RlmtUpdate calls in GetStatVal. *	-Inserted SK_PNMI_CHECKFLAGS macro increase readability. * *	Revision 1.25  1998/10/29 08:50:36  mhaveman *	Fixed problems after second event simulation. * *	Revision 1.24  1998/10/28 08:44:37  mhaveman *	-Fixed alignment problem *	-Fixed problems during event simulation *	-Fixed sequence of error return code (INSTANCE -> ACCESS -> SHORT) *	-Changed type of parameter Instance back to SK_U32 because of VPD *	-Updated new VPD function calls * *	Revision 1.23  1998/10/23 10:16:37  mhaveman *	Fixed bugs after buffer test simulation. * *	Revision 1.22  1998/10/21 13:23:52  mhaveman *	-Call syntax of SkOsGetTime() changed to SkOsGetTime(pAc). *	-Changed calculation of hundrets of seconds. * *	Revision 1.20  1998/10/20 07:30:45  mhaveman *	Made type changes to unsigned integer where possible. *

⌨️ 快捷键说明

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