Commit 8866d756 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] sk98 vendor driver update

parent b7158553
......@@ -2043,32 +2043,204 @@ config R8169
recommended. The module will be called r8169.
config SK98LIN
tristate "SysKonnect SK-98xx support"
tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support"
depends on PCI
---help---
Say Y here if you have a SysKonnect SK-98xx Gigabit Ethernet Server
Adapter. The following adapters are supported by this driver:
- SK-9841 (single link 1000Base-LX)
- SK-9842 (dual link 1000Base-LX)
- SK-9843 (single link 1000Base-SX)
- SK-9844 (dual link 1000Base-SX)
- SK-9821 (single link 1000Base-T)
- SK-9822 (dual link 1000Base-T)
- SK-9861 (single link Volition connector)
- SK-9862 (dual link Volition connector)
The driver also supports the following adapters from Allied Telesyn:
- AT2970...
The dual link adapters support a link-failover feature. Read
<file:Documentation/networking/sk98lin.txt> for information about
Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx
compliant Gigabit Ethernet Adapter. The following adapters are supported
by this driver:
- 3Com 3C940 Gigabit LOM Ethernet Adapter
- 3Com 3C941 Gigabit LOM Ethernet Adapter
- Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971T Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
- DGE-530T Gigabit Ethernet Adapter
- EG1032 v2 Instant Gigabit Network Adapter
- EG1064 v2 Instant Gigabit Network Adapter
- Marvell RDK-8001 Adapter
- Marvell RDK-8002 Adapter
- Marvell RDK-8003 Adapter
- Marvell RDK-8004 Adapter
- Marvell RDK-8006 Adapter
- Marvell RDK-8007 Adapter
- Marvell RDK-8008 Adapter
- Marvell RDK-8009 Adapter
- Marvell RDK-8011 Adapter
- Marvell RDK-8012 Adapter
- Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
- SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
- SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
- SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
- SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
- SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
- SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
- SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
- SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
- SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
- SK-9521 V2.0 10/100/1000Base-T Adapter
- SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- SK-9521 10/100/1000Base-T Adapter
The adapters support Jumbo Frames.
The dual link adapters support link-failover and dual port features.
Both Marvell Yukon and SysKonnect SK-98xx/SK-95xx adapters support
the scatter-gather functionality with sendfile(). Please refer to
Documentation/networking/sk98lin.txt for more information about
optional driver parameters.
Questions concerning this driver may be addressed to:
linux@syskonnect.de
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/modules.txt>. This is
recommended. The module will be called sk98lin.
say M here and read Documentation/modules.txt. This is recommended.
The module will be called sk98lin.o.
config CONFIG_SK98LIN_T1
bool "3Com 3C940/3C941 Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- 3Com 3C940 Gigabit LOM Ethernet Adapter
- 3Com 3C941 Gigabit LOM Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T2
bool "Allied Telesyn AT-29xx Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- Allied Telesyn AT-2970SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971SX Gigabit Ethernet Adapter
- Allied Telesyn AT-2971T Gigabit Ethernet Adapter
- Allied Telesyn AT-2970SX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970LX/2SC Gigabit Ethernet Adapter
- Allied Telesyn AT-2970TX/2TX Gigabit Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T3
bool "CNet N-Way Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T4
bool "D-Link DGE-530T Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- DGE-530T Gigabit Ethernet Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T5
bool "Linksys EG10xx Ethernet Server Adapter"
depends on SK98LIN
help
This driver supports:
- EG1032 v2 Instant Gigabit Network Adapter
- EG1064 v2 Instant Gigabit Network Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T6
bool "Marvell RDK-80xx Adapter"
depends on SK98LIN
help
This driver supports:
- Marvell RDK-8001 Adapter
- Marvell RDK-8002 Adapter
- Marvell RDK-8003 Adapter
- Marvell RDK-8004 Adapter
- Marvell RDK-8006 Adapter
- Marvell RDK-8007 Adapter
- Marvell RDK-8008 Adapter
- Marvell RDK-8009 Adapter
- Marvell RDK-8011 Adapter
- Marvell RDK-8012 Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T7
bool "Marvell Yukon Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T8
bool "SysKonnect SK-98xx Server Gigabit Adapter"
depends on SK98LIN
help
This driver supports:
- SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)
- SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)
- SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)
- SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)
- SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)
- SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)
- SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)
- SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)
- SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)
- SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config CONFIG_SK98LIN_T9
bool "SysKonnect SK-98xx V2.0 Gigabit Ethernet Adapter"
depends on SK98LIN
help
This driver supports:
- SK-9521 V2.0 10/100/1000Base-T Adapter
- SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
- SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
- SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
- SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
- SK-9521 10/100/1000Base-T Adapter
Questions concerning this driver may be addressed to:
linux@syskonnect.de
config TIGON3
tristate "Broadcom Tigon3 support"
......
......@@ -2,11 +2,32 @@
# Makefile for the SysKonnect SK-98xx device driver.
#
obj-$(CONFIG_SK98LIN) += sk98lin.o
sk98lin-objs := skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \
ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \
skxmac2.o skproc.o skcsum.o
#
# Standalone driver params
# SKPARAM += -DSK_KERNEL_24
# SKPARAM += -DSK_KERNEL_24_26
# SKPARAM += -DSK_KERNEL_26
# SKPARAM += -DSK_KERNEL_22_24
obj-$(CONFIG_SK98LIN) += sk98lin.o
sk98lin-objs := \
skge.o \
skdim.o \
skaddr.o \
skgehwt.o \
skgeinit.o \
skgepnmi.o \
skgesirq.o \
ski2c.o \
sklm80.o \
skqueue.o \
skrlmt.o \
sktimer.o \
skvpd.o \
skxmac2.o \
skproc.o \
skcsum.o
# DBGDEF = \
# -DDEBUG
......@@ -55,4 +76,13 @@ endif
# SK_DBGCAT_DRV_INT_SRC 0x04000000 interrupts sources
# SK_DBGCAT_DRV_EVENT 0x08000000 driver events
EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_USE_CSUM $(DBGDEF)
EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_USE_CSUM -DGENESIS -DYUKON $(DBGDEF) $(SKPARAM)
clean:
rm -f core *.o *.a *.s
/******************************************************************************
*
* Name: lm80.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.3 $
* Date: $Date: 1999/11/22 13:41:19 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.6 $
* Date: $Date: 2003/05/13 17:26:52 $
* Purpose: Contains all defines for the LM80 Chip
* (National Semiconductor).
*
......@@ -11,8 +11,8 @@
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2002 SysKonnect.
* (C)Copyright 2002-2003 Marvell.
*
* 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 +27,16 @@
*
* History:
* $Log: lm80.h,v $
* Revision 1.6 2003/05/13 17:26:52 mkarl
* Editorial changes.
*
* Revision 1.5 2003/03/31 07:15:18 mkarl
* Corrected Copyright.
* Editorial changes.
*
* Revision 1.4 2002/04/25 11:04:10 rschmidt
* Editorial changes
*
* Revision 1.3 1999/11/22 13:41:19 cgoos
* Changed license header to GPL.
*
......@@ -69,7 +79,7 @@ extern "C" {
#define LM80_VT4_IN 0x24 /* current Voltage 4 value */
#define LM80_VT5_IN 0x25 /* current Voltage 5 value */
#define LM80_VT6_IN 0x26 /* current Voltage 6 value */
#define LM80_TEMP_IN 0x27 /* current temperature value */
#define LM80_TEMP_IN 0x27 /* current Temperature value */
#define LM80_FAN1_IN 0x28 /* current Fan 1 count */
#define LM80_FAN2_IN 0x29 /* current Fan 2 count */
/* limit values */
......@@ -126,7 +136,7 @@ extern "C" {
#define LM80_IS_BTI (1<<1) /* state of BTI# pin */
#define LM80_IS_FAN1 (1<<2) /* count limit exceeded for Fan 1 */
#define LM80_IS_FAN2 (1<<3) /* count limit exceeded for Fan 2 */
#define LM80_IS_CI (1<<4) /* Chassis Intrusion occurred */
#define LM80_IS_CI (1<<4) /* Chassis Intrusion occured */
#define LM80_IS_OS (1<<5) /* OS temperature limit exceeded */
/* bit 6 and 7 are reserved in LM80_ISRC_2 */
#define LM80_IS_HT_IRQ_MD (1<<6) /* Hot temperature interrupt mode */
......
/******************************************************************************
*
* Name: skaddr.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.24 $
* Date: $Date: 2001/01/22 13:41:34 $
* Project: Gigabit Ethernet Adapters, ADDR-Modul
* Version: $Revision: 1.29 $
* Date: $Date: 2003/05/13 16:57:24 $
* Purpose: Header file for Address Management (MC, UC, Prom).
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2001 SysKonnect GmbH.
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -26,6 +27,24 @@
* History:
*
* $Log: skaddr.h,v $
* Revision 1.29 2003/05/13 16:57:24 mkarl
* Changes for SLIM driver.
* Editorial changes.
*
* Revision 1.28 2003/04/15 09:33:22 tschilli
* Copyright messages changed.
*
* Revision 1.27 2003/04/14 15:55:11 tschilli
* "#error C++ is not yet supported." removed.
*
* Revision 1.26 2002/11/15 07:24:42 tschilli
* SK_ADDR_EQUAL macro fixed.
*
* Revision 1.25 2002/06/10 13:55:18 tschilli
* Changes for handling YUKON.
* All changes are internally and not visible to the programmer
* using this module.
*
* Revision 1.24 2001/01/22 13:41:34 rassmann
* Supporting two nets on dual-port adapters.
*
......@@ -132,7 +151,6 @@
#define __INC_SKADDR_H
#ifdef __cplusplus
#error C++ is not yet supported.
extern "C" {
#endif /* cplusplus */
......@@ -198,6 +216,7 @@ extern "C" {
/* Macros */
#ifdef OLD_STUFF
#ifndef SK_ADDR_EQUAL
/*
* "&" instead of "&&" allows better optimization on IA-64.
......@@ -217,6 +236,25 @@ extern "C" {
(*(SK_U32 *)&(((SK_U8 *)(A1))[0]) == *(SK_U32 *)&(((SK_U8 *)(A2))[0])))
#endif /* SK_ADDR_DWORD_COMPARE */
#endif /* SK_ADDR_EQUAL */
#endif /* 0 */
#ifndef SK_ADDR_EQUAL
#ifndef SK_ADDR_DWORD_COMPARE
#define SK_ADDR_EQUAL(A1,A2) ( \
(((SK_U8 SK_FAR *)(A1))[5] == ((SK_U8 SK_FAR *)(A2))[5]) & \
(((SK_U8 SK_FAR *)(A1))[4] == ((SK_U8 SK_FAR *)(A2))[4]) & \
(((SK_U8 SK_FAR *)(A1))[3] == ((SK_U8 SK_FAR *)(A2))[3]) & \
(((SK_U8 SK_FAR *)(A1))[2] == ((SK_U8 SK_FAR *)(A2))[2]) & \
(((SK_U8 SK_FAR *)(A1))[1] == ((SK_U8 SK_FAR *)(A2))[1]) & \
(((SK_U8 SK_FAR *)(A1))[0] == ((SK_U8 SK_FAR *)(A2))[0]))
#else /* SK_ADDR_DWORD_COMPARE */
#define SK_ADDR_EQUAL(A1,A2) ( \
(*(SK_U16 SK_FAR *)&(((SK_U8 SK_FAR *)(A1))[4]) == \
*(SK_U16 SK_FAR *)&(((SK_U8 SK_FAR *)(A2))[4])) && \
(*(SK_U32 SK_FAR *)&(((SK_U8 SK_FAR *)(A1))[0]) == \
*(SK_U32 SK_FAR *)&(((SK_U8 SK_FAR *)(A2))[0])))
#endif /* SK_ADDR_DWORD_COMPARE */
#endif /* SK_ADDR_EQUAL */
/* typedefs *******************************************************************/
......@@ -255,6 +293,8 @@ typedef struct s_AddrPort {
SK_U32 NextExactMatchDrv;
SK_MAC_ADDR Exact[SK_ADDR_EXACT_MATCHES];
SK_FILTER64 InexactFilter; /* For 64-bit hash register. */
SK_FILTER64 InexactRlmtFilter; /* For 64-bit hash register. */
SK_FILTER64 InexactDrvFilter; /* For 64-bit hash register. */
} SK_ADDR_PORT;
......@@ -302,6 +342,18 @@ extern int SkAddrMcClear(
SK_U32 PortNumber,
int Flags);
extern int SkAddrXmacMcClear(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
int Flags);
extern int SkAddrGmacMcClear(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
int Flags);
extern int SkAddrMcAdd(
SK_AC *pAC,
SK_IOC IoC,
......@@ -309,16 +361,40 @@ extern int SkAddrMcAdd(
SK_MAC_ADDR *pMc,
int Flags);
extern int SkAddrXmacMcAdd(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
SK_MAC_ADDR *pMc,
int Flags);
extern int SkAddrGmacMcAdd(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
SK_MAC_ADDR *pMc,
int Flags);
extern int SkAddrMcUpdate(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber);
extern int SkAddrXmacMcUpdate(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber);
extern int SkAddrGmacMcUpdate(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber);
extern int SkAddrOverride(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
SK_MAC_ADDR *pNewAddr,
SK_MAC_ADDR SK_FAR *pNewAddr,
int Flags);
extern int SkAddrPromiscuousChange(
......@@ -327,11 +403,25 @@ extern int SkAddrPromiscuousChange(
SK_U32 PortNumber,
int NewPromMode);
extern int SkAddrXmacPromiscuousChange(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
int NewPromMode);
extern int SkAddrGmacPromiscuousChange(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 PortNumber,
int NewPromMode);
#ifndef SK_SLIM
extern int SkAddrSwap(
SK_AC *pAC,
SK_IOC IoC,
SK_U32 FromPortNumber,
SK_U32 ToPortNumber);
#endif
#else /* defined(SK_KR_PROTO)) */
......
/******************************************************************************
*
* Name: skdebug.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.10 $
* Date: $Date: 1999/11/22 13:47:40 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.14 $
* Date: $Date: 2003/05/13 17:26:00 $
* Purpose: SK specific DEBUG support
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2002 SysKonnect.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -26,6 +26,19 @@
*
* History:
* $Log: skdebug.h,v $
* Revision 1.14 2003/05/13 17:26:00 mkarl
* Editorial changes.
*
* Revision 1.13 2003/03/31 07:16:39 mkarl
* Corrected Copyright.
*
* Revision 1.12 2002/07/15 15:37:13 rschmidt
* Power Management support
* Editorial changes
*
* Revision 1.11 2002/04/25 11:04:39 rschmidt
* Editorial changes
*
* Revision 1.10 1999/11/22 13:47:40 cgoos
* Changed license header to GPL.
*
......@@ -96,19 +109,18 @@
#define SK_DBGMOD_CSUM 0x00000040L /* CSUM module */
#define SK_DBGMOD_ADDR 0x00000080L /* ADDR module */
#define SK_DBGMOD_PECP 0x00000100L /* PECP module */
#define SK_DBGMOD_POWM 0x00000200L /* Power Management module */
/* Debug events */
#define SK_DBGCAT_INIT 0x00000001L /* module/driver initialization */
#define SK_DBGCAT_CTRL 0x00000002L /* controlling: add/rmv MCA/MAC
* and other controls (IOCTL)
*/
#define SK_DBGCAT_CTRL 0x00000002L /* controlling devices */
#define SK_DBGCAT_ERR 0x00000004L /* error handling paths */
#define SK_DBGCAT_TX 0x00000008L /* transmit path */
#define SK_DBGCAT_RX 0x00000010L /* receive path */
#define SK_DBGCAT_IRQ 0x00000020L /* general IRQ handling */
#define SK_DBGCAT_QUEUE 0x00000040L /* any queue management */
#define SK_DBGCAT_DUMP 0x00000080L /* large data output e.g. hex dump */
#define SK_DBGCAT_FATAL 0x00000100L /* large data output e.g. hex dump */
#define SK_DBGCAT_FATAL 0x00000100L /* fatal error */
#endif /* __INC_SKDEBUG_H */
......@@ -2,16 +2,15 @@
*
* Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.9.2.1 $
* Date: $Date: 2001/03/12 16:50:59 $
* Version: $Revision: 1.15 $
* Date: $Date: 2003/07/17 14:54:09 $
* Purpose: First header file for driver and all other modules
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2001 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2003 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,30 @@
* History:
*
* $Log: skdrv1st.h,v $
* Revision 1.15 2003/07/17 14:54:09 rroesler
* Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
*
* Revision 1.14 2003/06/03 14:36:32 mlindner
* Add: Additions for SK_SLIM
*
* Revision 1.13 2003/05/26 14:03:06 mlindner
* Add: Support for SLIM skaddr
*
* Revision 1.12 2003/05/26 12:56:39 mlindner
* Add: Support for Kernel 2.5/2.6
* Add: New SkOsGetTimeCurrent function
* Add: SK_PNMI_HUNDREDS_SEC definition
* Fix: SK_TICKS_PER_SEC on Intel Itanium2
*
* Revision 1.11 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement
*
* Revision 1.10 2002/10/02 12:46:02 mlindner
* Add: Support for Yukon
*
* Revision 1.9.2.2 2001/12/07 12:06:42 mlindner
* Fix: malloc -> slab changes
*
* Revision 1.9.2.1 2001/03/12 16:50:59 mlindner
* chg: kernel 2.4 adaption
*
......@@ -72,7 +95,7 @@
* Description:
*
* This is the first include file of the driver, which includes all
* necessary system header files and some of the GEnesis header files.
* neccessary system header files and some of the GEnesis header files.
* It also defines some basic items.
*
* Include File Hierarchy:
......@@ -84,17 +107,22 @@
#ifndef __INC_SKDRV1ST_H
#define __INC_SKDRV1ST_H
/* Check kernel version */
#include <linux/version.h>
typedef struct s_AC SK_AC;
/* Set card versions */
#define SK_FAR
/* override some default functions with optimized linux functions */
#define SK_PNMI_STORE_U16(p,v) memcpy((char*)(p),(char*)&(v),2)
#define SK_PNMI_STORE_U32(p,v) memcpy((char*)(p),(char*)&(v),4)
#define SK_PNMI_STORE_U64(p,v) memcpy((char*)(p),(char*)&(v),8)
#define SK_PNMI_READ_U16(p,v) memcpy((char*)&(v),(char*)(p),2)
#define SK_PNMI_READ_U32(p,v) memcpy((char*)&(v),(char*)(p),2)
#define SK_PNMI_READ_U64(p,v) memcpy((char*)&(v),(char*)(p),2)
#define SK_PNMI_READ_U32(p,v) memcpy((char*)&(v),(char*)(p),4)
#define SK_PNMI_READ_U64(p,v) memcpy((char*)&(v),(char*)(p),8)
#define SkCsCalculateChecksum(p,l) ((~ip_compute_csum(p, l)) & 0xffff)
......@@ -116,7 +144,6 @@ typedef struct s_AC SK_AC;
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/crc32.h>
#include <asm/byteorder.h>
#include <asm/bitops.h>
#include <asm/io.h>
......@@ -140,9 +167,11 @@ typedef struct s_AC SK_AC;
#define SK_BIG_ENDIAN
#endif
#define SK_NET_DEVICE net_device
/* we use gethrtime(), return unit: nanoseconds */
#define SK_TICKS_PER_SEC HZ
#define SK_TICKS_PER_SEC 100
#define SK_MEM_MAPPED_IO
......@@ -161,17 +190,17 @@ typedef struct s_DrvRlmtMbuf SK_MBUF;
#define SK_MEMCPY(dest,src,size) memcpy(dest,src,size)
#define SK_MEMCMP(s1,s2,size) memcmp(s1,s2,size)
#define SK_MEMSET(dest,val,size) memset(dest,val,size)
#define SK_STRLEN(pStr) strlen((char*)pStr)
#define SK_STRNCPY(pDest,pSrc,size) strncpy((char*)pDest,(char*)pSrc,size)
#define SK_STRCMP(pStr1,pStr2) strcmp((char*)pStr1,(char*)pStr2)
#define SK_STRLEN(pStr) strlen((char*)(pStr))
#define SK_STRNCPY(pDest,pSrc,size) strncpy((char*)(pDest),(char*)(pSrc),size)
#define SK_STRCMP(pStr1,pStr2) strcmp((char*)(pStr1),(char*)(pStr2))
/* macros to access the adapter */
#define SK_OUT8(b,a,v) writeb(v, (b+a))
#define SK_OUT16(b,a,v) writew(v, (b+a))
#define SK_OUT32(b,a,v) writel(v, (b+a))
#define SK_IN8(b,a,pv) (*(pv) = readb(b+a))
#define SK_IN16(b,a,pv) (*(pv) = readw(b+a))
#define SK_IN32(b,a,pv) (*(pv) = readl(b+a))
#define SK_OUT8(b,a,v) writeb((v), ((b)+(a)))
#define SK_OUT16(b,a,v) writew((v), ((b)+(a)))
#define SK_OUT32(b,a,v) writel((v), ((b)+(a)))
#define SK_IN8(b,a,pv) (*(pv) = readb((b)+(a)))
#define SK_IN16(b,a,pv) (*(pv) = readw((b)+(a)))
#define SK_IN32(b,a,pv) (*(pv) = readl((b)+(a)))
#define int8_t char
#define int16_t short
......@@ -222,11 +251,11 @@ extern void SkDbgPrintf(const char *format,...);
#define SK_DBGCAT_DRV_INT_SRC 0x04000000
#define SK_DBGCAT_DRV_EVENT 0x08000000
#endif /* DEBUG */
#endif
#define SK_ERR_LOG SkErrorLog
extern void SkErrorLog(SK_AC*, int, int, char*);
#endif /* __INC_SKDRV1ST_H */
#endif
This diff is collapsed.
/******************************************************************************
*
* Name: skerror.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $
* Date: $Date: 1999/11/22 13:51:59 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.7 $
* Date: $Date: 2003/05/13 17:25:13 $
* Purpose: SK specific Error log support
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2002 SysKonnect.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -26,6 +26,15 @@
*
* History:
* $Log: skerror.h,v $
* Revision 1.7 2003/05/13 17:25:13 mkarl
* Editorial changes.
*
* Revision 1.6 2003/03/31 07:17:48 mkarl
* Corrected Copyright.
*
* Revision 1.5 2002/04/25 11:05:10 rschmidt
* Editorial changes
*
* Revision 1.4 1999/11/22 13:51:59 cgoos
* Changed license header to GPL.
*
......@@ -49,19 +58,19 @@
#define _INC_SKERROR_H_
/*
* Define the Error Classes
* Define Error Classes
*/
#define SK_ERRCL_OTHER (0) /* Other error */
#define SK_ERRCL_CONFIG (1L<<0) /* Configuration error */
#define SK_ERRCL_INIT (1L<<1) /* Initialization error */
#define SK_ERRCL_NORES (1L<<2) /* Out of resources error */
#define SK_ERRCL_SW (1L<<3) /* internal Software error */
#define SK_ERRCL_HW (1L<<4) /* Hardware failure */
#define SK_ERRCL_NORES (1L<<2) /* Out of Resources error */
#define SK_ERRCL_SW (1L<<3) /* Internal Software error */
#define SK_ERRCL_HW (1L<<4) /* Hardware Failure */
#define SK_ERRCL_COMM (1L<<5) /* Communication error */
/*
* Define Error code bases
* Define Error Code Bases
*/
#define SK_ERRBASE_RLMT 100 /* Base Error number for RLMT */
#define SK_ERRBASE_HWINIT 200 /* Base Error number for HWInit */
......@@ -69,9 +78,9 @@
#define SK_ERRBASE_PNMI 400 /* Base Error number for PNMI */
#define SK_ERRBASE_CSUM 500 /* Base Error number for Checksum */
#define SK_ERRBASE_SIRQ 600 /* Base Error number for Special IRQ */
#define SK_ERRBASE_I2C 700 /* Base Error number for i2C module */
#define SK_ERRBASE_I2C 700 /* Base Error number for I2C module */
#define SK_ERRBASE_QUEUE 800 /* Base Error number for Scheduler */
#define SK_ERRBASE_ADDR 900 /* Base Error number for Address mod. */
#define SK_ERRBASE_ADDR 900 /* Base Error number for Address module */
#define SK_ERRBASE_PECP 1000 /* Base Error number for PECP */
#define SK_ERRBASE_DRV 1100 /* Base Error number for Driver */
......
/******************************************************************************
*
* Name: skgedrv.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $
* Date: $Date: 1999/11/22 13:52:46 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.10 $
* Date: $Date: 2003/07/04 12:25:01 $
* Purpose: Interface with the driver
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2002 SysKonnect.
* (C)Copyright 2002-2003 Marvell.
*
* 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 +27,27 @@
* History:
*
* $Log: skgedrv.h,v $
* Revision 1.10 2003/07/04 12:25:01 rschmidt
* Added event SK_DRV_DOWNSHIFT_DET for Downshift 4-Pair / 2-Pair
*
* Revision 1.9 2003/05/13 17:24:21 mkarl
* Added events SK_DRV_LINK_UP and SK_DRV_LINK_DOWN for drivers not using
* RLMT (SK_NO_RLMT).
* Editorial changes.
*
* Revision 1.8 2003/03/31 07:18:54 mkarl
* Corrected Copyright.
*
* Revision 1.7 2003/03/18 09:43:47 rroesler
* Added new event for timer
*
* Revision 1.6 2002/07/15 15:38:01 rschmidt
* Power Management support
* Editorial changes
*
* Revision 1.5 2002/04/25 11:05:47 rschmidt
* Editorial changes
*
* Revision 1.4 1999/11/22 13:52:46 cgoos
* Changed license header to GPL.
*
......@@ -49,17 +70,23 @@
/*
* Define the driver events.
* Usually the events are defined by the destination module. In case of the
* driver we put the definition of the events here.
* Usually the events are defined by the destination module.
* In case of the driver we put the definition of the events here.
*/
#define SK_DRV_PORT_RESET 1 /* The port needs to be reset */
#define SK_DRV_NET_UP 2 /* The net is now operational */
#define SK_DRV_NET_DOWN 3 /* The net is now down */
#define SK_DRV_SWITCH_SOFT 4 /* Ports switch with both links conn */
#define SK_DRV_NET_UP 2 /* The net is operational */
#define SK_DRV_NET_DOWN 3 /* The net is down */
#define SK_DRV_SWITCH_SOFT 4 /* Ports switch with both links connected */
#define SK_DRV_SWITCH_HARD 5 /* Port switch due to link failure */
#define SK_DRV_RLMT_SEND 6 /* Send a RLMT packet */
#define SK_DRV_ADAP_FAIL 7 /* The whole adapter fails */
#define SK_DRV_PORT_FAIL 8 /* One port fails */
#define SK_DRV_SWITCH_INTERN 9 /* Port switch from driver to itself */
#define SK_DRV_SWITCH_INTERN 9 /* Port switch by the driver itself */
#define SK_DRV_POWER_DOWN 10 /* Power down mode */
#define SK_DRV_TIMER 11 /* Timer for free use */
#ifdef SK_NO_RLMT
#define SK_DRV_LINK_UP 12 /* Link Up event for driver */
#define SK_DRV_LINK_DOWN 13 /* Link Down event for driver */
#endif
#define SK_DRV_DOWNSHIFT_DET 14 /* Downshift 4-Pair / 2-Pair (YUKON only) */
#endif /* __INC_SKGEDRV_H_ */
This source diff could not be displayed because it is too large. You can view the blob instead.
/******************************************************************************
*
* Name: skhwt.h
* Project: Genesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $
* Date: $Date: 1998/08/19 09:50:58 $
* Project: Gigabit Ethernet Adapters, Schedule-Modul
* Version: $Revision: 1.6 $
* Date: $Date: 2003/05/13 17:57:48 $
* Purpose: Defines for the hardware timer functions
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,12 @@
* History:
*
* $Log: skgehwt.h,v $
* Revision 1.6 2003/05/13 17:57:48 mkarl
* Editorial changes.
*
* Revision 1.5 1999/11/22 13:54:24 cgoos
* Changed license header to GPL.
*
* Revision 1.4 1998/08/19 09:50:58 gklug
* fix: remove struct keyword from c-code (see CCC) add typedefs
*
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,15 +2,16 @@
*
* Name: skgepnm2.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.30 $
* Date: $Date: 2001/02/06 10:03:41 $
* Version: $Revision: 1.36 $
* Date: $Date: 2003/05/23 12:45:13 $
* Purpose: Defines for Private Network Management Interface
*
****************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2001 SysKonnect GmbH.
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -26,6 +27,28 @@
* History:
*
* $Log: skgepnm2.h,v $
* Revision 1.36 2003/05/23 12:45:13 tschilli
* #ifndef SK_PNMI_HUNDREDS_SEC added to SK_PNMI_HUNDREDS_SEC definition
* to allow own time macro defines.
*
* Revision 1.35 2003/03/27 11:27:48 tschilli
* Copyright messages changed.
*
* Revision 1.34 2002/12/16 09:05:18 tschilli
* Code for VCT handling added.
*
* Revision 1.33 2002/09/10 09:00:03 rwahl
* Adapted boolean definitions according sktypes.
*
* Revision 1.32 2002/08/09 09:47:01 rwahl
* Added write-only flag to oid access defines.
* Editorial changes.
*
* Revision 1.31 2002/07/17 19:23:18 rwahl
* - Replaced MAC counter definitions by enumeration.
* - Added definition SK_PNMI_MAC_TYPES.
* - Added chipset defnition for Yukon.
*
* Revision 1.30 2001/02/06 10:03:41 mkunz
* - Pnmi V4 dual net support added. Interface functions and macros extended
* - Vpd bug fixed
......@@ -140,18 +163,11 @@
#ifndef _SKGEPNM2_H_
#define _SKGEPNM2_H_
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE !(FALSE)
#endif
/*
* General definitions
*/
#define SK_PNMI_CHIPSET 1 /* XMAC11800FP */
#define SK_PNMI_CHIPSET_XMAC 1 /* XMAC11800FP */
#define SK_PNMI_CHIPSET_YUKON 2 /* YUKON */
#define SK_PNMI_BUS_PCI 1 /* PCI bus*/
......@@ -188,6 +204,14 @@
*/
#define SK_PNMI_DEF_RLMT_CHG_THRES 240 /* 4 changes per minute */
/*
* VCT internal status values
*/
#define SK_PNMI_VCT_PENDING 32
#define SK_PNMI_VCT_TEST_DONE 64
#define SK_PNMI_VCT_LINK 128
/*
* Internal table definitions
*/
......@@ -197,6 +221,7 @@
#define SK_PNMI_RO 0
#define SK_PNMI_RW 1
#define SK_PNMI_WO 2
typedef struct s_OidTabEntry {
SK_U32 Id;
......@@ -220,92 +245,96 @@ typedef struct s_OidTabEntry {
#define SK_PNMI_TRAP_RLMT_CHANGE_LEN 23
#define SK_PNMI_TRAP_RLMT_PORT_LEN 23
/*
* Number of MAC types supported
*/
#define SK_PNMI_MAC_TYPES (SK_MAC_GMAC + 1)
/*
* MAC statistic data structures
* Only for the first 64 counters: the number relates to the bit in the
* XMAC overflow status register
* MAC statistic data list (overall set for MAC types used)
*/
#define SK_PNMI_HTX 0
#define SK_PNMI_HTX_OCTET 1
#define SK_PNMI_HTX_OCTETHIGH 1
#define SK_PNMI_HTX_OCTETLOW 2
#define SK_PNMI_HTX_BROADCAST 3
#define SK_PNMI_HTX_MULTICAST 4
#define SK_PNMI_HTX_UNICAST 5
#define SK_PNMI_HTX_LONGFRAMES 6
#define SK_PNMI_HTX_BURST 7
#define SK_PNMI_HTX_PMACC 8
#define SK_PNMI_HTX_MACC 9
#define SK_PNMI_HTX_SINGLE_COL 10
#define SK_PNMI_HTX_MULTI_COL 11
#define SK_PNMI_HTX_EXCESS_COL 12
#define SK_PNMI_HTX_LATE_COL 13
#define SK_PNMI_HTX_DEFFERAL 14
#define SK_PNMI_HTX_EXCESS_DEF 15
#define SK_PNMI_HTX_UNDERRUN 16
#define SK_PNMI_HTX_CARRIER 17
#define SK_PNMI_HTX_UTILUNDER 18
#define SK_PNMI_HTX_UTILOVER 19
#define SK_PNMI_HTX_64 20
#define SK_PNMI_HTX_127 21
#define SK_PNMI_HTX_255 22
#define SK_PNMI_HTX_511 23
#define SK_PNMI_HTX_1023 24
#define SK_PNMI_HTX_MAX 25
#define SK_PNMI_HTX_RESERVED26 26
#define SK_PNMI_HTX_RESERVED27 27
#define SK_PNMI_HTX_RESERVED28 28
#define SK_PNMI_HTX_RESERVED29 29
#define SK_PNMI_HTX_RESERVED30 30
#define SK_PNMI_HTX_RESERVED31 31
#define SK_PNMI_HRX (32 + 0)
#define SK_PNMI_HRX_OCTET (32 + 1)
#define SK_PNMI_HRX_OCTETHIGH (32 + 1)
#define SK_PNMI_HRX_OCTETLOW (32 + 2)
#define SK_PNMI_HRX_BROADCAST (32 + 3)
#define SK_PNMI_HRX_MULTICAST (32 + 4)
#define SK_PNMI_HRX_UNICAST (32 + 5)
#define SK_PNMI_HRX_PMACC (32 + 6)
#define SK_PNMI_HRX_MACC (32 + 7)
#define SK_PNMI_HRX_PMACC_ERR (32 + 8)
#define SK_PNMI_HRX_MACC_UNKWN (32 + 9)
#define SK_PNMI_HRX_BURST (32 + 10)
#define SK_PNMI_HRX_MISSED (32 + 11)
#define SK_PNMI_HRX_FRAMING (32 + 12)
#define SK_PNMI_HRX_OVERFLOW (32 + 13)
#define SK_PNMI_HRX_JABBER (32 + 14)
#define SK_PNMI_HRX_CARRIER (32 + 15)
#define SK_PNMI_HRX_IRLENGTH (32 + 16)
#define SK_PNMI_HRX_SYMBOL (32 + 17)
#define SK_PNMI_HRX_SHORTS (32 + 18)
#define SK_PNMI_HRX_RUNT (32 + 19)
#define SK_PNMI_HRX_TOO_LONG (32 + 20)
#define SK_PNMI_HRX_FCS (32 + 21)
#define SK_PNMI_HRX_RESERVED22 (32 + 22)
#define SK_PNMI_HRX_CEXT (32 + 23)
#define SK_PNMI_HRX_UTILUNDER (32 + 24)
#define SK_PNMI_HRX_UTILOVER (32 + 25)
#define SK_PNMI_HRX_64 (32 + 26)
#define SK_PNMI_HRX_127 (32 + 27)
#define SK_PNMI_HRX_255 (32 + 28)
#define SK_PNMI_HRX_511 (32 + 29)
#define SK_PNMI_HRX_1023 (32 + 30)
#define SK_PNMI_HRX_MAX (32 + 31)
#define SK_PNMI_HTX_SYNC 64
#define SK_PNMI_HTX_SYNC_OCTET 65
#define SK_PNMI_HRX_LONGFRAMES 66
#define SK_PNMI_MAX_IDX (SK_PNMI_CNT_NO)
enum SK_MACSTATS {
SK_PNMI_HTX = 0,
SK_PNMI_HTX_OCTET,
SK_PNMI_HTX_OCTETHIGH = SK_PNMI_HTX_OCTET,
SK_PNMI_HTX_OCTETLOW,
SK_PNMI_HTX_BROADCAST,
SK_PNMI_HTX_MULTICAST,
SK_PNMI_HTX_UNICAST,
SK_PNMI_HTX_BURST,
SK_PNMI_HTX_PMACC,
SK_PNMI_HTX_MACC,
SK_PNMI_HTX_COL,
SK_PNMI_HTX_SINGLE_COL,
SK_PNMI_HTX_MULTI_COL,
SK_PNMI_HTX_EXCESS_COL,
SK_PNMI_HTX_LATE_COL,
SK_PNMI_HTX_DEFFERAL,
SK_PNMI_HTX_EXCESS_DEF,
SK_PNMI_HTX_UNDERRUN,
SK_PNMI_HTX_CARRIER,
SK_PNMI_HTX_UTILUNDER,
SK_PNMI_HTX_UTILOVER,
SK_PNMI_HTX_64,
SK_PNMI_HTX_127,
SK_PNMI_HTX_255,
SK_PNMI_HTX_511,
SK_PNMI_HTX_1023,
SK_PNMI_HTX_MAX,
SK_PNMI_HTX_LONGFRAMES,
SK_PNMI_HTX_SYNC,
SK_PNMI_HTX_SYNC_OCTET,
SK_PNMI_HTX_RESERVED,
SK_PNMI_HRX,
SK_PNMI_HRX_OCTET,
SK_PNMI_HRX_OCTETHIGH = SK_PNMI_HRX_OCTET,
SK_PNMI_HRX_OCTETLOW,
SK_PNMI_HRX_BADOCTET,
SK_PNMI_HRX_BADOCTETHIGH = SK_PNMI_HRX_BADOCTET,
SK_PNMI_HRX_BADOCTETLOW,
SK_PNMI_HRX_BROADCAST,
SK_PNMI_HRX_MULTICAST,
SK_PNMI_HRX_UNICAST,
SK_PNMI_HRX_PMACC,
SK_PNMI_HRX_MACC,
SK_PNMI_HRX_PMACC_ERR,
SK_PNMI_HRX_MACC_UNKWN,
SK_PNMI_HRX_BURST,
SK_PNMI_HRX_MISSED,
SK_PNMI_HRX_FRAMING,
SK_PNMI_HRX_UNDERSIZE,
SK_PNMI_HRX_OVERFLOW,
SK_PNMI_HRX_JABBER,
SK_PNMI_HRX_CARRIER,
SK_PNMI_HRX_IRLENGTH,
SK_PNMI_HRX_SYMBOL,
SK_PNMI_HRX_SHORTS,
SK_PNMI_HRX_RUNT,
SK_PNMI_HRX_TOO_LONG,
SK_PNMI_HRX_FCS,
SK_PNMI_HRX_CEXT,
SK_PNMI_HRX_UTILUNDER,
SK_PNMI_HRX_UTILOVER,
SK_PNMI_HRX_64,
SK_PNMI_HRX_127,
SK_PNMI_HRX_255,
SK_PNMI_HRX_511,
SK_PNMI_HRX_1023,
SK_PNMI_HRX_MAX,
SK_PNMI_HRX_LONGFRAMES,
SK_PNMI_HRX_RESERVED,
SK_PNMI_MAX_IDX /* NOTE: Ensure SK_PNMI_CNT_NO is set to this value */
};
/*
* MAC specific data
*/
typedef struct s_PnmiStatAddr {
SK_BOOL GetOffset; /* TRUE: Call GetStatVal function */
SK_U16 Param; /* XMAC register containing value */
SK_U16 Reg; /* MAC register containing the value */
SK_BOOL GetOffset; /* TRUE: Offset managed by PNMI (call GetStatVal())*/
} SK_PNMI_STATADDR;
......@@ -338,11 +367,13 @@ typedef struct s_PnmiStatAddr {
/*
* Time macros
*/
#ifndef SK_PNMI_HUNDREDS_SEC
#if SK_TICKS_PER_SEC == 100
#define SK_PNMI_HUNDREDS_SEC(t) (t)
#else
#define SK_PNMI_HUNDREDS_SEC(t) ((((long)t) * 100) / (SK_TICKS_PER_SEC))
#endif
#define SK_PNMI_HUNDREDS_SEC(t) (((t) * 100) / (SK_TICKS_PER_SEC))
#endif /* !SK_TICKS_PER_SEC */
#endif /* !SK_PNMI_HUNDREDS_SEC */
/*
* Macros to work around alignment problems
......
This diff is collapsed.
/******************************************************************************
*
* Name: skgesirq.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.22 $
* Date: $Date: 2000/11/09 11:30:10 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.30 $
* Date: $Date: 2003/07/04 12:34:13 $
* Purpose: SK specific Gigabit Ethernet special IRQ functions
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2000 SysKonnect GmbH.
* (C)Copyright 1998-2002 SysKonnect.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -25,6 +26,35 @@
*
* History:
* $Log: skgesirq.h,v $
* Revision 1.30 2003/07/04 12:34:13 rschmidt
* Added SKERR_SIRQ_E025 for Downshift detected (Yukon-Copper)
*
* Revision 1.29 2003/05/28 15:14:49 rschmidt
* Moved defines for return codes of SkGePortCheckUp() to header file.
* Minor changes to avoid LINT warnings.
*
* Revision 1.28 2003/05/13 17:22:43 mkarl
* Editorial changes.
*
* Revision 1.27 2003/03/31 07:32:34 mkarl
* Corrected Copyright.
* Editorial changes.
*
* Revision 1.26 2002/10/14 09:52:36 rschmidt
* Added SKERR_SIRQ_E023 and SKERR_SIRQ_E024 for GPHY (Yukon)
* Editorial changes
*
* Revision 1.25 2002/07/15 18:15:52 rwahl
* Editorial changes.
*
* Revision 1.24 2002/07/15 15:39:21 rschmidt
* Corrected define for SKERR_SIRQ_E022
* Editorial changes
*
* Revision 1.23 2002/04/25 11:09:45 rschmidt
* Removed declarations for SkXmInitPhy(), SkXmRxTxEnable()
* Editorial changes
*
* Revision 1.22 2000/11/09 11:30:10 rassmann
* WA: Waiting after releasing reset until BCom chip is accessible.
*
......@@ -66,7 +96,7 @@
* defined in skgeinit.h now.
*
* Revision 1.9 1998/10/14 14:00:39 gklug
* add: eroor logs for init phys
* add: error logs for init phys
*
* Revision 1.8 1998/10/14 05:44:05 gklug
* add: E020
......@@ -100,10 +130,15 @@
#ifndef _INC_SKGESIRQ_H_
#define _INC_SKGESIRQ_H_
/* Define return codes of SkGePortCheckUp and CheckShort */
#define SK_HW_PS_NONE 0 /* No action needed */
#define SK_HW_PS_RESTART 1 /* Restart needed */
#define SK_HW_PS_LINK 2 /* Link Up actions needed */
/*
* Define the Event the special IRQ/INI module can handle
*/
#define SK_HWEV_WATIM 1 /* Timeout for WA errata #2 XMAC */
#define SK_HWEV_WATIM 1 /* Timeout for WA Errata #2 XMAC */
#define SK_HWEV_PORT_START 2 /* Port Start Event by RLMT */
#define SK_HWEV_PORT_STOP 3 /* Port Stop Event by RLMT */
#define SK_HWEV_CLEAR_STAT 4 /* Clear Statistics by PNMI */
......@@ -111,12 +146,13 @@
#define SK_HWEV_SET_LMODE 6 /* Set Link Mode by PNMI */
#define SK_HWEV_SET_FLOWMODE 7 /* Set Flow Control Mode by PNMI */
#define SK_HWEV_SET_ROLE 8 /* Set Master/Slave (Role) by PNMI */
#define SK_HWEV_HALFDUP_CHK 9 /* Set Master/Slave (Role) by PNMI */
#define SK_HWEV_SET_SPEED 9 /* Set Link Speed by PNMI */
#define SK_HWEV_HALFDUP_CHK 10 /* Half Duplex Hangup Workaround */
#define SK_WA_ACT_TIME (5000000L) /* 5 sec */
#define SK_WA_INA_TIME (100000L) /* 100 msec */
#define SK_WA_ACT_TIME (5000000UL) /* 5 sec */
#define SK_WA_INA_TIME (100000UL) /* 100 msec */
#define SK_HALFDUP_CHK_TIME (10000L) /* 10 msec */
#define SK_HALFDUP_CHK_TIME (10000UL) /* 10 msec */
/*
* Define the error numbers and messages
......@@ -128,9 +164,9 @@
#define SKERR_SIRQ_E003 (SKERR_SIRQ_E002+1)
#define SKERR_SIRQ_E003MSG "Packet timeout RX2"
#define SKERR_SIRQ_E004 (SKERR_SIRQ_E003+1)
#define SKERR_SIRQ_E004MSG "XMAC 1 not correctly initialized"
#define SKERR_SIRQ_E004MSG "MAC 1 not correctly initialized"
#define SKERR_SIRQ_E005 (SKERR_SIRQ_E004+1)
#define SKERR_SIRQ_E005MSG "XMAC 2 not correctly initialized"
#define SKERR_SIRQ_E005MSG "MAC 2 not correctly initialized"
#define SKERR_SIRQ_E006 (SKERR_SIRQ_E005+1)
#define SKERR_SIRQ_E006MSG "CHECK failure R1"
#define SKERR_SIRQ_E007 (SKERR_SIRQ_E006+1)
......@@ -160,16 +196,20 @@
#define SKERR_SIRQ_E019 (SKERR_SIRQ_E018+1)
#define SKERR_SIRQ_E019MSG "Parity error RX 2"
#define SKERR_SIRQ_E020 (SKERR_SIRQ_E019+1)
#define SKERR_SIRQ_E020MSG "XMAC transmit FIFO underrun"
#define SKERR_SIRQ_E020MSG "MAC transmit FIFO underrun"
#define SKERR_SIRQ_E021 (SKERR_SIRQ_E020+1)
#define SKERR_SIRQ_E021MSG "Spurious I2C interrupt"
#define SKERR_SIRQ_E022 (SKERR_SIRQ_E020+1)
#define SKERR_SIRQ_E021MSG "Spurious TWSI interrupt"
#define SKERR_SIRQ_E022 (SKERR_SIRQ_E021+1)
#define SKERR_SIRQ_E022MSG "Cable pair swap error"
#define SKERR_SIRQ_E023 (SKERR_SIRQ_E022+1)
#define SKERR_SIRQ_E023MSG "Auto-negotiation error"
#define SKERR_SIRQ_E024 (SKERR_SIRQ_E023+1)
#define SKERR_SIRQ_E024MSG "FIFO overflow error"
#define SKERR_SIRQ_E025 (SKERR_SIRQ_E024+1)
#define SKERR_SIRQ_E025MSG "2 Pair Downshift detected"
extern void SkGeSirqIsr(SK_AC *pAC, SK_IOC IoC, SK_U32 Istatus);
extern int SkGeSirqEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para);
extern void SkXmInitPhy( SK_AC *pAC, SK_IOC IoC, int Port, SK_BOOL DoLoop);
extern int SkXmRxTxEnable(SK_AC *pAC, SK_IOC IoC, int Port);
extern void SkHWLinkUp(SK_AC *pAC, SK_IOC IoC, int Port);
extern void SkHWLinkDown(SK_AC *pAC, SK_IOC IoC, int Port);
......
......@@ -2,17 +2,15 @@
*
* Name: ski2c.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.30 $
* Date: $Date: 2001/04/05 11:38:09 $
* Version: $Revision: 1.34 $
* Date: $Date: 2003/01/28 09:11:21 $
* Purpose: Defines to access Voltage and Temperature Sensor
* (taken from Monalisa (taken from Concentrator))
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2003 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
......@@ -28,6 +26,18 @@
* History:
*
* $Log: ski2c.h,v $
* Revision 1.34 2003/01/28 09:11:21 rschmidt
* Editorial changes
*
* Revision 1.33 2002/10/14 16:40:50 rschmidt
* Editorial changes (TWSI)
*
* Revision 1.32 2002/08/13 08:55:07 rschmidt
* Editorial changes
*
* Revision 1.31 2002/08/06 09:44:22 jschmalz
* Extensions and changes for Yukon
*
* Revision 1.30 2001/04/05 11:38:09 rassmann
* Set SenState to idle in SkI2cWaitIrq().
* Changed error message in SkI2cWaitIrq().
......@@ -142,11 +152,11 @@ typedef struct s_Sensor SK_SENSOR;
#include "h/skgei2c.h"
/*
* Define the I2c events.
* Define the I2C events.
*/
#define SK_I2CEV_IRQ 1 /* IRQ happened Event */
#define SK_I2CEV_TIM 2 /* Timeout event */
#define SK_I2CEV_CLEAR 3 /* Clear Mib Values */
#define SK_I2CEV_CLEAR 3 /* Clear MIB Values */
/*
* Define READ and WRITE Constants.
......@@ -154,24 +164,24 @@ typedef struct s_Sensor SK_SENSOR;
#define I2C_READ 0
#define I2C_WRITE 1
#define I2C_BURST 1
#define I2C_SIGLE 0
#define I2C_SINGLE 0
#define SKERR_I2C_E001 (SK_ERRBASE_I2C+0)
#define SKERR_I2C_E001MSG "Sensor index unknown"
#define SKERR_I2C_E002 (SKERR_I2C_E001+1)
#define SKERR_I2C_E002MSG "I2C: transfer does not complete.\n"
#define SKERR_I2C_E002MSG "TWSI: transfer does not complete"
#define SKERR_I2C_E003 (SKERR_I2C_E002+1)
#define SKERR_I2C_E003MSG "lm80: NAK on device send.\n"
#define SKERR_I2C_E003MSG "LM80: NAK on device send"
#define SKERR_I2C_E004 (SKERR_I2C_E003+1)
#define SKERR_I2C_E004MSG "lm80: NAK on register send.\n"
#define SKERR_I2C_E004MSG "LM80: NAK on register send"
#define SKERR_I2C_E005 (SKERR_I2C_E004+1)
#define SKERR_I2C_E005MSG "lm80: NAK on device (2) send.\n"
#define SKERR_I2C_E005MSG "LM80: NAK on device (2) send"
#define SKERR_I2C_E006 (SKERR_I2C_E005+1)
#define SKERR_I2C_E006MSG "Unknown event"
#define SKERR_I2C_E007 (SKERR_I2C_E006+1)
#define SKERR_I2C_E007MSG "LM80 read out of state"
#define SKERR_I2C_E008 (SKERR_I2C_E007+1)
#define SKERR_I2C_E008MSG "unexpected sensor read completed"
#define SKERR_I2C_E008MSG "Unexpected sensor read completed"
#define SKERR_I2C_E009 (SKERR_I2C_E008+1)
#define SKERR_I2C_E009MSG "WARNING: temperature sensor out of range"
#define SKERR_I2C_E010 (SKERR_I2C_E009+1)
......@@ -187,13 +197,14 @@ typedef struct s_Sensor SK_SENSOR;
#define SKERR_I2C_E015 (SKERR_I2C_E014+1)
#define SKERR_I2C_E015MSG "ERROR: fan sensor out of range"
#define SKERR_I2C_E016 (SKERR_I2C_E015+1)
#define SKERR_I2C_E016MSG "I2C: active transfer does not complete.\n"
#define SKERR_I2C_E016MSG "TWSI: active transfer does not complete"
/*
* Define Timeout values
*/
#define SK_I2C_TIM_LONG 2000000L /* 2 seconds */
#define SK_I2C_TIM_SHORT 100000L /* 100 milliseconds */
#define SK_I2C_TIM_WATCH 1000000L /* 1 second */
/*
* Define trap and error log hold times
......@@ -214,16 +225,19 @@ typedef struct s_Sensor SK_SENSOR;
/*
* Defines for SenType
*/
#define SK_SEN_UNKNOWN 0
#define SK_SEN_TEMP 1
#define SK_SEN_VOLT 2
#define SK_SEN_FAN 3
/*
* Define for the ErrorFlag
* Define for the SenErrorFlag
*/
#define SK_SEN_ERR_NOT_PRESENT 0 /* Error Flag: Sensor not present */
#define SK_SEN_ERR_OK 1 /* Error Flag: O.K. */
#define SK_SEN_ERR_WARN 2 /* Error Flag: Warning */
#define SK_SEN_ERR_ERR 3 /* Error Flag: Error */
#define SK_SEN_ERR_FAULTY 4 /* Error Flag: Faulty */
/*
* Define the Sensor struct
......@@ -233,11 +247,11 @@ struct s_Sensor {
int SenType; /* Voltage or Temperature */
SK_I32 SenValue; /* Current value of the sensor */
SK_I32 SenThreErrHigh; /* High error Threshhold of this sensor */
SK_I32 SenThreWarnHigh;/* High warning Threshhold of this sensor */
SK_I32 SenThreWarnHigh; /* High warning Threshhold of this sensor */
SK_I32 SenThreErrLow; /* Lower error Threshold of the sensor */
SK_I32 SenThreWarnLow; /* Lower warning Threshold of the sensor */
int SenErrFlag; /* Sensor indicated an error */
SK_BOOL SenInit; /* Is sensor initialized? */
SK_BOOL SenInit; /* Is sensor initialized ? */
SK_U64 SenErrCts; /* Error trap counter */
SK_U64 SenWarnCts; /* Warning trap counter */
SK_U64 SenBegErrTS; /* Begin error timestamp */
......@@ -247,17 +261,17 @@ struct s_Sensor {
SK_U64 SenLastWarnTrapTS; /* Last warning trap timestamp */
SK_U64 SenLastWarnLogTS; /* Last warning log timestamp */
int SenState; /* Sensor State (see HW specific include) */
int (*SenRead)(SK_AC *pAC, SK_IOC IoC,struct s_Sensor *pSen) ;
int (*SenRead)(SK_AC *pAC, SK_IOC IoC, struct s_Sensor *pSen);
/* Sensors read function */
SK_U16 SenReg; /* Register Address for this sensor */
SK_U8 SenDev; /* DeviceSelection for this sensor */
} ;
SK_U8 SenDev; /* Device Selection for this sensor */
};
typedef struct s_I2c {
SK_SENSOR SenTable[SK_MAX_SENSORS]; /* Sensor Table */
int CurrSens; /* Which sensor is currently queried */
int MaxSens; /* Max. number of sensors */
int TimerMode; /* Use the timer also to watch the state machine */
int InitLevel; /* Initialized Level */
#ifndef SK_DIAG
int DummyReads; /* Number of non-checked dummy reads */
......
/******************************************************************************
*
* Name: skqueue.h
* Project: Genesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.12 $
* Date: $Date: 1998/09/08 08:48:01 $
* Project: Gigabit Ethernet Adapters, Schedule-Modul
* Version: $Revision: 1.15 $
* Date: $Date: 2003/05/13 17:54:57 $
* Purpose: Defines for the Event queue
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,15 @@
* History:
*
* $Log: skqueue.h,v $
* Revision 1.15 2003/05/13 17:54:57 mkarl
* Editorial changes.
*
* Revision 1.14 2002/03/15 10:52:13 mkunz
* Added event classes for link aggregation
*
* Revision 1.13 1999/11/22 13:59:05 cgoos
* Changed license header to GPL.
*
* Revision 1.12 1998/09/08 08:48:01 gklug
* add: init level handling
*
......@@ -97,6 +97,12 @@
#define SKGE_CSUM 5 /* Checksum Event Class */
#define SKGE_HWAC 6 /* Hardware Access Event Class */
#define SKGE_SWT 9 /* Software Timer Event Class */
#define SKGE_LACP 10 /* LACP Aggregation Event Class */
#define SKGE_RSF 11 /* RSF Aggregation Event Class */
#define SKGE_MARKER 12 /* MARKER Aggregation Event Class */
#define SKGE_FD 13 /* FD Distributor Event Class */
/*
* define event queue as circular buffer
*/
......
......@@ -2,15 +2,16 @@
*
* Name: skrlmt.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.32 $
* Date: $Date: 2001/02/14 14:06:31 $
* Version: $Revision: 1.37 $
* Date: $Date: 2003/04/15 09:43:43 $
* Purpose: Header file for Redundant Link ManagemenT.
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2001 SysKonnect GmbH.
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* 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
......@@ -26,6 +27,21 @@
* History:
*
* $Log: skrlmt.h,v $
* Revision 1.37 2003/04/15 09:43:43 tschilli
* Copyright messages changed.
*
* Revision 1.36 2003/04/14 15:56:22 tschilli
* "#error C++ is not yet supported." removed.
*
* Revision 1.35 2003/01/31 14:12:41 mkunz
* single port adapter runs now with two identical MAC addresses
*
* Revision 1.34 2002/09/23 15:13:41 rwahl
* Editorial changes.
*
* Revision 1.33 2001/07/03 12:16:48 mkunz
* New Flag ChgBcPrio (Change priority of last broadcast received)
*
* Revision 1.32 2001/02/14 14:06:31 rassmann
* Editorial changes.
*
......@@ -160,7 +176,6 @@
#define __INC_SKRLMT_H
#ifdef __cplusplus
#error C++ is not yet supported.
extern "C" {
#endif /* cplusplus */
......@@ -283,6 +298,10 @@ unsigned *pNumBytes /* #Bytes to present to SK_RLMT_LOOKAHEAD */
_PortNum = (SK_U32)(PortNum); \
/* _pAC->Rlmt.Port[_PortNum].PacketsRx++; */ \
_pAC->Rlmt.Port[_PortNum].PacketsPerTimeSlot++; \
if (_pAC->Rlmt.RlmtOff) { \
*(pNumBytes) = 0; \
} \
else {\
if ((_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_TRANSPARENT) != 0) { \
*(pNumBytes) = 0; \
} \
......@@ -305,6 +324,7 @@ unsigned *pNumBytes /* #Bytes to present to SK_RLMT_LOOKAHEAD */
*(pOffset) = 0; \
} \
} \
} \
}
#if 0
......@@ -468,6 +488,7 @@ struct s_RlmtNet {
/* For PNMI */
SK_U32 ChgBcPrio; /* Change Priority of last broadcast received */
SK_U32 RlmtMode; /* Check ... */
SK_U32 ActivePort; /* Active port. */
SK_U32 Preference; /* 0xFFFFFFFF: Automatic. */
......@@ -501,8 +522,10 @@ typedef struct s_Rlmt {
/* ----- Private part ----- */
SK_BOOL CheckSwitch;
SK_U8 Align01;
SK_U16 Align02;
SK_BOOL RlmtOff; /* set to zero if the Mac addresses
are equal or the second one
is zero */
SK_U16 Align01;
} SK_RLMT;
......
/******************************************************************************
*
* Name: sktimer.h
* Project: Genesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.8 $
* Date: $Date: 1998/09/08 08:48:02 $
* Project: Gigabit Ethernet Adapters, Schedule-Modul
* Version: $Revision: 1.10 $
* Date: $Date: 2003/05/13 17:56:44 $
* Purpose: Defines for the timer functions
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,12 @@
* History:
*
* $Log: sktimer.h,v $
* Revision 1.10 2003/05/13 17:56:44 mkarl
* Editorial changes.
*
* Revision 1.9 1999/11/22 14:00:29 cgoos
* Changed license header to GPL.
*
* Revision 1.8 1998/09/08 08:48:02 gklug
* add: init level handling
*
......
......@@ -2,16 +2,15 @@
*
* Name: sktypes.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.2 $
* Date: $Date: 1999/11/22 14:01:58 $
* Version: $Revision: 1.3 $
* Date: $Date: 2003/02/25 14:16:40 $
* Purpose: Define data types for Linux
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2003 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: sktypes.h,v $
* Revision 1.3 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement
*
* Revision 1.2 1999/11/22 14:01:58 cgoos
* Changed license header to GPL.
* Now using Linux' fixed size types instead of standard types.
......
......@@ -2,16 +2,15 @@
*
* Name: version.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.1 $
* Date: $Date: 2001/03/06 09:25:00 $
* Version: $Revision: 1.4 $
* Date: $Date: 2003/02/25 14:16:40 $
* Purpose: SK specific Error log support
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2003 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
......@@ -26,6 +25,15 @@
*
* History:
* $Log: skversion.h,v $
* Revision 1.4 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement
*
* Revision 1.3 2003/02/25 13:30:18 mlindner
* Add: Support for various vendors
*
* Revision 1.1.2.1 2001/09/05 13:38:30 mlindner
* Removed FILE description
*
* Revision 1.1 2001/03/06 09:25:00 mlindner
* first version
*
......@@ -34,13 +42,13 @@
******************************************************************************/
static const char SysKonnectFileId[] = "@(#)" __FILE__ " (C) SysKonnect GmbH.";
static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
static const char SysKonnectBuildNumber[] =
"@(#)SK-BUILD: 4.06 PL: 01";
"@(#)SK-BUILD: 6.14 PL: 01";
#define BOOT_STRING "sk98lin: Network Device Driver v4.06\n" \
"Copyright (C) 2000-2001 SysKonnect GmbH."
#define BOOT_STRING "sk98lin: Network Device Driver v6.14\n" \
"(C)Copyright 1999-2003 Marvell(R)."
#define VER_STRING "4.06"
#define VER_STRING "6.14"
......@@ -2,16 +2,15 @@
*
* Name: skvpd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.9 $
* Date: $Date: 1999/11/22 14:02:27 $
* Version: $Revision: 1.15 $
* Date: $Date: 2003/01/13 10:39:38 $
* Purpose: Defines and Macros for VPD handling
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (C)Copyright 1998-2003 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,33 @@
* History:
*
* $Log: skvpd.h,v $
* Revision 1.15 2003/01/13 10:39:38 rschmidt
* Replaced define for PCI device Id for YUKON with GENESIS
* Editorial changes
*
* Revision 1.14 2002/11/14 15:18:10 gheinig
* Added const specifier to key and buf parameters for VpdPara,VpdRead
* and VpdWrite. This is necessary for the Diag 7 GUI API
*
* Revision 1.13 2002/10/14 15:58:18 rschmidt
* Added entry in rom_size struct s_vpd
* Editorial changes
*
* Revision 1.12 2002/09/09 14:43:51 mkarl
* added PCI Id of Yukon for reading VPD in diag before the adapter has
* been initialized
* editorial changes
*
* Revision 1.11 2002/07/26 13:19:16 mkarl
* added support for Yukon
* added vpd_size to VPD struct
*
* Revision 1.10 2000/08/10 11:29:07 rassmann
* Editorial changes.
* Preserving 32-bit alignment in structs for the adapter context.
* Removed unused function VpdWriteDword() (#if 0).
* Made VpdReadKeyword() available for SKDIAG only.
*
* Revision 1.9 1999/11/22 14:02:27 cgoos
* Changed license header to GPL.
*
......@@ -45,7 +71,7 @@
* Changed constants in SK_SWAP_32 to UL.
*
* Revision 1.4 1998/08/19 08:14:09 gklug
* fix: remove struct keyword as much as possible from the c-code (see CCC)
* fix: remove struct keyword as much as possible from the C-code (see CCC)
*
* Revision 1.3 1998/08/18 08:18:56 malthoff
* Modify VPD in and out macros for SK_DIAG
......@@ -99,6 +125,11 @@
/*
* Define READ and WRITE Constants.
*/
#define VPD_DEV_ID_GENESIS 0x4300
#define VPD_SIZE_YUKON 256
#define VPD_SIZE_GENESIS 512
#define VPD_SIZE 512
#define VPD_READ 0x0000
#define VPD_WRITE 0x8000
......@@ -122,33 +153,37 @@
* VPD structs
*/
typedef struct s_vpd_status {
unsigned short vpd_status ; /* VPD status, description see above */
int vpd_free_ro ; /* unused bytes in read only area */
int vpd_free_rw ; /* bytes available in read/write area */
unsigned short Align01; /* Alignment */
unsigned short vpd_status; /* VPD status, description see above */
int vpd_free_ro; /* unused bytes in read only area */
int vpd_free_rw; /* bytes available in read/write area */
} SK_VPD_STATUS;
typedef struct s_vpd {
SK_VPD_STATUS v ; /* VPD status structure */
char vpd_buf[VPD_SIZE] ; /* VPD buffer */
SK_VPD_STATUS v; /* VPD status structure */
char vpd_buf[VPD_SIZE]; /* VPD buffer */
int rom_size; /* VPD ROM Size from PCI_OUR_REG_2 */
int vpd_size; /* saved VPD-size */
} SK_VPD;
typedef struct s_vpd_para {
unsigned int p_len ; /* parameter length */
char *p_val ; /* points to the value */
unsigned int p_len; /* parameter length */
char *p_val; /* points to the value */
} SK_VPD_PARA;
/*
* structure of Large Resource Type Identifiers
*/
/* was removed, because of alignment problems */
/* was removed because of alignment problems */
/*
* sturcture of VPD keywords
* structure of VPD keywords
*/
typedef struct s_vpd_key {
char p_key[2] ; /* 2 bytes ID string */
unsigned char p_len ; /* 1 byte length */
char p_val ; /* start of the value string */
char p_key[2]; /* 2 bytes ID string */
unsigned char p_len; /* 1 byte length */
char p_val; /* start of the value string */
} SK_VPD_KEY;
......@@ -174,37 +209,37 @@ typedef struct s_vpd_key {
#else /* SKDIAG */
#define VPD_OUT8(pAC,Ioc,Addr,Val) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciWriteCfgByte(pAC,Addr,Val) ; \
SkPciWriteCfgByte(pAC,Addr,Val); \
else \
SK_OUT8(pAC,PCI_C(Addr),Val); \
}
#define VPD_OUT16(pAC,Ioc,Addr,Val) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciWriteCfgWord(pAC,Addr,Val) ; \
SkPciWriteCfgWord(pAC,Addr,Val); \
else \
SK_OUT16(pAC,PCI_C(Addr),Val); \
}
#define VPD_OUT32(pAC,Ioc,Addr,Val) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciWriteCfgDWord(pAC,Addr,Val) ; \
SkPciWriteCfgDWord(pAC,Addr,Val); \
else \
SK_OUT32(pAC,PCI_C(Addr),Val); \
}
#define VPD_IN8(pAC,Ioc,Addr,pVal) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciReadCfgByte(pAC,Addr,pVal) ; \
SkPciReadCfgByte(pAC,Addr,pVal); \
else \
SK_IN8(pAC,PCI_C(Addr),pVal); \
}
#define VPD_IN16(pAC,Ioc,Addr,pVal) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciReadCfgWord(pAC,Addr,pVal) ; \
SkPciReadCfgWord(pAC,Addr,pVal); \
else \
SK_IN16(pAC,PCI_C(Addr),pVal); \
}
#define VPD_IN32(pAC,Ioc,Addr,pVal) { \
if ((pAC)->DgT.DgUseCfgCycle) \
SkPciReadCfgDWord(pAC,Addr,pVal) ; \
SkPciReadCfgDWord(pAC,Addr,pVal); \
else \
SK_IN32(pAC,PCI_C(Addr),pVal); \
}
......@@ -213,50 +248,52 @@ typedef struct s_vpd_key {
/* function prototypes ********************************************************/
#ifndef SK_KR_PROTO
#ifdef SKDIAG
extern SK_U32 VpdReadDWord(
SK_AC *pAC,
SK_IOC IoC,
int addr) ;
int addr);
#endif /* SKDIAG */
extern int VpdSetupPara(
SK_AC *pAC,
char *key,
char *buf,
const char *key,
const char *buf,
int len,
int type,
int op) ;
int op);
extern SK_VPD_STATUS *VpdStat(
SK_AC *pAC,
SK_IOC IoC) ;
SK_IOC IoC);
extern int VpdKeys(
SK_AC *pAC,
SK_IOC IoC,
char *buf,
int *len,
int *elements) ;
int *elements);
extern int VpdRead(
SK_AC *pAC,
SK_IOC IoC,
char *key,
const char *key,
char *buf,
int *len) ;
int *len);
extern SK_BOOL VpdMayWrite(
char *key) ;
char *key);
extern int VpdWrite(
SK_AC *pAC,
SK_IOC IoC,
char *key,
char *buf) ;
const char *key,
const char *buf);
extern int VpdDelete(
SK_AC *pAC,
SK_IOC IoC,
char *key) ;
char *key);
extern int VpdUpdate(
SK_AC *pAC,
......@@ -265,7 +302,7 @@ extern int VpdUpdate(
extern void VpdErrLog(
SK_AC *pAC,
SK_IOC IoC,
char *msg) ;
char *msg);
#ifdef SKDIAG
extern int VpdReadBlock(
......@@ -273,26 +310,26 @@ extern int VpdReadBlock(
SK_IOC IoC,
char *buf,
int addr,
int len) ;
int len);
extern int VpdWriteBlock(
SK_AC *pAC,
SK_IOC IoC,
char *buf,
int addr,
int len) ;
int len);
#endif /* SKDIAG */
#else /* SK_KR_PROTO */
extern SK_U32 VpdReadDWord() ;
extern int VpdSetupPara() ;
extern SK_VPD_STATUS *VpdStat() ;
extern int VpdKeys() ;
extern int VpdRead() ;
extern SK_BOOL VpdMayWrite() ;
extern int VpdWrite() ;
extern int VpdDelete() ;
extern int VpdUpdate() ;
extern void VpdErrLog() ;
extern SK_U32 VpdReadDWord();
extern int VpdSetupPara();
extern SK_VPD_STATUS *VpdStat();
extern int VpdKeys();
extern int VpdRead();
extern SK_BOOL VpdMayWrite();
extern int VpdWrite();
extern int VpdDelete();
extern int VpdUpdate();
extern void VpdErrLog();
#endif /* SK_KR_PROTO */
#endif /* __INC_SKVPD_H_ */
This diff is collapsed.
This diff is collapsed.
......@@ -2,15 +2,15 @@
*
* Name: skcsum.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.8 $
* Date: $Date: 2001/02/06 11:15:36 $
* Version: $Revision: 1.11 $
* Date: $Date: 2003/03/11 14:05:55 $
* Purpose: Store/verify Internet checksum in send/receive packets.
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998-2001 SysKonnect GmbH.
* (C)Copyright 1998-2003 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
......@@ -26,6 +26,19 @@
* History:
*
* $Log: skcsum.c,v $
* Revision 1.11 2003/03/11 14:05:55 rschmidt
* Replaced memset() by macro SK_MEMSET()
* Editorial changes
*
* Revision 1.10 2002/04/11 10:02:04 rwahl
* Fix in SkCsGetSendInfo():
* - function did not return ProtocolFlags in every case.
* - pseudo header csum calculated wrong for big endian.
*
* Revision 1.9 2001/06/13 07:42:08 gklug
* fix: NetNumber was wrong in CLEAR_STAT event
* add: check for good NetNumber in Clear STAT
*
* Revision 1.8 2001/02/06 11:15:36 rassmann
* Supporting two nets on dual-port adapters.
*
......@@ -64,9 +77,8 @@
#ifdef SK_USE_CSUM /* Check if CSUM is to be used. */
#ifndef lint
static const char SysKonnectFileId[] = "@(#)"
"$Id: skcsum.c,v 1.8 2001/02/06 11:15:36 rassmann Exp $"
" (C) SysKonnect.";
static const char SysKonnectFileId[] =
"@(#) $Id: skcsum.c,v 1.11 2003/03/11 14:05:55 rschmidt Exp $ (C) SysKonnect.";
#endif /* !lint */
/******************************************************************************
......@@ -164,7 +176,7 @@ static const char SysKonnectFileId[] = "@(#)"
* little/big endian conversion on little endian machines only.
*/
#ifdef SK_LITTLE_ENDIAN
#define SKCS_HTON16(Val16) (((unsigned) (Val16) >> 8) | (((Val16) & 0xFF) << 8))
#define SKCS_HTON16(Val16) (((unsigned) (Val16) >> 8) | (((Val16) & 0xff) << 8))
#endif /* SK_LITTLE_ENDIAN */
#ifdef SK_BIG_ENDIAN
#define SKCS_HTON16(Val16) (Val16)
......@@ -195,7 +207,7 @@ static const char SysKonnectFileId[] = "@(#)"
* zero.)
*
* Note:
* There is a bug in the ASIC which may lead to wrong checksums.
* There is a bug in the GENESIS ASIC which may lead to wrong checksums.
*
* Arguments:
* pAc - A pointer to the adapter context struct.
......@@ -411,7 +423,7 @@ int NetNumber) /* Net number */
SKCS_OFS_IP_DESTINATION_ADDRESS + 0) +
(unsigned long) *(SK_U16 *) SKCS_IDX(pIpHeader,
SKCS_OFS_IP_DESTINATION_ADDRESS + 2) +
(unsigned long) (NextLevelProtocol << 8) +
(unsigned long) SKCS_HTON16(NextLevelProtocol) +
(unsigned long) SKCS_HTON16(IpDataLength);
/* Add-in any carries. */
......@@ -422,6 +434,7 @@ int NetNumber) /* Net number */
SKCS_OC_ADD(pPacketInfo->PseudoHeaderChecksum, PseudoHeaderChecksum, 0);
pPacketInfo->ProtocolFlags = ProtocolFlags;
NextLevelProtoStats->TxOkCts++; /* Success. */
} /* SkCsGetSendInfo */
......@@ -593,7 +606,7 @@ int NetNumber) /* Net number */
NextLevelProtocol = *(SK_U8 *)
SKCS_IDX(pIpHeader, SKCS_OFS_IP_NEXT_LEVEL_PROTOCOL);
if (IpHeaderChecksum != 0xFFFF) {
if (IpHeaderChecksum != 0xffff) {
pAc->Csum.ProtoStats[NetNumber][SKCS_PROTO_STATS_IP].RxErrCts++;
/* the NDIS tester wants to know the upper level protocol too */
if (NextLevelProtocol == SKCS_PROTO_ID_TCP) {
......@@ -711,7 +724,7 @@ int NetNumber) /* Net number */
/* Check if the TCP/UDP checksum is ok. */
if ((unsigned) NextLevelProtocolChecksum == 0xFFFF) {
if ((unsigned) NextLevelProtocolChecksum == 0xffff) {
/* TCP/UDP checksum ok. */
......@@ -889,14 +902,16 @@ SK_EVPARA Param) /* Event dependent parameter. */
*/
case SK_CSUM_EVENT_CLEAR_PROTO_STATS:
ProtoIndex = (int)Param.Para32[0];
NetNumber = (int)Param.Para32[1];
ProtoIndex = (int)Param.Para32[1];
NetNumber = (int)Param.Para32[0];
if (ProtoIndex < 0) { /* Clear for all protocols. */
memset(&pAc->Csum.ProtoStats[NetNumber][0], 0,
if (NetNumber >= 0) {
SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][0], 0,
sizeof(pAc->Csum.ProtoStats[NetNumber]));
}
}
else { /* Clear for individual protocol. */
memset(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0,
SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0,
sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex]));
}
break;
......
This diff is collapsed.
This diff is collapsed.
/******************************************************************************
*
* Name: skgehwt.c
* Project: PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.12 $
* Date: $Date: 1998/10/15 15:11:34 $
* Project: Gigabit Ethernet Adapters, Common Modules
* Version: $Revision: 1.14 $
* Date: $Date: 2003/05/13 18:01:58 $
* Purpose: Hardware Timer.
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,12 @@
* History:
*
* $Log: skgehwt.c,v $
* Revision 1.14 2003/05/13 18:01:58 mkarl
* Editorial changes.
*
* Revision 1.13 1999/11/22 13:31:12 cgoos
* Changed license header to GPL.
*
* Revision 1.12 1998/10/15 15:11:34 gklug
* fix: ID_sccs to SysKonnectFileId
*
......@@ -61,14 +58,14 @@
* fix: chg pAc -> pAC
*
* Revision 1.4 1998/08/10 14:14:52 gklug
* rmv: unnecessary SK_ADDR macro
* rmv: unneccessary SK_ADDR macro
*
* Revision 1.3 1998/08/07 12:53:44 gklug
* fix: first compiled version
*
* Revision 1.2 1998/08/07 09:19:29 gklug
* adapt functions to the C coding conventions
* rmv unnecessary functions.
* rmv unneccessary functions.
*
* Revision 1.1 1998/08/05 11:28:36 gklug
* first version: adapted from SMT/FDDI
......@@ -82,8 +79,10 @@
/*
Event queue and dispatcher
*/
#if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
static const char SysKonnectFileId[] =
"$Header: /usr56/projects/ge/schedule/skgehwt.c,v 1.12 1998/10/15 15:11:34 gklug Exp $" ;
"$Header: /usr56/projects/ge/schedule/skgehwt.c,v 1.14 2003/05/13 18:01:58 mkarl Exp $" ;
#endif
#include "h/skdrv1st.h" /* Driver Specific Definitions */
#include "h/skdrv2nd.h" /* Adapter Control- and Driver specific Def. */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,16 +2,15 @@
*
* Name: sklm80.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.17 $
* Date: $Date: 1999/11/22 13:35:51 $
* Version: $Revision: 1.20 $
* Date: $Date: 2002/08/13 09:16:27 $
* Purpose: Funktions to access Voltage and Temperature Sensor (LM80)
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1998,1999 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* (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
......@@ -27,6 +26,16 @@
* History:
*
* $Log: sklm80.c,v $
* Revision 1.20 2002/08/13 09:16:27 rschmidt
* Changed return value for SkLm80ReadSensor() back to 'int'
* Editorial changes
*
* Revision 1.19 2002/08/06 09:43:31 jschmalz
* Extensions and changes for Yukon
*
* Revision 1.18 2002/08/02 12:26:57 rschmidt
* Editorial changes
*
* Revision 1.17 1999/11/22 13:35:51 cgoos
* Changed license header to GPL.
*
......@@ -93,7 +102,7 @@
LM80 functions
*/
static const char SysKonnectFileId[] =
"$Id: sklm80.c,v 1.17 1999/11/22 13:35:51 cgoos Exp $" ;
"$Id: sklm80.c,v 1.20 2002/08/13 09:16:27 rschmidt Exp $" ;
#include "h/skdrv1st.h" /* Driver Specific Definitions */
#include "h/lm80.h"
......@@ -107,7 +116,7 @@ static const char SysKonnectFileId[] =
#ifdef SK_DIAG
/*
* read the regeister 'reg' from the device 'device'
* read the register 'Reg' from the device 'Dev'
*
* return read error -1
* success the read value
......@@ -134,9 +143,9 @@ int Reg) /* register to read */
return(-1);
}
switch(Reg) {
switch (Reg) {
case LM80_TEMP_IN:
Val = (int)SkI2cRcvByte(IoC, 1) ;
Val = (int)SkI2cRcvByte(IoC, 1);
/* First: correct the value: it might be negative */
if ((Val & 0x80) != 0) {
......@@ -145,7 +154,9 @@ int Reg) /* register to read */
}
Val = Val * SK_LM80_TEMP_LSB;
SkI2cStop(IoC);
TempExt = (int) SkLm80RcvReg(IoC,LM80_ADDR,LM80_TEMP_CTRL);
TempExt = (int)SkLm80RcvReg(IoC, LM80_ADDR, LM80_TEMP_CTRL);
if (Val > 0) {
Val += ((TempExt >> 7) * SK_LM80_TEMPEXT_LSB);
}
......@@ -158,10 +169,11 @@ int Reg) /* register to read */
case LM80_VT1_IN:
case LM80_VT2_IN:
case LM80_VT3_IN:
Val = (int) SkI2cRcvByte(IoC, 1) * SK_LM80_VT_LSB;
Val = (int)SkI2cRcvByte(IoC, 1) * SK_LM80_VT_LSB;
break;
default:
Val = (int) SkI2cRcvByte(IoC, 1);
Val = (int)SkI2cRcvByte(IoC, 1);
break;
}
......@@ -173,30 +185,32 @@ int Reg) /* register to read */
/*
* read a sensors value (LM80 specific)
*
* This function reads a sensors value from the I2c sensor chip LM80. The
* sensor is defined by its index into the sensors database in the struct
* This function reads a sensors value from the I2C sensor chip LM80.
* The sensor is defined by its index into the sensors database in the struct
* pAC points to.
*
* Returns 1 if the read is completed
* 0 if the read must be continued (I2c Bus still allocated)
* 0 if the read must be continued (I2C Bus still allocated)
*/
int SkLm80ReadSensor(
SK_AC *pAC, /* Adapter Context */
SK_IOC IoC, /* IoContext needed in level 1 and 2 */
SK_IOC IoC, /* I/O Context needed in level 1 and 2 */
SK_SENSOR *pSen) /* Sensor to be read */
{
SK_I32 Value;
switch(pSen->SenState) {
switch (pSen->SenState) {
case SK_SEN_IDLE:
/* Send address to ADDR register */
SK_I2C_CTL(IoC,I2C_READ,pSen->SenDev,pSen->SenReg,0);
SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, pSen->SenReg, 0);
pSen->SenState = SK_SEN_VALUE ;
BREAK_OR_WAIT(pAC, IoC, I2C_READ) ;
BREAK_OR_WAIT(pAC, IoC, I2C_READ);
case SK_SEN_VALUE:
/* Read value from data register */
SK_IN32(IoC,B2_I2C_DATA, ((SK_U32 *)&Value));
SK_IN32(IoC, B2_I2C_DATA, ((SK_U32 *)&Value));
Value &= 0xff; /* only least significant byte is valid */
/* Do NOT check the Value against the thresholds */
......@@ -228,10 +242,9 @@ SK_SENSOR *pSen) /* Sensor to be read */
Value = Value - 256;
}
/* We have a temperature sensor and need to get the signed
* extension. For now we get the extension from the last
* reading, so in the normal case we won't see flickering
* temperatures.
/* We have a temperature sensor and need to get the signed extension.
* For now we get the extension from the last reading, so in the normal
* case we won't see flickering temperatures.
*/
pSen->SenValue = (Value * SK_LM80_TEMP_LSB) +
(pSen->SenValue % SK_LM80_TEMP_LSB);
......@@ -240,32 +253,34 @@ SK_SENSOR *pSen) /* Sensor to be read */
SK_I2C_CTL(IoC, I2C_READ, pSen->SenDev, LM80_TEMP_CTRL, 0);
pSen->SenState = SK_SEN_VALEXT ;
BREAK_OR_WAIT(pAC, IoC, I2C_READ) ;
BREAK_OR_WAIT(pAC, IoC, I2C_READ);
case SK_SEN_VALEXT:
/* Read value from data register */
SK_IN32(IoC,B2_I2C_DATA,((SK_U32 *)&Value));
SK_IN32(IoC, B2_I2C_DATA, ((SK_U32 *)&Value));
Value &= LM80_TEMP_LSB_9; /* only bit 7 is valid */
/* cut the LSB bit */
pSen->SenValue = ((pSen->SenValue / SK_LM80_TEMP_LSB) *
SK_LM80_TEMP_LSB) ;
SK_LM80_TEMP_LSB);
if (pSen->SenValue < 0) {
/* Value negative: The bit value must be subtracted */
pSen->SenValue -= ((Value >> 7) * SK_LM80_TEMPEXT_LSB);
} else {
}
else {
/* Value positive: The bit value must be added */
pSen->SenValue += ((Value >> 7) * SK_LM80_TEMPEXT_LSB);
}
pSen->SenState = SK_SEN_IDLE ;
return(1);
default:
SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E007,
SKERR_I2C_E007MSG) ;
SK_ERR_LOG(pAC, SK_ERRCL_SW, SKERR_I2C_E007, SKERR_I2C_E007MSG);
return(1);
}
/* Not completed */
return(0) ;
return(0);
}
This diff is collapsed.
/******************************************************************************
*
* Name: skqueue.c
* Project: PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.14 $
* Date: $Date: 1998/10/15 15:11:35 $
* Project: Gigabit Ethernet Adapters, Schedule-Modul
* Version: $Revision: 1.19 $
* Date: $Date: 2003/05/13 18:00:07 $
* Purpose: Management of an event queue.
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,22 @@
* History:
*
* $Log: skqueue.c,v $
* Revision 1.19 2003/05/13 18:00:07 mkarl
* Removed calls to RLMT, TWSI, and PNMI for SLIM driver (SK_SLIM).
* Editorial changes.
*
* Revision 1.18 2002/05/07 14:11:11 rwahl
* Fixed Watcom Precompiler error.
*
* Revision 1.17 2002/03/25 10:06:41 mkunz
* SkIgnoreEvent deleted
*
* Revision 1.16 2002/03/15 10:51:59 mkunz
* Added event classes for link aggregation
*
* Revision 1.15 1999/11/22 13:36:29 cgoos
* Changed license header to GPL.
*
* Revision 1.14 1998/10/15 15:11:35 gklug
* fix: ID_sccs to SysKonnectFileId
*
......@@ -87,8 +94,10 @@
/*
Event queue and dispatcher
*/
#if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
static const char SysKonnectFileId[] =
"$Header: /usr56/projects/ge/schedule/skqueue.c,v 1.14 1998/10/15 15:11:35 gklug Exp $" ;
"$Header: /usr56/projects/ge/schedule/skqueue.c,v 1.19 2003/05/13 18:00:07 mkarl Exp $" ;
#endif
#include "h/skdrv1st.h" /* Driver Specific Definitions */
#include "h/skqueue.h" /* Queue Definitions */
......@@ -153,7 +162,7 @@ SK_EVPARA Para) /* Event parameter */
* send command to state machine
* end
* return error reported by individual Event function
* 0 if no error occurred.
* 0 if no error occured.
*/
int SkEventDispatcher(
SK_AC *pAC, /* Adapters Context */
......@@ -168,9 +177,8 @@ SK_IOC Ioc) /* Io context */
while (pEv != pAC->Event.EvPut) {
PRINTF("dispatch Class %d Event %d\n",pEv->Class,pEv->Event) ;
switch(Class = pEv->Class) {
case SKGE_DRV : /* Driver Event */
Rtv = SkDrvEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#ifndef SK_USE_LAC_EV
#ifndef SK_SLIM
case SKGE_RLMT : /* RLMT Event */
Rtv = SkRlmtEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
......@@ -180,9 +188,34 @@ SK_IOC Ioc) /* Io context */
case SKGE_PNMI :
Rtv = SkPnmiEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#endif /* not SK_SLIM */
#endif /* not SK_USE_LAC_EV */
case SKGE_DRV : /* Driver Event */
Rtv = SkDrvEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#ifndef SK_USE_SW_TIMER
case SKGE_HWAC :
Rtv = SkGeSirqEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#else /* !SK_USE_SW_TIMER */
case SKGE_SWT :
Rtv = SkSwtEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#endif /* !SK_USE_SW_TIMER */
#ifdef SK_USE_LAC_EV
case SKGE_LACP :
Rtv = SkLacpEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
case SKGE_RSF :
Rtv = SkRsfEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
case SKGE_MARKER :
Rtv = SkMarkerEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
case SKGE_FD :
Rtv = SkFdEvent(pAC,Ioc,pEv->Event,pEv->Para);
break ;
#endif /* SK_USE_LAC_EV */
#ifdef SK_USE_CSUM
case SKGE_CSUM :
Rtv = SkCsEvent(pAC,Ioc,pEv->Event,pEv->Para);
......
This diff is collapsed.
/******************************************************************************
*
* Name: sktimer.c
* Project: PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.11 $
* Date: $Date: 1998/12/17 13:24:13 $
* Project: Gigabit Ethernet Adapters, Schedule-Modul
* Version: $Revision: 1.13 $
* Date: $Date: 2003/05/13 18:01:01 $
* Purpose: High level timer functions.
*
******************************************************************************/
/******************************************************************************
*
* (C)Copyright 1989-1998 SysKonnect,
* a business unit of Schneider & Koch & Co. Datensysteme GmbH.
* All Rights Reserved
* (C)Copyright 1998-2002 SysKonnect GmbH.
* (C)Copyright 2002-2003 Marvell.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
* The copyright notice above does not evidence any
* actual or intended publication of such source code.
* 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.
*
* This Module contains Proprietary Information of SysKonnect
* and should be treated as Confidential.
*
* The information in this file is provided for the exclusive use of
* the licensees of SysKonnect.
* Such users have the right to use, modify, and incorporate this code
* into products for purposes authorized by the license agreement
* provided they include this notice and the associated copyright notice
* with any such product.
* The information in this file is provided "AS IS" without warranty.
*
******************************************************************************/
......@@ -36,6 +27,12 @@
* History:
*
* $Log: sktimer.c,v $
* Revision 1.13 2003/05/13 18:01:01 mkarl
* Editorial changes.
*
* Revision 1.12 1999/11/22 13:38:51 cgoos
* Changed license header to GPL.
*
* Revision 1.11 1998/12/17 13:24:13 gklug
* fix: restart problem: do NOT destroy timer queue if init 1 is done
*
......@@ -81,8 +78,10 @@
/*
Event queue and dispatcher
*/
#if (defined(DEBUG) || ((!defined(LINT)) && (!defined(SK_SLIM))))
static const char SysKonnectFileId[] =
"$Header: /usr56/projects/ge/schedule/sktimer.c,v 1.11 1998/12/17 13:24:13 gklug Exp $" ;
"$Header: /usr56/projects/ge/schedule/sktimer.c,v 1.13 2003/05/13 18:01:01 mkarl Exp $" ;
#endif
#include "h/skdrv1st.h" /* Driver Specific Definitions */
#include "h/skdrv2nd.h" /* Adapter Control- and Driver specific Def. */
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment