patch-2.4.7 linux/drivers/net/sk98lin/skgepnmi.c

Next file: linux/drivers/net/sk98lin/skgesirq.c
Previous file: linux/drivers/net/sk98lin/skgeinit.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/drivers/net/sk98lin/skgepnmi.c linux/drivers/net/sk98lin/skgepnmi.c
@@ -2,16 +2,15 @@
  *
  * Name:	skgepnmi.c
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.78 $
- * Date:	$Date: 2000/09/12 10:44:58 $
+ * Version:	$Revision: 1.87 $
+ * Date:	$Date: 2001/04/06 13:35:09 $
  * Purpose:	Private Network Management Interface
  *
  ****************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998,1999 SysKonnect,
- *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
+ *	(C)Copyright 1998-2001 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
@@ -27,6 +26,37 @@
  * History:
  *
  *	$Log: skgepnmi.c,v $
+ *	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
+ *	C	^VS:
+ *	
+ *	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.
  *	
@@ -72,7 +102,7 @@
  *	
  *	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.
  *	
@@ -81,7 +111,7 @@
  *	
  *	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.
@@ -149,7 +179,7 @@
  *	Fixed: Couldnot delete VPD keys on UNIX.
  *	
  *	Revision 1.48  1998/12/09 14:11:10  mhaveman
- *	-Add: Debugmessage for XMAC_RESET suppressed to minimize output.
+ *	-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
@@ -185,7 +215,7 @@
  *	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.
  *	
@@ -206,7 +236,7 @@
  *	-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 useful for multiple instance
+ *	 value 0, which has no effect. It is usefull for multiple instance
  *	 SETs.
  *	
  *	Revision 1.37  1998/11/20 08:02:04  mhaveman
@@ -220,7 +250,7 @@
  *	
  *	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
@@ -240,7 +270,7 @@
  *	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.
  *	
@@ -270,14 +300,14 @@
  *	-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.
  *	
@@ -291,12 +321,12 @@
  *	 to HWACCESS.
  *	-Provided all MEMCPY/MEMSET macros with (char *) pointers, because
  *	 Solaris throwed warnings when mapping to bcopy/bset.
- *	
+ *
  *	Revision 1.17  1998/10/13 07:42:01  mhaveman
  *	-Added OIDs OID_SKGE_TRAP_NUMBER and OID_SKGE_ALL_DATA
  *	-Removed old cvs history entries
  *	-Renamed MacNumber to PortNumber
- *	
+ *
  *	Revision 1.16  1998/10/07 10:52:49  mhaveman
  *	-Inserted handling of some OID_GEN_ Ids for windows
  *	-Fixed problem with 803.2 statistic.
@@ -332,7 +362,7 @@
 
 
 static const char SysKonnectFileId[] =
-	"@(#) $Id: skgepnmi.c,v 1.78 2000/09/12 10:44:58 cgoos Exp $"
+	"@(#) $Id: skgepnmi.c,v 1.87 2001/04/06 13:35:09 mkunz Exp $"
 	" (C) SysKonnect.";
 
 #include "h/skdrv1st.h"
@@ -356,14 +386,17 @@
  */
 int SkPnmiInit(SK_AC *pAC, SK_IOC IoC, int level);
 int SkPnmiGetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf,
-	unsigned int *pLen, SK_U32 Instance);
+	unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
 int SkPnmiPreSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf,
-	unsigned int *pLen, SK_U32 Instance);
+	unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
 int SkPnmiSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void *pBuf,
-	unsigned int *pLen, SK_U32 Instance);
-int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen);
-int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen);
-int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, unsigned int *pLen);
+	unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
+int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf,
+	unsigned int *pLen, SK_U32 NetIndex);
+int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, 
+	unsigned int *pLen, SK_U32 NetIndex);
+int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void *pBuf, 
+	unsigned int *pLen, SK_U32 NetIndex);
 int SkPnmiEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Param);
 
 
@@ -372,7 +405,7 @@
  */
 static int Addr(SK_AC *pAC, SK_IOC IoC, int action,
 	SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static SK_U8 CalculateLinkModeStatus(SK_AC *pAC, SK_IOC IoC, unsigned int
 	PhysPortIndex);
 static SK_U8 CalculateLinkStatus(SK_AC *pAC, SK_IOC IoC, unsigned int
@@ -381,14 +414,14 @@
 static void CopyTrapQueue(SK_AC *pAC, char *pDstBuf);
 static int CsumStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int General(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static SK_U64 GetPhysStatVal(SK_AC *pAC, SK_IOC IoC,
 	unsigned int PhysPortIndex, unsigned int StatIndex);
 static SK_U64 GetStatVal(SK_AC *pAC, SK_IOC IoC, unsigned int LogPortIndex,
-	unsigned int StatIndex);
+	unsigned int StatIndex, SK_U32 NetIndex);
 static char* GetTrapEntry(SK_AC *pAC, SK_U32 TrapId, unsigned int Size);
 static void GetTrapQueueLen(SK_AC *pAC, unsigned int *pLen,
 	unsigned int *pEntries);
@@ -397,50 +430,50 @@
 static int LookupId(SK_U32 Id);
 static int Mac8023Stat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int MacPrivateConf(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int MacPrivateStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int MacUpdate(SK_AC *pAC, SK_IOC IoC, unsigned int FirstMac,
 	unsigned int LastMac);
 static int Monitor(SK_AC *pAC, SK_IOC IoC, int action,
 	SK_U32 Id, char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int OidStruct(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int Perform(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int* pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int PnmiStruct(SK_AC *pAC, SK_IOC IoC, int Action, char *pBuf,
-	unsigned int *pLen);
+	unsigned int *pLen, SK_U32 NetIndex);
 static int PnmiVar(SK_AC *pAC, SK_IOC IoC, int Action, SK_U32 Id,
-	char *pBuf, unsigned int *pLen, SK_U32 Instance);
+	char *pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
 static void QueueRlmtNewMacTrap(SK_AC *pAC, unsigned int ActiveMac);
 static void QueueRlmtPortTrap(SK_AC *pAC, SK_U32 TrapId,
 	unsigned int PortIndex);
 static void QueueSensorTrap(SK_AC *pAC, SK_U32 TrapId,
 	unsigned int SensorIndex);
 static void QueueSimpleTrap(SK_AC *pAC, SK_U32 TrapId);
-static void ResetCounter(SK_AC *pAC, SK_IOC IoC);
+static void ResetCounter(SK_AC *pAC, SK_IOC IoC, SK_U32 NetIndex);
 static int Rlmt(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int RlmtStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
-static int RlmtUpdate(SK_AC *pAC, SK_IOC IoC);
+	unsigned int TableIndex, SK_U32 NetIndex);
+static int RlmtUpdate(SK_AC *pAC, SK_IOC IoC, SK_U32 NetIndex);
 static int SensorStat(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 static int SirqUpdate(SK_AC *pAC, SK_IOC IoC);
 static void VirtualConf(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, char *pBuf);
 static int Vpd(SK_AC *pAC, SK_IOC IoC, int action, SK_U32 Id,
 	char *pBuf, unsigned int *pLen, SK_U32 Instance,
-	unsigned int TableIndex);
+	unsigned int TableIndex, SK_U32 NetIndex);
 
 
 /******************************************************************************
@@ -1323,11 +1356,16 @@
 		sizeof(SK_PNMI_RLMT_MONITOR),
 		SK_PNMI_OFF(RlmtMonitor) + SK_PNMI_MON_OFF(RlmtMonitorAdmin),
 		SK_PNMI_RW, Monitor, 0},
+	{OID_SKGE_MTU,
+		1,
+		0,
+		SK_PNMI_MAI_OFF(MtuSize),
+		SK_PNMI_RW, MacPrivateConf, 0},
 };
 
 /*
  * Table for hardware register saving on resets and port switches
-*/
+ */
 static const SK_PNMI_STATADDR StatAddress[SK_PNMI_MAX_IDX] = {
 	/*  0 */	{TRUE, XM_TXF_OK},
 	/*  1 */	{TRUE, 0},
@@ -1445,6 +1483,7 @@
 		for (PortIndex = 0; PortIndex < SK_MAX_MACS; PortIndex ++) {
 
 			pAC->Pnmi.Port[PortIndex].ActiveFlag = SK_FALSE;
+			pAC->Pnmi.DualNetActiveFlag = SK_FALSE;
 		}
 		break;
 
@@ -1600,7 +1639,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
  *	SK_PNMI_ERR_UNKNOWN_OID  The requested OID is unknown
@@ -1615,14 +1654,15 @@
 SK_U32 Id,		/* Object ID that is to be processed */
 void *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
-SK_U32 Instance)	/* Instance (1..n) that is to be queried or -1 */
+SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiGetVar: Called, Id=0x%x, BufLen=%d\n", Id,
-		*pLen));
+		("PNMI: SkPnmiGetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n",
+			Id, *pLen, Instance, NetIndex));
 
 	return (PnmiVar(pAC, IoC, SK_PNMI_GET, Id, (char *)pBuf, pLen,
-		Instance));
+		Instance, NetIndex));
 }
 
 /*****************************************************************************
@@ -1632,13 +1672,13 @@
  * Description:
  *	Calls a general sub-function for all this stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is useful to check if a set might be successful.
+ *	new value. This is usefull to check if a set might be successfull.
  *	If as instance a -1 is passed, an array of values is supposed and
  *	all instance of the OID will be set.
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1657,14 +1697,16 @@
 SK_U32 Id,		/* Object ID that is to be processed */
 void *pBuf,		/* Buffer which stores the mgmt data to be set */
 unsigned int *pLen,	/* Total length of mgmt data */
-SK_U32 Instance)	/* Instance (1..n) that is to be set or -1 */
+SK_U32 Instance,	/* Instance (1..n) that is to be set or -1 */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiPreSetVar: Called, Id=0x%x, BufLen=%d\n",
-		Id, *pLen));
+		("PNMI: SkPnmiPreSetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n",
+			Id, *pLen, Instance, NetIndex));
+
 
 	return (PnmiVar(pAC, IoC, SK_PNMI_PRESET, Id, (char *)pBuf, pLen,
-		Instance));
+		Instance, NetIndex));
 }
 
 /*****************************************************************************
@@ -1674,13 +1716,13 @@
  * Description:
  *	Calls a general sub-function for all this stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is useful to check if a set might be successful.
+ *	new value. This is usefull to check if a set might be successfull.
  *	If as instance a -1 is passed, an array of values is supposed and
  *	all instance of the OID will be set.
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1699,14 +1741,15 @@
 SK_U32 Id,		/* Object ID that is to be processed */
 void *pBuf,		/* Buffer which stores the mgmt data to be set */
 unsigned int *pLen,	/* Total length of mgmt data */
-SK_U32 Instance)	/* Instance (1..n) that is to be set or -1 */
+SK_U32 Instance,	/* Instance (1..n) that is to be set or -1 */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiSetVar: Called, Id=0x%x, BufLen=%d\n", Id,
-		*pLen));
+		("PNMI: SkPnmiSetVar: Called, Id=0x%x, BufLen=%d, Instance=%d, NetIndex=%d\n",
+			Id, *pLen, Instance, NetIndex));
 
 	return (PnmiVar(pAC, IoC, SK_PNMI_SET, Id, (char *)pBuf, pLen,
-		Instance));
+		Instance, NetIndex));
 }
 
 /*****************************************************************************
@@ -1723,16 +1766,18 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to take
  *	                         the data.
+ *	SK_PNMI_ERR_UNKNOWN_NET  The requested NetIndex doesn't exist 
  */
 
 int SkPnmiGetStruct(
 SK_AC *pAC,		/* Pointer to adapter context */
 SK_IOC IoC,		/* IO context handle */
 void *pBuf,		/* Buffer which will store the retrieved data */
-unsigned int *pLen)	/* Length of buffer */
+unsigned int *pLen,	/* Length of buffer */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int		Ret;
 	unsigned int	TableIndex;
@@ -1741,11 +1786,12 @@
 	unsigned int	InstanceCnt;
 	SK_U32		Instance;
 	unsigned int	TmpLen;
-	char		KeyArr[SK_PNMI_VPD_ARR_SIZE][SK_PNMI_VPD_STR_SIZE];
+	char		KeyArr[SK_PNMI_VPD_ENTRIES][SK_PNMI_VPD_KEY_SIZE];
+
 
-	
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiGetStruct: Called, BufLen=%d\n", *pLen));
+		("PNMI: SkPnmiGetStruct: Called, BufLen=%d, NetIndex=%d\n",
+			*pLen, NetIndex));
 
 	if (*pLen < SK_PNMI_STRUCT_SIZE) {
 
@@ -1759,6 +1805,13 @@
 		return (SK_PNMI_ERR_TOO_SHORT);
 	}
 
+    /*
+     * Check NetIndex
+     */
+	if (NetIndex >= pAC->Rlmt.NumNets) {
+		return (SK_PNMI_ERR_UNKNOWN_NET);
+	}
+
 	/* Update statistic */
 	SK_PNMI_CHECKFLAGS("SkPnmiGetStruct: On call");
 
@@ -1770,7 +1823,7 @@
 		return (Ret);
 	}
 
-	if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) {
+	if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) {
 
 		SK_PNMI_SET_STAT(pBuf, Ret, (SK_U32)(-1));
 		*pLen = SK_PNMI_MIN_STRUCT_SIZE;
@@ -1812,7 +1865,6 @@
 		TableIndex ++) {
 
 		InstanceNo = IdTable[TableIndex].InstanceNo;
-
 		for (InstanceCnt = 1; InstanceCnt <= InstanceNo;
 			InstanceCnt ++) {
 
@@ -1830,8 +1882,7 @@
 				IdTable[TableIndex].Id == OID_SKGE_VPD_ACCESS ||
 				IdTable[TableIndex].Id == OID_SKGE_VPD_ACTION) {
 
-				SK_PNMI_READ_U32(KeyArr[InstanceCnt - 1],
-					Instance);
+				SK_STRNCPY((char *)&Instance, KeyArr[InstanceCnt - 1], 4);
 			}
 			else {
 				Instance = (SK_U32)InstanceCnt;
@@ -1840,7 +1891,7 @@
 			TmpLen = *pLen - DstOffset;
 			Ret = IdTable[TableIndex].Func(pAC, IoC, SK_PNMI_GET,
 				IdTable[TableIndex].Id, (char *)pBuf +
-				DstOffset, &TmpLen, Instance, TableIndex);
+				DstOffset, &TmpLen, Instance, TableIndex, NetIndex);
 
 			/*
 			 * An unknown instance error means that we reached
@@ -1850,7 +1901,7 @@
 			 */
 			if (Ret == SK_PNMI_ERR_UNKNOWN_INST) {
 
-				break;
+                break;
 			}
 
 			if (Ret != SK_PNMI_ERR_OK) {
@@ -1884,7 +1935,7 @@
  * Description:
  *	Calls a general sub-function for all this set stuff. The preset does
  *	the same as a set, but returns just before finally setting the
- *	new value. This is useful to check if a set might be successful.
+ *	new value. This is usefull to check if a set might be successfull.
  *	The sub-function runs through the IdTable, checks which OIDs are able
  *	to set, and calls the handler function of the OID to perform the
  *	preset. The return value of the function will also be stored in
@@ -1893,7 +1944,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1905,12 +1956,15 @@
 SK_AC *pAC,		/* Pointer to adapter context */
 SK_IOC IoC,		/* IO context handle */
 void *pBuf,		/* Buffer which contains the data to be set */
-unsigned int *pLen)	/* Length of buffer */
+unsigned int *pLen,	/* Length of buffer */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiPreSetStruct: Called, BufLen=%d\n", *pLen));
+		("PNMI: SkPnmiPreSetStruct: Called, BufLen=%d, NetIndex=%d\n",
+			*pLen, NetIndex));
 
-	return (PnmiStruct(pAC, IoC, SK_PNMI_PRESET, (char *)pBuf, pLen));
+	return (PnmiStruct(pAC, IoC, SK_PNMI_PRESET, (char *)pBuf, 
+    					pLen, NetIndex));
 }
 
 /*****************************************************************************
@@ -1929,7 +1983,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -1941,12 +1995,15 @@
 SK_AC *pAC,		/* Pointer to adapter context */
 SK_IOC IoC,		/* IO context handle */
 void *pBuf,		/* Buffer which contains the data to be set */
-unsigned int *pLen)	/* Length of buffer */
+unsigned int *pLen,	/* Length of buffer */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
-		("PNMI: SkPnmiSetStruct: Called, BufLen=%d\n", *pLen));
+		("PNMI: SkPnmiSetStruct: Called, BufLen=%d, NetIndex=%d\n",
+			*pLen, NetIndex));
 
