patch-2.4.7 linux/drivers/net/sk98lin/h/skaddr.h

Next file: linux/drivers/net/sk98lin/h/skcsum.h
Previous file: linux/drivers/net/sk98lin/h/lm80.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.6/linux/drivers/net/sk98lin/h/skaddr.h linux/drivers/net/sk98lin/h/skaddr.h
@@ -2,16 +2,15 @@
  *
  * Name:	skaddr.h
  * Project:	GEnesis, PCI Gigabit Ethernet Adapter
- * Version:	$Revision: 1.23 $
- * Date:	$Date: 2000/08/10 11:27:50 $
+ * Version:	$Revision: 1.24 $
+ * Date:	$Date: 2001/01/22 13:41:34 $
  * Purpose:	Header file for Address Management (MC, UC, Prom).
  *
  ******************************************************************************/
 
 /******************************************************************************
  *
- *	(C)Copyright 1998-2000 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,9 @@
  * History:
  *
  *	$Log: skaddr.h,v $
+ *	Revision 1.24  2001/01/22 13:41:34  rassmann
+ *	Supporting two nets on dual-port adapters.
+ *	
  *	Revision 1.23  2000/08/10 11:27:50  rassmann
  *	Editorial changes.
  *	Preserving 32-bit alignment in structs for the adapter context.
@@ -158,6 +160,8 @@
 #define SK_ADDR_LOGICAL_ADDRESS		0
 #define SK_ADDR_VIRTUAL_ADDRESS		(SK_ADDR_LOGICAL_ADDRESS)	/* old */
 #define SK_ADDR_PHYSICAL_ADDRESS	1
+#define SK_ADDR_CLEAR_LOGICAL		2
+#define SK_ADDR_SET_LOGICAL			4
 
 /* ----- Override return values ----- */
 
@@ -195,18 +199,22 @@
 /* Macros */
 
 #ifndef SK_ADDR_EQUAL
+/*
+ * "&" instead of "&&" allows better optimization on IA-64.
+ * The replacement is safe here, as all bytes exist.
+ */
 #ifndef SK_ADDR_DWORD_COMPARE
 #define SK_ADDR_EQUAL(A1,A2)	( \
-	((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5] && \
-	((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4] && \
-	((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3] && \
-	((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2] && \
-	((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1] && \
-	((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0])
+	(((SK_U8 *)(A1))[5] == ((SK_U8 *)(A2))[5]) & \
+	(((SK_U8 *)(A1))[4] == ((SK_U8 *)(A2))[4]) & \
+	(((SK_U8 *)(A1))[3] == ((SK_U8 *)(A2))[3]) & \
+	(((SK_U8 *)(A1))[2] == ((SK_U8 *)(A2))[2]) & \
+	(((SK_U8 *)(A1))[1] == ((SK_U8 *)(A2))[1]) & \
+	(((SK_U8 *)(A1))[0] == ((SK_U8 *)(A2))[0]))
 #else	/* SK_ADDR_DWORD_COMPARE */
 #define SK_ADDR_EQUAL(A1,A2)	( \
-	*(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2]) && \
-	*(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0]))
+	(*(SK_U32 *)&(((SK_U8 *)(A1))[2]) == *(SK_U32 *)&(((SK_U8 *)(A2))[2])) & \
+	(*(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0])))
 #endif	/* SK_ADDR_DWORD_COMPARE */
 #endif	/* SK_ADDR_EQUAL */
 
@@ -216,25 +224,31 @@
 	SK_U8	a[SK_MAC_ADDR_LEN];
 } SK_MAC_ADDR;
 
+
 /* SK_FILTER is used to ensure alignment of the filter. */
 typedef union s_InexactFilter {
 	SK_U8	Bytes[8];
 	SK_U64	Val;	/* Dummy entry for alignment only. */
 } SK_FILTER64;
 
+
+typedef struct s_AddrNet SK_ADDR_NET;
+
+
 typedef struct s_AddrPort {
 
 /* ----- Public part (read-only) ----- */
 
 	SK_MAC_ADDR	CurrentMacAddress;		/* Current physical MAC Address. */
 	SK_MAC_ADDR	PermanentMacAddress;	/* Permanent physical MAC Address. */
-	int		PromMode;					/* Promiscuous Mode. */
+	int			PromMode;				/* Promiscuous Mode. */
 
 /* ----- Private part ----- */
 
 	SK_MAC_ADDR	PreviousMacAddress;		/* Prev. phys. MAC Address. */
 	SK_BOOL		CurrentMacAddressSet;	/* CurrentMacAddress is set. */
 	SK_U8		Align01;
+
 	SK_U32		FirstExactMatchRlmt;
 	SK_U32		NextExactMatchRlmt;
 	SK_U32		FirstExactMatchDrv;
@@ -243,20 +257,30 @@
 	SK_FILTER64	InexactFilter;			/* For 64-bit hash register. */
 } SK_ADDR_PORT;
 
+
+struct s_AddrNet {
+/* ----- Public part (read-only) ----- */
+
+	SK_MAC_ADDR		CurrentMacAddress;		/* Logical MAC Address. */
+	SK_MAC_ADDR		PermanentMacAddress;	/* Logical MAC Address. */
+
+/* ----- Private part ----- */
+
+	SK_U32			ActivePort;				/* View of module ADDR. */
+	SK_BOOL			CurrentMacAddressSet;	/* CurrentMacAddress is set. */
+	SK_U8			Align01;
+	SK_U16			Align02;
+};
+
+
 typedef struct s_Addr {
 
 /* ----- Public part (read-only) ----- */
 
+	SK_ADDR_NET		Net[SK_MAX_NETS];
 	SK_ADDR_PORT	Port[SK_MAX_MACS];
-	SK_MAC_ADDR	PermanentMacAddress;	/* Logical MAC Address. */
-	SK_MAC_ADDR	CurrentMacAddress;		/* Logical MAC Address. */
 
 /* ----- Private part ----- */
-
-	SK_U32		ActivePort;				/* View of module ADDR. */
-	SK_BOOL		CurrentMacAddressSet;	/* CurrentMacAddress is set. */
-	SK_U8		Align01;
-	SK_U16		Align02;
 } SK_ADDR;
 
 /* function prototypes ********************************************************/
@@ -270,44 +294,44 @@
 extern	int	SkAddrInit(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
-	int	Level);
+	int		Level);
 
 extern	int	SkAddrMcClear(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
-	SK_U32	PortIdx,
-	int	Flags);
+	SK_U32	PortNumber,
+	int		Flags);
 
 extern	int	SkAddrMcAdd(
 	SK_AC		*pAC,
 	SK_IOC		IoC,
-	SK_U32		PortIdx,
+	SK_U32		PortNumber,
 	SK_MAC_ADDR	*pMc,
-	int		Flags);
+	int			Flags);
 
 extern	int	SkAddrMcUpdate(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
-	SK_U32	PortIdx);
+	SK_U32	PortNumber);
 
 extern	int	SkAddrOverride(
 	SK_AC		*pAC,
 	SK_IOC		IoC,
-	SK_U32		PortIdx,
+	SK_U32		PortNumber,
 	SK_MAC_ADDR	*pNewAddr,
-	int		Flags);
+	int			Flags);
 
 extern	int	SkAddrPromiscuousChange(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
-	SK_U32	PortIdx,
-	int	NewPromMode);
+	SK_U32	PortNumber,
+	int		NewPromMode);
 
 extern	int	SkAddrSwap(
 	SK_AC	*pAC,
 	SK_IOC	IoC,
-	SK_U32	FromPortIdx,
-	SK_U32	ToPortIdx);
+	SK_U32	FromPortNumber,
+	SK_U32	ToPortNumber);
 
 #else	/* defined(SK_KR_PROTO)) */
 

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