-	return (PnmiStruct(pAC, IoC, SK_PNMI_SET, (char *)pBuf, pLen));
+	return (PnmiStruct(pAC, IoC, SK_PNMI_SET, (char *)pBuf, 
+    					pLen, NetIndex));
 }
 
 /*****************************************************************************
@@ -1981,11 +2038,6 @@
  *	SK_PNMI_EVT_RLMT_PORT_DOWN    Generated by RLMT to notify that a port
  *	                              went logically down. A trap message will
  *	                              be stored to the trap buffer.
- *	SK_PNMI_EVT_RLMT_PORT_SWITCH  Generated by RLMT to notify that the
- *	                              active port switched. PNMI will split
- *	                              this into two message ACTIVE_DOWN and
- *	                              ACTIVE_UP to be future compatible with
- *	                              load balancing and card fail over.
  *	SK_PNMI_EVT_RLMT_SEGMENTATION Generated by RLMT to notify that two
  *	                              spanning tree root bridges were
  *	                              detected. A trap message will be stored
@@ -1997,6 +2049,9 @@
  *	                              is now an active port. PNMI will now
  *	                              add the statistic data of this port to
  *	                              the virtual port.
+ *	SK_PNMI_EVT_RLMT_SET_NETS     Notifies PNMI about the net mode. The first Parameter
+ *	                              contains the number of nets. 1 means single net, 2 means
+ *	                              dual net. The second Parameter is -1
  *
  * Returns:
  *	Always 0
@@ -2009,6 +2064,7 @@
 SK_EVPARA Param)	/* Event dependent parameter */
 {
 	unsigned int	PhysPortIndex;
+    unsigned int	MaxNetNumber;
 	int		CounterIndex;
 	int		Ret;
 	SK_U16		MacStatus;
@@ -2022,6 +2078,7 @@
 	SK_U64		OldestValue;
 	SK_U64		Delta;
 	SK_PNMI_ESTIMATE *pEst;
+	SK_U32		NetIndex;
 
 
 #ifdef DEBUG
@@ -2284,9 +2341,27 @@
 
 	case SK_PNMI_EVT_CLEAR_COUNTER:
 		/*
+		 *  Param.Para32[0] contains the NetIndex (0 ..1).
+		 *  Param.Para32[1] is reserved, contains -1.
+		 */
+		NetIndex = (SK_U32)Param.Para32[0];
+
+#ifdef DEBUG
+		if (NetIndex >= pAC->Rlmt.NumNets) {
+
+			SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
+				("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_CLEAR_COUNTER parameter wrong, NetIndex=%d\n",
+				NetIndex));
+
+			return (0);
+		}
+#endif
+
+		/*
 		 * Set all counters and timestamps to zero
 		 */
-		ResetCounter(pAC, IoC);
+		ResetCounter(pAC, IoC, NetIndex); /* the according NetIndex is required
+												as a Parameter of the Event */ 
 		break;
 
 	case SK_PNMI_EVT_XMAC_RESET:
@@ -2351,9 +2426,8 @@
 		}
 #endif
 		/*
-		 * Store a trap message in the trap buffer and generate
-		 * an event for user space applications with the
-		 * SK_DRIVER_SENDEVENT macro.
+		 * Store a trap message in the trap buffer and generate an event for
+		 * user space applications with the SK_DRIVER_SENDEVENT macro.
 		 */
 		QueueRlmtPortTrap(pAC, OID_SKGE_TRAP_RLMT_PORT_UP,
 			(unsigned int)Param.Para32[0]);
@@ -2372,9 +2446,8 @@
 		}
 #endif
 		/*
-		 * Store a trap message in the trap buffer and generate
-		 * an event for user space applications with the
-		 * SK_DRIVER_SENDEVENT macro.
+		 * Store a trap message in the trap buffer and generate an event for
+		 * user space applications with the SK_DRIVER_SENDEVENT macro.
 		 */
 		QueueRlmtPortTrap(pAC, OID_SKGE_TRAP_RLMT_PORT_DOWN,
 			(unsigned int)Param.Para32[0]);
@@ -2383,6 +2456,7 @@
 
 	case SK_PNMI_EVT_RLMT_ACTIVE_DOWN:
 		PhysPortIndex = (unsigned int)Param.Para32[0];
+		NetIndex = (SK_U32)Param.Para32[1];
 #ifdef DEBUG
 		if (PhysPortIndex >= SK_MAX_MACS) {
 
@@ -2390,8 +2464,23 @@
 				("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_DOWN parameter too high, PhysPort=%d\n",
 				PhysPortIndex));
 		}
+
+		if (NetIndex >= pAC->Rlmt.NumNets) {
+
+			SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
+				("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_DOWN parameter too high, NetIndex=%d\n",
+				NetIndex));
+		}
 #endif
 		/*
+		 * For now, ignore event if NetIndex != 0.
+		 */
+		if (Param.Para32[1] != 0) {
+
+			return (0);
+		}
+
+		/*
 		 * Nothing to do if port is already inactive
 		 */
 		if (!pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) {
@@ -2400,9 +2489,9 @@
 		}
 
 		/*
-		 * Update statistic counters to calculate new offset
-		 * for the virtual port and increment semaphore to
-		 * indicate that an update was already done.
+		 * Update statistic counters to calculate new offset for the virtual
+		 * port and increment semaphore to indicate that an update was already
+		 * done.
 		 */
 		if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) !=
 			SK_PNMI_ERR_OK) {
@@ -2413,13 +2502,12 @@
 		pAC->Pnmi.MacUpdatedFlag ++;
 
 		/*
-		 * Calculate new counter offset for virtual port to
-		 * grant continous counting on port switches. The virtual
-		 * port consists of all currently active ports. The port
-		 * down event indicates that a port is removed fromt the
-		 * virtual port. Therefore add the counter value of the
-		 * removed port to the CounterOffset for the virtual port
-		 * to grant the same counter value.
+		 * Calculate new counter offset for virtual port to grant continous
+		 * counting on port switches. The virtual port consists of all currently
+		 * active ports. The port down event indicates that a port is removed
+		 * from the virtual port. Therefore add the counter value of the removed
+		 * port to the CounterOffset for the virtual port to grant the same
+		 * counter value.
 		 */
 		for (CounterIndex = 0; CounterIndex < SK_PNMI_MAX_IDX;
 			CounterIndex ++) {
@@ -2429,8 +2517,7 @@
 				continue;
 			}
 
-			Value = GetPhysStatVal(pAC, IoC, PhysPortIndex,
-				CounterIndex);
+			Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, CounterIndex);
 
 			pAC->Pnmi.VirtualCounterOffset[CounterIndex] += Value;
 		}
@@ -2445,6 +2532,7 @@
 
 	case SK_PNMI_EVT_RLMT_ACTIVE_UP:
 		PhysPortIndex = (unsigned int)Param.Para32[0];
+		NetIndex = (SK_U32)Param.Para32[1];
 #ifdef DEBUG
 		if (PhysPortIndex >= SK_MAX_MACS) {
 
@@ -2452,8 +2540,23 @@
 				("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_UP parameter too high, PhysPort=%d\n",
 				PhysPortIndex));
 		}
+
+		if (NetIndex >= pAC->Rlmt.NumNets) {
+
+			SK_DBG_MSG(pAC, SK_DBGMOD_PNMI, SK_DBGCAT_CTRL,
+				("PNMI: ERR: SkPnmiEvent: SK_PNMI_EVT_RLMT_ACTIVE_UP parameter too high, NetIndex=%d\n",
+				NetIndex));
+		}
 #endif
 		/*
+		 * For now, ignore event if NetIndex != 0.
+		 */
+		if (Param.Para32[1] != 0) {
+
+			return (0);
+		}
+
+		/*
 		 * Nothing to do if port is already active
 		 */
 		if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) {
@@ -2462,24 +2565,22 @@
 		}
 
 		/*
-		 * Statistic maintanence
+		 * Statistic maintenance
 		 */
 		pAC->Pnmi.RlmtChangeCts ++;
-		pAC->Pnmi.RlmtChangeTime =
-			SK_PNMI_HUNDREDS_SEC(SkOsGetTime(pAC));
+		pAC->Pnmi.RlmtChangeTime = SK_PNMI_HUNDREDS_SEC(SkOsGetTime(pAC));
 
 		/*
-		 * Store a trap message in the trap buffer and generate
-		 * an event for user space applications with the
-		 * SK_DRIVER_SENDEVENT macro.
+		 * Store a trap message in the trap buffer and generate an event for
+		 * user space applications with the SK_DRIVER_SENDEVENT macro.
 		 */
 		QueueRlmtNewMacTrap(pAC, PhysPortIndex);
 		(void)SK_DRIVER_SENDEVENT(pAC, IoC);
 
 		/*
-		 * Update statistic counters to calculate new offset
-		 * for the virtual port and increment semaphore to indicate
-		 * that an update was already done.
+		 * Update statistic counters to calculate new offset for the virtual
+		 * port and increment semaphore to indicate that an update was
+		 * already done.
 		 */
 		if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) !=
 			SK_PNMI_ERR_OK) {
@@ -2490,11 +2591,10 @@
 		pAC->Pnmi.MacUpdatedFlag ++;
 
 		/*
-		 * Calculate new counter offset for virtual port to
-		 * grant continous counting on port switches. A new port
-		 * is added to the virtual port. Therefore substract the
-		 * counter value of the new port from the CounterOffset
-		 * for the virtual port to grant the same value.
+		 * Calculate new counter offset for virtual port to grant continous
+		 * counting on port switches. A new port is added to the virtual port.
+		 * Therefore substract the counter value of the new port from the
+		 * CounterOffset for the virtual port to grant the same value.
 		 */
 		for (CounterIndex = 0; CounterIndex < SK_PNMI_MAX_IDX;
 			CounterIndex ++) {
@@ -2504,8 +2604,7 @@
 				continue;
 			}
 
-			Value = GetPhysStatVal(pAC, IoC, PhysPortIndex,
-				CounterIndex);
+			Value = GetPhysStatVal(pAC, IoC, PhysPortIndex, CounterIndex);
 
 			pAC->Pnmi.VirtualCounterOffset[CounterIndex] -= Value;
 		}
@@ -2518,40 +2617,41 @@
 		pAC->Pnmi.MacUpdatedFlag --;
 		break;
 
-	case SK_PNMI_EVT_RLMT_PORT_SWITCH:
+	case SK_PNMI_EVT_RLMT_SEGMENTATION:
 		/*
-		 * This event becomes obsolete if RLMT generates directly
-		 * the events SK_PNMI_EVT_RLMT_ACTIVE_DOWN and
-		 * SK_PNMI_EVT_RLMT_ACTIVE_UP. The events are here emulated.
-		 * PNMI handles that multiple ports may become active. 
-		 * Increment semaphore to indicate that an update was
-		 * already done.
+		 * Para.Para32[0] contains the NetIndex.
 		 */
-		if (MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1) !=
-			SK_PNMI_ERR_OK) {
-
-			SK_PNMI_CHECKFLAGS("SkPnmiEvent: On return");
-			return (0);
-		}
-		pAC->Pnmi.MacUpdatedFlag ++;
-
-		SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_RLMT_ACTIVE_DOWN, Param);
-		Param.Para32[0] = Param.Para32[1];
-		SkPnmiEvent(pAC, IoC, SK_PNMI_EVT_RLMT_ACTIVE_UP, Param);
-
-		pAC->Pnmi.MacUpdatedFlag --;
-		break;
 
-	case SK_PNMI_EVT_RLMT_SEGMENTATION:
 		/*
-		 * Store a trap message in the trap buffer and generate
-		 * an event for user space applications with the
-		 * SK_DRIVER_SENDEVENT macro.
+		 * Store a trap message in the trap buffer and generate an event for
+		 * user space applications with the SK_DRIVER_SENDEVENT macro.
 		 */
 		QueueSimpleTrap(pAC, OID_SKGE_TRAP_RLMT_SEGMENTATION);
 		(void)SK_DRIVER_SENDEVENT(pAC, IoC);
 		break;
 
+    case SK_PNMI_EVT_RLMT_SET_NETS:
+		/*
+		 *  Param.Para32[0] contains the number of Nets.
+		 *  Param.Para32[1] is reserved, contains -1.
+		 */
+	    /*
+    	 * Check number of nets
+		 */
+		MaxNetNumber = pAC->GIni.GIMacsFound;
+		if (((unsigned int)Param.Para32[0] < 1)
+			|| ((unsigned int)Param.Para32[0] > MaxNetNumber)) {
+			return (SK_PNMI_ERR_UNKNOWN_NET);
+		}
+
+        if((unsigned int)Param.Para32[0] == 1){ /* single net mode */
+        	pAC->Pnmi.DualNetActiveFlag = SK_FALSE;
+        }
+        else { /* dual net mode */
+        	pAC->Pnmi.DualNetActiveFlag = SK_TRUE;
+        }
+        break;
+
 	default:
 		break;
 	}
@@ -2580,6 +2680,7 @@
  * Returns:
  *	SK_PNMI_ERR_XXX. For details have a look to the description of the
  *	calling functions.
+ *	SK_PNMI_ERR_UNKNOWN_NET  The requested NetIndex doesn't exist 
  */
 
 static int PnmiVar(
@@ -2589,7 +2690,8 @@
 SK_U32 Id,		/* Object ID that is to be processed */
 char *pBuf,		/* Buffer which stores the mgmt data to be set */
 unsigned int *pLen,	/* Total length of mgmt data */
-SK_U32 Instance)	/* Instance (1..n) that is to be set or -1 */
+SK_U32 Instance,	/* Instance (1..n) that is to be set or -1 */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	TableIndex;
 	int		Ret;
@@ -2600,11 +2702,18 @@
 		*pLen = 0;
 		return (SK_PNMI_ERR_UNKNOWN_OID);
 	}
+	
+    /* 
+     * Check NetIndex 
+     */
+	if (NetIndex >= pAC->Rlmt.NumNets) {
+		return (SK_PNMI_ERR_UNKNOWN_NET);
+	}
 
 	SK_PNMI_CHECKFLAGS("PnmiVar: On call");
 
 	Ret = IdTable[TableIndex].Func(pAC, IoC, Action, Id, pBuf, pLen,
-		Instance, TableIndex);
+		Instance, TableIndex, NetIndex);
 
 	SK_PNMI_CHECKFLAGS("PnmiVar: On return");
 
@@ -2627,6 +2736,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_XXX. The codes are described in the calling functions.
+ *	SK_PNMI_ERR_UNKNOWN_NET  The requested NetIndex doesn't exist 
  */
 
 static int PnmiStruct(
@@ -2634,7 +2744,8 @@
 SK_IOC IoC,		/* IO context handle */
 int  Action,		/* Set action to be performed */
 char *pBuf,		/* Buffer which contains the data to be set */
-unsigned int *pLen)	/* Length of buffer */
+unsigned int *pLen,	/* Length of buffer */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int		Ret;
 	unsigned int	TableIndex;
@@ -2660,13 +2771,20 @@
 		return (SK_PNMI_ERR_TOO_SHORT);
 	}
 	
+    /* 
+     * Check NetIndex 
+     */
+	if (NetIndex >= pAC->Rlmt.NumNets) {
+		return (SK_PNMI_ERR_UNKNOWN_NET);
+	}
+	
 	SK_PNMI_CHECKFLAGS("PnmiStruct: On call");
 
 	/*
 	 * Update the values of RLMT and SIRQ and increment semaphores to
 	 * indicate that an update was already done.
 	 */
-	if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) {
+	if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) {
 
 		SK_PNMI_SET_STAT(pBuf, Ret, (SK_U32)(-1));
 		*pLen = SK_PNMI_MIN_STRUCT_SIZE;
@@ -2716,7 +2834,7 @@
 			Len = 0;
 			Ret = IdTable[TableIndex].Func(pAC, IoC,
 				SK_PNMI_GET, IdTable[TableIndex].Id,
-				NULL, &Len, Instance, TableIndex);
+				NULL, &Len, Instance, TableIndex, NetIndex);
 
 			if (Ret == SK_PNMI_ERR_UNKNOWN_INST) {
 
@@ -2754,7 +2872,7 @@
 			/* Call the OID handler function */
 			Ret = IdTable[TableIndex].Func(pAC, IoC, Action,
 				IdTable[TableIndex].Id, pBuf + DstOffset,
-				&Len, Instance, TableIndex);
+				&Len, Instance, TableIndex, NetIndex);
 
 			if (Ret != SK_PNMI_ERR_OK) {
 
@@ -2816,7 +2934,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -2836,7 +2954,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	if (Id != OID_SKGE_ALL_DATA) {
 
@@ -2859,13 +2978,13 @@
 	switch (Action) {
 
 	case SK_PNMI_GET:
-		return (SkPnmiGetStruct(pAC, IoC, pBuf, pLen));
+		return (SkPnmiGetStruct(pAC, IoC, pBuf, pLen, NetIndex));
 
 	case SK_PNMI_PRESET:
-		return (SkPnmiPreSetStruct(pAC, IoC, pBuf, pLen));
+		return (SkPnmiPreSetStruct(pAC, IoC, pBuf, pLen, NetIndex));
 
 	case SK_PNMI_SET:
-		return (SkPnmiSetStruct(pAC, IoC, pBuf, pLen));
+		return (SkPnmiSetStruct(pAC, IoC, pBuf, pLen, NetIndex));
 	}
 
 	SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR004, SK_PNMI_ERR004MSG);
@@ -2883,7 +3002,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -2903,7 +3022,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int	Ret;
 	SK_U32	ActionOp;
@@ -2992,7 +3112,7 @@
 
 	case SK_PNMI_ACT_RESETCNT:
 		/* Set all counters and timestamps to zero */
-		ResetCounter(pAC, IoC);
+		ResetCounter(pAC, IoC, NetIndex);
 		break;
 
 	default:
@@ -3017,7 +3137,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3034,7 +3154,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex,	/* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int    Ret;
 	SK_U64 StatVal;
@@ -3080,7 +3201,7 @@
 		}
 
 #else /* SK_NDIS_64BIT_CTR */
-		
+
 		/*
 		 * for compatibility, at least 32bit are required for oid
 		 */
@@ -3092,7 +3213,7 @@
 			*pLen = sizeof(SK_U64);
 			return (SK_PNMI_ERR_TOO_SHORT);
 		}
-		
+
 		Is64BitReq = (*pLen < sizeof(SK_U64)) ? SK_FALSE : SK_TRUE;
 #endif /* SK_NDIS_64BIT_CTR */
 		break;
@@ -3117,17 +3238,17 @@
 	switch (Id) {
 
 	case OID_802_3_PERMANENT_ADDRESS:
-		CopyMac(pBuf, &pAC->Addr.PermanentMacAddress);
+		CopyMac(pBuf, &pAC->Addr.Net[NetIndex].PermanentMacAddress);
 		*pLen = sizeof(SK_MAC_ADDR);
 		break;
 
 	case OID_802_3_CURRENT_ADDRESS:
-		CopyMac(pBuf, &pAC->Addr.CurrentMacAddress);
+		CopyMac(pBuf, &pAC->Addr.Net[NetIndex].CurrentMacAddress);
 		*pLen = sizeof(SK_MAC_ADDR);
 		break;
 
 	default:
-		StatVal = GetStatVal(pAC, IoC, 0, IdTable[TableIndex].Param);
+		StatVal = GetStatVal(pAC, IoC, 0, IdTable[TableIndex].Param, NetIndex);
 
 		/*
 		 * by default 32bit values are evaluated
@@ -3159,7 +3280,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3176,7 +3297,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	LogPortMax;
 	unsigned int	LogPortIndex;
@@ -3194,22 +3316,28 @@
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
-	if ((Instance != (SK_U32)(-1))) {
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
 
+	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
+		/* Check instance range */
 		if ((Instance < 1) || (Instance > LogPortMax)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
-
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
 		Limit = LogPortIndex + 1;
 	}
-	else {
+
+	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
+
 		LogPortIndex = 0;
 		Limit = LogPortMax;
 	}
 
+
 	/*
 	 * Check action
 	 */
@@ -3232,7 +3360,7 @@
 	 * Update XMAC statistic and increment semaphore to indicate that
 	 * an update was already done.
 	 */
-	Ret = MacUpdate(pAC, IoC, 0, PhysPortMax - 1);
+	Ret = MacUpdate(pAC, IoC, 0, pAC->GIni.GIMacsFound - 1);
 	if (Ret != SK_PNMI_ERR_OK) {
 
 		*pLen = 0;
@@ -3264,15 +3392,15 @@
 		 */
 		case OID_SKGE_STAT_RX_TOO_LONG:
 			StatVal = GetStatVal(pAC, IoC, LogPortIndex,
-					     IdTable[TableIndex].Param) -
+					     IdTable[TableIndex].Param, NetIndex) -
 				GetStatVal(pAC, IoC, LogPortIndex,
-					   SK_PNMI_HRX_LONGFRAMES);
+					   SK_PNMI_HRX_LONGFRAMES, NetIndex);
 			SK_PNMI_STORE_U64(pBuf + Offset, StatVal);
 			break;
 
 		default:
 			StatVal = GetStatVal(pAC, IoC, LogPortIndex,
-				IdTable[TableIndex].Param);
+				IdTable[TableIndex].Param, NetIndex);
 			SK_PNMI_STORE_U64(pBuf + Offset, StatVal);
 			break;
 		}
@@ -3299,7 +3427,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3319,7 +3447,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int		Ret;
 	unsigned int	LogPortMax;
@@ -3330,24 +3459,31 @@
 	unsigned int	Offset = 0;
 
 
+
 	/*
-	 * Calculate instance if wished
+	 * Calculate instance if wished. MAC index 0 is the virtual
+	 * MAC.
 	 */
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
-	if ((Instance != (SK_U32)(-1))) {
-		
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
+
+	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
+		/* Check instance range */
 		if ((Instance < 1) || (Instance > LogPortMax)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
-
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
 		Limit = LogPortIndex + 1;
 	}
-	else {
+
+	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
+
 		LogPortIndex = 0;
 		Limit = LogPortMax;
 	}
@@ -3375,34 +3511,28 @@
 
 			case OID_SKGE_PHYS_CUR_ADDR:
 				if (LogPortIndex == 0) {
-
-					CopyMac(pBuf + Offset, &pAC->Addr.
-						CurrentMacAddress);
+					CopyMac(pBuf + Offset, &pAC->Addr.Net[NetIndex].CurrentMacAddress);
 				}
 				else {
-					PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(
-						pAC, LogPortIndex);
+					PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex);
 
-					CopyMac(pBuf + Offset, &pAC->Addr.
-						Port[PhysPortIndex].
-						CurrentMacAddress);
+					CopyMac(pBuf + Offset,
+						&pAC->Addr.Port[PhysPortIndex].CurrentMacAddress);
 				}
 				Offset += 6;
 				break;
 
 			case OID_SKGE_PHYS_FAC_ADDR:
 				if (LogPortIndex == 0) {
-
-					CopyMac(pBuf + Offset, &pAC->Addr.
-						PermanentMacAddress);
+					CopyMac(pBuf + Offset,
+						&pAC->Addr.Net[NetIndex].PermanentMacAddress);
 				}
 				else {
 					PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(
 						pAC, LogPortIndex);
 
-					CopyMac(pBuf + Offset, &pAC->Addr.
-						Port[PhysPortIndex].
-						PermanentMacAddress);
+					CopyMac(pBuf + Offset,
+						&pAC->Addr.Port[PhysPortIndex].PermanentMacAddress);
 				}
 				Offset += 6;
 				break;
@@ -3509,7 +3639,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3526,7 +3656,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	Index;
 	unsigned int	Limit;
@@ -3538,15 +3669,14 @@
 	 * Calculate instance if wished
 	 */
 	if (Instance != (SK_U32)(-1)) {
-		
+
 		if ((Instance < 1) || (Instance > SKCS_NUM_PROTOCOLS)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
-
 		Index = (unsigned int)Instance - 1;
-		Limit = (unsigned int)Instance;
+		Limit = Index + 1;
 	}
 	else {
 		Index = 0;
@@ -3579,23 +3709,23 @@
 		switch (Id) {
 
 		case OID_SKGE_CHKSM_RX_OK_CTS:
-			StatVal = pAC->Csum.ProtoStats[Index].RxOkCts;
+			StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxOkCts;
 			break;
 
 		case OID_SKGE_CHKSM_RX_UNABLE_CTS:
-			StatVal = pAC->Csum.ProtoStats[Index].RxUnableCts;
+			StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxUnableCts;
 			break;
 
 		case OID_SKGE_CHKSM_RX_ERR_CTS:
-			StatVal = pAC->Csum.ProtoStats[Index].RxErrCts;
+			StatVal = pAC->Csum.ProtoStats[NetIndex][Index].RxErrCts;
 			break;
 
 		case OID_SKGE_CHKSM_TX_OK_CTS:
-			StatVal = pAC->Csum.ProtoStats[Index].TxOkCts;
+			StatVal = pAC->Csum.ProtoStats[NetIndex][Index].TxOkCts;
 			break;
 
 		case OID_SKGE_CHKSM_TX_UNABLE_CTS:
-			StatVal = pAC->Csum.ProtoStats[Index].TxUnableCts;
+			StatVal = pAC->Csum.ProtoStats[NetIndex][Index].TxUnableCts;
 			break;
 
 		default:
@@ -3628,7 +3758,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3645,7 +3775,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	i;
 	unsigned int	Index;
@@ -3872,7 +4003,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -3892,13 +4023,14 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_VPD_STATUS	*pVpdStatus;
 	unsigned int	BufLen;
 	char		Buf[256];
-	char		KeyArr[SK_PNMI_VPD_ARR_SIZE][SK_PNMI_VPD_STR_SIZE];
-	char		KeyStr[SK_PNMI_VPD_STR_SIZE];
+	char		KeyArr[SK_PNMI_VPD_ENTRIES][SK_PNMI_VPD_KEY_SIZE];
+	char		KeyStr[SK_PNMI_VPD_KEY_SIZE];
 	unsigned int	KeyNo;
 	unsigned int	Offset;
 	unsigned int	Index;
@@ -3914,7 +4046,6 @@
 	Ret = GetVpdKeyArr(pAC, IoC, &KeyArr[0][0], sizeof(KeyArr),
 		&KeyNo);
 	if (Ret != SK_PNMI_ERR_OK) {
-
 		*pLen = 0;
 		return (Ret);
 	}
@@ -3939,7 +4070,6 @@
 			for (Index = 0; Index < KeyNo; Index ++) {
 
 				if (SK_STRCMP(KeyStr, KeyArr[Index]) == 0) {
-
 					FirstIndex = Index;
 					LastIndex = Index+1;
 					break;
@@ -4352,7 +4482,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4369,7 +4499,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int		Ret;
 	unsigned int	Index;
@@ -4419,7 +4550,7 @@
 		}
 
 #else /* SK_NDIS_64BIT_CTR */
-		
+
 		/*
 		 * for compatibility, at least 32bit are required for oid
 		 */
@@ -4431,7 +4562,7 @@
 			*pLen = sizeof(SK_U64);
 			return (SK_PNMI_ERR_TOO_SHORT);
 		}
-		
+
 		Is64BitReq = (*pLen < sizeof(SK_U64)) ? SK_FALSE : SK_TRUE;
 #endif /* SK_NDIS_64BIT_CTR */
 		break;
@@ -4529,32 +4660,30 @@
 		case OID_SKGE_IN_ERRORS_CTS:
 		case OID_GEN_RCV_ERROR:
 			Val64RxHwErrs =
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_MISSED) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FRAMING) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_OVERFLOW)+
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_JABBER) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CARRIER) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_IRLENGTH)+
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SYMBOL) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SHORTS) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_RUNT) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_TOO_LONG)-
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_LONGFRAMES)+
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FCS) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CEXT);
-			break;
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_MISSED, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FRAMING, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_OVERFLOW, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_JABBER, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CARRIER, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_IRLENGTH, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SYMBOL, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_SHORTS, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_RUNT, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_TOO_LONG, NetIndex)-
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_LONGFRAMES, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_FCS, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HRX_CEXT, NetIndex);
+	        break;
 
 		case OID_SKGE_TX_HW_ERROR_CTS:
 		case OID_SKGE_OUT_ERROR_CTS:
 		case OID_GEN_XMIT_ERROR:
 			Val64TxHwErrs =
-				GetStatVal(pAC, IoC, 0,
-				SK_PNMI_HTX_EXCESS_COL) +
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_LATE_COL)+
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_UNDERRUN)+
-				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_CARRIER)+
-				GetStatVal(pAC, IoC, 0,
-				SK_PNMI_HTX_EXCESS_COL);
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_EXCESS_COL, NetIndex) +
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_LATE_COL, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_UNDERRUN, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_CARRIER, NetIndex)+
+				GetStatVal(pAC, IoC, 0, SK_PNMI_HTX_EXCESS_COL, NetIndex);
 			break;
 		}
 	}
@@ -4766,61 +4895,142 @@
 		break;
 
 	case OID_SKGE_TX_SW_QUEUE_LEN:
-		Val64 = pAC->Pnmi.TxSwQueueLen;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxSwQueueLen;
+		}
+		/* Single net mode */
+		else {
+			Val64 =  pAC->Pnmi.Port[0].TxSwQueueLen +
+				pAC->Pnmi.Port[1].TxSwQueueLen;
+		}			
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
+
 	case OID_SKGE_TX_SW_QUEUE_MAX:
-		Val64 = pAC->Pnmi.TxSwQueueMax;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxSwQueueMax;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].TxSwQueueMax +
+				pAC->Pnmi.Port[1].TxSwQueueMax;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_TX_RETRY:
-		Val64 = pAC->Pnmi.TxRetryCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxRetryCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].TxRetryCts +
+				pAC->Pnmi.Port[1].TxRetryCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_RX_INTR_CTS:
-		Val64 = pAC->Pnmi.RxIntrCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].RxIntrCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].RxIntrCts +
+				pAC->Pnmi.Port[1].RxIntrCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_TX_INTR_CTS:
-		Val64 = pAC->Pnmi.TxIntrCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxIntrCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].TxIntrCts +
+				pAC->Pnmi.Port[1].TxIntrCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_RX_NO_BUF_CTS:
-		Val64 = pAC->Pnmi.RxNoBufCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].RxNoBufCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].RxNoBufCts +
+				pAC->Pnmi.Port[1].RxNoBufCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_TX_NO_BUF_CTS:
-		Val64 = pAC->Pnmi.TxNoBufCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxNoBufCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].TxNoBufCts +
+				pAC->Pnmi.Port[1].TxNoBufCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_TX_USED_DESCR_NO:
-		Val64 = pAC->Pnmi.TxUsedDescrNo;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].TxUsedDescrNo;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].TxUsedDescrNo +
+				pAC->Pnmi.Port[1].TxUsedDescrNo;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_RX_DELIVERED_CTS:
-		Val64 = pAC->Pnmi.RxDeliveredCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].RxDeliveredCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].RxDeliveredCts +
+				pAC->Pnmi.Port[1].RxDeliveredCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_RX_OCTETS_DELIV_CTS:
-		Val64 = pAC->Pnmi.RxOctetsDeliveredCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].RxOctetsDeliveredCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].RxOctetsDeliveredCts +
+				pAC->Pnmi.Port[1].RxOctetsDeliveredCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
@@ -4836,19 +5046,45 @@
 		break;
 
 	case OID_SKGE_IN_ERRORS_CTS:
-		Val64 = Val64RxHwErrs + pAC->Pnmi.RxNoBufCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = Val64RxHwErrs + pAC->Pnmi.Port[NetIndex].RxNoBufCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = Val64RxHwErrs + 
+				pAC->Pnmi.Port[0].RxNoBufCts +
+				pAC->Pnmi.Port[1].RxNoBufCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_OUT_ERROR_CTS:
-		Val64 = Val64TxHwErrs + pAC->Pnmi.TxNoBufCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = Val64TxHwErrs + pAC->Pnmi.Port[NetIndex].TxNoBufCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = Val64TxHwErrs + 
+				pAC->Pnmi.Port[0].TxNoBufCts +
+				pAC->Pnmi.Port[1].TxNoBufCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
 
 	case OID_SKGE_ERR_RECOVERY_CTS:
-		Val64 = pAC->Pnmi.ErrRecoveryCts;
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			Val64 = pAC->Pnmi.Port[NetIndex].ErrRecoveryCts;
+		}
+		/* Single net mode */
+		else {
+			Val64 = pAC->Pnmi.Port[0].ErrRecoveryCts +
+				pAC->Pnmi.Port[1].ErrRecoveryCts;
+		}
 		SK_PNMI_STORE_U64(pBuf, Val64);
 		*pLen = sizeof(SK_U64);
 		break;
@@ -4867,13 +5103,12 @@
 		break;
 
 	case OID_GEN_RCV_ERROR:
-		Val64 = Val64RxHwErrs + pAC->Pnmi.RxNoBufCts;
+		Val64 = Val64RxHwErrs + pAC->Pnmi.Port[NetIndex].RxNoBufCts;
 
 		/*
 		 * by default 32bit values are evaluated
 		 */
 		if (!Is64BitReq) {
-			SK_U32	Val32;
 			Val32 = (SK_U32)Val64;
 			SK_PNMI_STORE_U32(pBuf, Val32);
 			*pLen = sizeof(SK_U32);
@@ -4885,13 +5120,12 @@
 		break;
 
 	case OID_GEN_XMIT_ERROR:
-		Val64 = Val64TxHwErrs + pAC->Pnmi.TxNoBufCts;
+		Val64 = Val64TxHwErrs + pAC->Pnmi.Port[NetIndex].TxNoBufCts;
 
 		/*
 		 * by default 32bit values are evaluated
 		 */
 		if (!Is64BitReq) {
-			SK_U32	Val32;
 			Val32 = (SK_U32)Val64;
 			SK_PNMI_STORE_U32(pBuf, Val32);
 			*pLen = sizeof(SK_U32);
@@ -4903,13 +5137,12 @@
 		break;
 
 	case OID_GEN_RCV_NO_BUFFER:
-		Val64 = pAC->Pnmi.RxNoBufCts;
+		Val64 = pAC->Pnmi.Port[NetIndex].RxNoBufCts;
 
 		/*
 		 * by default 32bit values are evaluated
 		 */
 		if (!Is64BitReq) {
-			SK_U32	Val32;
 			Val32 = (SK_U32)Val64;
 			SK_PNMI_STORE_U32(pBuf, Val32);
 			*pLen = sizeof(SK_U32);
@@ -4921,7 +5154,7 @@
 		break;
 
 	case OID_GEN_TRANSMIT_QUEUE_LENGTH:
-		Val32 = (SK_U32)pAC->Pnmi.TxSwQueueLen;
+		Val32 = (SK_U32)pAC->Pnmi.Port[NetIndex].TxSwQueueLen;
 		SK_PNMI_STORE_U32(pBuf, Val32);
 		*pLen = sizeof(SK_U32);
 		break;
@@ -4956,7 +5189,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -4976,7 +5209,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	int		Ret;
 	unsigned int	PhysPortIndex;
@@ -5049,7 +5283,7 @@
 		 * statistic always up to date some time. Then we can
 		 * remove this type of call.
 		 */
-		if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) {
+		if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) {
 
 			*pLen = 0;
 			return (Ret);
@@ -5062,7 +5296,7 @@
 		switch (Id) {
 
 		case OID_SKGE_RLMT_MODE:
-			*pBuf = (char)pAC->Rlmt.RlmtMode;
+			*pBuf = (char)pAC->Rlmt.Net[0].RlmtMode;
 			*pLen = sizeof(char);
 			break;
 
@@ -5088,8 +5322,7 @@
 
 				if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) {
 
-					*pBuf = (char)SK_PNMI_PORT_PHYS2LOG(
-						PhysPortIndex);
+					*pBuf = (char)SK_PNMI_PORT_PHYS2LOG(PhysPortIndex);
 					break;
 				}
 			}
@@ -5097,8 +5330,7 @@
 			break;
 
 		case OID_SKGE_RLMT_PORT_PREFERRED:
-			*pBuf = (char)SK_PNMI_PORT_PHYS2LOG(
-				pAC->Rlmt.MacPreferred);
+			*pBuf = (char)SK_PNMI_PORT_PHYS2LOG(pAC->Rlmt.Net[NetIndex].Preference);
 			*pLen = sizeof(char);
 			break;
 
@@ -5165,6 +5397,7 @@
 			/* Send an event to RLMT to change the mode */
 			SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam));
 			EventParam.Para32[0] |= (SK_U32)(*pBuf);
+			EventParam.Para32[1] = 0;
 			if (SkRlmtEvent(pAC, IoC, SK_RLMT_MODE_CHANGE,
 				EventParam) > 0) {
 
@@ -5204,6 +5437,7 @@
 			 */
 			SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam));
 			EventParam.Para32[0] = (SK_U32)(*pBuf) - 1;
+			EventParam.Para32[1] = NetIndex;
 			if (SkRlmtEvent(pAC, IoC, SK_RLMT_PREFPORT_CHANGE,
 				EventParam) > 0) {
 
@@ -5264,7 +5498,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5281,7 +5515,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	PhysPortMax;
 	unsigned int	PhysPortIndex;
@@ -5291,26 +5526,40 @@
 	SK_U32		Val32;
 	SK_U64		Val64;
 
-
 	/*
 	 * Calculate the port indexes from the instance
 	 */
 	PhysPortMax = pAC->GIni.GIMacsFound;
 
 	if ((Instance != (SK_U32)(-1))) {
-
+		/* Check instance range */
 		if ((Instance < 1) || (Instance > PhysPortMax)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
 
+		/* Single net mode */
 		PhysPortIndex = Instance - 1;
+
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			PhysPortIndex = NetIndex;
+		}
+
+		/* Both net modes */
 		Limit = PhysPortIndex + 1;
 	}
 	else {
+		/* Single net mode */
 		PhysPortIndex = 0;
 		Limit = PhysPortMax;
+
+		/* Dual net mode */
+		if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){
+			PhysPortIndex = NetIndex;
+			Limit = PhysPortIndex + 1;
+		}
 	}
 
 	/*
@@ -5360,7 +5609,7 @@
 	 * Update statistic and increment semaphores to indicate that
 	 * an update was already done.
 	 */
-	if ((Ret = RlmtUpdate(pAC, IoC)) != SK_PNMI_ERR_OK) {
+	if ((Ret = RlmtUpdate(pAC, IoC, NetIndex)) != SK_PNMI_ERR_OK) {
 
 		*pLen = 0;
 		return (Ret);
@@ -5449,7 +5698,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -5469,7 +5718,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	PhysPortMax;
 	unsigned int	PhysPortIndex;
@@ -5480,6 +5730,7 @@
 	char		Val8;
 	int		Ret;
 	SK_EVPARA	EventParam;
+	SK_U32		Val32;
 
 
 	/*
@@ -5489,18 +5740,23 @@
 	PhysPortMax = pAC->GIni.GIMacsFound;
 	LogPortMax = SK_PNMI_PORT_PHYS2LOG(PhysPortMax);
 
-	if ((Instance != (SK_U32)(-1))) {
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){ /* Dual net mode */
+		LogPortMax--;
+	}
 
+	if ((Instance != (SK_U32)(-1))) { /* Only one specific instance is queried */
+		/* Check instance range */
 		if ((Instance < 1) || (Instance > LogPortMax)) {
 
 			*pLen = 0;
 			return (SK_PNMI_ERR_UNKNOWN_INST);
 		}
-
 		LogPortIndex = SK_PNMI_PORT_INST2LOG(Instance);
 		Limit = LogPortIndex + 1;
 	}
-	else {
+
+	else { /* Instance == (SK_U32)(-1), get all Instances of that OID */
+
 		LogPortIndex = 0;
 		Limit = LogPortMax;
 	}
@@ -5535,10 +5791,17 @@
 			}
 			break;
 
+        case OID_SKGE_MTU:
+			if (*pLen < sizeof(SK_U32)) {
+
+				*pLen = sizeof(SK_U32);
+				return (SK_PNMI_ERR_TOO_SHORT);
+			}
+			break;
+
 		default:
 			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR041,
 				SK_PNMI_ERR041MSG);
-
 			*pLen = 0;
 			return (SK_PNMI_ERR_GENERAL);
 		}
@@ -5755,6 +6018,12 @@
 				Offset += sizeof(char);
 				break;
 
+			case OID_SKGE_MTU:
+				Val32 = SK_DRIVER_GET_MTU(pAC, IoC, NetIndex);
+				SK_PNMI_STORE_U32(pBuf + Offset, Val32);
+				Offset += sizeof(SK_U32);
+				break;
+
 			default:
 				SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR042,
 					SK_PNMI_ERR042MSG);
@@ -5790,7 +6059,20 @@
 		}
 		break;
 
-	default:
+	case OID_SKGE_MTU:
+		if (*pLen < sizeof(SK_U32)) {
+
+			*pLen = sizeof(SK_U32);
+			return (SK_PNMI_ERR_TOO_SHORT);
+		}
+		if (*pLen != sizeof(SK_U32)) {
+
+			*pLen = 0;
+			return (SK_PNMI_ERR_BAD_VALUE);
+		}
+		break;
+
+    default:
 		*pLen = 0;
 		return (SK_PNMI_ERR_READ_ONLY);
 	}
@@ -5812,7 +6094,8 @@
 				break;
 			}
 			if (Val8 < SK_LMODE_HALF ||
-				Val8 > SK_LMODE_AUTOSENSE) {
+				(LogPortIndex != 0 && Val8 > SK_LMODE_AUTOSENSE) ||
+				(LogPortIndex == 0 && Val8 > SK_LMODE_INDETERMINATED)) {
 
 				*pLen = 0;
 				return (SK_PNMI_ERR_BAD_VALUE);
@@ -5887,7 +6170,8 @@
 				break;
 			}
 			if (Val8 < SK_FLOW_MODE_NONE ||
-				Val8 > SK_FLOW_MODE_SYM_OR_REM) {
+				(LogPortIndex != 0 && Val8 > SK_FLOW_MODE_SYM_OR_REM) ||
+				(LogPortIndex == 0 && Val8 > SK_FLOW_MODE_INDETERMINATED)) {
 
 				*pLen = 0;
 				return (SK_PNMI_ERR_BAD_VALUE);
@@ -5963,7 +6247,8 @@
 				break;
 			}
 			if (Val8 < SK_MS_MODE_AUTO ||
-				Val8 > SK_MS_MODE_SLAVE) {
+				(LogPortIndex != 0 && Val8 > SK_MS_MODE_SLAVE) ||
+				(LogPortIndex == 0 && Val8 > SK_MS_MODE_INDETERMINATED)) {
 
 				*pLen = 0;
 				return (SK_PNMI_ERR_BAD_VALUE);
@@ -6026,10 +6311,35 @@
 					return (SK_PNMI_ERR_GENERAL);
 				}
 			}
-			
+
 			Offset += sizeof(char);
 			break;
 
+		case OID_SKGE_MTU :
+			/* Check the value range */
+			Val32 = *(SK_U32*)(pBuf + Offset);
+			if (Val32 == 0) {
+				/* mtu of this port remains unchanged */
+				Offset += sizeof(SK_U32);
+				break;
+			}
+			if (SK_DRIVER_PRESET_MTU(pAC, IoC, NetIndex, Val32) != 0) {
+				*pLen = 0;
+				return (SK_PNMI_ERR_BAD_VALUE);
+			}
+
+			/* The preset ends here */
+			if (Action == SK_PNMI_PRESET) {
+				return (SK_PNMI_ERR_OK);
+			}
+
+			if (SK_DRIVER_SET_MTU(pAC, IoC, NetIndex, Val32) != 0) {
+				return (SK_PNMI_ERR_GENERAL);
+			}
+
+			Offset += sizeof(SK_U32);
+			break;
+
 		default:
 			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR045,
 				SK_PNMI_ERR045MSG);
@@ -6052,7 +6362,7 @@
  *
  * Returns:
  *	SK_PNMI_ERR_OK           The request was successfully performed.
- *	SK_PNMI_ERR_GENERAL      A general severe internal error occurred.
+ *	SK_PNMI_ERR_GENERAL      A general severe internal error occured.
  *	SK_PNMI_ERR_TOO_SHORT    The passed buffer is too short to contain
  *	                         the correct data (e.g. a 32bit value is
  *	                         needed, but a 16 bit value was passed).
@@ -6072,7 +6382,8 @@
 char *pBuf,		/* Buffer to which to mgmt data will be retrieved */
 unsigned int *pLen,	/* On call: buffer length. On return: used buffer */
 SK_U32 Instance,	/* Instance (1..n) that is to be queried or -1 */
-unsigned int TableIndex) /* Index to the Id table */
+unsigned int TableIndex, /* Index to the Id table */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	Index;
 	unsigned int	Limit;
@@ -6502,7 +6813,7 @@
  *
  * Description:
  *	The COMMON module only tells us if the mode is half or full duplex.
- *	But in the decade of auto sensing it is useful for the user to
+ *	But in the decade of auto sensing it is usefull for the user to
  *	know if the mode was negotiated or forced. Therefore we have a
  *	look to the mode, which was last used by the negotiation process.
  *
@@ -6566,8 +6877,8 @@
 unsigned int KeyArrLen,	/* Length of array in bytes */
 unsigned int *pKeyNo)	/* Number of keys */
 {
-	unsigned int		BufKeysLen = 128;
-	char			BufKeys[128];
+	unsigned int		BufKeysLen = SK_PNMI_VPD_BUFSIZE;
+	char			BufKeys[SK_PNMI_VPD_BUFSIZE];
 	unsigned int		StartOffset;
 	unsigned int		Offset;
 	int			Index;
@@ -6598,12 +6909,12 @@
 	 * errorlog notification. This case should not happen because
 	 * the maximum number of keys is limited due to RAM limitations
 	 */
-	if (*pKeyNo > SK_PNMI_VPD_ARR_SIZE) {
+	if (*pKeyNo > SK_PNMI_VPD_ENTRIES) {
 
 		SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR015,
 			SK_PNMI_ERR015MSG);
 
-		*pKeyNo = SK_PNMI_VPD_ARR_SIZE;
+		*pKeyNo = SK_PNMI_VPD_ENTRIES;
 	}
 
 	/*
@@ -6618,15 +6929,15 @@
 			continue;
 		}
 
-		if (Offset - StartOffset > SK_PNMI_VPD_STR_SIZE) {
+		if (Offset - StartOffset > SK_PNMI_VPD_KEY_SIZE) {
 
 			SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR016,
 				SK_PNMI_ERR016MSG);
 			return (SK_PNMI_ERR_GENERAL);
 		}
 
-		SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_STR_SIZE,
-			&BufKeys[StartOffset], SK_PNMI_VPD_STR_SIZE);
+		SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_KEY_SIZE,
+			&BufKeys[StartOffset], SK_PNMI_VPD_KEY_SIZE);
 
 		Index ++;
 		StartOffset = Offset + 1;
@@ -6635,8 +6946,8 @@
 	/* Last key not zero terminated? Get it anyway */
 	if (StartOffset < Offset) {
 
-		SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_STR_SIZE,
-			&BufKeys[StartOffset], SK_PNMI_VPD_STR_SIZE);
+		SK_STRNCPY(pKeyArr + Index * SK_PNMI_VPD_KEY_SIZE,
+			&BufKeys[StartOffset], SK_PNMI_VPD_KEY_SIZE);
 	}
 
 	return (SK_PNMI_ERR_OK);
@@ -6698,7 +7009,8 @@
 
 static int RlmtUpdate(
 SK_AC *pAC,	/* Pointer to adapter context */
-SK_IOC IoC)	/* IO context handle */
+SK_IOC IoC,	/* IO context handle */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	SK_EVPARA	EventParam;
 
@@ -6711,6 +7023,8 @@
 
 	/* Send an synchronuous update event to the module */
 	SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam));
+	EventParam.Para32[0] = NetIndex;
+	EventParam.Para32[1] = (SK_U32)-1;
 	if (SkRlmtEvent(pAC, IoC, SK_RLMT_STATS_UPDATE, EventParam) > 0) {
 
 		SK_ERR_LOG(pAC, SK_ERRCL_SW, SK_PNMI_ERR048,
@@ -6764,7 +7078,7 @@
 
 		/*
 		 * It is an auto-clearing register. If the command bits
-		 * went to zero again, the statistics are transferred.
+		 * went to zero again, the statistics are transfered.
 		 * Normally the command should be executed immediately.
 		 * But just to be sure we execute a loop.
 		 */
@@ -6807,40 +7121,49 @@
  */
 
 static SK_U64 GetStatVal(
-SK_AC *pAC,			/* Pointer to adapter context */
-SK_IOC IoC,			/* IO context handle */
+SK_AC *pAC,					/* Pointer to adapter context */
+SK_IOC IoC,					/* IO context handle */
 unsigned int LogPortIndex,	/* Index of the logical Port to be processed */
-unsigned int StatIndex)		/* Index to statistic value */
+unsigned int StatIndex,		/* Index to statistic value */
+SK_U32 NetIndex)	/* NetIndex (0..n), in single net mode allways zero */
 {
 	unsigned int	PhysPortIndex;
 	unsigned int	PhysPortMax;
 	SK_U64		Val = 0;
 
 
-	if (LogPortIndex == 0) {
+	if(pAC->Pnmi.DualNetActiveFlag == SK_TRUE){	/* Dual net mode */
 
-		PhysPortMax = pAC->GIni.GIMacsFound;
+		PhysPortIndex = NetIndex;
+		Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex);
+    }	/* end of dual net mode */
 
-		/* Add counter of all active ports */
-		for (PhysPortIndex = 0; PhysPortIndex < PhysPortMax;
-			PhysPortIndex ++) {
+	else { /* single net mode */
 
-			if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) {
+		if (LogPortIndex == 0) {
 
-				Val += GetPhysStatVal(pAC, IoC, PhysPortIndex,
-					StatIndex);
-			}
-		}
+			PhysPortMax = pAC->GIni.GIMacsFound;
 
-		/* Correct value because of port switches */
-		Val += pAC->Pnmi.VirtualCounterOffset[StatIndex];
-	}
-	else {
-		/* Get counter value of physical port */
-		PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex);
-		Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex);
-	}
+			/* Add counter of all active ports */
+			for (PhysPortIndex = 0; PhysPortIndex < PhysPortMax;
+				PhysPortIndex ++) {
+
+				if (pAC->Pnmi.Port[PhysPortIndex].ActiveFlag) {
+
+					Val += GetPhysStatVal(pAC, IoC, PhysPortIndex,
+						StatIndex);
+				}
+			}
 
+			/* Correct value because of port switches */
+			Val += pAC->Pnmi.VirtualCounterOffset[StatIndex];
+		}
+		else {
+			/* Get counter value of physical port */
+			PhysPortIndex = SK_PNMI_PORT_LOG2PHYS(pAC, LogPortIndex);
+			Val = GetPhysStatVal(pAC, IoC, PhysPortIndex, StatIndex);
+		}
+	} /* end of single net mode */
 	return (Val);
 }
 
@@ -6862,8 +7185,8 @@
  */
 
 static SK_U64 GetPhysStatVal(
-SK_AC *pAC,			/* Pointer to adapter context */
-SK_IOC IoC,			/* IO context handle */
+SK_AC *pAC,					/* Pointer to adapter context */
+SK_IOC IoC,					/* IO context handle */
 unsigned int PhysPortIndex,	/* Index of the logical Port to be processed */
 unsigned int StatIndex)		/* Index to statistic value */
 {
@@ -6959,7 +7282,8 @@
 
 static void ResetCounter(
 SK_AC *pAC,		/* Pointer to adapter context */
-SK_IOC IoC)		/* IO context handle */
+SK_IOC IoC,		/* IO context handle */
+SK_U32 NetIndex)
 {
 	unsigned int	PhysPortIndex;
 	SK_EVPARA	EventParam;
@@ -6971,7 +7295,10 @@
 	SkEventQueue(pAC, SKGE_I2C, SK_I2CEV_CLEAR, EventParam);
 
 	/* Notify RLMT module */
+	EventParam.Para32[0] = NetIndex;
+	EventParam.Para32[1] = (SK_U32)-1;
 	SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_STATS_CLEAR, EventParam);
+	EventParam.Para32[1] = 0;
 
 	/* Notify SIRQ module */
 	SkEventQueue(pAC, SKGE_HWAC, SK_HWEV_CLEAR_STAT, EventParam);
@@ -7019,16 +7346,16 @@
 		sizeof(pAC->Pnmi.RlmtChangeEstimate.EstValue));
 	pAC->Pnmi.RlmtChangeEstimate.EstValueIndex = 0;
 	pAC->Pnmi.RlmtChangeEstimate.Estimate = 0;
-	pAC->Pnmi.TxSwQueueMax = 0;
-	pAC->Pnmi.TxRetryCts = 0;
-	pAC->Pnmi.RxIntrCts = 0;
-	pAC->Pnmi.TxIntrCts = 0;
-	pAC->Pnmi.RxNoBufCts = 0;
-	pAC->Pnmi.TxNoBufCts = 0;
-	pAC->Pnmi.TxUsedDescrNo = 0;
-	pAC->Pnmi.RxDeliveredCts = 0;
-	pAC->Pnmi.RxOctetsDeliveredCts = 0;
-	pAC->Pnmi.ErrRecoveryCts = 0;
+	pAC->Pnmi.Port[NetIndex].TxSwQueueMax = 0;
+	pAC->Pnmi.Port[NetIndex].TxRetryCts = 0;
+	pAC->Pnmi.Port[NetIndex].RxIntrCts = 0;
+	pAC->Pnmi.Port[NetIndex].TxIntrCts = 0;
+	pAC->Pnmi.Port[NetIndex].RxNoBufCts = 0;
+	pAC->Pnmi.Port[NetIndex].TxNoBufCts = 0;
+	pAC->Pnmi.Port[NetIndex].TxUsedDescrNo = 0;
+	pAC->Pnmi.Port[NetIndex].RxDeliveredCts = 0;
+	pAC->Pnmi.Port[NetIndex].RxOctetsDeliveredCts = 0;
+	pAC->Pnmi.Port[NetIndex].ErrRecoveryCts = 0;
 }
 
 /*****************************************************************************
@@ -7037,7 +7364,7 @@
  *
  * Description:
  *	The trap buffer stores various events. A user application somehow
- *	gets notified that an event occurred and retrieves the trap buffer
+ *	gets notified that an event occured and retrieves the trap buffer
  *	contens (or simply polls the buffer). The buffer is organized as
  *	a ring which stores the newest traps at the beginning. The oldest
  *	traps are overwritten by the newest ones. Each trap entry has a

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)