Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
This commit is contained in:
179
drivers/net/sk98lin/h/lm80.h
Normal file
179
drivers/net/sk98lin/h/lm80.h
Normal file
@@ -0,0 +1,179 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: lm80.h
|
||||
* 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).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_LM80_H
|
||||
#define __INC_LM80_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
/*
|
||||
* LM80 register definition
|
||||
*
|
||||
* All registers are 8 bit wide
|
||||
*/
|
||||
#define LM80_CFG 0x00 /* Configuration Register */
|
||||
#define LM80_ISRC_1 0x01 /* Interrupt Status Register 1 */
|
||||
#define LM80_ISRC_2 0x02 /* Interrupt Status Register 2 */
|
||||
#define LM80_IMSK_1 0x03 /* Interrupt Mask Register 1 */
|
||||
#define LM80_IMSK_2 0x04 /* Interrupt Mask Register 2 */
|
||||
#define LM80_FAN_CTRL 0x05 /* Fan Devisor/RST#/OS# Register */
|
||||
#define LM80_TEMP_CTRL 0x06 /* OS# Config, Temp Res. Reg */
|
||||
/* 0x07 - 0x1f reserved */
|
||||
/* current values */
|
||||
#define LM80_VT0_IN 0x20 /* current Voltage 0 value */
|
||||
#define LM80_VT1_IN 0x21 /* current Voltage 1 value */
|
||||
#define LM80_VT2_IN 0x22 /* current Voltage 2 value */
|
||||
#define LM80_VT3_IN 0x23 /* current Voltage 3 value */
|
||||
#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_FAN1_IN 0x28 /* current Fan 1 count */
|
||||
#define LM80_FAN2_IN 0x29 /* current Fan 2 count */
|
||||
/* limit values */
|
||||
#define LM80_VT0_HIGH_LIM 0x2a /* high limit val for Voltage 0 */
|
||||
#define LM80_VT0_LOW_LIM 0x2b /* low limit val for Voltage 0 */
|
||||
#define LM80_VT1_HIGH_LIM 0x2c /* high limit val for Voltage 1 */
|
||||
#define LM80_VT1_LOW_LIM 0x2d /* low limit val for Voltage 1 */
|
||||
#define LM80_VT2_HIGH_LIM 0x2e /* high limit val for Voltage 2 */
|
||||
#define LM80_VT2_LOW_LIM 0x2f /* low limit val for Voltage 2 */
|
||||
#define LM80_VT3_HIGH_LIM 0x30 /* high limit val for Voltage 3 */
|
||||
#define LM80_VT3_LOW_LIM 0x31 /* low limit val for Voltage 3 */
|
||||
#define LM80_VT4_HIGH_LIM 0x32 /* high limit val for Voltage 4 */
|
||||
#define LM80_VT4_LOW_LIM 0x33 /* low limit val for Voltage 4 */
|
||||
#define LM80_VT5_HIGH_LIM 0x34 /* high limit val for Voltage 5 */
|
||||
#define LM80_VT5_LOW_LIM 0x35 /* low limit val for Voltage 5 */
|
||||
#define LM80_VT6_HIGH_LIM 0x36 /* high limit val for Voltage 6 */
|
||||
#define LM80_VT6_LOW_LIM 0x37 /* low limit val for Voltage 6 */
|
||||
#define LM80_THOT_LIM_UP 0x38 /* hot temperature limit (high) */
|
||||
#define LM80_THOT_LIM_LO 0x39 /* hot temperature limit (low) */
|
||||
#define LM80_TOS_LIM_UP 0x3a /* OS temperature limit (high) */
|
||||
#define LM80_TOS_LIM_LO 0x3b /* OS temperature limit (low) */
|
||||
#define LM80_FAN1_COUNT_LIM 0x3c /* Fan 1 count limit (high) */
|
||||
#define LM80_FAN2_COUNT_LIM 0x3d /* Fan 2 count limit (low) */
|
||||
/* 0x3e - 0x3f reserved */
|
||||
|
||||
/*
|
||||
* LM80 bit definitions
|
||||
*/
|
||||
|
||||
/* LM80_CFG Configuration Register */
|
||||
#define LM80_CFG_START (1<<0) /* start monitoring operation */
|
||||
#define LM80_CFG_INT_ENA (1<<1) /* enables the INT# Interrupt output */
|
||||
#define LM80_CFG_INT_POL (1<<2) /* INT# pol: 0 act low, 1 act high */
|
||||
#define LM80_CFG_INT_CLR (1<<3) /* disables INT#/RST_OUT#/OS# outputs */
|
||||
#define LM80_CFG_RESET (1<<4) /* signals a reset */
|
||||
#define LM80_CFG_CHASS_CLR (1<<5) /* clears Chassis Intrusion (CI) pin */
|
||||
#define LM80_CFG_GPO (1<<6) /* drives the GPO# pin */
|
||||
#define LM80_CFG_INIT (1<<7) /* restore power on defaults */
|
||||
|
||||
/* LM80_ISRC_1 Interrupt Status Register 1 */
|
||||
/* LM80_IMSK_1 Interrupt Mask Register 1 */
|
||||
#define LM80_IS_VT0 (1<<0) /* limit exceeded for Voltage 0 */
|
||||
#define LM80_IS_VT1 (1<<1) /* limit exceeded for Voltage 1 */
|
||||
#define LM80_IS_VT2 (1<<2) /* limit exceeded for Voltage 2 */
|
||||
#define LM80_IS_VT3 (1<<3) /* limit exceeded for Voltage 3 */
|
||||
#define LM80_IS_VT4 (1<<4) /* limit exceeded for Voltage 4 */
|
||||
#define LM80_IS_VT5 (1<<5) /* limit exceeded for Voltage 5 */
|
||||
#define LM80_IS_VT6 (1<<6) /* limit exceeded for Voltage 6 */
|
||||
#define LM80_IS_INT_IN (1<<7) /* state of INT_IN# */
|
||||
|
||||
/* LM80_ISRC_2 Interrupt Status Register 2 */
|
||||
/* LM80_IMSK_2 Interrupt Mask Register 2 */
|
||||
#define LM80_IS_TEMP (1<<0) /* HOT temperature limit exceeded */
|
||||
#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 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 */
|
||||
#define LM80_IS_OT_IRQ_MD (1<<7) /* OS temperature interrupt mode */
|
||||
|
||||
/* LM80_FAN_CTRL Fan Devisor/RST#/OS# Register */
|
||||
#define LM80_FAN1_MD_SEL (1<<0) /* Fan 1 mode select */
|
||||
#define LM80_FAN2_MD_SEL (1<<1) /* Fan 2 mode select */
|
||||
#define LM80_FAN1_PRM_CTL (3<<2) /* Fan 1 speed control */
|
||||
#define LM80_FAN2_PRM_CTL (3<<4) /* Fan 2 speed control */
|
||||
#define LM80_FAN_OS_ENA (1<<6) /* enable OS mode on RST_OUT#/OS# pins*/
|
||||
#define LM80_FAN_RST_ENA (1<<7) /* sets RST_OUT#/OS# pins in RST mode */
|
||||
|
||||
/* LM80_TEMP_CTRL OS# Config, Temp Res. Reg */
|
||||
#define LM80_TEMP_OS_STAT (1<<0) /* mirrors the state of RST_OUT#/OS# */
|
||||
#define LM80_TEMP_OS_POL (1<<1) /* select OS# polarity */
|
||||
#define LM80_TEMP_OS_MODE (1<<2) /* selects Interrupt mode */
|
||||
#define LM80_TEMP_RES (1<<3) /* selects 9 or 11 bit temp resulution*/
|
||||
#define LM80_TEMP_LSB (0xf<<4)/* 4 LSBs of 11 bit temp data */
|
||||
#define LM80_TEMP_LSB_9 (1<<7) /* LSB of 9 bit temperature data */
|
||||
|
||||
/* 0x07 - 0x1f reserved */
|
||||
/* LM80_VT0_IN current Voltage 0 value */
|
||||
/* LM80_VT1_IN current Voltage 1 value */
|
||||
/* LM80_VT2_IN current Voltage 2 value */
|
||||
/* LM80_VT3_IN current Voltage 3 value */
|
||||
/* LM80_VT4_IN current Voltage 4 value */
|
||||
/* LM80_VT5_IN current Voltage 5 value */
|
||||
/* LM80_VT6_IN current Voltage 6 value */
|
||||
/* LM80_TEMP_IN current temperature value */
|
||||
/* LM80_FAN1_IN current Fan 1 count */
|
||||
/* LM80_FAN2_IN current Fan 2 count */
|
||||
/* LM80_VT0_HIGH_LIM high limit val for Voltage 0 */
|
||||
/* LM80_VT0_LOW_LIM low limit val for Voltage 0 */
|
||||
/* LM80_VT1_HIGH_LIM high limit val for Voltage 1 */
|
||||
/* LM80_VT1_LOW_LIM low limit val for Voltage 1 */
|
||||
/* LM80_VT2_HIGH_LIM high limit val for Voltage 2 */
|
||||
/* LM80_VT2_LOW_LIM low limit val for Voltage 2 */
|
||||
/* LM80_VT3_HIGH_LIM high limit val for Voltage 3 */
|
||||
/* LM80_VT3_LOW_LIM low limit val for Voltage 3 */
|
||||
/* LM80_VT4_HIGH_LIM high limit val for Voltage 4 */
|
||||
/* LM80_VT4_LOW_LIM low limit val for Voltage 4 */
|
||||
/* LM80_VT5_HIGH_LIM high limit val for Voltage 5 */
|
||||
/* LM80_VT5_LOW_LIM low limit val for Voltage 5 */
|
||||
/* LM80_VT6_HIGH_LIM high limit val for Voltage 6 */
|
||||
/* LM80_VT6_LOW_LIM low limit val for Voltage 6 */
|
||||
/* LM80_THOT_LIM_UP hot temperature limit (high) */
|
||||
/* LM80_THOT_LIM_LO hot temperature limit (low) */
|
||||
/* LM80_TOS_LIM_UP OS temperature limit (high) */
|
||||
/* LM80_TOS_LIM_LO OS temperature limit (low) */
|
||||
/* LM80_FAN1_COUNT_LIM Fan 1 count limit (high) */
|
||||
/* LM80_FAN2_COUNT_LIM Fan 2 count limit (low) */
|
||||
/* 0x3e - 0x3f reserved */
|
||||
|
||||
#define LM80_ADDR 0x28 /* LM80 default addr */
|
||||
|
||||
/* typedefs *******************************************************************/
|
||||
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INC_LM80_H */
|
333
drivers/net/sk98lin/h/skaddr.h
Normal file
333
drivers/net/sk98lin/h/skaddr.h
Normal file
@@ -0,0 +1,333 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skaddr.h
|
||||
* 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-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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* This module is intended to manage multicast addresses and promiscuous mode
|
||||
* on GEnesis adapters.
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
* "skdrv1st.h"
|
||||
* ...
|
||||
* "sktypes.h"
|
||||
* "skqueue.h"
|
||||
* "skaddr.h"
|
||||
* ...
|
||||
* "skdrv2nd.h"
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKADDR_H
|
||||
#define __INC_SKADDR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* cplusplus */
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
#define SK_MAC_ADDR_LEN 6 /* Length of MAC address. */
|
||||
#define SK_MAX_ADDRS 14 /* #Addrs for exact match. */
|
||||
|
||||
/* ----- Common return values ----- */
|
||||
|
||||
#define SK_ADDR_SUCCESS 0 /* Function returned successfully. */
|
||||
#define SK_ADDR_ILLEGAL_PORT 100 /* Port number too high. */
|
||||
#define SK_ADDR_TOO_EARLY 101 /* Function called too early. */
|
||||
|
||||
/* ----- Clear/Add flag bits ----- */
|
||||
|
||||
#define SK_ADDR_PERMANENT 1 /* RLMT Address */
|
||||
|
||||
/* ----- Additional Clear flag bits ----- */
|
||||
|
||||
#define SK_MC_SW_ONLY 2 /* Do not update HW when clearing. */
|
||||
|
||||
/* ----- Override flag bits ----- */
|
||||
|
||||
#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 ----- */
|
||||
|
||||
#define SK_ADDR_OVERRIDE_SUCCESS (SK_ADDR_SUCCESS)
|
||||
#define SK_ADDR_DUPLICATE_ADDRESS 1
|
||||
#define SK_ADDR_MULTICAST_ADDRESS 2
|
||||
|
||||
/* ----- Partitioning of excact match table ----- */
|
||||
|
||||
#define SK_ADDR_EXACT_MATCHES 16 /* #Exact match entries. */
|
||||
|
||||
#define SK_ADDR_FIRST_MATCH_RLMT 1
|
||||
#define SK_ADDR_LAST_MATCH_RLMT 2
|
||||
#define SK_ADDR_FIRST_MATCH_DRV 3
|
||||
#define SK_ADDR_LAST_MATCH_DRV (SK_ADDR_EXACT_MATCHES - 1)
|
||||
|
||||
/* ----- SkAddrMcAdd/SkAddrMcUpdate return values ----- */
|
||||
|
||||
#define SK_MC_FILTERING_EXACT 0 /* Exact filtering. */
|
||||
#define SK_MC_FILTERING_INEXACT 1 /* Inexact filtering. */
|
||||
|
||||
/* ----- Additional SkAddrMcAdd return values ----- */
|
||||
|
||||
#define SK_MC_ILLEGAL_ADDRESS 2 /* Illegal address. */
|
||||
#define SK_MC_ILLEGAL_PORT 3 /* Illegal port (not the active one). */
|
||||
#define SK_MC_RLMT_OVERFLOW 4 /* Too many RLMT mc addresses. */
|
||||
|
||||
/* Promiscuous mode bits ----- */
|
||||
|
||||
#define SK_PROM_MODE_NONE 0 /* Normal receive. */
|
||||
#define SK_PROM_MODE_LLC 1 /* Receive all LLC frames. */
|
||||
#define SK_PROM_MODE_ALL_MC 2 /* Receive all multicast frames. */
|
||||
/* #define SK_PROM_MODE_NON_LLC 4 */ /* Receive all non-LLC frames. */
|
||||
|
||||
/* Macros */
|
||||
|
||||
#ifdef OLD_STUFF
|
||||
#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]))
|
||||
#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])))
|
||||
#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 *******************************************************************/
|
||||
|
||||
typedef struct s_MacAddr {
|
||||
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. */
|
||||
|
||||
/* ----- 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;
|
||||
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;
|
||||
|
||||
|
||||
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];
|
||||
|
||||
/* ----- Private part ----- */
|
||||
} SK_ADDR;
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#ifndef SK_KR_PROTO
|
||||
|
||||
/* Functions provided by SkAddr */
|
||||
|
||||
/* ANSI/C++ compliant function prototypes */
|
||||
|
||||
extern int SkAddrInit(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Level);
|
||||
|
||||
extern int SkAddrMcClear(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
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,
|
||||
SK_U32 PortNumber,
|
||||
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 SK_FAR *pNewAddr,
|
||||
int Flags);
|
||||
|
||||
extern int SkAddrPromiscuousChange(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
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)) */
|
||||
|
||||
/* Non-ANSI/C++ compliant function prototypes */
|
||||
|
||||
#error KR-style prototypes are not yet provided.
|
||||
|
||||
#endif /* defined(SK_KR_PROTO)) */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INC_SKADDR_H */
|
219
drivers/net/sk98lin/h/skcsum.h
Normal file
219
drivers/net/sk98lin/h/skcsum.h
Normal file
@@ -0,0 +1,219 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skcsum.h
|
||||
* Project: GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx)
|
||||
* Version: $Revision: 1.10 $
|
||||
* Date: $Date: 2003/08/20 13:59:57 $
|
||||
* Purpose: Store/verify Internet checksum in send/receive packets.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Public header file for the "GEnesis" common module "CSUM".
|
||||
*
|
||||
* "GEnesis" is an abbreviation of "Gigabit Ethernet Network System in Silicon"
|
||||
* and is the code name of this SysKonnect project.
|
||||
*
|
||||
* Compilation Options:
|
||||
*
|
||||
* SK_USE_CSUM - Define if CSUM is to be used. Otherwise, CSUM will be an
|
||||
* empty module.
|
||||
*
|
||||
* SKCS_OVERWRITE_PROTO - Define to overwrite the default protocol id
|
||||
* definitions. In this case, all SKCS_PROTO_xxx definitions must be made
|
||||
* external.
|
||||
*
|
||||
* SKCS_OVERWRITE_STATUS - Define to overwrite the default return status
|
||||
* definitions. In this case, all SKCS_STATUS_xxx definitions must be made
|
||||
* external.
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
* "h/skcsum.h"
|
||||
* "h/sktypes.h"
|
||||
* "h/skqueue.h"
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKCSUM_H
|
||||
#define __INC_SKCSUM_H
|
||||
|
||||
#include "h/sktypes.h"
|
||||
#include "h/skqueue.h"
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
/*
|
||||
* Define the default bit flags for 'SKCS_PACKET_INFO.ProtocolFlags' if no user
|
||||
* overwrite.
|
||||
*/
|
||||
#ifndef SKCS_OVERWRITE_PROTO /* User overwrite? */
|
||||
#define SKCS_PROTO_IP 0x1 /* IP (Internet Protocol version 4) */
|
||||
#define SKCS_PROTO_TCP 0x2 /* TCP (Transmission Control Protocol) */
|
||||
#define SKCS_PROTO_UDP 0x4 /* UDP (User Datagram Protocol) */
|
||||
|
||||
/* Indices for protocol statistics. */
|
||||
#define SKCS_PROTO_STATS_IP 0
|
||||
#define SKCS_PROTO_STATS_UDP 1
|
||||
#define SKCS_PROTO_STATS_TCP 2
|
||||
#define SKCS_NUM_PROTOCOLS 3 /* Number of supported protocols. */
|
||||
#endif /* !SKCS_OVERWRITE_PROTO */
|
||||
|
||||
/*
|
||||
* Define the default SKCS_STATUS type and values if no user overwrite.
|
||||
*
|
||||
* SKCS_STATUS_UNKNOWN_IP_VERSION - Not an IP v4 frame.
|
||||
* SKCS_STATUS_IP_CSUM_ERROR - IP checksum error.
|
||||
* SKCS_STATUS_IP_CSUM_ERROR_TCP - IP checksum error in TCP frame.
|
||||
* SKCS_STATUS_IP_CSUM_ERROR_UDP - IP checksum error in UDP frame
|
||||
* SKCS_STATUS_IP_FRAGMENT - IP fragment (IP checksum ok).
|
||||
* SKCS_STATUS_IP_CSUM_OK - IP checksum ok (not a TCP or UDP frame).
|
||||
* SKCS_STATUS_TCP_CSUM_ERROR - TCP checksum error (IP checksum ok).
|
||||
* SKCS_STATUS_UDP_CSUM_ERROR - UDP checksum error (IP checksum ok).
|
||||
* SKCS_STATUS_TCP_CSUM_OK - IP and TCP checksum ok.
|
||||
* SKCS_STATUS_UDP_CSUM_OK - IP and UDP checksum ok.
|
||||
* SKCS_STATUS_IP_CSUM_OK_NO_UDP - IP checksum OK and no UDP checksum.
|
||||
*/
|
||||
#ifndef SKCS_OVERWRITE_STATUS /* User overwrite? */
|
||||
#define SKCS_STATUS int /* Define status type. */
|
||||
|
||||
#define SKCS_STATUS_UNKNOWN_IP_VERSION 1
|
||||
#define SKCS_STATUS_IP_CSUM_ERROR 2
|
||||
#define SKCS_STATUS_IP_FRAGMENT 3
|
||||
#define SKCS_STATUS_IP_CSUM_OK 4
|
||||
#define SKCS_STATUS_TCP_CSUM_ERROR 5
|
||||
#define SKCS_STATUS_UDP_CSUM_ERROR 6
|
||||
#define SKCS_STATUS_TCP_CSUM_OK 7
|
||||
#define SKCS_STATUS_UDP_CSUM_OK 8
|
||||
/* needed for Microsoft */
|
||||
#define SKCS_STATUS_IP_CSUM_ERROR_UDP 9
|
||||
#define SKCS_STATUS_IP_CSUM_ERROR_TCP 10
|
||||
/* UDP checksum may be omitted */
|
||||
#define SKCS_STATUS_IP_CSUM_OK_NO_UDP 11
|
||||
#endif /* !SKCS_OVERWRITE_STATUS */
|
||||
|
||||
/* Clear protocol statistics event. */
|
||||
#define SK_CSUM_EVENT_CLEAR_PROTO_STATS 1
|
||||
|
||||
/*
|
||||
* Add two values in one's complement.
|
||||
*
|
||||
* Note: One of the two input values may be "longer" than 16-bit, but then the
|
||||
* resulting sum may be 17 bits long. In this case, add zero to the result using
|
||||
* SKCS_OC_ADD() again.
|
||||
*
|
||||
* Result = Value1 + Value2
|
||||
*/
|
||||
#define SKCS_OC_ADD(Result, Value1, Value2) { \
|
||||
unsigned long Sum; \
|
||||
\
|
||||
Sum = (unsigned long) (Value1) + (unsigned long) (Value2); \
|
||||
/* Add-in any carry. */ \
|
||||
(Result) = (Sum & 0xffff) + (Sum >> 16); \
|
||||
}
|
||||
|
||||
/*
|
||||
* Subtract two values in one's complement.
|
||||
*
|
||||
* Result = Value1 - Value2
|
||||
*/
|
||||
#define SKCS_OC_SUB(Result, Value1, Value2) \
|
||||
SKCS_OC_ADD((Result), (Value1), ~(Value2) & 0xffff)
|
||||
|
||||
/* typedefs *******************************************************************/
|
||||
|
||||
/*
|
||||
* SKCS_PROTO_STATS - The CSUM protocol statistics structure.
|
||||
*
|
||||
* There is one instance of this structure for each protocol supported.
|
||||
*/
|
||||
typedef struct s_CsProtocolStatistics {
|
||||
SK_U64 RxOkCts; /* Receive checksum ok. */
|
||||
SK_U64 RxUnableCts; /* Unable to verify receive checksum. */
|
||||
SK_U64 RxErrCts; /* Receive checksum error. */
|
||||
SK_U64 TxOkCts; /* Transmit checksum ok. */
|
||||
SK_U64 TxUnableCts; /* Unable to calculate checksum in hw. */
|
||||
} SKCS_PROTO_STATS;
|
||||
|
||||
/*
|
||||
* s_Csum - The CSUM module context structure.
|
||||
*/
|
||||
typedef struct s_Csum {
|
||||
/* Enabled receive SK_PROTO_XXX bit flags. */
|
||||
unsigned ReceiveFlags[SK_MAX_NETS];
|
||||
#ifdef TX_CSUM
|
||||
unsigned TransmitFlags[SK_MAX_NETS];
|
||||
#endif /* TX_CSUM */
|
||||
|
||||
/* The protocol statistics structure; one per supported protocol. */
|
||||
SKCS_PROTO_STATS ProtoStats[SK_MAX_NETS][SKCS_NUM_PROTOCOLS];
|
||||
} SK_CSUM;
|
||||
|
||||
/*
|
||||
* SKCS_PACKET_INFO - The packet information structure.
|
||||
*/
|
||||
typedef struct s_CsPacketInfo {
|
||||
/* Bit field specifiying the desired/found protocols. */
|
||||
unsigned ProtocolFlags;
|
||||
|
||||
/* Length of complete IP header, including any option fields. */
|
||||
unsigned IpHeaderLength;
|
||||
|
||||
/* IP header checksum. */
|
||||
unsigned IpHeaderChecksum;
|
||||
|
||||
/* TCP/UDP pseudo header checksum. */
|
||||
unsigned PseudoHeaderChecksum;
|
||||
} SKCS_PACKET_INFO;
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#ifndef SK_CS_CALCULATE_CHECKSUM
|
||||
extern unsigned SkCsCalculateChecksum(
|
||||
void *pData,
|
||||
unsigned Length);
|
||||
#endif /* SK_CS_CALCULATE_CHECKSUM */
|
||||
|
||||
extern int SkCsEvent(
|
||||
SK_AC *pAc,
|
||||
SK_IOC Ioc,
|
||||
SK_U32 Event,
|
||||
SK_EVPARA Param);
|
||||
|
||||
extern SKCS_STATUS SkCsGetReceiveInfo(
|
||||
SK_AC *pAc,
|
||||
void *pIpHeader,
|
||||
unsigned Checksum1,
|
||||
unsigned Checksum2,
|
||||
int NetNumber);
|
||||
|
||||
extern void SkCsGetSendInfo(
|
||||
SK_AC *pAc,
|
||||
void *pIpHeader,
|
||||
SKCS_PACKET_INFO *pPacketInfo,
|
||||
int NetNumber);
|
||||
|
||||
extern void SkCsSetReceiveFlags(
|
||||
SK_AC *pAc,
|
||||
unsigned ReceiveFlags,
|
||||
unsigned *pChecksum1Offset,
|
||||
unsigned *pChecksum2Offset,
|
||||
int NetNumber);
|
||||
|
||||
#endif /* __INC_SKCSUM_H */
|
74
drivers/net/sk98lin/h/skdebug.h
Normal file
74
drivers/net/sk98lin/h/skdebug.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skdebug.h
|
||||
* 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-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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKDEBUG_H
|
||||
#define __INC_SKDEBUG_H
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifndef SK_DBG_MSG
|
||||
#define SK_DBG_MSG(pAC,comp,cat,arg) \
|
||||
if ( ((comp) & SK_DBG_CHKMOD(pAC)) && \
|
||||
((cat) & SK_DBG_CHKCAT(pAC)) ) { \
|
||||
SK_DBG_PRINTF arg ; \
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#define SK_DBG_MSG(pAC,comp,lev,arg)
|
||||
#endif
|
||||
|
||||
/* PLS NOTE:
|
||||
* =========
|
||||
* Due to any restrictions of kernel printf routines do not use other
|
||||
* format identifiers as: %x %d %c %s .
|
||||
* Never use any combined format identifiers such as: %lx %ld in your
|
||||
* printf - argument (arg) because some OS specific kernel printfs may
|
||||
* only support some basic identifiers.
|
||||
*/
|
||||
|
||||
/* Debug modules */
|
||||
|
||||
#define SK_DBGMOD_MERR 0x00000001L /* general module error indication */
|
||||
#define SK_DBGMOD_HWM 0x00000002L /* Hardware init module */
|
||||
#define SK_DBGMOD_RLMT 0x00000004L /* RLMT module */
|
||||
#define SK_DBGMOD_VPD 0x00000008L /* VPD module */
|
||||
#define SK_DBGMOD_I2C 0x00000010L /* I2C module */
|
||||
#define SK_DBGMOD_PNMI 0x00000020L /* PNMI module */
|
||||
#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 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 /* fatal error */
|
||||
|
||||
#endif /* __INC_SKDEBUG_H */
|
191
drivers/net/sk98lin/h/skdrv1st.h
Normal file
191
drivers/net/sk98lin/h/skdrv1st.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skdrv1st.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.4 $
|
||||
* Date: $Date: 2003/11/12 14:28:14 $
|
||||
* Purpose: First header file for driver and all other modules
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* This is the first include file of the driver, which includes all
|
||||
* neccessary system header files and some of the GEnesis header files.
|
||||
* It also defines some basic items.
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
* see skge.c
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#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),4)
|
||||
#define SK_PNMI_READ_U64(p,v) memcpy((char*)&(v),(char*)(p),8)
|
||||
|
||||
#define SK_ADDR_EQUAL(a1,a2) (!memcmp(a1,a2,6))
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <net/checksum.h>
|
||||
|
||||
#define SK_CS_CALCULATE_CHECKSUM
|
||||
#ifndef CONFIG_X86_64
|
||||
#define SkCsCalculateChecksum(p,l) ((~ip_compute_csum(p, l)) & 0xffff)
|
||||
#else
|
||||
#define SkCsCalculateChecksum(p,l) ((~ip_fast_csum(p, l)) & 0xffff)
|
||||
#endif
|
||||
|
||||
#include "h/sktypes.h"
|
||||
#include "h/skerror.h"
|
||||
#include "h/skdebug.h"
|
||||
#include "h/lm80.h"
|
||||
#include "h/xmac_ii.h"
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
#define SK_LITTLE_ENDIAN
|
||||
#else
|
||||
#define SK_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#define SK_NET_DEVICE net_device
|
||||
|
||||
|
||||
/* we use gethrtime(), return unit: nanoseconds */
|
||||
#define SK_TICKS_PER_SEC 100
|
||||
|
||||
#define SK_MEM_MAPPED_IO
|
||||
|
||||
// #define SK_RLMT_SLOW_LOOKAHEAD
|
||||
|
||||
#define SK_MAX_MACS 2
|
||||
#define SK_MAX_NETS 2
|
||||
|
||||
#define SK_IOC char __iomem *
|
||||
|
||||
typedef struct s_DrvRlmtMbuf SK_MBUF;
|
||||
|
||||
#define SK_CONST64 INT64_C
|
||||
#define SK_CONSTU64 UINT64_C
|
||||
|
||||
#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))
|
||||
|
||||
/* 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 int8_t char
|
||||
#define int16_t short
|
||||
#define int32_t long
|
||||
#define int64_t long long
|
||||
#define uint8_t u_char
|
||||
#define uint16_t u_short
|
||||
#define uint32_t u_long
|
||||
#define uint64_t unsigned long long
|
||||
#define t_scalar_t int
|
||||
#define t_uscalar_t unsigned int
|
||||
#define uintptr_t unsigned long
|
||||
|
||||
#define __CONCAT__(A,B) A##B
|
||||
|
||||
#define INT32_C(a) __CONCAT__(a,L)
|
||||
#define INT64_C(a) __CONCAT__(a,LL)
|
||||
#define UINT32_C(a) __CONCAT__(a,UL)
|
||||
#define UINT64_C(a) __CONCAT__(a,ULL)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define SK_DBG_PRINTF printk
|
||||
#ifndef SK_DEBUG_CHKMOD
|
||||
#define SK_DEBUG_CHKMOD 0
|
||||
#endif
|
||||
#ifndef SK_DEBUG_CHKCAT
|
||||
#define SK_DEBUG_CHKCAT 0
|
||||
#endif
|
||||
/* those come from the makefile */
|
||||
#define SK_DBG_CHKMOD(pAC) (SK_DEBUG_CHKMOD)
|
||||
#define SK_DBG_CHKCAT(pAC) (SK_DEBUG_CHKCAT)
|
||||
|
||||
extern void SkDbgPrintf(const char *format,...);
|
||||
|
||||
#define SK_DBGMOD_DRV 0x00010000
|
||||
|
||||
/**** possible driver debug categories ********************************/
|
||||
#define SK_DBGCAT_DRV_ENTRY 0x00010000
|
||||
#define SK_DBGCAT_DRV_SAP 0x00020000
|
||||
#define SK_DBGCAT_DRV_MCA 0x00040000
|
||||
#define SK_DBGCAT_DRV_TX_PROGRESS 0x00080000
|
||||
#define SK_DBGCAT_DRV_RX_PROGRESS 0x00100000
|
||||
#define SK_DBGCAT_DRV_PROGRESS 0x00200000
|
||||
#define SK_DBGCAT_DRV_MSG 0x00400000
|
||||
#define SK_DBGCAT_DRV_PROM 0x00800000
|
||||
#define SK_DBGCAT_DRV_TX_FRAME 0x01000000
|
||||
#define SK_DBGCAT_DRV_ERROR 0x02000000
|
||||
#define SK_DBGCAT_DRV_INT_SRC 0x04000000
|
||||
#define SK_DBGCAT_DRV_EVENT 0x08000000
|
||||
|
||||
#endif
|
||||
|
||||
#define SK_ERR_LOG SkErrorLog
|
||||
|
||||
extern void SkErrorLog(SK_AC*, int, int, char*);
|
||||
|
||||
#endif
|
||||
|
456
drivers/net/sk98lin/h/skdrv2nd.h
Normal file
456
drivers/net/sk98lin/h/skdrv2nd.h
Normal file
@@ -0,0 +1,456 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skdrv2nd.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.10 $
|
||||
* Date: $Date: 2003/12/11 16:04:45 $
|
||||
* Purpose: Second header file for driver and all other modules
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* This is the second include file of the driver, which includes all other
|
||||
* neccessary files and defines all structures and constants used by the
|
||||
* driver and the common modules.
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
* see skge.c
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKDRV2ND_H
|
||||
#define __INC_SKDRV2ND_H
|
||||
|
||||
#include "h/skqueue.h"
|
||||
#include "h/skgehwt.h"
|
||||
#include "h/sktimer.h"
|
||||
#include "h/ski2c.h"
|
||||
#include "h/skgepnmi.h"
|
||||
#include "h/skvpd.h"
|
||||
#include "h/skgehw.h"
|
||||
#include "h/skgeinit.h"
|
||||
#include "h/skaddr.h"
|
||||
#include "h/skgesirq.h"
|
||||
#include "h/skcsum.h"
|
||||
#include "h/skrlmt.h"
|
||||
#include "h/skgedrv.h"
|
||||
|
||||
|
||||
extern SK_MBUF *SkDrvAllocRlmtMbuf(SK_AC*, SK_IOC, unsigned);
|
||||
extern void SkDrvFreeRlmtMbuf(SK_AC*, SK_IOC, SK_MBUF*);
|
||||
extern SK_U64 SkOsGetTime(SK_AC*);
|
||||
extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*);
|
||||
extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*);
|
||||
extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*);
|
||||
extern int SkPciWriteCfgDWord(SK_AC*, int, SK_U32);
|
||||
extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16);
|
||||
extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8);
|
||||
extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
|
||||
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
extern int SkDrvEnterDiagMode(SK_AC *pAc);
|
||||
extern int SkDrvLeaveDiagMode(SK_AC *pAc);
|
||||
#endif
|
||||
|
||||
struct s_DrvRlmtMbuf {
|
||||
SK_MBUF *pNext; /* Pointer to next RLMT Mbuf. */
|
||||
SK_U8 *pData; /* Data buffer (virtually contig.). */
|
||||
unsigned Size; /* Data buffer size. */
|
||||
unsigned Length; /* Length of packet (<= Size). */
|
||||
SK_U32 PortIdx; /* Receiving/transmitting port. */
|
||||
#ifdef SK_RLMT_MBUF_PRIVATE
|
||||
SK_RLMT_MBUF Rlmt; /* Private part for RLMT. */
|
||||
#endif /* SK_RLMT_MBUF_PRIVATE */
|
||||
struct sk_buff *pOs; /* Pointer to message block */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Time macros
|
||||
*/
|
||||
#if SK_TICKS_PER_SEC == 100
|
||||
#define SK_PNMI_HUNDREDS_SEC(t) (t)
|
||||
#else
|
||||
#define SK_PNMI_HUNDREDS_SEC(t) ((((unsigned long)t) * 100) / \
|
||||
(SK_TICKS_PER_SEC))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* New SkOsGetTime
|
||||
*/
|
||||
#define SkOsGetTimeCurrent(pAC, pUsec) {\
|
||||
struct timeval t;\
|
||||
do_gettimeofday(&t);\
|
||||
*pUsec = ((((t.tv_sec) * 1000000L)+t.tv_usec)/10000);\
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ioctl definitions
|
||||
*/
|
||||
#define SK_IOCTL_BASE (SIOCDEVPRIVATE)
|
||||
#define SK_IOCTL_GETMIB (SK_IOCTL_BASE + 0)
|
||||
#define SK_IOCTL_SETMIB (SK_IOCTL_BASE + 1)
|
||||
#define SK_IOCTL_PRESETMIB (SK_IOCTL_BASE + 2)
|
||||
#define SK_IOCTL_GEN (SK_IOCTL_BASE + 3)
|
||||
#define SK_IOCTL_DIAG (SK_IOCTL_BASE + 4)
|
||||
|
||||
typedef struct s_IOCTL SK_GE_IOCTL;
|
||||
|
||||
struct s_IOCTL {
|
||||
char __user * pData;
|
||||
unsigned int Len;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* define sizes of descriptor rings in bytes
|
||||
*/
|
||||
|
||||
#define TX_RING_SIZE (8*1024)
|
||||
#define RX_RING_SIZE (24*1024)
|
||||
|
||||
/*
|
||||
* Buffer size for ethernet packets
|
||||
*/
|
||||
#define ETH_BUF_SIZE 1540
|
||||
#define ETH_MAX_MTU 1514
|
||||
#define ETH_MIN_MTU 60
|
||||
#define ETH_MULTICAST_BIT 0x01
|
||||
#define SK_JUMBO_MTU 9000
|
||||
|
||||
/*
|
||||
* transmit priority selects the queue: LOW=asynchron, HIGH=synchron
|
||||
*/
|
||||
#define TX_PRIO_LOW 0
|
||||
#define TX_PRIO_HIGH 1
|
||||
|
||||
/*
|
||||
* alignment of rx/tx descriptors
|
||||
*/
|
||||
#define DESCR_ALIGN 64
|
||||
|
||||
/*
|
||||
* definitions for pnmi. TODO
|
||||
*/
|
||||
#define SK_DRIVER_RESET(pAC, IoC) 0
|
||||
#define SK_DRIVER_SENDEVENT(pAC, IoC) 0
|
||||
#define SK_DRIVER_SELFTEST(pAC, IoC) 0
|
||||
/* For get mtu you must add an own function */
|
||||
#define SK_DRIVER_GET_MTU(pAc,IoC,i) 0
|
||||
#define SK_DRIVER_SET_MTU(pAc,IoC,i,v) 0
|
||||
#define SK_DRIVER_PRESET_MTU(pAc,IoC,i,v) 0
|
||||
|
||||
/*
|
||||
** Interim definition of SK_DRV_TIMER placed in this file until
|
||||
** common modules have boon finallized
|
||||
*/
|
||||
#define SK_DRV_TIMER 11
|
||||
#define SK_DRV_MODERATION_TIMER 1
|
||||
#define SK_DRV_MODERATION_TIMER_LENGTH 1000000 /* 1 second */
|
||||
#define SK_DRV_RX_CLEANUP_TIMER 2
|
||||
#define SK_DRV_RX_CLEANUP_TIMER_LENGTH 1000000 /* 100 millisecs */
|
||||
|
||||
/*
|
||||
** Definitions regarding transmitting frames
|
||||
** any calculating any checksum.
|
||||
*/
|
||||
#define C_LEN_ETHERMAC_HEADER_DEST_ADDR 6
|
||||
#define C_LEN_ETHERMAC_HEADER_SRC_ADDR 6
|
||||
#define C_LEN_ETHERMAC_HEADER_LENTYPE 2
|
||||
#define C_LEN_ETHERMAC_HEADER ( (C_LEN_ETHERMAC_HEADER_DEST_ADDR) + \
|
||||
(C_LEN_ETHERMAC_HEADER_SRC_ADDR) + \
|
||||
(C_LEN_ETHERMAC_HEADER_LENTYPE) )
|
||||
|
||||
#define C_LEN_ETHERMTU_MINSIZE 46
|
||||
#define C_LEN_ETHERMTU_MAXSIZE_STD 1500
|
||||
#define C_LEN_ETHERMTU_MAXSIZE_JUMBO 9000
|
||||
|
||||
#define C_LEN_ETHERNET_MINSIZE ( (C_LEN_ETHERMAC_HEADER) + \
|
||||
(C_LEN_ETHERMTU_MINSIZE) )
|
||||
|
||||
#define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER
|
||||
#define C_OFFSET_IPHEADER_IPPROTO 9
|
||||
#define C_OFFSET_TCPHEADER_TCPCS 16
|
||||
#define C_OFFSET_UDPHEADER_UDPCS 6
|
||||
|
||||
#define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \
|
||||
(C_OFFSET_IPHEADER_IPPROTO) )
|
||||
|
||||
#define C_PROTO_ID_UDP 17 /* refer to RFC 790 or Stevens' */
|
||||
#define C_PROTO_ID_TCP 6 /* TCP/IP illustrated for details */
|
||||
|
||||
/* TX and RX descriptors *****************************************************/
|
||||
|
||||
typedef struct s_RxD RXD; /* the receive descriptor */
|
||||
|
||||
struct s_RxD {
|
||||
volatile SK_U32 RBControl; /* Receive Buffer Control */
|
||||
SK_U32 VNextRxd; /* Next receive descriptor,low dword */
|
||||
SK_U32 VDataLow; /* Receive buffer Addr, low dword */
|
||||
SK_U32 VDataHigh; /* Receive buffer Addr, high dword */
|
||||
SK_U32 FrameStat; /* Receive Frame Status word */
|
||||
SK_U32 TimeStamp; /* Time stamp from XMAC */
|
||||
SK_U32 TcpSums; /* TCP Sum 2 / TCP Sum 1 */
|
||||
SK_U32 TcpSumStarts; /* TCP Sum Start 2 / TCP Sum Start 1 */
|
||||
RXD *pNextRxd; /* Pointer to next Rxd */
|
||||
struct sk_buff *pMBuf; /* Pointer to Linux' socket buffer */
|
||||
};
|
||||
|
||||
typedef struct s_TxD TXD; /* the transmit descriptor */
|
||||
|
||||
struct s_TxD {
|
||||
volatile SK_U32 TBControl; /* Transmit Buffer Control */
|
||||
SK_U32 VNextTxd; /* Next transmit descriptor,low dword */
|
||||
SK_U32 VDataLow; /* Transmit Buffer Addr, low dword */
|
||||
SK_U32 VDataHigh; /* Transmit Buffer Addr, high dword */
|
||||
SK_U32 FrameStat; /* Transmit Frame Status Word */
|
||||
SK_U32 TcpSumOfs; /* Reserved / TCP Sum Offset */
|
||||
SK_U16 TcpSumSt; /* TCP Sum Start */
|
||||
SK_U16 TcpSumWr; /* TCP Sum Write */
|
||||
SK_U32 TcpReserved; /* not used */
|
||||
TXD *pNextTxd; /* Pointer to next Txd */
|
||||
struct sk_buff *pMBuf; /* Pointer to Linux' socket buffer */
|
||||
};
|
||||
|
||||
/* Used interrupt bits in the interrupts source register *********************/
|
||||
|
||||
#define DRIVER_IRQS ((IS_IRQ_SW) | \
|
||||
(IS_R1_F) |(IS_R2_F) | \
|
||||
(IS_XS1_F) |(IS_XA1_F) | \
|
||||
(IS_XS2_F) |(IS_XA2_F))
|
||||
|
||||
#define SPECIAL_IRQS ((IS_HW_ERR) |(IS_I2C_READY) | \
|
||||
(IS_EXT_REG) |(IS_TIMINT) | \
|
||||
(IS_PA_TO_RX1) |(IS_PA_TO_RX2) | \
|
||||
(IS_PA_TO_TX1) |(IS_PA_TO_TX2) | \
|
||||
(IS_MAC1) |(IS_LNK_SYNC_M1)| \
|
||||
(IS_MAC2) |(IS_LNK_SYNC_M2)| \
|
||||
(IS_R1_C) |(IS_R2_C) | \
|
||||
(IS_XS1_C) |(IS_XA1_C) | \
|
||||
(IS_XS2_C) |(IS_XA2_C))
|
||||
|
||||
#define IRQ_MASK ((IS_IRQ_SW) | \
|
||||
(IS_R1_B) |(IS_R1_F) |(IS_R2_B) |(IS_R2_F) | \
|
||||
(IS_XS1_B) |(IS_XS1_F) |(IS_XA1_B)|(IS_XA1_F)| \
|
||||
(IS_XS2_B) |(IS_XS2_F) |(IS_XA2_B)|(IS_XA2_F)| \
|
||||
(IS_HW_ERR) |(IS_I2C_READY)| \
|
||||
(IS_EXT_REG) |(IS_TIMINT) | \
|
||||
(IS_PA_TO_RX1) |(IS_PA_TO_RX2)| \
|
||||
(IS_PA_TO_TX1) |(IS_PA_TO_TX2)| \
|
||||
(IS_MAC1) |(IS_MAC2) | \
|
||||
(IS_R1_C) |(IS_R2_C) | \
|
||||
(IS_XS1_C) |(IS_XA1_C) | \
|
||||
(IS_XS2_C) |(IS_XA2_C))
|
||||
|
||||
#define IRQ_HWE_MASK (IS_ERR_MSK) /* enable all HW irqs */
|
||||
|
||||
typedef struct s_DevNet DEV_NET;
|
||||
|
||||
struct s_DevNet {
|
||||
int PortNr;
|
||||
int NetNr;
|
||||
int Mtu;
|
||||
int Up;
|
||||
SK_AC *pAC;
|
||||
};
|
||||
|
||||
typedef struct s_TxPort TX_PORT;
|
||||
|
||||
struct s_TxPort {
|
||||
/* the transmit descriptor rings */
|
||||
caddr_t pTxDescrRing; /* descriptor area memory */
|
||||
SK_U64 VTxDescrRing; /* descr. area bus virt. addr. */
|
||||
TXD *pTxdRingHead; /* Head of Tx rings */
|
||||
TXD *pTxdRingTail; /* Tail of Tx rings */
|
||||
TXD *pTxdRingPrev; /* descriptor sent previously */
|
||||
int TxdRingFree; /* # of free entrys */
|
||||
spinlock_t TxDesRingLock; /* serialize descriptor accesses */
|
||||
SK_IOC HwAddr; /* bmu registers address */
|
||||
int PortIndex; /* index number of port (0 or 1) */
|
||||
};
|
||||
|
||||
typedef struct s_RxPort RX_PORT;
|
||||
|
||||
struct s_RxPort {
|
||||
/* the receive descriptor rings */
|
||||
caddr_t pRxDescrRing; /* descriptor area memory */
|
||||
SK_U64 VRxDescrRing; /* descr. area bus virt. addr. */
|
||||
RXD *pRxdRingHead; /* Head of Rx rings */
|
||||
RXD *pRxdRingTail; /* Tail of Rx rings */
|
||||
RXD *pRxdRingPrev; /* descriptor given to BMU previously */
|
||||
int RxdRingFree; /* # of free entrys */
|
||||
spinlock_t RxDesRingLock; /* serialize descriptor accesses */
|
||||
int RxFillLimit; /* limit for buffers in ring */
|
||||
SK_IOC HwAddr; /* bmu registers address */
|
||||
int PortIndex; /* index number of port (0 or 1) */
|
||||
};
|
||||
|
||||
/* Definitions needed for interrupt moderation *******************************/
|
||||
|
||||
#define IRQ_EOF_AS_TX ((IS_XA1_F) | (IS_XA2_F))
|
||||
#define IRQ_EOF_SY_TX ((IS_XS1_F) | (IS_XS2_F))
|
||||
#define IRQ_MASK_TX_ONLY ((IRQ_EOF_AS_TX)| (IRQ_EOF_SY_TX))
|
||||
#define IRQ_MASK_RX_ONLY ((IS_R1_F) | (IS_R2_F))
|
||||
#define IRQ_MASK_SP_ONLY (SPECIAL_IRQS)
|
||||
#define IRQ_MASK_TX_RX ((IRQ_MASK_TX_ONLY)| (IRQ_MASK_RX_ONLY))
|
||||
#define IRQ_MASK_SP_RX ((SPECIAL_IRQS) | (IRQ_MASK_RX_ONLY))
|
||||
#define IRQ_MASK_SP_TX ((SPECIAL_IRQS) | (IRQ_MASK_TX_ONLY))
|
||||
#define IRQ_MASK_RX_TX_SP ((SPECIAL_IRQS) | (IRQ_MASK_TX_RX))
|
||||
|
||||
#define C_INT_MOD_NONE 1
|
||||
#define C_INT_MOD_STATIC 2
|
||||
#define C_INT_MOD_DYNAMIC 4
|
||||
|
||||
#define C_CLK_FREQ_GENESIS 53215000 /* shorter: 53.125 MHz */
|
||||
#define C_CLK_FREQ_YUKON 78215000 /* shorter: 78.125 MHz */
|
||||
|
||||
#define C_INTS_PER_SEC_DEFAULT 2000
|
||||
#define C_INT_MOD_ENABLE_PERCENTAGE 50 /* if higher 50% enable */
|
||||
#define C_INT_MOD_DISABLE_PERCENTAGE 50 /* if lower 50% disable */
|
||||
#define C_INT_MOD_IPS_LOWER_RANGE 30
|
||||
#define C_INT_MOD_IPS_UPPER_RANGE 40000
|
||||
|
||||
|
||||
typedef struct s_DynIrqModInfo DIM_INFO;
|
||||
struct s_DynIrqModInfo {
|
||||
unsigned long PrevTimeVal;
|
||||
unsigned int PrevSysLoad;
|
||||
unsigned int PrevUsedTime;
|
||||
unsigned int PrevTotalTime;
|
||||
int PrevUsedDescrRatio;
|
||||
int NbrProcessedDescr;
|
||||
SK_U64 PrevPort0RxIntrCts;
|
||||
SK_U64 PrevPort1RxIntrCts;
|
||||
SK_U64 PrevPort0TxIntrCts;
|
||||
SK_U64 PrevPort1TxIntrCts;
|
||||
SK_BOOL ModJustEnabled; /* Moderation just enabled yes/no */
|
||||
|
||||
int MaxModIntsPerSec; /* Moderation Threshold */
|
||||
int MaxModIntsPerSecUpperLimit; /* Upper limit for DIM */
|
||||
int MaxModIntsPerSecLowerLimit; /* Lower limit for DIM */
|
||||
|
||||
long MaskIrqModeration; /* ModIrqType (eg. 'TxRx') */
|
||||
SK_BOOL DisplayStats; /* Stats yes/no */
|
||||
SK_BOOL AutoSizing; /* Resize DIM-timer on/off */
|
||||
int IntModTypeSelect; /* EnableIntMod (eg. 'dynamic') */
|
||||
|
||||
SK_TIMER ModTimer; /* just some timer */
|
||||
};
|
||||
|
||||
typedef struct s_PerStrm PER_STRM;
|
||||
|
||||
#define SK_ALLOC_IRQ 0x00000001
|
||||
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
#define DIAG_ACTIVE 1
|
||||
#define DIAG_NOTACTIVE 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Per board structure / Adapter Context structure:
|
||||
* Allocated within attach(9e) and freed within detach(9e).
|
||||
* Contains all 'per device' necessary handles, flags, locks etc.:
|
||||
*/
|
||||
struct s_AC {
|
||||
SK_GEINIT GIni; /* GE init struct */
|
||||
SK_PNMI Pnmi; /* PNMI data struct */
|
||||
SK_VPD vpd; /* vpd data struct */
|
||||
SK_QUEUE Event; /* Event queue */
|
||||
SK_HWT Hwt; /* Hardware Timer control struct */
|
||||
SK_TIMCTRL Tim; /* Software Timer control struct */
|
||||
SK_I2C I2c; /* I2C relevant data structure */
|
||||
SK_ADDR Addr; /* for Address module */
|
||||
SK_CSUM Csum; /* for checksum module */
|
||||
SK_RLMT Rlmt; /* for rlmt module */
|
||||
spinlock_t SlowPathLock; /* Normal IRQ lock */
|
||||
struct timer_list BlinkTimer; /* for LED blinking */
|
||||
int LedsOn;
|
||||
SK_PNMI_STRUCT_DATA PnmiStruct; /* structure to get all Pnmi-Data */
|
||||
int RlmtMode; /* link check mode to set */
|
||||
int RlmtNets; /* Number of nets */
|
||||
|
||||
SK_IOC IoBase; /* register set of adapter */
|
||||
int BoardLevel; /* level of active hw init (0-2) */
|
||||
char DeviceStr[80]; /* adapter string from vpd */
|
||||
SK_U32 AllocFlag; /* flag allocation of resources */
|
||||
struct pci_dev *PciDev; /* for access to pci config space */
|
||||
SK_U32 PciDevId; /* pci device id */
|
||||
struct SK_NET_DEVICE *dev[2]; /* pointer to device struct */
|
||||
char Name[30]; /* driver name */
|
||||
|
||||
int RxBufSize; /* length of receive buffers */
|
||||
struct net_device_stats stats; /* linux 'netstat -i' statistics */
|
||||
int Index; /* internal board index number */
|
||||
|
||||
/* adapter RAM sizes for queues of active port */
|
||||
int RxQueueSize; /* memory used for receive queue */
|
||||
int TxSQueueSize; /* memory used for sync. tx queue */
|
||||
int TxAQueueSize; /* memory used for async. tx queue */
|
||||
|
||||
int PromiscCount; /* promiscuous mode counter */
|
||||
int AllMultiCount; /* allmulticast mode counter */
|
||||
int MulticCount; /* number of different MC */
|
||||
/* addresses for this board */
|
||||
/* (may be more than HW can)*/
|
||||
|
||||
int HWRevision; /* Hardware revision */
|
||||
int ActivePort; /* the active XMAC port */
|
||||
int MaxPorts; /* number of activated ports */
|
||||
int TxDescrPerRing; /* # of descriptors per tx ring */
|
||||
int RxDescrPerRing; /* # of descriptors per rx ring */
|
||||
|
||||
caddr_t pDescrMem; /* Pointer to the descriptor area */
|
||||
dma_addr_t pDescrMemDMA; /* PCI DMA address of area */
|
||||
|
||||
/* the port structures with descriptor rings */
|
||||
TX_PORT TxPort[SK_MAX_MACS][2];
|
||||
RX_PORT RxPort[SK_MAX_MACS];
|
||||
|
||||
unsigned int CsOfs1; /* for checksum calculation */
|
||||
unsigned int CsOfs2; /* for checksum calculation */
|
||||
SK_U32 CsOfs; /* for checksum calculation */
|
||||
|
||||
SK_BOOL CheckQueue; /* check event queue soon */
|
||||
SK_TIMER DrvCleanupTimer;/* to check for pending descriptors */
|
||||
DIM_INFO DynIrqModInfo; /* all data related to DIM */
|
||||
|
||||
/* Only for tests */
|
||||
int PortUp;
|
||||
int PortDown;
|
||||
int ChipsetType; /* Chipset family type
|
||||
* 0 == Genesis family support
|
||||
* 1 == Yukon family support
|
||||
*/
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
SK_U32 DiagModeActive; /* is diag active? */
|
||||
SK_BOOL DiagFlowCtrl; /* for control purposes */
|
||||
SK_PNMI_STRUCT_DATA PnmiBackup; /* backup structure for all Pnmi-Data */
|
||||
SK_BOOL WasIfUp[SK_MAX_MACS]; /* for OpenClose while
|
||||
* DIAG is busy with NIC
|
||||
*/
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* __INC_SKDRV2ND_H */
|
||||
|
55
drivers/net/sk98lin/h/skerror.h
Normal file
55
drivers/net/sk98lin/h/skerror.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skerror.h
|
||||
* 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-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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _INC_SKERROR_H_
|
||||
#define _INC_SKERROR_H_
|
||||
|
||||
/*
|
||||
* 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_COMM (1L<<5) /* Communication error */
|
||||
|
||||
|
||||
/*
|
||||
* Define Error Code Bases
|
||||
*/
|
||||
#define SK_ERRBASE_RLMT 100 /* Base Error number for RLMT */
|
||||
#define SK_ERRBASE_HWINIT 200 /* Base Error number for HWInit */
|
||||
#define SK_ERRBASE_VPD 300 /* Base Error number for VPD */
|
||||
#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_QUEUE 800 /* Base Error number for Scheduler */
|
||||
#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 */
|
||||
|
||||
#endif /* _INC_SKERROR_H_ */
|
51
drivers/net/sk98lin/h/skgedrv.h
Normal file
51
drivers/net/sk98lin/h/skgedrv.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skgedrv.h
|
||||
* 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-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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKGEDRV_H_
|
||||
#define __INC_SKGEDRV_H_
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
#define SK_DRV_PORT_RESET 1 /* The port needs to be reset */
|
||||
#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 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_ */
|
2126
drivers/net/sk98lin/h/skgehw.h
Normal file
2126
drivers/net/sk98lin/h/skgehw.h
Normal file
Plik diff jest za duży
Load Diff
48
drivers/net/sk98lin/h/skgehwt.h
Normal file
48
drivers/net/sk98lin/h/skgehwt.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skhwt.h
|
||||
* Project: Gigabit Ethernet Adapters, Event Scheduler Module
|
||||
* Version: $Revision: 1.7 $
|
||||
* Date: $Date: 2003/09/16 12:55:08 $
|
||||
* Purpose: Defines for the hardware timer functions
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* SKGEHWT.H contains all defines and types for the timer functions
|
||||
*/
|
||||
|
||||
#ifndef _SKGEHWT_H_
|
||||
#define _SKGEHWT_H_
|
||||
|
||||
/*
|
||||
* SK Hardware Timer
|
||||
* - needed wherever the HWT module is used
|
||||
* - use in Adapters context name pAC->Hwt
|
||||
*/
|
||||
typedef struct s_Hwt {
|
||||
SK_U32 TStart; /* HWT start */
|
||||
SK_U32 TStop; /* HWT stop */
|
||||
int TActive; /* HWT: flag : active/inactive */
|
||||
} SK_HWT;
|
||||
|
||||
extern void SkHwtInit(SK_AC *pAC, SK_IOC Ioc);
|
||||
extern void SkHwtStart(SK_AC *pAC, SK_IOC Ioc, SK_U32 Time);
|
||||
extern void SkHwtStop(SK_AC *pAC, SK_IOC Ioc);
|
||||
extern SK_U32 SkHwtRead(SK_AC *pAC, SK_IOC Ioc);
|
||||
extern void SkHwtIsr(SK_AC *pAC, SK_IOC Ioc);
|
||||
#endif /* _SKGEHWT_H_ */
|
210
drivers/net/sk98lin/h/skgei2c.h
Normal file
210
drivers/net/sk98lin/h/skgei2c.h
Normal file
@@ -0,0 +1,210 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skgei2c.h
|
||||
* Project: Gigabit Ethernet Adapters, TWSI-Module
|
||||
* Version: $Revision: 1.25 $
|
||||
* Date: $Date: 2003/10/20 09:06:05 $
|
||||
* Purpose: Special defines for TWSI
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* SKGEI2C.H contains all SK-98xx specific defines for the TWSI handling
|
||||
*/
|
||||
|
||||
#ifndef _INC_SKGEI2C_H_
|
||||
#define _INC_SKGEI2C_H_
|
||||
|
||||
/*
|
||||
* Macros to access the B2_I2C_CTRL
|
||||
*/
|
||||
#define SK_I2C_CTL(IoC, flag, dev, dev_size, reg, burst) \
|
||||
SK_OUT32(IoC, B2_I2C_CTRL,\
|
||||
(flag ? 0x80000000UL : 0x0L) | \
|
||||
(((SK_U32)reg << 16) & I2C_ADDR) | \
|
||||
(((SK_U32)dev << 9) & I2C_DEV_SEL) | \
|
||||
(dev_size & I2C_DEV_SIZE) | \
|
||||
((burst << 4) & I2C_BURST_LEN))
|
||||
|
||||
#define SK_I2C_STOP(IoC) { \
|
||||
SK_U32 I2cCtrl; \
|
||||
SK_IN32(IoC, B2_I2C_CTRL, &I2cCtrl); \
|
||||
SK_OUT32(IoC, B2_I2C_CTRL, I2cCtrl | I2C_STOP); \
|
||||
}
|
||||
|
||||
#define SK_I2C_GET_CTL(IoC, pI2cCtrl) SK_IN32(IoC, B2_I2C_CTRL, pI2cCtrl)
|
||||
|
||||
/*
|
||||
* Macros to access the TWSI SW Registers
|
||||
*/
|
||||
#define SK_I2C_SET_BIT(IoC, SetBits) { \
|
||||
SK_U8 OrgBits; \
|
||||
SK_IN8(IoC, B2_I2C_SW, &OrgBits); \
|
||||
SK_OUT8(IoC, B2_I2C_SW, OrgBits | (SK_U8)(SetBits)); \
|
||||
}
|
||||
|
||||
#define SK_I2C_CLR_BIT(IoC, ClrBits) { \
|
||||
SK_U8 OrgBits; \
|
||||
SK_IN8(IoC, B2_I2C_SW, &OrgBits); \
|
||||
SK_OUT8(IoC, B2_I2C_SW, OrgBits & ~((SK_U8)(ClrBits))); \
|
||||
}
|
||||
|
||||
#define SK_I2C_GET_SW(IoC, pI2cSw) SK_IN8(IoC, B2_I2C_SW, pI2cSw)
|
||||
|
||||
/*
|
||||
* define the possible sensor states
|
||||
*/
|
||||
#define SK_SEN_IDLE 0 /* Idle: sensor not read */
|
||||
#define SK_SEN_VALUE 1 /* Value Read cycle */
|
||||
#define SK_SEN_VALEXT 2 /* Extended Value Read cycle */
|
||||
|
||||
/*
|
||||
* Conversion factor to convert read Voltage sensor to milli Volt
|
||||
* Conversion factor to convert read Temperature sensor to 10th degree Celsius
|
||||
*/
|
||||
#define SK_LM80_VT_LSB 22 /* 22mV LSB resolution */
|
||||
#define SK_LM80_TEMP_LSB 10 /* 1 degree LSB resolution */
|
||||
#define SK_LM80_TEMPEXT_LSB 5 /* 0.5 degree LSB resolution for ext. val. */
|
||||
|
||||
/*
|
||||
* formula: counter = (22500*60)/(rpm * divisor * pulses/2)
|
||||
* assuming: 6500rpm, 4 pulses, divisor 1
|
||||
*/
|
||||
#define SK_LM80_FAN_FAKTOR ((22500L*60)/(1*2))
|
||||
|
||||
/*
|
||||
* Define sensor management data
|
||||
* Maximum is reached on Genesis copper dual port and Yukon-64
|
||||
* Board specific maximum is in pAC->I2c.MaxSens
|
||||
*/
|
||||
#define SK_MAX_SENSORS 8 /* maximal no. of installed sensors */
|
||||
#define SK_MIN_SENSORS 5 /* minimal no. of installed sensors */
|
||||
|
||||
/*
|
||||
* To watch the state machine (SM) use the timer in two ways
|
||||
* instead of one as hitherto
|
||||
*/
|
||||
#define SK_TIMER_WATCH_SM 0 /* Watch the SM to finish in a spec. time */
|
||||
#define SK_TIMER_NEW_GAUGING 1 /* Start a new gauging when timer expires */
|
||||
|
||||
/*
|
||||
* Defines for the individual thresholds
|
||||
*/
|
||||
|
||||
/* Temperature sensor */
|
||||
#define SK_SEN_TEMP_HIGH_ERR 800 /* Temperature High Err Threshold */
|
||||
#define SK_SEN_TEMP_HIGH_WARN 700 /* Temperature High Warn Threshold */
|
||||
#define SK_SEN_TEMP_LOW_WARN 100 /* Temperature Low Warn Threshold */
|
||||
#define SK_SEN_TEMP_LOW_ERR 0 /* Temperature Low Err Threshold */
|
||||
|
||||
/* VCC which should be 5 V */
|
||||
#define SK_SEN_PCI_5V_HIGH_ERR 5588 /* Voltage PCI High Err Threshold */
|
||||
#define SK_SEN_PCI_5V_HIGH_WARN 5346 /* Voltage PCI High Warn Threshold */
|
||||
#define SK_SEN_PCI_5V_LOW_WARN 4664 /* Voltage PCI Low Warn Threshold */
|
||||
#define SK_SEN_PCI_5V_LOW_ERR 4422 /* Voltage PCI Low Err Threshold */
|
||||
|
||||
/*
|
||||
* VIO may be 5 V or 3.3 V. Initialization takes two parts:
|
||||
* 1. Initialize lowest lower limit and highest higher limit.
|
||||
* 2. After the first value is read correct the upper or the lower limit to
|
||||
* the appropriate C constant.
|
||||
*
|
||||
* Warning limits are +-5% of the exepected voltage.
|
||||
* Error limits are +-10% of the expected voltage.
|
||||
*/
|
||||
|
||||
/* Bug fix AF: 16.Aug.2001: Correct the init base of LM80 sensor */
|
||||
|
||||
#define SK_SEN_PCI_IO_5V_HIGH_ERR 5566 /* + 10% V PCI-IO High Err Threshold */
|
||||
#define SK_SEN_PCI_IO_5V_HIGH_WARN 5324 /* + 5% V PCI-IO High Warn Threshold */
|
||||
/* 5000 mVolt */
|
||||
#define SK_SEN_PCI_IO_5V_LOW_WARN 4686 /* - 5% V PCI-IO Low Warn Threshold */
|
||||
#define SK_SEN_PCI_IO_5V_LOW_ERR 4444 /* - 10% V PCI-IO Low Err Threshold */
|
||||
|
||||
#define SK_SEN_PCI_IO_RANGE_LIMITER 4000 /* 4000 mV range delimiter */
|
||||
|
||||
/* correction values for the second pass */
|
||||
#define SK_SEN_PCI_IO_3V3_HIGH_ERR 3850 /* + 15% V PCI-IO High Err Threshold */
|
||||
#define SK_SEN_PCI_IO_3V3_HIGH_WARN 3674 /* + 10% V PCI-IO High Warn Threshold */
|
||||
/* 3300 mVolt */
|
||||
#define SK_SEN_PCI_IO_3V3_LOW_WARN 2926 /* - 10% V PCI-IO Low Warn Threshold */
|
||||
#define SK_SEN_PCI_IO_3V3_LOW_ERR 2772 /* - 15% V PCI-IO Low Err Threshold */
|
||||
|
||||
/*
|
||||
* VDD voltage
|
||||
*/
|
||||
#define SK_SEN_VDD_HIGH_ERR 3630 /* Voltage ASIC High Err Threshold */
|
||||
#define SK_SEN_VDD_HIGH_WARN 3476 /* Voltage ASIC High Warn Threshold */
|
||||
#define SK_SEN_VDD_LOW_WARN 3146 /* Voltage ASIC Low Warn Threshold */
|
||||
#define SK_SEN_VDD_LOW_ERR 2970 /* Voltage ASIC Low Err Threshold */
|
||||
|
||||
/*
|
||||
* PHY PLL 3V3 voltage
|
||||
*/
|
||||
#define SK_SEN_PLL_3V3_HIGH_ERR 3630 /* Voltage PMA High Err Threshold */
|
||||
#define SK_SEN_PLL_3V3_HIGH_WARN 3476 /* Voltage PMA High Warn Threshold */
|
||||
#define SK_SEN_PLL_3V3_LOW_WARN 3146 /* Voltage PMA Low Warn Threshold */
|
||||
#define SK_SEN_PLL_3V3_LOW_ERR 2970 /* Voltage PMA Low Err Threshold */
|
||||
|
||||
/*
|
||||
* VAUX (YUKON only)
|
||||
*/
|
||||
#define SK_SEN_VAUX_3V3_HIGH_ERR 3630 /* Voltage VAUX High Err Threshold */
|
||||
#define SK_SEN_VAUX_3V3_HIGH_WARN 3476 /* Voltage VAUX High Warn Threshold */
|
||||
#define SK_SEN_VAUX_3V3_LOW_WARN 3146 /* Voltage VAUX Low Warn Threshold */
|
||||
#define SK_SEN_VAUX_3V3_LOW_ERR 2970 /* Voltage VAUX Low Err Threshold */
|
||||
#define SK_SEN_VAUX_0V_WARN_ERR 0 /* if VAUX not present */
|
||||
#define SK_SEN_VAUX_RANGE_LIMITER 1000 /* 1000 mV range delimiter */
|
||||
|
||||
/*
|
||||
* PHY 2V5 voltage
|
||||
*/
|
||||
#define SK_SEN_PHY_2V5_HIGH_ERR 2750 /* Voltage PHY High Err Threshold */
|
||||
#define SK_SEN_PHY_2V5_HIGH_WARN 2640 /* Voltage PHY High Warn Threshold */
|
||||
#define SK_SEN_PHY_2V5_LOW_WARN 2376 /* Voltage PHY Low Warn Threshold */
|
||||
#define SK_SEN_PHY_2V5_LOW_ERR 2222 /* Voltage PHY Low Err Threshold */
|
||||
|
||||
/*
|
||||
* ASIC Core 1V5 voltage (YUKON only)
|
||||
*/
|
||||
#define SK_SEN_CORE_1V5_HIGH_ERR 1650 /* Voltage ASIC Core High Err Threshold */
|
||||
#define SK_SEN_CORE_1V5_HIGH_WARN 1575 /* Voltage ASIC Core High Warn Threshold */
|
||||
#define SK_SEN_CORE_1V5_LOW_WARN 1425 /* Voltage ASIC Core Low Warn Threshold */
|
||||
#define SK_SEN_CORE_1V5_LOW_ERR 1350 /* Voltage ASIC Core Low Err Threshold */
|
||||
|
||||
/*
|
||||
* FAN 1 speed
|
||||
*/
|
||||
/* assuming: 6500rpm +-15%, 4 pulses,
|
||||
* warning at: 80 %
|
||||
* error at: 70 %
|
||||
* no upper limit
|
||||
*/
|
||||
#define SK_SEN_FAN_HIGH_ERR 20000 /* FAN Speed High Err Threshold */
|
||||
#define SK_SEN_FAN_HIGH_WARN 20000 /* FAN Speed High Warn Threshold */
|
||||
#define SK_SEN_FAN_LOW_WARN 5200 /* FAN Speed Low Warn Threshold */
|
||||
#define SK_SEN_FAN_LOW_ERR 4550 /* FAN Speed Low Err Threshold */
|
||||
|
||||
/*
|
||||
* Some Voltages need dynamic thresholds
|
||||
*/
|
||||
#define SK_SEN_DYN_INIT_NONE 0 /* No dynamic init of thresholds */
|
||||
#define SK_SEN_DYN_INIT_PCI_IO 10 /* Init PCI-IO with new thresholds */
|
||||
#define SK_SEN_DYN_INIT_VAUX 11 /* Init VAUX with new thresholds */
|
||||
|
||||
extern int SkLm80ReadSensor(SK_AC *pAC, SK_IOC IoC, SK_SENSOR *pSen);
|
||||
#endif /* n_INC_SKGEI2C_H */
|
853
drivers/net/sk98lin/h/skgeinit.h
Normal file
853
drivers/net/sk98lin/h/skgeinit.h
Normal file
@@ -0,0 +1,853 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skgeinit.h
|
||||
* Project: Gigabit Ethernet Adapters, Common Modules
|
||||
* Version: $Revision: 1.83 $
|
||||
* Date: $Date: 2003/09/16 14:07:37 $
|
||||
* Purpose: Structures and prototypes for the GE Init Module
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKGEINIT_H_
|
||||
#define __INC_SKGEINIT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
#define SK_TEST_VAL 0x11335577UL
|
||||
|
||||
/* modifying Link LED behaviour (used with SkGeLinkLED()) */
|
||||
#define SK_LNK_OFF LED_OFF
|
||||
#define SK_LNK_ON (LED_ON | LED_BLK_OFF | LED_SYNC_OFF)
|
||||
#define SK_LNK_BLINK (LED_ON | LED_BLK_ON | LED_SYNC_ON)
|
||||
#define SK_LNK_PERM (LED_ON | LED_BLK_OFF | LED_SYNC_ON)
|
||||
#define SK_LNK_TST (LED_ON | LED_BLK_ON | LED_SYNC_OFF)
|
||||
|
||||
/* parameter 'Mode' when calling SK_HWAC_LINK_LED() */
|
||||
#define SK_LED_OFF LED_OFF
|
||||
#define SK_LED_ACTIVE (LED_ON | LED_BLK_OFF | LED_SYNC_OFF)
|
||||
#define SK_LED_STANDBY (LED_ON | LED_BLK_ON | LED_SYNC_OFF)
|
||||
|
||||
/* addressing LED Registers in SkGeXmitLED() */
|
||||
#define XMIT_LED_INI 0
|
||||
#define XMIT_LED_CNT (RX_LED_VAL - RX_LED_INI)
|
||||
#define XMIT_LED_CTRL (RX_LED_CTRL- RX_LED_INI)
|
||||
#define XMIT_LED_TST (RX_LED_TST - RX_LED_INI)
|
||||
|
||||
/* parameter 'Mode' when calling SkGeXmitLED() */
|
||||
#define SK_LED_DIS 0
|
||||
#define SK_LED_ENA 1
|
||||
#define SK_LED_TST 2
|
||||
|
||||
/* Counter and Timer constants, for a host clock of 62.5 MHz */
|
||||
#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */
|
||||
#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */
|
||||
|
||||
#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */
|
||||
|
||||
#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */
|
||||
/* 215 ms at 78.12 MHz */
|
||||
|
||||
#define SK_FACT_62 100 /* is given in percent */
|
||||
#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */
|
||||
#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */
|
||||
|
||||
/* Timeout values */
|
||||
#define SK_MAC_TO_53 72 /* MAC arbiter timeout */
|
||||
#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */
|
||||
#define SK_PKT_TO_MAX 0xffff /* Maximum value */
|
||||
#define SK_RI_TO_53 36 /* RAM interface timeout */
|
||||
|
||||
#define SK_PHY_ACC_TO 600000 /* PHY access timeout */
|
||||
|
||||
/* RAM Buffer High Pause Threshold values */
|
||||
#define SK_RB_ULPP ( 8 * 1024) /* Upper Level in kB/8 */
|
||||
#define SK_RB_LLPP_S (10 * 1024) /* Lower Level for small Queues */
|
||||
#define SK_RB_LLPP_B (16 * 1024) /* Lower Level for big Queues */
|
||||
|
||||
#ifndef SK_BMU_RX_WM
|
||||
#define SK_BMU_RX_WM 0x600 /* BMU Rx Watermark */
|
||||
#endif
|
||||
#ifndef SK_BMU_TX_WM
|
||||
#define SK_BMU_TX_WM 0x600 /* BMU Tx Watermark */
|
||||
#endif
|
||||
|
||||
/* XMAC II Rx High Watermark */
|
||||
#define SK_XM_RX_HI_WM 0x05aa /* 1450 */
|
||||
|
||||
/* XMAC II Tx Threshold */
|
||||
#define SK_XM_THR_REDL 0x01fb /* .. for redundant link usage */
|
||||
#define SK_XM_THR_SL 0x01fb /* .. for single link adapters */
|
||||
#define SK_XM_THR_MULL 0x01fb /* .. for multiple link usage */
|
||||
#define SK_XM_THR_JUMBO 0x03fc /* .. for jumbo frame usage */
|
||||
|
||||
/* values for GIPortUsage */
|
||||
#define SK_RED_LINK 1 /* redundant link usage */
|
||||
#define SK_MUL_LINK 2 /* multiple link usage */
|
||||
#define SK_JUMBO_LINK 3 /* driver uses jumbo frames */
|
||||
|
||||
/* Minimum RAM Buffer Rx Queue Size */
|
||||
#define SK_MIN_RXQ_SIZE 16 /* 16 kB */
|
||||
|
||||
/* Minimum RAM Buffer Tx Queue Size */
|
||||
#define SK_MIN_TXQ_SIZE 16 /* 16 kB */
|
||||
|
||||
/* Queue Size units */
|
||||
#define QZ_UNITS 0x7
|
||||
#define QZ_STEP 8
|
||||
|
||||
/* Percentage of queue size from whole memory */
|
||||
/* 80 % for receive */
|
||||
#define RAM_QUOTA_RX 80L
|
||||
/* 0% for sync transfer */
|
||||
#define RAM_QUOTA_SYNC 0L
|
||||
/* the rest (20%) is taken for async transfer */
|
||||
|
||||
/* Get the rounded queue size in Bytes in 8k steps */
|
||||
#define ROUND_QUEUE_SIZE(SizeInBytes) \
|
||||
((((unsigned long) (SizeInBytes) + (QZ_STEP*1024L)-1) / 1024) & \
|
||||
~(QZ_STEP-1))
|
||||
|
||||
/* Get the rounded queue size in KBytes in 8k steps */
|
||||
#define ROUND_QUEUE_SIZE_KB(Kilobytes) \
|
||||
ROUND_QUEUE_SIZE((Kilobytes) * 1024L)
|
||||
|
||||
/* Types of RAM Buffer Queues */
|
||||
#define SK_RX_SRAM_Q 1 /* small receive queue */
|
||||
#define SK_RX_BRAM_Q 2 /* big receive queue */
|
||||
#define SK_TX_RAM_Q 3 /* small or big transmit queue */
|
||||
|
||||
/* parameter 'Dir' when calling SkGeStopPort() */
|
||||
#define SK_STOP_TX 1 /* Stops the transmit path, resets the XMAC */
|
||||
#define SK_STOP_RX 2 /* Stops the receive path */
|
||||
#define SK_STOP_ALL 3 /* Stops Rx and Tx path, resets the XMAC */
|
||||
|
||||
/* parameter 'RstMode' when calling SkGeStopPort() */
|
||||
#define SK_SOFT_RST 1 /* perform a software reset */
|
||||
#define SK_HARD_RST 2 /* perform a hardware reset */
|
||||
|
||||
/* Init Levels */
|
||||
#define SK_INIT_DATA 0 /* Init level 0: init data structures */
|
||||
#define SK_INIT_IO 1 /* Init level 1: init with IOs */
|
||||
#define SK_INIT_RUN 2 /* Init level 2: init for run time */
|
||||
|
||||
/* Link Mode Parameter */
|
||||
#define SK_LMODE_HALF 1 /* Half Duplex Mode */
|
||||
#define SK_LMODE_FULL 2 /* Full Duplex Mode */
|
||||
#define SK_LMODE_AUTOHALF 3 /* AutoHalf Duplex Mode */
|
||||
#define SK_LMODE_AUTOFULL 4 /* AutoFull Duplex Mode */
|
||||
#define SK_LMODE_AUTOBOTH 5 /* AutoBoth Duplex Mode */
|
||||
#define SK_LMODE_AUTOSENSE 6 /* configured mode auto sensing */
|
||||
#define SK_LMODE_INDETERMINATED 7 /* indeterminated */
|
||||
|
||||
/* Auto-negotiation timeout in 100ms granularity */
|
||||
#define SK_AND_MAX_TO 6 /* Wait 600 msec before link comes up */
|
||||
|
||||
/* Auto-negotiation error codes */
|
||||
#define SK_AND_OK 0 /* no error */
|
||||
#define SK_AND_OTHER 1 /* other error than below */
|
||||
#define SK_AND_DUP_CAP 2 /* Duplex capabilities error */
|
||||
|
||||
|
||||
/* Link Speed Capabilities */
|
||||
#define SK_LSPEED_CAP_AUTO (1<<0) /* Automatic resolution */
|
||||
#define SK_LSPEED_CAP_10MBPS (1<<1) /* 10 Mbps */
|
||||
#define SK_LSPEED_CAP_100MBPS (1<<2) /* 100 Mbps */
|
||||
#define SK_LSPEED_CAP_1000MBPS (1<<3) /* 1000 Mbps */
|
||||
#define SK_LSPEED_CAP_INDETERMINATED (1<<4) /* indeterminated */
|
||||
|
||||
/* Link Speed Parameter */
|
||||
#define SK_LSPEED_AUTO 1 /* Automatic resolution */
|
||||
#define SK_LSPEED_10MBPS 2 /* 10 Mbps */
|
||||
#define SK_LSPEED_100MBPS 3 /* 100 Mbps */
|
||||
#define SK_LSPEED_1000MBPS 4 /* 1000 Mbps */
|
||||
#define SK_LSPEED_INDETERMINATED 5 /* indeterminated */
|
||||
|
||||
/* Link Speed Current State */
|
||||
#define SK_LSPEED_STAT_UNKNOWN 1
|
||||
#define SK_LSPEED_STAT_10MBPS 2
|
||||
#define SK_LSPEED_STAT_100MBPS 3
|
||||
#define SK_LSPEED_STAT_1000MBPS 4
|
||||
#define SK_LSPEED_STAT_INDETERMINATED 5
|
||||
|
||||
|
||||
/* Link Capability Parameter */
|
||||
#define SK_LMODE_CAP_HALF (1<<0) /* Half Duplex Mode */
|
||||
#define SK_LMODE_CAP_FULL (1<<1) /* Full Duplex Mode */
|
||||
#define SK_LMODE_CAP_AUTOHALF (1<<2) /* AutoHalf Duplex Mode */
|
||||
#define SK_LMODE_CAP_AUTOFULL (1<<3) /* AutoFull Duplex Mode */
|
||||
#define SK_LMODE_CAP_INDETERMINATED (1<<4) /* indeterminated */
|
||||
|
||||
/* Link Mode Current State */
|
||||
#define SK_LMODE_STAT_UNKNOWN 1 /* Unknown Duplex Mode */
|
||||
#define SK_LMODE_STAT_HALF 2 /* Half Duplex Mode */
|
||||
#define SK_LMODE_STAT_FULL 3 /* Full Duplex Mode */
|
||||
#define SK_LMODE_STAT_AUTOHALF 4 /* Half Duplex Mode obtained by Auto-Neg */
|
||||
#define SK_LMODE_STAT_AUTOFULL 5 /* Full Duplex Mode obtained by Auto-Neg */
|
||||
#define SK_LMODE_STAT_INDETERMINATED 6 /* indeterminated */
|
||||
|
||||
/* Flow Control Mode Parameter (and capabilities) */
|
||||
#define SK_FLOW_MODE_NONE 1 /* No Flow-Control */
|
||||
#define SK_FLOW_MODE_LOC_SEND 2 /* Local station sends PAUSE */
|
||||
#define SK_FLOW_MODE_SYMMETRIC 3 /* Both stations may send PAUSE */
|
||||
#define SK_FLOW_MODE_SYM_OR_REM 4 /* Both stations may send PAUSE or
|
||||
* just the remote station may send PAUSE
|
||||
*/
|
||||
#define SK_FLOW_MODE_INDETERMINATED 5 /* indeterminated */
|
||||
|
||||
/* Flow Control Status Parameter */
|
||||
#define SK_FLOW_STAT_NONE 1 /* No Flow Control */
|
||||
#define SK_FLOW_STAT_REM_SEND 2 /* Remote Station sends PAUSE */
|
||||
#define SK_FLOW_STAT_LOC_SEND 3 /* Local station sends PAUSE */
|
||||
#define SK_FLOW_STAT_SYMMETRIC 4 /* Both station may send PAUSE */
|
||||
#define SK_FLOW_STAT_INDETERMINATED 5 /* indeterminated */
|
||||
|
||||
/* Master/Slave Mode Capabilities */
|
||||
#define SK_MS_CAP_AUTO (1<<0) /* Automatic resolution */
|
||||
#define SK_MS_CAP_MASTER (1<<1) /* This station is master */
|
||||
#define SK_MS_CAP_SLAVE (1<<2) /* This station is slave */
|
||||
#define SK_MS_CAP_INDETERMINATED (1<<3) /* indeterminated */
|
||||
|
||||
/* Set Master/Slave Mode Parameter (and capabilities) */
|
||||
#define SK_MS_MODE_AUTO 1 /* Automatic resolution */
|
||||
#define SK_MS_MODE_MASTER 2 /* This station is master */
|
||||
#define SK_MS_MODE_SLAVE 3 /* This station is slave */
|
||||
#define SK_MS_MODE_INDETERMINATED 4 /* indeterminated */
|
||||
|
||||
/* Master/Slave Status Parameter */
|
||||
#define SK_MS_STAT_UNSET 1 /* The M/S status is not set */
|
||||
#define SK_MS_STAT_MASTER 2 /* This station is master */
|
||||
#define SK_MS_STAT_SLAVE 3 /* This station is slave */
|
||||
#define SK_MS_STAT_FAULT 4 /* M/S resolution failed */
|
||||
#define SK_MS_STAT_INDETERMINATED 5 /* indeterminated */
|
||||
|
||||
/* parameter 'Mode' when calling SkXmSetRxCmd() */
|
||||
#define SK_STRIP_FCS_ON (1<<0) /* Enable FCS stripping of Rx frames */
|
||||
#define SK_STRIP_FCS_OFF (1<<1) /* Disable FCS stripping of Rx frames */
|
||||
#define SK_STRIP_PAD_ON (1<<2) /* Enable pad byte stripping of Rx fr */
|
||||
#define SK_STRIP_PAD_OFF (1<<3) /* Disable pad byte stripping of Rx fr */
|
||||
#define SK_LENERR_OK_ON (1<<4) /* Don't chk fr for in range len error */
|
||||
#define SK_LENERR_OK_OFF (1<<5) /* Check frames for in range len error */
|
||||
#define SK_BIG_PK_OK_ON (1<<6) /* Don't set Rx Error bit for big frames */
|
||||
#define SK_BIG_PK_OK_OFF (1<<7) /* Set Rx Error bit for big frames */
|
||||
#define SK_SELF_RX_ON (1<<8) /* Enable Rx of own packets */
|
||||
#define SK_SELF_RX_OFF (1<<9) /* Disable Rx of own packets */
|
||||
|
||||
/* parameter 'Para' when calling SkMacSetRxTxEn() */
|
||||
#define SK_MAC_LOOPB_ON (1<<0) /* Enable MAC Loopback Mode */
|
||||
#define SK_MAC_LOOPB_OFF (1<<1) /* Disable MAC Loopback Mode */
|
||||
#define SK_PHY_LOOPB_ON (1<<2) /* Enable PHY Loopback Mode */
|
||||
#define SK_PHY_LOOPB_OFF (1<<3) /* Disable PHY Loopback Mode */
|
||||
#define SK_PHY_FULLD_ON (1<<4) /* Enable GMII Full Duplex */
|
||||
#define SK_PHY_FULLD_OFF (1<<5) /* Disable GMII Full Duplex */
|
||||
|
||||
/* States of PState */
|
||||
#define SK_PRT_RESET 0 /* the port is reset */
|
||||
#define SK_PRT_STOP 1 /* the port is stopped (similar to SW reset) */
|
||||
#define SK_PRT_INIT 2 /* the port is initialized */
|
||||
#define SK_PRT_RUN 3 /* the port has an active link */
|
||||
|
||||
/* PHY power down modes */
|
||||
#define PHY_PM_OPERATIONAL_MODE 0 /* PHY operational mode */
|
||||
#define PHY_PM_DEEP_SLEEP 1 /* coma mode --> minimal power */
|
||||
#define PHY_PM_IEEE_POWER_DOWN 2 /* IEEE 22.2.4.1.5 compl. power down */
|
||||
#define PHY_PM_ENERGY_DETECT 3 /* energy detect */
|
||||
#define PHY_PM_ENERGY_DETECT_PLUS 4 /* energy detect plus */
|
||||
|
||||
/* Default receive frame limit for Workaround of XMAC Errata */
|
||||
#define SK_DEF_RX_WA_LIM SK_CONSTU64(100)
|
||||
|
||||
/* values for GILedBlinkCtrl (LED Blink Control) */
|
||||
#define SK_ACT_LED_BLINK (1<<0) /* Active LED blinking */
|
||||
#define SK_DUP_LED_NORMAL (1<<1) /* Duplex LED normal */
|
||||
#define SK_LED_LINK100_ON (1<<2) /* Link 100M LED on */
|
||||
|
||||
/* Link Partner Status */
|
||||
#define SK_LIPA_UNKNOWN 0 /* Link partner is in unknown state */
|
||||
#define SK_LIPA_MANUAL 1 /* Link partner is in detected manual state */
|
||||
#define SK_LIPA_AUTO 2 /* Link partner is in auto-negotiation state */
|
||||
|
||||
/* Maximum Restarts before restart is ignored (3Com WA) */
|
||||
#define SK_MAX_LRESTART 3 /* Max. 3 times the link is restarted */
|
||||
|
||||
/* Max. Auto-neg. timeouts before link detection in sense mode is reset */
|
||||
#define SK_MAX_ANEG_TO 10 /* Max. 10 times the sense mode is reset */
|
||||
|
||||
/* structures *****************************************************************/
|
||||
|
||||
/*
|
||||
* MAC specific functions
|
||||
*/
|
||||
typedef struct s_GeMacFunc {
|
||||
int (*pFnMacUpdateStats)(SK_AC *pAC, SK_IOC IoC, unsigned int Port);
|
||||
int (*pFnMacStatistic)(SK_AC *pAC, SK_IOC IoC, unsigned int Port,
|
||||
SK_U16 StatAddr, SK_U32 SK_FAR *pVal);
|
||||
int (*pFnMacResetCounter)(SK_AC *pAC, SK_IOC IoC, unsigned int Port);
|
||||
int (*pFnMacOverflow)(SK_AC *pAC, SK_IOC IoC, unsigned int Port,
|
||||
SK_U16 IStatus, SK_U64 SK_FAR *pVal);
|
||||
} SK_GEMACFUNC;
|
||||
|
||||
/*
|
||||
* Port Structure
|
||||
*/
|
||||
typedef struct s_GePort {
|
||||
#ifndef SK_DIAG
|
||||
SK_TIMER PWaTimer; /* Workaround Timer */
|
||||
SK_TIMER HalfDupChkTimer;
|
||||
#endif /* SK_DIAG */
|
||||
SK_U32 PPrevShorts; /* Previous Short Counter checking */
|
||||
SK_U32 PPrevFcs; /* Previous FCS Error Counter checking */
|
||||
SK_U64 PPrevRx; /* Previous RxOk Counter checking */
|
||||
SK_U64 PRxLim; /* Previous RxOk Counter checking */
|
||||
SK_U64 LastOctets; /* For half duplex hang check */
|
||||
int PLinkResCt; /* Link Restart Counter */
|
||||
int PAutoNegTimeOut;/* Auto-negotiation timeout current value */
|
||||
int PAutoNegTOCt; /* Auto-negotiation Timeout Counter */
|
||||
int PRxQSize; /* Port Rx Queue Size in kB */
|
||||
int PXSQSize; /* Port Synchronous Transmit Queue Size in kB */
|
||||
int PXAQSize; /* Port Asynchronous Transmit Queue Size in kB */
|
||||
SK_U32 PRxQRamStart; /* Receive Queue RAM Buffer Start Address */
|
||||
SK_U32 PRxQRamEnd; /* Receive Queue RAM Buffer End Address */
|
||||
SK_U32 PXsQRamStart; /* Sync Tx Queue RAM Buffer Start Address */
|
||||
SK_U32 PXsQRamEnd; /* Sync Tx Queue RAM Buffer End Address */
|
||||
SK_U32 PXaQRamStart; /* Async Tx Queue RAM Buffer Start Address */
|
||||
SK_U32 PXaQRamEnd; /* Async Tx Queue RAM Buffer End Address */
|
||||
SK_U32 PRxOverCnt; /* Receive Overflow Counter */
|
||||
int PRxQOff; /* Rx Queue Address Offset */
|
||||
int PXsQOff; /* Synchronous Tx Queue Address Offset */
|
||||
int PXaQOff; /* Asynchronous Tx Queue Address Offset */
|
||||
int PhyType; /* PHY used on this port */
|
||||
int PState; /* Port status (reset, stop, init, run) */
|
||||
SK_U16 PhyId1; /* PHY Id1 on this port */
|
||||
SK_U16 PhyAddr; /* MDIO/MDC PHY address */
|
||||
SK_U16 PIsave; /* Saved Interrupt status word */
|
||||
SK_U16 PSsave; /* Saved PHY status word */
|
||||
SK_U16 PGmANegAdv; /* Saved GPhy AutoNegAdvertisment register */
|
||||
SK_BOOL PHWLinkUp; /* The hardware Link is up (wiring) */
|
||||
SK_BOOL PLinkBroken; /* Is Link broken ? */
|
||||
SK_BOOL PCheckPar; /* Do we check for parity errors ? */
|
||||
SK_BOOL HalfDupTimerActive;
|
||||
SK_U8 PLinkCap; /* Link Capabilities */
|
||||
SK_U8 PLinkModeConf; /* Link Mode configured */
|
||||
SK_U8 PLinkMode; /* Link Mode currently used */
|
||||
SK_U8 PLinkModeStatus;/* Link Mode Status */
|
||||
SK_U8 PLinkSpeedCap; /* Link Speed Capabilities(10/100/1000 Mbps) */
|
||||
SK_U8 PLinkSpeed; /* configured Link Speed (10/100/1000 Mbps) */
|
||||
SK_U8 PLinkSpeedUsed; /* current Link Speed (10/100/1000 Mbps) */
|
||||
SK_U8 PFlowCtrlCap; /* Flow Control Capabilities */
|
||||
SK_U8 PFlowCtrlMode; /* Flow Control Mode */
|
||||
SK_U8 PFlowCtrlStatus;/* Flow Control Status */
|
||||
SK_U8 PMSCap; /* Master/Slave Capabilities */
|
||||
SK_U8 PMSMode; /* Master/Slave Mode */
|
||||
SK_U8 PMSStatus; /* Master/Slave Status */
|
||||
SK_BOOL PAutoNegFail; /* Auto-negotiation fail flag */
|
||||
SK_U8 PLipaAutoNeg; /* Auto-negotiation possible with Link Partner */
|
||||
SK_U8 PCableLen; /* Cable Length */
|
||||
SK_U8 PMdiPairLen[4]; /* MDI[0..3] Pair Length */
|
||||
SK_U8 PMdiPairSts[4]; /* MDI[0..3] Pair Diagnostic Status */
|
||||
SK_U8 PPhyPowerState; /* PHY current power state */
|
||||
int PMacColThres; /* MAC Collision Threshold */
|
||||
int PMacJamLen; /* MAC Jam length */
|
||||
int PMacJamIpgVal; /* MAC Jam IPG */
|
||||
int PMacJamIpgData; /* MAC IPG Jam to Data */
|
||||
int PMacIpgData; /* MAC Data IPG */
|
||||
SK_BOOL PMacLimit4; /* reset collision counter and backoff algorithm */
|
||||
} SK_GEPORT;
|
||||
|
||||
/*
|
||||
* Gigabit Ethernet Initialization Struct
|
||||
* (has to be included in the adapter context)
|
||||
*/
|
||||
typedef struct s_GeInit {
|
||||
int GIChipId; /* Chip Identification Number */
|
||||
int GIChipRev; /* Chip Revision Number */
|
||||
SK_U8 GIPciHwRev; /* PCI HW Revision Number */
|
||||
SK_BOOL GIGenesis; /* Genesis adapter ? */
|
||||
SK_BOOL GIYukon; /* YUKON-A1/Bx chip */
|
||||
SK_BOOL GIYukonLite; /* YUKON-Lite chip */
|
||||
SK_BOOL GICopperType; /* Copper Type adapter ? */
|
||||
SK_BOOL GIPciSlot64; /* 64-bit PCI Slot */
|
||||
SK_BOOL GIPciClock66; /* 66 MHz PCI Clock */
|
||||
SK_BOOL GIVauxAvail; /* VAUX available (YUKON) */
|
||||
SK_BOOL GIYukon32Bit; /* 32-Bit YUKON adapter */
|
||||
SK_U16 GILedBlinkCtrl; /* LED Blink Control */
|
||||
int GIMacsFound; /* Number of MACs found on this adapter */
|
||||
int GIMacType; /* MAC Type used on this adapter */
|
||||
int GIHstClkFact; /* Host Clock Factor (62.5 / HstClk * 100) */
|
||||
int GIPortUsage; /* Driver Port Usage */
|
||||
int GILevel; /* Initialization Level completed */
|
||||
int GIRamSize; /* The RAM size of the adapter in kB */
|
||||
int GIWolOffs; /* WOL Register Offset (HW-Bug in Rev. A) */
|
||||
SK_U32 GIRamOffs; /* RAM Address Offset for addr calculation */
|
||||
SK_U32 GIPollTimerVal; /* Descr. Poll Timer Init Val (HstClk ticks) */
|
||||
SK_U32 GIValIrqMask; /* Value for Interrupt Mask */
|
||||
SK_U32 GITimeStampCnt; /* Time Stamp High Counter (YUKON only) */
|
||||
SK_GEPORT GP[SK_MAX_MACS];/* Port Dependent Information */
|
||||
SK_GEMACFUNC GIFunc; /* MAC depedent functions */
|
||||
} SK_GEINIT;
|
||||
|
||||
/*
|
||||
* Error numbers and messages for skxmac2.c and skgeinit.c
|
||||
*/
|
||||
#define SKERR_HWI_E001 (SK_ERRBASE_HWINIT)
|
||||
#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got illegal parameters"
|
||||
#define SKERR_HWI_E002 (SKERR_HWI_E001+1)
|
||||
#define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing"
|
||||
#define SKERR_HWI_E003 (SKERR_HWI_E002+1)
|
||||
#define SKERR_HWI_E003MSG "SkGeInit() called with illegal init Level"
|
||||
#define SKERR_HWI_E004 (SKERR_HWI_E003+1)
|
||||
#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size illegal configured"
|
||||
#define SKERR_HWI_E005 (SKERR_HWI_E004+1)
|
||||
#define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports"
|
||||
#define SKERR_HWI_E006 (SKERR_HWI_E005+1)
|
||||
#define SKERR_HWI_E006MSG "SkGeMacInit(): PState does not match HW state"
|
||||
#define SKERR_HWI_E007 (SKERR_HWI_E006+1)
|
||||
#define SKERR_HWI_E007MSG "SkXmInitDupMd() called with invalid Dup Mode"
|
||||
#define SKERR_HWI_E008 (SKERR_HWI_E007+1)
|
||||
#define SKERR_HWI_E008MSG "SkXmSetRxCmd() called with invalid Mode"
|
||||
#define SKERR_HWI_E009 (SKERR_HWI_E008+1)
|
||||
#define SKERR_HWI_E009MSG "SkGeCfgSync() called although PXSQSize zero"
|
||||
#define SKERR_HWI_E010 (SKERR_HWI_E009+1)
|
||||
#define SKERR_HWI_E010MSG "SkGeCfgSync() called with invalid parameters"
|
||||
#define SKERR_HWI_E011 (SKERR_HWI_E010+1)
|
||||
#define SKERR_HWI_E011MSG "SkGeInitPort(): Receive Queue Size too small"
|
||||
#define SKERR_HWI_E012 (SKERR_HWI_E011+1)
|
||||
#define SKERR_HWI_E012MSG "SkGeInitPort(): invalid Queue Size specified"
|
||||
#define SKERR_HWI_E013 (SKERR_HWI_E012+1)
|
||||
#define SKERR_HWI_E013MSG "SkGeInitPort(): cfg changed for running queue"
|
||||
#define SKERR_HWI_E014 (SKERR_HWI_E013+1)
|
||||
#define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified"
|
||||
#define SKERR_HWI_E015 (SKERR_HWI_E014+1)
|
||||
#define SKERR_HWI_E015MSG "Illegal Link mode parameter"
|
||||
#define SKERR_HWI_E016 (SKERR_HWI_E015+1)
|
||||
#define SKERR_HWI_E016MSG "Illegal Flow control mode parameter"
|
||||
#define SKERR_HWI_E017 (SKERR_HWI_E016+1)
|
||||
#define SKERR_HWI_E017MSG "Illegal value specified for GIPollTimerVal"
|
||||
#define SKERR_HWI_E018 (SKERR_HWI_E017+1)
|
||||
#define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)"
|
||||
#define SKERR_HWI_E019 (SKERR_HWI_E018+1)
|
||||
#define SKERR_HWI_E019MSG "Illegal Speed parameter"
|
||||
#define SKERR_HWI_E020 (SKERR_HWI_E019+1)
|
||||
#define SKERR_HWI_E020MSG "Illegal Master/Slave parameter"
|
||||
#define SKERR_HWI_E021 (SKERR_HWI_E020+1)
|
||||
#define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter"
|
||||
#define SKERR_HWI_E022 (SKERR_HWI_E021+1)
|
||||
#define SKERR_HWI_E022MSG "MacStatistic(): illegal statistic base address"
|
||||
#define SKERR_HWI_E023 (SKERR_HWI_E022+1)
|
||||
#define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small"
|
||||
#define SKERR_HWI_E024 (SKERR_HWI_E023+1)
|
||||
#define SKERR_HWI_E024MSG "FATAL: SkGeStopPort() does not terminate (Rx)"
|
||||
#define SKERR_HWI_E025 (SKERR_HWI_E024+1)
|
||||
#define SKERR_HWI_E025MSG ""
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#ifndef SK_KR_PROTO
|
||||
|
||||
/*
|
||||
* public functions in skgeinit.c
|
||||
*/
|
||||
extern void SkGePollRxD(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL PollRxD);
|
||||
|
||||
extern void SkGePollTxD(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL PollTxD);
|
||||
|
||||
extern void SkGeYellowLED(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int State);
|
||||
|
||||
extern int SkGeCfgSync(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_U32 IntTime,
|
||||
SK_U32 LimCount,
|
||||
int SyncMode);
|
||||
|
||||
extern void SkGeLoadLnkSyncCnt(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_U32 CntVal);
|
||||
|
||||
extern void SkGeStopPort(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Dir,
|
||||
int RstMode);
|
||||
|
||||
extern int SkGeInit(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Level);
|
||||
|
||||
extern void SkGeDeInit(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC);
|
||||
|
||||
extern int SkGeInitPort(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkGeXmitLED(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Led,
|
||||
int Mode);
|
||||
|
||||
extern void SkGeInitRamIface(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC);
|
||||
|
||||
extern int SkGeInitAssignRamToQueues(
|
||||
SK_AC *pAC,
|
||||
int ActivePort,
|
||||
SK_BOOL DualNet);
|
||||
|
||||
/*
|
||||
* public functions in skxmac2.c
|
||||
*/
|
||||
extern void SkMacRxTxDisable(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacSoftRst(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacHardRst(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacClearRst(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkXmInitMac(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkGmInitMac(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacInitPhy(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL DoLoop);
|
||||
|
||||
extern void SkMacIrqDisable(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacFlushTxFifo(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacFlushRxFifo(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacIrq(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern int SkMacAutoNegDone(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacAutoNegLipaPhy(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_U16 IStatus);
|
||||
|
||||
extern void SkMacSetRxTxEn(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Para);
|
||||
|
||||
extern int SkMacRxTxEnable(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkMacPromiscMode(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL Enable);
|
||||
|
||||
extern void SkMacHashing(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL Enable);
|
||||
|
||||
extern void SkXmPhyRead(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 SK_FAR *pVal);
|
||||
|
||||
extern void SkXmPhyWrite(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 Val);
|
||||
|
||||
extern void SkGmPhyRead(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 SK_FAR *pVal);
|
||||
|
||||
extern void SkGmPhyWrite(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 Val);
|
||||
|
||||
extern void SkXmClrExactAddr(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int StartNum,
|
||||
int StopNum);
|
||||
|
||||
extern void SkXmInitDupMd(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkXmInitPauseMd(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
extern void SkXmAutoNegLipaXmac(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_U16 IStatus);
|
||||
|
||||
extern int SkXmUpdateStats(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port);
|
||||
|
||||
extern int SkGmUpdateStats(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port);
|
||||
|
||||
extern int SkXmMacStatistic(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port,
|
||||
SK_U16 StatAddr,
|
||||
SK_U32 SK_FAR *pVal);
|
||||
|
||||
extern int SkGmMacStatistic(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port,
|
||||
SK_U16 StatAddr,
|
||||
SK_U32 SK_FAR *pVal);
|
||||
|
||||
extern int SkXmResetCounter(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port);
|
||||
|
||||
extern int SkGmResetCounter(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port);
|
||||
|
||||
extern int SkXmOverflowStatus(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port,
|
||||
SK_U16 IStatus,
|
||||
SK_U64 SK_FAR *pStatus);
|
||||
|
||||
extern int SkGmOverflowStatus(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
unsigned int Port,
|
||||
SK_U16 MacStatus,
|
||||
SK_U64 SK_FAR *pStatus);
|
||||
|
||||
extern int SkGmCableDiagStatus(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL StartTest);
|
||||
|
||||
extern int SkGmEnterLowPowerMode(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_U8 Mode);
|
||||
|
||||
extern int SkGmLeaveLowPowerMode(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port);
|
||||
|
||||
#ifdef SK_DIAG
|
||||
extern void SkGePhyRead(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 *pVal);
|
||||
|
||||
extern void SkGePhyWrite(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Addr,
|
||||
SK_U16 Val);
|
||||
|
||||
extern void SkMacSetRxCmd(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
int Mode);
|
||||
extern void SkMacCrcGener(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL Enable);
|
||||
extern void SkMacTimeStamp(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL Enable);
|
||||
extern void SkXmSendCont(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Port,
|
||||
SK_BOOL Enable);
|
||||
#endif /* SK_DIAG */
|
||||
|
||||
#else /* SK_KR_PROTO */
|
||||
|
||||
/*
|
||||
* public functions in skgeinit.c
|
||||
*/
|
||||
extern void SkGePollRxD();
|
||||
extern void SkGePollTxD();
|
||||
extern void SkGeYellowLED();
|
||||
extern int SkGeCfgSync();
|
||||
extern void SkGeLoadLnkSyncCnt();
|
||||
extern void SkGeStopPort();
|
||||
extern int SkGeInit();
|
||||
extern void SkGeDeInit();
|
||||
extern int SkGeInitPort();
|
||||
extern void SkGeXmitLED();
|
||||
extern void SkGeInitRamIface();
|
||||
extern int SkGeInitAssignRamToQueues();
|
||||
|
||||
/*
|
||||
* public functions in skxmac2.c
|
||||
*/
|
||||
extern void SkMacRxTxDisable();
|
||||
extern void SkMacSoftRst();
|
||||
extern void SkMacHardRst();
|
||||
extern void SkMacClearRst();
|
||||
extern void SkMacInitPhy();
|
||||
extern int SkMacRxTxEnable();
|
||||
extern void SkMacPromiscMode();
|
||||
extern void SkMacHashing();
|
||||
extern void SkMacIrqDisable();
|
||||
extern void SkMacFlushTxFifo();
|
||||
extern void SkMacFlushRxFifo();
|
||||
extern void SkMacIrq();
|
||||
extern int SkMacAutoNegDone();
|
||||
extern void SkMacAutoNegLipaPhy();
|
||||
extern void SkMacSetRxTxEn();
|
||||
extern void SkXmInitMac();
|
||||
extern void SkXmPhyRead();
|
||||
extern void SkXmPhyWrite();
|
||||
extern void SkGmInitMac();
|
||||
extern void SkGmPhyRead();
|
||||
extern void SkGmPhyWrite();
|
||||
extern void SkXmClrExactAddr();
|
||||
extern void SkXmInitDupMd();
|
||||
extern void SkXmInitPauseMd();
|
||||
extern void SkXmAutoNegLipaXmac();
|
||||
extern int SkXmUpdateStats();
|
||||
extern int SkGmUpdateStats();
|
||||
extern int SkXmMacStatistic();
|
||||
extern int SkGmMacStatistic();
|
||||
extern int SkXmResetCounter();
|
||||
extern int SkGmResetCounter();
|
||||
extern int SkXmOverflowStatus();
|
||||
extern int SkGmOverflowStatus();
|
||||
extern int SkGmCableDiagStatus();
|
||||
extern int SkGmEnterLowPowerMode();
|
||||
extern int SkGmLeaveLowPowerMode();
|
||||
|
||||
#ifdef SK_DIAG
|
||||
extern void SkGePhyRead();
|
||||
extern void SkGePhyWrite();
|
||||
extern void SkMacSetRxCmd();
|
||||
extern void SkMacCrcGener();
|
||||
extern void SkMacTimeStamp();
|
||||
extern void SkXmSendCont();
|
||||
#endif /* SK_DIAG */
|
||||
|
||||
#endif /* SK_KR_PROTO */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INC_SKGEINIT_H_ */
|
334
drivers/net/sk98lin/h/skgepnm2.h
Normal file
334
drivers/net/sk98lin/h/skgepnm2.h
Normal file
@@ -0,0 +1,334 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Name: skgepnm2.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.36 $
|
||||
* Date: $Date: 2003/05/23 12:45:13 $
|
||||
* Purpose: Defines for Private Network Management Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _SKGEPNM2_H_
|
||||
#define _SKGEPNM2_H_
|
||||
|
||||
/*
|
||||
* General definitions
|
||||
*/
|
||||
#define SK_PNMI_CHIPSET_XMAC 1 /* XMAC11800FP */
|
||||
#define SK_PNMI_CHIPSET_YUKON 2 /* YUKON */
|
||||
|
||||
#define SK_PNMI_BUS_PCI 1 /* PCI bus*/
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
#define SK_PNMI_ACT_IDLE 1
|
||||
#define SK_PNMI_ACT_RESET 2
|
||||
#define SK_PNMI_ACT_SELFTEST 3
|
||||
#define SK_PNMI_ACT_RESETCNT 4
|
||||
|
||||
/*
|
||||
* VPD releated defines
|
||||
*/
|
||||
|
||||
#define SK_PNMI_VPD_RW 1
|
||||
#define SK_PNMI_VPD_RO 2
|
||||
|
||||
#define SK_PNMI_VPD_OK 0
|
||||
#define SK_PNMI_VPD_NOTFOUND 1
|
||||
#define SK_PNMI_VPD_CUT 2
|
||||
#define SK_PNMI_VPD_TIMEOUT 3
|
||||
#define SK_PNMI_VPD_FULL 4
|
||||
#define SK_PNMI_VPD_NOWRITE 5
|
||||
#define SK_PNMI_VPD_FATAL 6
|
||||
|
||||
#define SK_PNMI_VPD_IGNORE 0
|
||||
#define SK_PNMI_VPD_CREATE 1
|
||||
#define SK_PNMI_VPD_DELETE 2
|
||||
|
||||
|
||||
/*
|
||||
* RLMT related defines
|
||||
*/
|
||||
#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
|
||||
*/
|
||||
#define SK_PNMI_GET 0
|
||||
#define SK_PNMI_PRESET 1
|
||||
#define SK_PNMI_SET 2
|
||||
|
||||
#define SK_PNMI_RO 0
|
||||
#define SK_PNMI_RW 1
|
||||
#define SK_PNMI_WO 2
|
||||
|
||||
typedef struct s_OidTabEntry {
|
||||
SK_U32 Id;
|
||||
SK_U32 InstanceNo;
|
||||
unsigned int StructSize;
|
||||
unsigned int Offset;
|
||||
int Access;
|
||||
int (* Func)(SK_AC *pAc, SK_IOC pIo, int action,
|
||||
SK_U32 Id, char* pBuf, unsigned int* pLen,
|
||||
SK_U32 Instance, unsigned int TableIndex,
|
||||
SK_U32 NetNumber);
|
||||
SK_U16 Param;
|
||||
} SK_PNMI_TAB_ENTRY;
|
||||
|
||||
|
||||
/*
|
||||
* Trap lengths
|
||||
*/
|
||||
#define SK_PNMI_TRAP_SIMPLE_LEN 17
|
||||
#define SK_PNMI_TRAP_SENSOR_LEN_BASE 46
|
||||
#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 list (overall set for MAC types used)
|
||||
*/
|
||||
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_U16 Reg; /* MAC register containing the value */
|
||||
SK_BOOL GetOffset; /* TRUE: Offset managed by PNMI (call GetStatVal())*/
|
||||
} SK_PNMI_STATADDR;
|
||||
|
||||
|
||||
/*
|
||||
* SK_PNMI_STRUCT_DATA copy offset evaluation macros
|
||||
*/
|
||||
#define SK_PNMI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e))
|
||||
#define SK_PNMI_MAI_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STRUCT_DATA *)0)->e))
|
||||
#define SK_PNMI_VPD_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_VPD *)0)->e))
|
||||
#define SK_PNMI_SEN_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_SENSOR *)0)->e))
|
||||
#define SK_PNMI_CHK_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CHECKSUM *)0)->e))
|
||||
#define SK_PNMI_STA_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_STAT *)0)->e))
|
||||
#define SK_PNMI_CNF_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_CONF *)0)->e))
|
||||
#define SK_PNMI_RLM_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT *)0)->e))
|
||||
#define SK_PNMI_MON_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_RLMT_MONITOR *)0)->e))
|
||||
#define SK_PNMI_TRP_OFF(e) ((SK_U32)(SK_UPTR)&(((SK_PNMI_TRAP *)0)->e))
|
||||
|
||||
#define SK_PNMI_SET_STAT(b,s,o) {SK_U32 Val32; char *pVal; \
|
||||
Val32 = (s); \
|
||||
pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \
|
||||
&(((SK_PNMI_STRUCT_DATA *)0)-> \
|
||||
ReturnStatus.ErrorStatus)); \
|
||||
SK_PNMI_STORE_U32(pVal, Val32); \
|
||||
Val32 = (o); \
|
||||
pVal = (char *)(b) + ((SK_U32)(SK_UPTR) \
|
||||
&(((SK_PNMI_STRUCT_DATA *)0)-> \
|
||||
ReturnStatus.ErrorOffset)); \
|
||||
SK_PNMI_STORE_U32(pVal, Val32);}
|
||||
|
||||
/*
|
||||
* 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) (((t) * 100) / (SK_TICKS_PER_SEC))
|
||||
#endif /* !SK_TICKS_PER_SEC */
|
||||
#endif /* !SK_PNMI_HUNDREDS_SEC */
|
||||
|
||||
/*
|
||||
* Macros to work around alignment problems
|
||||
*/
|
||||
#ifndef SK_PNMI_STORE_U16
|
||||
#define SK_PNMI_STORE_U16(p,v) {*(char *)(p) = *((char *)&(v)); \
|
||||
*((char *)(p) + 1) = \
|
||||
*(((char *)&(v)) + 1);}
|
||||
#endif
|
||||
|
||||
#ifndef SK_PNMI_STORE_U32
|
||||
#define SK_PNMI_STORE_U32(p,v) {*(char *)(p) = *((char *)&(v)); \
|
||||
*((char *)(p) + 1) = \
|
||||
*(((char *)&(v)) + 1); \
|
||||
*((char *)(p) + 2) = \
|
||||
*(((char *)&(v)) + 2); \
|
||||
*((char *)(p) + 3) = \
|
||||
*(((char *)&(v)) + 3);}
|
||||
#endif
|
||||
|
||||
#ifndef SK_PNMI_STORE_U64
|
||||
#define SK_PNMI_STORE_U64(p,v) {*(char *)(p) = *((char *)&(v)); \
|
||||
*((char *)(p) + 1) = \
|
||||
*(((char *)&(v)) + 1); \
|
||||
*((char *)(p) + 2) = \
|
||||
*(((char *)&(v)) + 2); \
|
||||
*((char *)(p) + 3) = \
|
||||
*(((char *)&(v)) + 3); \
|
||||
*((char *)(p) + 4) = \
|
||||
*(((char *)&(v)) + 4); \
|
||||
*((char *)(p) + 5) = \
|
||||
*(((char *)&(v)) + 5); \
|
||||
*((char *)(p) + 6) = \
|
||||
*(((char *)&(v)) + 6); \
|
||||
*((char *)(p) + 7) = \
|
||||
*(((char *)&(v)) + 7);}
|
||||
#endif
|
||||
|
||||
#ifndef SK_PNMI_READ_U16
|
||||
#define SK_PNMI_READ_U16(p,v) {*((char *)&(v)) = *(char *)(p); \
|
||||
*(((char *)&(v)) + 1) = \
|
||||
*((char *)(p) + 1);}
|
||||
#endif
|
||||
|
||||
#ifndef SK_PNMI_READ_U32
|
||||
#define SK_PNMI_READ_U32(p,v) {*((char *)&(v)) = *(char *)(p); \
|
||||
*(((char *)&(v)) + 1) = \
|
||||
*((char *)(p) + 1); \
|
||||
*(((char *)&(v)) + 2) = \
|
||||
*((char *)(p) + 2); \
|
||||
*(((char *)&(v)) + 3) = \
|
||||
*((char *)(p) + 3);}
|
||||
#endif
|
||||
|
||||
#ifndef SK_PNMI_READ_U64
|
||||
#define SK_PNMI_READ_U64(p,v) {*((char *)&(v)) = *(char *)(p); \
|
||||
*(((char *)&(v)) + 1) = \
|
||||
*((char *)(p) + 1); \
|
||||
*(((char *)&(v)) + 2) = \
|
||||
*((char *)(p) + 2); \
|
||||
*(((char *)&(v)) + 3) = \
|
||||
*((char *)(p) + 3); \
|
||||
*(((char *)&(v)) + 4) = \
|
||||
*((char *)(p) + 4); \
|
||||
*(((char *)&(v)) + 5) = \
|
||||
*((char *)(p) + 5); \
|
||||
*(((char *)&(v)) + 6) = \
|
||||
*((char *)(p) + 6); \
|
||||
*(((char *)&(v)) + 7) = \
|
||||
*((char *)(p) + 7);}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros for Debug
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
|
||||
#define SK_PNMI_CHECKFLAGS(vSt) {if (pAC->Pnmi.MacUpdatedFlag > 0 || \
|
||||
pAC->Pnmi.RlmtUpdatedFlag > 0 || \
|
||||
pAC->Pnmi.SirqUpdatedFlag > 0) { \
|
||||
SK_DBG_MSG(pAC, \
|
||||
SK_DBGMOD_PNMI, \
|
||||
SK_DBGCAT_CTRL, \
|
||||
("PNMI: ERR: %s MacUFlag=%d, RlmtUFlag=%d, SirqUFlag=%d\n", \
|
||||
vSt, \
|
||||
pAC->Pnmi.MacUpdatedFlag, \
|
||||
pAC->Pnmi.RlmtUpdatedFlag, \
|
||||
pAC->Pnmi.SirqUpdatedFlag))}}
|
||||
|
||||
#else /* !DEBUG */
|
||||
|
||||
#define SK_PNMI_CHECKFLAGS(vSt) /* Nothing */
|
||||
|
||||
#endif /* !DEBUG */
|
||||
|
||||
#endif /* _SKGEPNM2_H_ */
|
966
drivers/net/sk98lin/h/skgepnmi.h
Normal file
966
drivers/net/sk98lin/h/skgepnmi.h
Normal file
@@ -0,0 +1,966 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Name: skgepnmi.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.62 $
|
||||
* Date: $Date: 2003/08/15 12:31:52 $
|
||||
* Purpose: Defines for Private Network Management Interface
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _SKGEPNMI_H_
|
||||
#define _SKGEPNMI_H_
|
||||
|
||||
/*
|
||||
* Include dependencies
|
||||
*/
|
||||
#include "h/sktypes.h"
|
||||
#include "h/skerror.h"
|
||||
#include "h/sktimer.h"
|
||||
#include "h/ski2c.h"
|
||||
#include "h/skaddr.h"
|
||||
#include "h/skrlmt.h"
|
||||
#include "h/skvpd.h"
|
||||
|
||||
/*
|
||||
* Management Database Version
|
||||
*/
|
||||
#define SK_PNMI_MDB_VERSION 0x00030001 /* 3.1 */
|
||||
|
||||
|
||||
/*
|
||||
* Event definitions
|
||||
*/
|
||||
#define SK_PNMI_EVT_SIRQ_OVERFLOW 1 /* Counter overflow */
|
||||
#define SK_PNMI_EVT_SEN_WAR_LOW 2 /* Lower war thres exceeded */
|
||||
#define SK_PNMI_EVT_SEN_WAR_UPP 3 /* Upper war thres exceeded */
|
||||
#define SK_PNMI_EVT_SEN_ERR_LOW 4 /* Lower err thres exceeded */
|
||||
#define SK_PNMI_EVT_SEN_ERR_UPP 5 /* Upper err thres exceeded */
|
||||
#define SK_PNMI_EVT_CHG_EST_TIMER 6 /* Timer event for RLMT Chg */
|
||||
#define SK_PNMI_EVT_UTILIZATION_TIMER 7 /* Timer event for Utiliza. */
|
||||
#define SK_PNMI_EVT_CLEAR_COUNTER 8 /* Clear statistic counters */
|
||||
#define SK_PNMI_EVT_XMAC_RESET 9 /* XMAC will be reset */
|
||||
|
||||
#define SK_PNMI_EVT_RLMT_PORT_UP 10 /* Port came logically up */
|
||||
#define SK_PNMI_EVT_RLMT_PORT_DOWN 11 /* Port went logically down */
|
||||
#define SK_PNMI_EVT_RLMT_SEGMENTATION 13 /* Two SP root bridges found */
|
||||
#define SK_PNMI_EVT_RLMT_ACTIVE_DOWN 14 /* Port went logically down */
|
||||
#define SK_PNMI_EVT_RLMT_ACTIVE_UP 15 /* Port came logically up */
|
||||
#define SK_PNMI_EVT_RLMT_SET_NETS 16 /* 1. Parameter is number of nets
|
||||
1 = single net; 2 = dual net */
|
||||
#define SK_PNMI_EVT_VCT_RESET 17 /* VCT port reset timer event started with SET. */
|
||||
|
||||
|
||||
/*
|
||||
* Return values
|
||||
*/
|
||||
#define SK_PNMI_ERR_OK 0
|
||||
#define SK_PNMI_ERR_GENERAL 1
|
||||
#define SK_PNMI_ERR_TOO_SHORT 2
|
||||
#define SK_PNMI_ERR_BAD_VALUE 3
|
||||
#define SK_PNMI_ERR_READ_ONLY 4
|
||||
#define SK_PNMI_ERR_UNKNOWN_OID 5
|
||||
#define SK_PNMI_ERR_UNKNOWN_INST 6
|
||||
#define SK_PNMI_ERR_UNKNOWN_NET 7
|
||||
#define SK_PNMI_ERR_NOT_SUPPORTED 10
|
||||
|
||||
|
||||
/*
|
||||
* Return values of driver reset function SK_DRIVER_RESET() and
|
||||
* driver event function SK_DRIVER_EVENT()
|
||||
*/
|
||||
#define SK_PNMI_ERR_OK 0
|
||||
#define SK_PNMI_ERR_FAIL 1
|
||||
|
||||
|
||||
/*
|
||||
* Return values of driver test function SK_DRIVER_SELFTEST()
|
||||
*/
|
||||
#define SK_PNMI_TST_UNKNOWN (1 << 0)
|
||||
#define SK_PNMI_TST_TRANCEIVER (1 << 1)
|
||||
#define SK_PNMI_TST_ASIC (1 << 2)
|
||||
#define SK_PNMI_TST_SENSOR (1 << 3)
|
||||
#define SK_PNMI_TST_POWERMGMT (1 << 4)
|
||||
#define SK_PNMI_TST_PCI (1 << 5)
|
||||
#define SK_PNMI_TST_MAC (1 << 6)
|
||||
|
||||
|
||||
/*
|
||||
* RLMT specific definitions
|
||||
*/
|
||||
#define SK_PNMI_RLMT_STATUS_STANDBY 1
|
||||
#define SK_PNMI_RLMT_STATUS_ACTIVE 2
|
||||
#define SK_PNMI_RLMT_STATUS_ERROR 3
|
||||
|
||||
#define SK_PNMI_RLMT_LSTAT_PHY_DOWN 1
|
||||
#define SK_PNMI_RLMT_LSTAT_AUTONEG 2
|
||||
#define SK_PNMI_RLMT_LSTAT_LOG_DOWN 3
|
||||
#define SK_PNMI_RLMT_LSTAT_LOG_UP 4
|
||||
#define SK_PNMI_RLMT_LSTAT_INDETERMINATED 5
|
||||
|
||||
#define SK_PNMI_RLMT_MODE_CHK_LINK (SK_RLMT_CHECK_LINK)
|
||||
#define SK_PNMI_RLMT_MODE_CHK_RX (SK_RLMT_CHECK_LOC_LINK)
|
||||
#define SK_PNMI_RLMT_MODE_CHK_SPT (SK_RLMT_CHECK_SEG)
|
||||
/* #define SK_PNMI_RLMT_MODE_CHK_EX */
|
||||
|
||||
/*
|
||||
* OID definition
|
||||
*/
|
||||
#ifndef _NDIS_ /* Check, whether NDIS already included OIDs */
|
||||
|
||||
#define OID_GEN_XMIT_OK 0x00020101
|
||||
#define OID_GEN_RCV_OK 0x00020102
|
||||
#define OID_GEN_XMIT_ERROR 0x00020103
|
||||
#define OID_GEN_RCV_ERROR 0x00020104
|
||||
#define OID_GEN_RCV_NO_BUFFER 0x00020105
|
||||
|
||||
/* #define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201 */
|
||||
#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
|
||||
/* #define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203 */
|
||||
#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
|
||||
/* #define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205 */
|
||||
#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
|
||||
/* #define OID_GEN_DIRECTED_BYTES_RCV 0x00020207 */
|
||||
#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
|
||||
/* #define OID_GEN_MULTICAST_BYTES_RCV 0x00020209 */
|
||||
#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
|
||||
/* #define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B */
|
||||
#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
|
||||
#define OID_GEN_RCV_CRC_ERROR 0x0002020D
|
||||
#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
|
||||
|
||||
#define OID_802_3_PERMANENT_ADDRESS 0x01010101
|
||||
#define OID_802_3_CURRENT_ADDRESS 0x01010102
|
||||
/* #define OID_802_3_MULTICAST_LIST 0x01010103 */
|
||||
/* #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 */
|
||||
/* #define OID_802_3_MAC_OPTIONS 0x01010105 */
|
||||
|
||||
#define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
|
||||
#define OID_802_3_XMIT_ONE_COLLISION 0x01020102
|
||||
#define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
|
||||
#define OID_802_3_XMIT_DEFERRED 0x01020201
|
||||
#define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
|
||||
#define OID_802_3_RCV_OVERRUN 0x01020203
|
||||
#define OID_802_3_XMIT_UNDERRUN 0x01020204
|
||||
#define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
|
||||
#define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
|
||||
|
||||
/*
|
||||
* PnP and PM OIDs
|
||||
*/
|
||||
#ifdef SK_POWER_MGMT
|
||||
#define OID_PNP_CAPABILITIES 0xFD010100
|
||||
#define OID_PNP_SET_POWER 0xFD010101
|
||||
#define OID_PNP_QUERY_POWER 0xFD010102
|
||||
#define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
|
||||
#define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
|
||||
#define OID_PNP_ENABLE_WAKE_UP 0xFD010106
|
||||
#endif /* SK_POWER_MGMT */
|
||||
|
||||
#endif /* _NDIS_ */
|
||||
|
||||
#define OID_SKGE_MDB_VERSION 0xFF010100
|
||||
#define OID_SKGE_SUPPORTED_LIST 0xFF010101
|
||||
#define OID_SKGE_VPD_FREE_BYTES 0xFF010102
|
||||
#define OID_SKGE_VPD_ENTRIES_LIST 0xFF010103
|
||||
#define OID_SKGE_VPD_ENTRIES_NUMBER 0xFF010104
|
||||
#define OID_SKGE_VPD_KEY 0xFF010105
|
||||
#define OID_SKGE_VPD_VALUE 0xFF010106
|
||||
#define OID_SKGE_VPD_ACCESS 0xFF010107
|
||||
#define OID_SKGE_VPD_ACTION 0xFF010108
|
||||
|
||||
#define OID_SKGE_PORT_NUMBER 0xFF010110
|
||||
#define OID_SKGE_DEVICE_TYPE 0xFF010111
|
||||
#define OID_SKGE_DRIVER_DESCR 0xFF010112
|
||||
#define OID_SKGE_DRIVER_VERSION 0xFF010113
|
||||
#define OID_SKGE_HW_DESCR 0xFF010114
|
||||
#define OID_SKGE_HW_VERSION 0xFF010115
|
||||
#define OID_SKGE_CHIPSET 0xFF010116
|
||||
#define OID_SKGE_ACTION 0xFF010117
|
||||
#define OID_SKGE_RESULT 0xFF010118
|
||||
#define OID_SKGE_BUS_TYPE 0xFF010119
|
||||
#define OID_SKGE_BUS_SPEED 0xFF01011A
|
||||
#define OID_SKGE_BUS_WIDTH 0xFF01011B
|
||||
/* 0xFF01011C unused */
|
||||
#define OID_SKGE_DIAG_ACTION 0xFF01011D
|
||||
#define OID_SKGE_DIAG_RESULT 0xFF01011E
|
||||
#define OID_SKGE_MTU 0xFF01011F
|
||||
#define OID_SKGE_PHYS_CUR_ADDR 0xFF010120
|
||||
#define OID_SKGE_PHYS_FAC_ADDR 0xFF010121
|
||||
#define OID_SKGE_PMD 0xFF010122
|
||||
#define OID_SKGE_CONNECTOR 0xFF010123
|
||||
#define OID_SKGE_LINK_CAP 0xFF010124
|
||||
#define OID_SKGE_LINK_MODE 0xFF010125
|
||||
#define OID_SKGE_LINK_MODE_STATUS 0xFF010126
|
||||
#define OID_SKGE_LINK_STATUS 0xFF010127
|
||||
#define OID_SKGE_FLOWCTRL_CAP 0xFF010128
|
||||
#define OID_SKGE_FLOWCTRL_MODE 0xFF010129
|
||||
#define OID_SKGE_FLOWCTRL_STATUS 0xFF01012A
|
||||
#define OID_SKGE_PHY_OPERATION_CAP 0xFF01012B
|
||||
#define OID_SKGE_PHY_OPERATION_MODE 0xFF01012C
|
||||
#define OID_SKGE_PHY_OPERATION_STATUS 0xFF01012D
|
||||
#define OID_SKGE_MULTICAST_LIST 0xFF01012E
|
||||
#define OID_SKGE_CURRENT_PACKET_FILTER 0xFF01012F
|
||||
|
||||
#define OID_SKGE_TRAP 0xFF010130
|
||||
#define OID_SKGE_TRAP_NUMBER 0xFF010131
|
||||
|
||||
#define OID_SKGE_RLMT_MODE 0xFF010140
|
||||
#define OID_SKGE_RLMT_PORT_NUMBER 0xFF010141
|
||||
#define OID_SKGE_RLMT_PORT_ACTIVE 0xFF010142
|
||||
#define OID_SKGE_RLMT_PORT_PREFERRED 0xFF010143
|
||||
#define OID_SKGE_INTERMEDIATE_SUPPORT 0xFF010160
|
||||
|
||||
#define OID_SKGE_SPEED_CAP 0xFF010170
|
||||
#define OID_SKGE_SPEED_MODE 0xFF010171
|
||||
#define OID_SKGE_SPEED_STATUS 0xFF010172
|
||||
|
||||
#define OID_SKGE_BOARDLEVEL 0xFF010180
|
||||
|
||||
#define OID_SKGE_SENSOR_NUMBER 0xFF020100
|
||||
#define OID_SKGE_SENSOR_INDEX 0xFF020101
|
||||
#define OID_SKGE_SENSOR_DESCR 0xFF020102
|
||||
#define OID_SKGE_SENSOR_TYPE 0xFF020103
|
||||
#define OID_SKGE_SENSOR_VALUE 0xFF020104
|
||||
#define OID_SKGE_SENSOR_WAR_THRES_LOW 0xFF020105
|
||||
#define OID_SKGE_SENSOR_WAR_THRES_UPP 0xFF020106
|
||||
#define OID_SKGE_SENSOR_ERR_THRES_LOW 0xFF020107
|
||||
#define OID_SKGE_SENSOR_ERR_THRES_UPP 0xFF020108
|
||||
#define OID_SKGE_SENSOR_STATUS 0xFF020109
|
||||
#define OID_SKGE_SENSOR_WAR_CTS 0xFF02010A
|
||||
#define OID_SKGE_SENSOR_ERR_CTS 0xFF02010B
|
||||
#define OID_SKGE_SENSOR_WAR_TIME 0xFF02010C
|
||||
#define OID_SKGE_SENSOR_ERR_TIME 0xFF02010D
|
||||
|
||||
#define OID_SKGE_CHKSM_NUMBER 0xFF020110
|
||||
#define OID_SKGE_CHKSM_RX_OK_CTS 0xFF020111
|
||||
#define OID_SKGE_CHKSM_RX_UNABLE_CTS 0xFF020112
|
||||
#define OID_SKGE_CHKSM_RX_ERR_CTS 0xFF020113
|
||||
#define OID_SKGE_CHKSM_TX_OK_CTS 0xFF020114
|
||||
#define OID_SKGE_CHKSM_TX_UNABLE_CTS 0xFF020115
|
||||
|
||||
#define OID_SKGE_STAT_TX 0xFF020120
|
||||
#define OID_SKGE_STAT_TX_OCTETS 0xFF020121
|
||||
#define OID_SKGE_STAT_TX_BROADCAST 0xFF020122
|
||||
#define OID_SKGE_STAT_TX_MULTICAST 0xFF020123
|
||||
#define OID_SKGE_STAT_TX_UNICAST 0xFF020124
|
||||
#define OID_SKGE_STAT_TX_LONGFRAMES 0xFF020125
|
||||
#define OID_SKGE_STAT_TX_BURST 0xFF020126
|
||||
#define OID_SKGE_STAT_TX_PFLOWC 0xFF020127
|
||||
#define OID_SKGE_STAT_TX_FLOWC 0xFF020128
|
||||
#define OID_SKGE_STAT_TX_SINGLE_COL 0xFF020129
|
||||
#define OID_SKGE_STAT_TX_MULTI_COL 0xFF02012A
|
||||
#define OID_SKGE_STAT_TX_EXCESS_COL 0xFF02012B
|
||||
#define OID_SKGE_STAT_TX_LATE_COL 0xFF02012C
|
||||
#define OID_SKGE_STAT_TX_DEFFERAL 0xFF02012D
|
||||
#define OID_SKGE_STAT_TX_EXCESS_DEF 0xFF02012E
|
||||
#define OID_SKGE_STAT_TX_UNDERRUN 0xFF02012F
|
||||
#define OID_SKGE_STAT_TX_CARRIER 0xFF020130
|
||||
/* #define OID_SKGE_STAT_TX_UTIL 0xFF020131 */
|
||||
#define OID_SKGE_STAT_TX_64 0xFF020132
|
||||
#define OID_SKGE_STAT_TX_127 0xFF020133
|
||||
#define OID_SKGE_STAT_TX_255 0xFF020134
|
||||
#define OID_SKGE_STAT_TX_511 0xFF020135
|
||||
#define OID_SKGE_STAT_TX_1023 0xFF020136
|
||||
#define OID_SKGE_STAT_TX_MAX 0xFF020137
|
||||
#define OID_SKGE_STAT_TX_SYNC 0xFF020138
|
||||
#define OID_SKGE_STAT_TX_SYNC_OCTETS 0xFF020139
|
||||
#define OID_SKGE_STAT_RX 0xFF02013A
|
||||
#define OID_SKGE_STAT_RX_OCTETS 0xFF02013B
|
||||
#define OID_SKGE_STAT_RX_BROADCAST 0xFF02013C
|
||||
#define OID_SKGE_STAT_RX_MULTICAST 0xFF02013D
|
||||
#define OID_SKGE_STAT_RX_UNICAST 0xFF02013E
|
||||
#define OID_SKGE_STAT_RX_PFLOWC 0xFF02013F
|
||||
#define OID_SKGE_STAT_RX_FLOWC 0xFF020140
|
||||
#define OID_SKGE_STAT_RX_PFLOWC_ERR 0xFF020141
|
||||
#define OID_SKGE_STAT_RX_FLOWC_UNKWN 0xFF020142
|
||||
#define OID_SKGE_STAT_RX_BURST 0xFF020143
|
||||
#define OID_SKGE_STAT_RX_MISSED 0xFF020144
|
||||
#define OID_SKGE_STAT_RX_FRAMING 0xFF020145
|
||||
#define OID_SKGE_STAT_RX_OVERFLOW 0xFF020146
|
||||
#define OID_SKGE_STAT_RX_JABBER 0xFF020147
|
||||
#define OID_SKGE_STAT_RX_CARRIER 0xFF020148
|
||||
#define OID_SKGE_STAT_RX_IR_LENGTH 0xFF020149
|
||||
#define OID_SKGE_STAT_RX_SYMBOL 0xFF02014A
|
||||
#define OID_SKGE_STAT_RX_SHORTS 0xFF02014B
|
||||
#define OID_SKGE_STAT_RX_RUNT 0xFF02014C
|
||||
#define OID_SKGE_STAT_RX_CEXT 0xFF02014D
|
||||
#define OID_SKGE_STAT_RX_TOO_LONG 0xFF02014E
|
||||
#define OID_SKGE_STAT_RX_FCS 0xFF02014F
|
||||
/* #define OID_SKGE_STAT_RX_UTIL 0xFF020150 */
|
||||
#define OID_SKGE_STAT_RX_64 0xFF020151
|
||||
#define OID_SKGE_STAT_RX_127 0xFF020152
|
||||
#define OID_SKGE_STAT_RX_255 0xFF020153
|
||||
#define OID_SKGE_STAT_RX_511 0xFF020154
|
||||
#define OID_SKGE_STAT_RX_1023 0xFF020155
|
||||
#define OID_SKGE_STAT_RX_MAX 0xFF020156
|
||||
#define OID_SKGE_STAT_RX_LONGFRAMES 0xFF020157
|
||||
|
||||
#define OID_SKGE_RLMT_CHANGE_CTS 0xFF020160
|
||||
#define OID_SKGE_RLMT_CHANGE_TIME 0xFF020161
|
||||
#define OID_SKGE_RLMT_CHANGE_ESTIM 0xFF020162
|
||||
#define OID_SKGE_RLMT_CHANGE_THRES 0xFF020163
|
||||
|
||||
#define OID_SKGE_RLMT_PORT_INDEX 0xFF020164
|
||||
#define OID_SKGE_RLMT_STATUS 0xFF020165
|
||||
#define OID_SKGE_RLMT_TX_HELLO_CTS 0xFF020166
|
||||
#define OID_SKGE_RLMT_RX_HELLO_CTS 0xFF020167
|
||||
#define OID_SKGE_RLMT_TX_SP_REQ_CTS 0xFF020168
|
||||
#define OID_SKGE_RLMT_RX_SP_CTS 0xFF020169
|
||||
|
||||
#define OID_SKGE_RLMT_MONITOR_NUMBER 0xFF010150
|
||||
#define OID_SKGE_RLMT_MONITOR_INDEX 0xFF010151
|
||||
#define OID_SKGE_RLMT_MONITOR_ADDR 0xFF010152
|
||||
#define OID_SKGE_RLMT_MONITOR_ERRS 0xFF010153
|
||||
#define OID_SKGE_RLMT_MONITOR_TIMESTAMP 0xFF010154
|
||||
#define OID_SKGE_RLMT_MONITOR_ADMIN 0xFF010155
|
||||
|
||||
#define OID_SKGE_TX_SW_QUEUE_LEN 0xFF020170
|
||||
#define OID_SKGE_TX_SW_QUEUE_MAX 0xFF020171
|
||||
#define OID_SKGE_TX_RETRY 0xFF020172
|
||||
#define OID_SKGE_RX_INTR_CTS 0xFF020173
|
||||
#define OID_SKGE_TX_INTR_CTS 0xFF020174
|
||||
#define OID_SKGE_RX_NO_BUF_CTS 0xFF020175
|
||||
#define OID_SKGE_TX_NO_BUF_CTS 0xFF020176
|
||||
#define OID_SKGE_TX_USED_DESCR_NO 0xFF020177
|
||||
#define OID_SKGE_RX_DELIVERED_CTS 0xFF020178
|
||||
#define OID_SKGE_RX_OCTETS_DELIV_CTS 0xFF020179
|
||||
#define OID_SKGE_RX_HW_ERROR_CTS 0xFF02017A
|
||||
#define OID_SKGE_TX_HW_ERROR_CTS 0xFF02017B
|
||||
#define OID_SKGE_IN_ERRORS_CTS 0xFF02017C
|
||||
#define OID_SKGE_OUT_ERROR_CTS 0xFF02017D
|
||||
#define OID_SKGE_ERR_RECOVERY_CTS 0xFF02017E
|
||||
#define OID_SKGE_SYSUPTIME 0xFF02017F
|
||||
|
||||
#define OID_SKGE_ALL_DATA 0xFF020190
|
||||
|
||||
/* Defines for VCT. */
|
||||
#define OID_SKGE_VCT_GET 0xFF020200
|
||||
#define OID_SKGE_VCT_SET 0xFF020201
|
||||
#define OID_SKGE_VCT_STATUS 0xFF020202
|
||||
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
/* Defines for driver DIAG mode. */
|
||||
#define OID_SKGE_DIAG_MODE 0xFF020204
|
||||
#endif /* SK_DIAG_SUPPORT */
|
||||
|
||||
/* New OIDs */
|
||||
#define OID_SKGE_DRIVER_RELDATE 0xFF020210
|
||||
#define OID_SKGE_DRIVER_FILENAME 0xFF020211
|
||||
#define OID_SKGE_CHIPID 0xFF020212
|
||||
#define OID_SKGE_RAMSIZE 0xFF020213
|
||||
#define OID_SKGE_VAUXAVAIL 0xFF020214
|
||||
#define OID_SKGE_PHY_TYPE 0xFF020215
|
||||
#define OID_SKGE_PHY_LP_MODE 0xFF020216
|
||||
|
||||
/* VCT struct to store a backup copy of VCT data after a port reset. */
|
||||
typedef struct s_PnmiVct {
|
||||
SK_U8 VctStatus;
|
||||
SK_U8 PCableLen;
|
||||
SK_U32 PMdiPairLen[4];
|
||||
SK_U8 PMdiPairSts[4];
|
||||
} SK_PNMI_VCT;
|
||||
|
||||
|
||||
/* VCT status values (to be given to CPA via OID_SKGE_VCT_STATUS). */
|
||||
#define SK_PNMI_VCT_NONE 0
|
||||
#define SK_PNMI_VCT_OLD_VCT_DATA 1
|
||||
#define SK_PNMI_VCT_NEW_VCT_DATA 2
|
||||
#define SK_PNMI_VCT_OLD_DSP_DATA 4
|
||||
#define SK_PNMI_VCT_NEW_DSP_DATA 8
|
||||
#define SK_PNMI_VCT_RUNNING 16
|
||||
|
||||
|
||||
/* VCT cable test status. */
|
||||
#define SK_PNMI_VCT_NORMAL_CABLE 0
|
||||
#define SK_PNMI_VCT_SHORT_CABLE 1
|
||||
#define SK_PNMI_VCT_OPEN_CABLE 2
|
||||
#define SK_PNMI_VCT_TEST_FAIL 3
|
||||
#define SK_PNMI_VCT_IMPEDANCE_MISMATCH 4
|
||||
|
||||
#define OID_SKGE_TRAP_SEN_WAR_LOW 500
|
||||
#define OID_SKGE_TRAP_SEN_WAR_UPP 501
|
||||
#define OID_SKGE_TRAP_SEN_ERR_LOW 502
|
||||
#define OID_SKGE_TRAP_SEN_ERR_UPP 503
|
||||
#define OID_SKGE_TRAP_RLMT_CHANGE_THRES 520
|
||||
#define OID_SKGE_TRAP_RLMT_CHANGE_PORT 521
|
||||
#define OID_SKGE_TRAP_RLMT_PORT_DOWN 522
|
||||
#define OID_SKGE_TRAP_RLMT_PORT_UP 523
|
||||
#define OID_SKGE_TRAP_RLMT_SEGMENTATION 524
|
||||
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
/* Defines for driver DIAG mode. */
|
||||
#define SK_DIAG_ATTACHED 2
|
||||
#define SK_DIAG_RUNNING 1
|
||||
#define SK_DIAG_IDLE 0
|
||||
#endif /* SK_DIAG_SUPPORT */
|
||||
|
||||
/*
|
||||
* Generic PNMI IOCTL subcommand definitions.
|
||||
*/
|
||||
#define SK_GET_SINGLE_VAR 1
|
||||
#define SK_SET_SINGLE_VAR 2
|
||||
#define SK_PRESET_SINGLE_VAR 3
|
||||
#define SK_GET_FULL_MIB 4
|
||||
#define SK_SET_FULL_MIB 5
|
||||
#define SK_PRESET_FULL_MIB 6
|
||||
|
||||
|
||||
/*
|
||||
* Define error numbers and messages for syslog
|
||||
*/
|
||||
#define SK_PNMI_ERR001 (SK_ERRBASE_PNMI + 1)
|
||||
#define SK_PNMI_ERR001MSG "SkPnmiGetStruct: Unknown OID"
|
||||
#define SK_PNMI_ERR002 (SK_ERRBASE_PNMI + 2)
|
||||
#define SK_PNMI_ERR002MSG "SkPnmiGetStruct: Cannot read VPD keys"
|
||||
#define SK_PNMI_ERR003 (SK_ERRBASE_PNMI + 3)
|
||||
#define SK_PNMI_ERR003MSG "OidStruct: Called with wrong OID"
|
||||
#define SK_PNMI_ERR004 (SK_ERRBASE_PNMI + 4)
|
||||
#define SK_PNMI_ERR004MSG "OidStruct: Called with wrong action"
|
||||
#define SK_PNMI_ERR005 (SK_ERRBASE_PNMI + 5)
|
||||
#define SK_PNMI_ERR005MSG "Perform: Cannot reset driver"
|
||||
#define SK_PNMI_ERR006 (SK_ERRBASE_PNMI + 6)
|
||||
#define SK_PNMI_ERR006MSG "Perform: Unknown OID action command"
|
||||
#define SK_PNMI_ERR007 (SK_ERRBASE_PNMI + 7)
|
||||
#define SK_PNMI_ERR007MSG "General: Driver description not initialized"
|
||||
#define SK_PNMI_ERR008 (SK_ERRBASE_PNMI + 8)
|
||||
#define SK_PNMI_ERR008MSG "Addr: Tried to get unknown OID"
|
||||
#define SK_PNMI_ERR009 (SK_ERRBASE_PNMI + 9)
|
||||
#define SK_PNMI_ERR009MSG "Addr: Unknown OID"
|
||||
#define SK_PNMI_ERR010 (SK_ERRBASE_PNMI + 10)
|
||||
#define SK_PNMI_ERR010MSG "CsumStat: Unknown OID"
|
||||
#define SK_PNMI_ERR011 (SK_ERRBASE_PNMI + 11)
|
||||
#define SK_PNMI_ERR011MSG "SensorStat: Sensor descr string too long"
|
||||
#define SK_PNMI_ERR012 (SK_ERRBASE_PNMI + 12)
|
||||
#define SK_PNMI_ERR012MSG "SensorStat: Unknown OID"
|
||||
#define SK_PNMI_ERR013 (SK_ERRBASE_PNMI + 13)
|
||||
#define SK_PNMI_ERR013MSG ""
|
||||
#define SK_PNMI_ERR014 (SK_ERRBASE_PNMI + 14)
|
||||
#define SK_PNMI_ERR014MSG "Vpd: Cannot read VPD keys"
|
||||
#define SK_PNMI_ERR015 (SK_ERRBASE_PNMI + 15)
|
||||
#define SK_PNMI_ERR015MSG "Vpd: Internal array for VPD keys to small"
|
||||
#define SK_PNMI_ERR016 (SK_ERRBASE_PNMI + 16)
|
||||
#define SK_PNMI_ERR016MSG "Vpd: Key string too long"
|
||||
#define SK_PNMI_ERR017 (SK_ERRBASE_PNMI + 17)
|
||||
#define SK_PNMI_ERR017MSG "Vpd: Invalid VPD status pointer"
|
||||
#define SK_PNMI_ERR018 (SK_ERRBASE_PNMI + 18)
|
||||
#define SK_PNMI_ERR018MSG "Vpd: VPD data not valid"
|
||||
#define SK_PNMI_ERR019 (SK_ERRBASE_PNMI + 19)
|
||||
#define SK_PNMI_ERR019MSG "Vpd: VPD entries list string too long"
|
||||
#define SK_PNMI_ERR021 (SK_ERRBASE_PNMI + 21)
|
||||
#define SK_PNMI_ERR021MSG "Vpd: VPD data string too long"
|
||||
#define SK_PNMI_ERR022 (SK_ERRBASE_PNMI + 22)
|
||||
#define SK_PNMI_ERR022MSG "Vpd: VPD data string too long should be errored before"
|
||||
#define SK_PNMI_ERR023 (SK_ERRBASE_PNMI + 23)
|
||||
#define SK_PNMI_ERR023MSG "Vpd: Unknown OID in get action"
|
||||
#define SK_PNMI_ERR024 (SK_ERRBASE_PNMI + 24)
|
||||
#define SK_PNMI_ERR024MSG "Vpd: Unknown OID in preset/set action"
|
||||
#define SK_PNMI_ERR025 (SK_ERRBASE_PNMI + 25)
|
||||
#define SK_PNMI_ERR025MSG "Vpd: Cannot write VPD after modify entry"
|
||||
#define SK_PNMI_ERR026 (SK_ERRBASE_PNMI + 26)
|
||||
#define SK_PNMI_ERR026MSG "Vpd: Cannot update VPD"
|
||||
#define SK_PNMI_ERR027 (SK_ERRBASE_PNMI + 27)
|
||||
#define SK_PNMI_ERR027MSG "Vpd: Cannot delete VPD entry"
|
||||
#define SK_PNMI_ERR028 (SK_ERRBASE_PNMI + 28)
|
||||
#define SK_PNMI_ERR028MSG "Vpd: Cannot update VPD after delete entry"
|
||||
#define SK_PNMI_ERR029 (SK_ERRBASE_PNMI + 29)
|
||||
#define SK_PNMI_ERR029MSG "General: Driver description string too long"
|
||||
#define SK_PNMI_ERR030 (SK_ERRBASE_PNMI + 30)
|
||||
#define SK_PNMI_ERR030MSG "General: Driver version not initialized"
|
||||
#define SK_PNMI_ERR031 (SK_ERRBASE_PNMI + 31)
|
||||
#define SK_PNMI_ERR031MSG "General: Driver version string too long"
|
||||
#define SK_PNMI_ERR032 (SK_ERRBASE_PNMI + 32)
|
||||
#define SK_PNMI_ERR032MSG "General: Cannot read VPD Name for HW descr"
|
||||
#define SK_PNMI_ERR033 (SK_ERRBASE_PNMI + 33)
|
||||
#define SK_PNMI_ERR033MSG "General: HW description string too long"
|
||||
#define SK_PNMI_ERR034 (SK_ERRBASE_PNMI + 34)
|
||||
#define SK_PNMI_ERR034MSG "General: Unknown OID"
|
||||
#define SK_PNMI_ERR035 (SK_ERRBASE_PNMI + 35)
|
||||
#define SK_PNMI_ERR035MSG "Rlmt: Unknown OID"
|
||||
#define SK_PNMI_ERR036 (SK_ERRBASE_PNMI + 36)
|
||||
#define SK_PNMI_ERR036MSG ""
|
||||
#define SK_PNMI_ERR037 (SK_ERRBASE_PNMI + 37)
|
||||
#define SK_PNMI_ERR037MSG "Rlmt: SK_RLMT_MODE_CHANGE event return not 0"
|
||||
#define SK_PNMI_ERR038 (SK_ERRBASE_PNMI + 38)
|
||||
#define SK_PNMI_ERR038MSG "Rlmt: SK_RLMT_PREFPORT_CHANGE event return not 0"
|
||||
#define SK_PNMI_ERR039 (SK_ERRBASE_PNMI + 39)
|
||||
#define SK_PNMI_ERR039MSG "RlmtStat: Unknown OID"
|
||||
#define SK_PNMI_ERR040 (SK_ERRBASE_PNMI + 40)
|
||||
#define SK_PNMI_ERR040MSG "PowerManagement: Unknown OID"
|
||||
#define SK_PNMI_ERR041 (SK_ERRBASE_PNMI + 41)
|
||||
#define SK_PNMI_ERR041MSG "MacPrivateConf: Unknown OID"
|
||||
#define SK_PNMI_ERR042 (SK_ERRBASE_PNMI + 42)
|
||||
#define SK_PNMI_ERR042MSG "MacPrivateConf: SK_HWEV_SET_ROLE returned not 0"
|
||||
#define SK_PNMI_ERR043 (SK_ERRBASE_PNMI + 43)
|
||||
#define SK_PNMI_ERR043MSG "MacPrivateConf: SK_HWEV_SET_LMODE returned not 0"
|
||||
#define SK_PNMI_ERR044 (SK_ERRBASE_PNMI + 44)
|
||||
#define SK_PNMI_ERR044MSG "MacPrivateConf: SK_HWEV_SET_FLOWMODE returned not 0"
|
||||
#define SK_PNMI_ERR045 (SK_ERRBASE_PNMI + 45)
|
||||
#define SK_PNMI_ERR045MSG "MacPrivateConf: SK_HWEV_SET_SPEED returned not 0"
|
||||
#define SK_PNMI_ERR046 (SK_ERRBASE_PNMI + 46)
|
||||
#define SK_PNMI_ERR046MSG "Monitor: Unknown OID"
|
||||
#define SK_PNMI_ERR047 (SK_ERRBASE_PNMI + 47)
|
||||
#define SK_PNMI_ERR047MSG "SirqUpdate: Event function returns not 0"
|
||||
#define SK_PNMI_ERR048 (SK_ERRBASE_PNMI + 48)
|
||||
#define SK_PNMI_ERR048MSG "RlmtUpdate: Event function returns not 0"
|
||||
#define SK_PNMI_ERR049 (SK_ERRBASE_PNMI + 49)
|
||||
#define SK_PNMI_ERR049MSG "SkPnmiInit: Invalid size of 'CounterOffset' struct!!"
|
||||
#define SK_PNMI_ERR050 (SK_ERRBASE_PNMI + 50)
|
||||
#define SK_PNMI_ERR050MSG "SkPnmiInit: Invalid size of 'StatAddr' table!!"
|
||||
#define SK_PNMI_ERR051 (SK_ERRBASE_PNMI + 51)
|
||||
#define SK_PNMI_ERR051MSG "SkPnmiEvent: Port switch suspicious"
|
||||
#define SK_PNMI_ERR052 (SK_ERRBASE_PNMI + 52)
|
||||
#define SK_PNMI_ERR052MSG ""
|
||||
#define SK_PNMI_ERR053 (SK_ERRBASE_PNMI + 53)
|
||||
#define SK_PNMI_ERR053MSG "General: Driver release date not initialized"
|
||||
#define SK_PNMI_ERR054 (SK_ERRBASE_PNMI + 54)
|
||||
#define SK_PNMI_ERR054MSG "General: Driver release date string too long"
|
||||
#define SK_PNMI_ERR055 (SK_ERRBASE_PNMI + 55)
|
||||
#define SK_PNMI_ERR055MSG "General: Driver file name not initialized"
|
||||
#define SK_PNMI_ERR056 (SK_ERRBASE_PNMI + 56)
|
||||
#define SK_PNMI_ERR056MSG "General: Driver file name string too long"
|
||||
|
||||
/*
|
||||
* Management counter macros called by the driver
|
||||
*/
|
||||
#define SK_PNMI_SET_DRIVER_DESCR(pAC,v) ((pAC)->Pnmi.pDriverDescription = \
|
||||
(char *)(v))
|
||||
|
||||
#define SK_PNMI_SET_DRIVER_VER(pAC,v) ((pAC)->Pnmi.pDriverVersion = \
|
||||
(char *)(v))
|
||||
|
||||
#define SK_PNMI_SET_DRIVER_RELDATE(pAC,v) ((pAC)->Pnmi.pDriverReleaseDate = \
|
||||
(char *)(v))
|
||||
|
||||
#define SK_PNMI_SET_DRIVER_FILENAME(pAC,v) ((pAC)->Pnmi.pDriverFileName = \
|
||||
(char *)(v))
|
||||
|
||||
#define SK_PNMI_CNT_TX_QUEUE_LEN(pAC,v,p) \
|
||||
{ \
|
||||
(pAC)->Pnmi.Port[p].TxSwQueueLen = (SK_U64)(v); \
|
||||
if ((pAC)->Pnmi.Port[p].TxSwQueueLen > (pAC)->Pnmi.Port[p].TxSwQueueMax) { \
|
||||
(pAC)->Pnmi.Port[p].TxSwQueueMax = (pAC)->Pnmi.Port[p].TxSwQueueLen; \
|
||||
} \
|
||||
}
|
||||
#define SK_PNMI_CNT_TX_RETRY(pAC,p) (((pAC)->Pnmi.Port[p].TxRetryCts)++)
|
||||
#define SK_PNMI_CNT_RX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].RxIntrCts)++)
|
||||
#define SK_PNMI_CNT_TX_INTR(pAC,p) (((pAC)->Pnmi.Port[p].TxIntrCts)++)
|
||||
#define SK_PNMI_CNT_NO_RX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].RxNoBufCts)++)
|
||||
#define SK_PNMI_CNT_NO_TX_BUF(pAC,p) (((pAC)->Pnmi.Port[p].TxNoBufCts)++)
|
||||
#define SK_PNMI_CNT_USED_TX_DESCR(pAC,v,p) \
|
||||
((pAC)->Pnmi.Port[p].TxUsedDescrNo=(SK_U64)(v));
|
||||
#define SK_PNMI_CNT_RX_OCTETS_DELIVERED(pAC,v,p) \
|
||||
{ \
|
||||
((pAC)->Pnmi.Port[p].RxDeliveredCts)++; \
|
||||
(pAC)->Pnmi.Port[p].RxOctetsDeliveredCts += (SK_U64)(v); \
|
||||
}
|
||||
#define SK_PNMI_CNT_ERR_RECOVERY(pAC,p) (((pAC)->Pnmi.Port[p].ErrRecoveryCts)++);
|
||||
|
||||
#define SK_PNMI_CNT_SYNC_OCTETS(pAC,p,v) \
|
||||
{ \
|
||||
if ((p) < SK_MAX_MACS) { \
|
||||
((pAC)->Pnmi.Port[p].StatSyncCts)++; \
|
||||
(pAC)->Pnmi.Port[p].StatSyncOctetsCts += (SK_U64)(v); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SK_PNMI_CNT_RX_LONGFRAMES(pAC,p) \
|
||||
{ \
|
||||
if ((p) < SK_MAX_MACS) { \
|
||||
((pAC)->Pnmi.Port[p].StatRxLongFrameCts++); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SK_PNMI_CNT_RX_FRAMETOOLONG(pAC,p) \
|
||||
{ \
|
||||
if ((p) < SK_MAX_MACS) { \
|
||||
((pAC)->Pnmi.Port[p].StatRxFrameTooLongCts++); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SK_PNMI_CNT_RX_PMACC_ERR(pAC,p) \
|
||||
{ \
|
||||
if ((p) < SK_MAX_MACS) { \
|
||||
((pAC)->Pnmi.Port[p].StatRxPMaccErr++); \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* Conversion Macros
|
||||
*/
|
||||
#define SK_PNMI_PORT_INST2LOG(i) ((unsigned int)(i) - 1)
|
||||
#define SK_PNMI_PORT_LOG2INST(l) ((unsigned int)(l) + 1)
|
||||
#define SK_PNMI_PORT_PHYS2LOG(p) ((unsigned int)(p) + 1)
|
||||
#define SK_PNMI_PORT_LOG2PHYS(pAC,l) ((unsigned int)(l) - 1)
|
||||
#define SK_PNMI_PORT_PHYS2INST(pAC,p) \
|
||||
(pAC->Pnmi.DualNetActiveFlag ? 2 : ((unsigned int)(p) + 2))
|
||||
#define SK_PNMI_PORT_INST2PHYS(pAC,i) ((unsigned int)(i) - 2)
|
||||
|
||||
/*
|
||||
* Structure definition for SkPnmiGetStruct and SkPnmiSetStruct
|
||||
*/
|
||||
#define SK_PNMI_VPD_KEY_SIZE 5
|
||||
#define SK_PNMI_VPD_BUFSIZE (VPD_SIZE)
|
||||
#define SK_PNMI_VPD_ENTRIES (VPD_SIZE / 4)
|
||||
#define SK_PNMI_VPD_DATALEN 128 /* Number of data bytes */
|
||||
|
||||
#define SK_PNMI_MULTICAST_LISTLEN 64
|
||||
#define SK_PNMI_SENSOR_ENTRIES (SK_MAX_SENSORS)
|
||||
#define SK_PNMI_CHECKSUM_ENTRIES 3
|
||||
#define SK_PNMI_MAC_ENTRIES (SK_MAX_MACS + 1)
|
||||
#define SK_PNMI_MONITOR_ENTRIES 20
|
||||
#define SK_PNMI_TRAP_ENTRIES 10
|
||||
#define SK_PNMI_TRAPLEN 128
|
||||
#define SK_PNMI_STRINGLEN1 80
|
||||
#define SK_PNMI_STRINGLEN2 25
|
||||
#define SK_PNMI_TRAP_QUEUE_LEN 512
|
||||
|
||||
typedef struct s_PnmiVpd {
|
||||
char VpdKey[SK_PNMI_VPD_KEY_SIZE];
|
||||
char VpdValue[SK_PNMI_VPD_DATALEN];
|
||||
SK_U8 VpdAccess;
|
||||
SK_U8 VpdAction;
|
||||
} SK_PNMI_VPD;
|
||||
|
||||
typedef struct s_PnmiSensor {
|
||||
SK_U8 SensorIndex;
|
||||
char SensorDescr[SK_PNMI_STRINGLEN2];
|
||||
SK_U8 SensorType;
|
||||
SK_U32 SensorValue;
|
||||
SK_U32 SensorWarningThresholdLow;
|
||||
SK_U32 SensorWarningThresholdHigh;
|
||||
SK_U32 SensorErrorThresholdLow;
|
||||
SK_U32 SensorErrorThresholdHigh;
|
||||
SK_U8 SensorStatus;
|
||||
SK_U64 SensorWarningCts;
|
||||
SK_U64 SensorErrorCts;
|
||||
SK_U64 SensorWarningTimestamp;
|
||||
SK_U64 SensorErrorTimestamp;
|
||||
} SK_PNMI_SENSOR;
|
||||
|
||||
typedef struct s_PnmiChecksum {
|
||||
SK_U64 ChecksumRxOkCts;
|
||||
SK_U64 ChecksumRxUnableCts;
|
||||
SK_U64 ChecksumRxErrCts;
|
||||
SK_U64 ChecksumTxOkCts;
|
||||
SK_U64 ChecksumTxUnableCts;
|
||||
} SK_PNMI_CHECKSUM;
|
||||
|
||||
typedef struct s_PnmiStat {
|
||||
SK_U64 StatTxOkCts;
|
||||
SK_U64 StatTxOctetsOkCts;
|
||||
SK_U64 StatTxBroadcastOkCts;
|
||||
SK_U64 StatTxMulticastOkCts;
|
||||
SK_U64 StatTxUnicastOkCts;
|
||||
SK_U64 StatTxLongFramesCts;
|
||||
SK_U64 StatTxBurstCts;
|
||||
SK_U64 StatTxPauseMacCtrlCts;
|
||||
SK_U64 StatTxMacCtrlCts;
|
||||
SK_U64 StatTxSingleCollisionCts;
|
||||
SK_U64 StatTxMultipleCollisionCts;
|
||||
SK_U64 StatTxExcessiveCollisionCts;
|
||||
SK_U64 StatTxLateCollisionCts;
|
||||
SK_U64 StatTxDeferralCts;
|
||||
SK_U64 StatTxExcessiveDeferralCts;
|
||||
SK_U64 StatTxFifoUnderrunCts;
|
||||
SK_U64 StatTxCarrierCts;
|
||||
SK_U64 Dummy1; /* StatTxUtilization */
|
||||
SK_U64 StatTx64Cts;
|
||||
SK_U64 StatTx127Cts;
|
||||
SK_U64 StatTx255Cts;
|
||||
SK_U64 StatTx511Cts;
|
||||
SK_U64 StatTx1023Cts;
|
||||
SK_U64 StatTxMaxCts;
|
||||
SK_U64 StatTxSyncCts;
|
||||
SK_U64 StatTxSyncOctetsCts;
|
||||
SK_U64 StatRxOkCts;
|
||||
SK_U64 StatRxOctetsOkCts;
|
||||
SK_U64 StatRxBroadcastOkCts;
|
||||
SK_U64 StatRxMulticastOkCts;
|
||||
SK_U64 StatRxUnicastOkCts;
|
||||
SK_U64 StatRxLongFramesCts;
|
||||
SK_U64 StatRxPauseMacCtrlCts;
|
||||
SK_U64 StatRxMacCtrlCts;
|
||||
SK_U64 StatRxPauseMacCtrlErrorCts;
|
||||
SK_U64 StatRxMacCtrlUnknownCts;
|
||||
SK_U64 StatRxBurstCts;
|
||||
SK_U64 StatRxMissedCts;
|
||||
SK_U64 StatRxFramingCts;
|
||||
SK_U64 StatRxFifoOverflowCts;
|
||||
SK_U64 StatRxJabberCts;
|
||||
SK_U64 StatRxCarrierCts;
|
||||
SK_U64 StatRxIRLengthCts;
|
||||
SK_U64 StatRxSymbolCts;
|
||||
SK_U64 StatRxShortsCts;
|
||||
SK_U64 StatRxRuntCts;
|
||||
SK_U64 StatRxCextCts;
|
||||
SK_U64 StatRxTooLongCts;
|
||||
SK_U64 StatRxFcsCts;
|
||||
SK_U64 Dummy2; /* StatRxUtilization */
|
||||
SK_U64 StatRx64Cts;
|
||||
SK_U64 StatRx127Cts;
|
||||
SK_U64 StatRx255Cts;
|
||||
SK_U64 StatRx511Cts;
|
||||
SK_U64 StatRx1023Cts;
|
||||
SK_U64 StatRxMaxCts;
|
||||
} SK_PNMI_STAT;
|
||||
|
||||
typedef struct s_PnmiConf {
|
||||
char ConfMacCurrentAddr[6];
|
||||
char ConfMacFactoryAddr[6];
|
||||
SK_U8 ConfPMD;
|
||||
SK_U8 ConfConnector;
|
||||
SK_U32 ConfPhyType;
|
||||
SK_U32 ConfPhyMode;
|
||||
SK_U8 ConfLinkCapability;
|
||||
SK_U8 ConfLinkMode;
|
||||
SK_U8 ConfLinkModeStatus;
|
||||
SK_U8 ConfLinkStatus;
|
||||
SK_U8 ConfFlowCtrlCapability;
|
||||
SK_U8 ConfFlowCtrlMode;
|
||||
SK_U8 ConfFlowCtrlStatus;
|
||||
SK_U8 ConfPhyOperationCapability;
|
||||
SK_U8 ConfPhyOperationMode;
|
||||
SK_U8 ConfPhyOperationStatus;
|
||||
SK_U8 ConfSpeedCapability;
|
||||
SK_U8 ConfSpeedMode;
|
||||
SK_U8 ConfSpeedStatus;
|
||||
} SK_PNMI_CONF;
|
||||
|
||||
typedef struct s_PnmiRlmt {
|
||||
SK_U32 RlmtIndex;
|
||||
SK_U32 RlmtStatus;
|
||||
SK_U64 RlmtTxHelloCts;
|
||||
SK_U64 RlmtRxHelloCts;
|
||||
SK_U64 RlmtTxSpHelloReqCts;
|
||||
SK_U64 RlmtRxSpHelloCts;
|
||||
} SK_PNMI_RLMT;
|
||||
|
||||
typedef struct s_PnmiRlmtMonitor {
|
||||
SK_U32 RlmtMonitorIndex;
|
||||
char RlmtMonitorAddr[6];
|
||||
SK_U64 RlmtMonitorErrorCts;
|
||||
SK_U64 RlmtMonitorTimestamp;
|
||||
SK_U8 RlmtMonitorAdmin;
|
||||
} SK_PNMI_RLMT_MONITOR;
|
||||
|
||||
typedef struct s_PnmiRequestStatus {
|
||||
SK_U32 ErrorStatus;
|
||||
SK_U32 ErrorOffset;
|
||||
} SK_PNMI_REQUEST_STATUS;
|
||||
|
||||
typedef struct s_PnmiStrucData {
|
||||
SK_U32 MgmtDBVersion;
|
||||
SK_PNMI_REQUEST_STATUS ReturnStatus;
|
||||
SK_U32 VpdFreeBytes;
|
||||
char VpdEntriesList[SK_PNMI_VPD_ENTRIES * SK_PNMI_VPD_KEY_SIZE];
|
||||
SK_U32 VpdEntriesNumber;
|
||||
SK_PNMI_VPD Vpd[SK_PNMI_VPD_ENTRIES];
|
||||
SK_U32 PortNumber;
|
||||
SK_U32 DeviceType;
|
||||
char DriverDescr[SK_PNMI_STRINGLEN1];
|
||||
char DriverVersion[SK_PNMI_STRINGLEN2];
|
||||
char DriverReleaseDate[SK_PNMI_STRINGLEN1];
|
||||
char DriverFileName[SK_PNMI_STRINGLEN1];
|
||||
char HwDescr[SK_PNMI_STRINGLEN1];
|
||||
char HwVersion[SK_PNMI_STRINGLEN2];
|
||||
SK_U16 Chipset;
|
||||
SK_U32 ChipId;
|
||||
SK_U8 VauxAvail;
|
||||
SK_U32 RamSize;
|
||||
SK_U32 MtuSize;
|
||||
SK_U32 Action;
|
||||
SK_U32 TestResult;
|
||||
SK_U8 BusType;
|
||||
SK_U8 BusSpeed;
|
||||
SK_U8 BusWidth;
|
||||
SK_U8 SensorNumber;
|
||||
SK_PNMI_SENSOR Sensor[SK_PNMI_SENSOR_ENTRIES];
|
||||
SK_U8 ChecksumNumber;
|
||||
SK_PNMI_CHECKSUM Checksum[SK_PNMI_CHECKSUM_ENTRIES];
|
||||
SK_PNMI_STAT Stat[SK_PNMI_MAC_ENTRIES];
|
||||
SK_PNMI_CONF Conf[SK_PNMI_MAC_ENTRIES];
|
||||
SK_U8 RlmtMode;
|
||||
SK_U32 RlmtPortNumber;
|
||||
SK_U8 RlmtPortActive;
|
||||
SK_U8 RlmtPortPreferred;
|
||||
SK_U64 RlmtChangeCts;
|
||||
SK_U64 RlmtChangeTime;
|
||||
SK_U64 RlmtChangeEstimate;
|
||||
SK_U64 RlmtChangeThreshold;
|
||||
SK_PNMI_RLMT Rlmt[SK_MAX_MACS];
|
||||
SK_U32 RlmtMonitorNumber;
|
||||
SK_PNMI_RLMT_MONITOR RlmtMonitor[SK_PNMI_MONITOR_ENTRIES];
|
||||
SK_U32 TrapNumber;
|
||||
SK_U8 Trap[SK_PNMI_TRAP_QUEUE_LEN];
|
||||
SK_U64 TxSwQueueLen;
|
||||
SK_U64 TxSwQueueMax;
|
||||
SK_U64 TxRetryCts;
|
||||
SK_U64 RxIntrCts;
|
||||
SK_U64 TxIntrCts;
|
||||
SK_U64 RxNoBufCts;
|
||||
SK_U64 TxNoBufCts;
|
||||
SK_U64 TxUsedDescrNo;
|
||||
SK_U64 RxDeliveredCts;
|
||||
SK_U64 RxOctetsDeliveredCts;
|
||||
SK_U64 RxHwErrorsCts;
|
||||
SK_U64 TxHwErrorsCts;
|
||||
SK_U64 InErrorsCts;
|
||||
SK_U64 OutErrorsCts;
|
||||
SK_U64 ErrRecoveryCts;
|
||||
SK_U64 SysUpTime;
|
||||
} SK_PNMI_STRUCT_DATA;
|
||||
|
||||
#define SK_PNMI_STRUCT_SIZE (sizeof(SK_PNMI_STRUCT_DATA))
|
||||
#define SK_PNMI_MIN_STRUCT_SIZE ((unsigned int)(SK_UPTR)\
|
||||
&(((SK_PNMI_STRUCT_DATA *)0)->VpdFreeBytes))
|
||||
/*
|
||||
* ReturnStatus field
|
||||
* must be located
|
||||
* before VpdFreeBytes
|
||||
*/
|
||||
|
||||
/*
|
||||
* Various definitions
|
||||
*/
|
||||
#define SK_PNMI_MAX_PROTOS 3
|
||||
|
||||
#define SK_PNMI_CNT_NO 66 /* Must have the value of the enum
|
||||
* SK_PNMI_MAX_IDX. Define SK_PNMI_CHECK
|
||||
* for check while init phase 1
|
||||
*/
|
||||
|
||||
/*
|
||||
* Estimate data structure
|
||||
*/
|
||||
typedef struct s_PnmiEstimate {
|
||||
unsigned int EstValueIndex;
|
||||
SK_U64 EstValue[7];
|
||||
SK_U64 Estimate;
|
||||
SK_TIMER EstTimer;
|
||||
} SK_PNMI_ESTIMATE;
|
||||
|
||||
|
||||
/*
|
||||
* VCT timer data structure
|
||||
*/
|
||||
typedef struct s_VctTimer {
|
||||
SK_TIMER VctTimer;
|
||||
} SK_PNMI_VCT_TIMER;
|
||||
|
||||
|
||||
/*
|
||||
* PNMI specific adapter context structure
|
||||
*/
|
||||
typedef struct s_PnmiPort {
|
||||
SK_U64 StatSyncCts;
|
||||
SK_U64 StatSyncOctetsCts;
|
||||
SK_U64 StatRxLongFrameCts;
|
||||
SK_U64 StatRxFrameTooLongCts;
|
||||
SK_U64 StatRxPMaccErr;
|
||||
SK_U64 TxSwQueueLen;
|
||||
SK_U64 TxSwQueueMax;
|
||||
SK_U64 TxRetryCts;
|
||||
SK_U64 RxIntrCts;
|
||||
SK_U64 TxIntrCts;
|
||||
SK_U64 RxNoBufCts;
|
||||
SK_U64 TxNoBufCts;
|
||||
SK_U64 TxUsedDescrNo;
|
||||
SK_U64 RxDeliveredCts;
|
||||
SK_U64 RxOctetsDeliveredCts;
|
||||
SK_U64 RxHwErrorsCts;
|
||||
SK_U64 TxHwErrorsCts;
|
||||
SK_U64 InErrorsCts;
|
||||
SK_U64 OutErrorsCts;
|
||||
SK_U64 ErrRecoveryCts;
|
||||
SK_U64 RxShortZeroMark;
|
||||
SK_U64 CounterOffset[SK_PNMI_CNT_NO];
|
||||
SK_U32 CounterHigh[SK_PNMI_CNT_NO];
|
||||
SK_BOOL ActiveFlag;
|
||||
SK_U8 Align[3];
|
||||
} SK_PNMI_PORT;
|
||||
|
||||
|
||||
typedef struct s_PnmiData {
|
||||
SK_PNMI_PORT Port [SK_MAX_MACS];
|
||||
SK_PNMI_PORT BufPort [SK_MAX_MACS]; /* 2002-09-13 pweber */
|
||||
SK_U64 VirtualCounterOffset[SK_PNMI_CNT_NO];
|
||||
SK_U32 TestResult;
|
||||
char HwVersion[10];
|
||||
SK_U16 Align01;
|
||||
|
||||
char *pDriverDescription;
|
||||
char *pDriverVersion;
|
||||
char *pDriverReleaseDate;
|
||||
char *pDriverFileName;
|
||||
|
||||
int MacUpdatedFlag;
|
||||
int RlmtUpdatedFlag;
|
||||
int SirqUpdatedFlag;
|
||||
|
||||
SK_U64 RlmtChangeCts;
|
||||
SK_U64 RlmtChangeTime;
|
||||
SK_PNMI_ESTIMATE RlmtChangeEstimate;
|
||||
SK_U64 RlmtChangeThreshold;
|
||||
|
||||
SK_U64 StartUpTime;
|
||||
SK_U32 DeviceType;
|
||||
char PciBusSpeed;
|
||||
char PciBusWidth;
|
||||
char Chipset;
|
||||
char PMD;
|
||||
char Connector;
|
||||
SK_BOOL DualNetActiveFlag;
|
||||
SK_U16 Align02;
|
||||
|
||||
char TrapBuf[SK_PNMI_TRAP_QUEUE_LEN];
|
||||
unsigned int TrapBufFree;
|
||||
unsigned int TrapQueueBeg;
|
||||
unsigned int TrapQueueEnd;
|
||||
unsigned int TrapBufPad;
|
||||
unsigned int TrapUnique;
|
||||
SK_U8 VctStatus[SK_MAX_MACS];
|
||||
SK_PNMI_VCT VctBackup[SK_MAX_MACS];
|
||||
SK_PNMI_VCT_TIMER VctTimeout[SK_MAX_MACS];
|
||||
#ifdef SK_DIAG_SUPPORT
|
||||
SK_U32 DiagAttached;
|
||||
#endif /* SK_DIAG_SUPPORT */
|
||||
} SK_PNMI;
|
||||
|
||||
|
||||
/*
|
||||
* Function prototypes
|
||||
*/
|
||||
extern int SkPnmiInit(SK_AC *pAC, SK_IOC IoC, int Level);
|
||||
extern int SkPnmiGetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void* pBuf,
|
||||
unsigned int* pLen, SK_U32 Instance, SK_U32 NetIndex);
|
||||
extern int SkPnmiPreSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id,
|
||||
void* pBuf, unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
|
||||
extern int SkPnmiSetVar(SK_AC *pAC, SK_IOC IoC, SK_U32 Id, void* pBuf,
|
||||
unsigned int *pLen, SK_U32 Instance, SK_U32 NetIndex);
|
||||
extern int SkPnmiGetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
|
||||
unsigned int *pLen, SK_U32 NetIndex);
|
||||
extern int SkPnmiPreSetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
|
||||
unsigned int *pLen, SK_U32 NetIndex);
|
||||
extern int SkPnmiSetStruct(SK_AC *pAC, SK_IOC IoC, void* pBuf,
|
||||
unsigned int *pLen, SK_U32 NetIndex);
|
||||
extern int SkPnmiEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event,
|
||||
SK_EVPARA Param);
|
||||
extern int SkPnmiGenIoctl(SK_AC *pAC, SK_IOC IoC, void * pBuf,
|
||||
unsigned int * pLen, SK_U32 NetIndex);
|
||||
|
||||
#endif
|
111
drivers/net/sk98lin/h/skgesirq.h
Normal file
111
drivers/net/sk98lin/h/skgesirq.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skgesirq.h
|
||||
* 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-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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#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_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 */
|
||||
#define SK_HWEV_UPDATE_STAT 5 /* Update Statistics by PNMI */
|
||||
#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_SET_SPEED 9 /* Set Link Speed by PNMI */
|
||||
#define SK_HWEV_HALFDUP_CHK 10 /* Half Duplex Hangup Workaround */
|
||||
|
||||
#define SK_WA_ACT_TIME (5000000UL) /* 5 sec */
|
||||
#define SK_WA_INA_TIME (100000UL) /* 100 msec */
|
||||
|
||||
#define SK_HALFDUP_CHK_TIME (10000UL) /* 10 msec */
|
||||
|
||||
/*
|
||||
* Define the error numbers and messages
|
||||
*/
|
||||
#define SKERR_SIRQ_E001 (SK_ERRBASE_SIRQ+0)
|
||||
#define SKERR_SIRQ_E001MSG "Unknown event"
|
||||
#define SKERR_SIRQ_E002 (SKERR_SIRQ_E001+1)
|
||||
#define SKERR_SIRQ_E002MSG "Packet timeout RX1"
|
||||
#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 "MAC 1 not correctly initialized"
|
||||
#define SKERR_SIRQ_E005 (SKERR_SIRQ_E004+1)
|
||||
#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)
|
||||
#define SKERR_SIRQ_E007MSG "CHECK failure R2"
|
||||
#define SKERR_SIRQ_E008 (SKERR_SIRQ_E007+1)
|
||||
#define SKERR_SIRQ_E008MSG "CHECK failure XS1"
|
||||
#define SKERR_SIRQ_E009 (SKERR_SIRQ_E008+1)
|
||||
#define SKERR_SIRQ_E009MSG "CHECK failure XA1"
|
||||
#define SKERR_SIRQ_E010 (SKERR_SIRQ_E009+1)
|
||||
#define SKERR_SIRQ_E010MSG "CHECK failure XS2"
|
||||
#define SKERR_SIRQ_E011 (SKERR_SIRQ_E010+1)
|
||||
#define SKERR_SIRQ_E011MSG "CHECK failure XA2"
|
||||
#define SKERR_SIRQ_E012 (SKERR_SIRQ_E011+1)
|
||||
#define SKERR_SIRQ_E012MSG "unexpected IRQ Master error"
|
||||
#define SKERR_SIRQ_E013 (SKERR_SIRQ_E012+1)
|
||||
#define SKERR_SIRQ_E013MSG "unexpected IRQ Status error"
|
||||
#define SKERR_SIRQ_E014 (SKERR_SIRQ_E013+1)
|
||||
#define SKERR_SIRQ_E014MSG "Parity error on RAM (read)"
|
||||
#define SKERR_SIRQ_E015 (SKERR_SIRQ_E014+1)
|
||||
#define SKERR_SIRQ_E015MSG "Parity error on RAM (write)"
|
||||
#define SKERR_SIRQ_E016 (SKERR_SIRQ_E015+1)
|
||||
#define SKERR_SIRQ_E016MSG "Parity error MAC 1"
|
||||
#define SKERR_SIRQ_E017 (SKERR_SIRQ_E016+1)
|
||||
#define SKERR_SIRQ_E017MSG "Parity error MAC 2"
|
||||
#define SKERR_SIRQ_E018 (SKERR_SIRQ_E017+1)
|
||||
#define SKERR_SIRQ_E018MSG "Parity error RX 1"
|
||||
#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 "MAC transmit FIFO underrun"
|
||||
#define SKERR_SIRQ_E021 (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 SkHWLinkUp(SK_AC *pAC, SK_IOC IoC, int Port);
|
||||
extern void SkHWLinkDown(SK_AC *pAC, SK_IOC IoC, int Port);
|
||||
|
||||
#endif /* _INC_SKGESIRQ_H_ */
|
177
drivers/net/sk98lin/h/ski2c.h
Normal file
177
drivers/net/sk98lin/h/ski2c.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: ski2c.h
|
||||
* Project: Gigabit Ethernet Adapters, TWSI-Module
|
||||
* Version: $Revision: 1.35 $
|
||||
* Date: $Date: 2003/10/20 09:06:30 $
|
||||
* Purpose: Defines to access Voltage and Temperature Sensor
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* SKI2C.H contains all I2C specific defines
|
||||
*/
|
||||
|
||||
#ifndef _SKI2C_H_
|
||||
#define _SKI2C_H_
|
||||
|
||||
typedef struct s_Sensor SK_SENSOR;
|
||||
|
||||
#include "h/skgei2c.h"
|
||||
|
||||
/*
|
||||
* 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 READ and WRITE Constants.
|
||||
*/
|
||||
#define I2C_READ 0
|
||||
#define I2C_WRITE 1
|
||||
#define I2C_BURST 1
|
||||
#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 "TWSI: transfer does not complete"
|
||||
#define SKERR_I2C_E003 (SKERR_I2C_E002+1)
|
||||
#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"
|
||||
#define SKERR_I2C_E005 (SKERR_I2C_E004+1)
|
||||
#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_E009 (SKERR_I2C_E008+1)
|
||||
#define SKERR_I2C_E009MSG "WARNING: temperature sensor out of range"
|
||||
#define SKERR_I2C_E010 (SKERR_I2C_E009+1)
|
||||
#define SKERR_I2C_E010MSG "WARNING: voltage sensor out of range"
|
||||
#define SKERR_I2C_E011 (SKERR_I2C_E010+1)
|
||||
#define SKERR_I2C_E011MSG "ERROR: temperature sensor out of range"
|
||||
#define SKERR_I2C_E012 (SKERR_I2C_E011+1)
|
||||
#define SKERR_I2C_E012MSG "ERROR: voltage sensor out of range"
|
||||
#define SKERR_I2C_E013 (SKERR_I2C_E012+1)
|
||||
#define SKERR_I2C_E013MSG "ERROR: couldn't init sensor"
|
||||
#define SKERR_I2C_E014 (SKERR_I2C_E013+1)
|
||||
#define SKERR_I2C_E014MSG "WARNING: fan sensor out of range"
|
||||
#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 "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
|
||||
*/
|
||||
#ifndef SK_SEN_ERR_TR_HOLD
|
||||
#define SK_SEN_ERR_TR_HOLD (4*SK_TICKS_PER_SEC)
|
||||
#endif
|
||||
#ifndef SK_SEN_ERR_LOG_HOLD
|
||||
#define SK_SEN_ERR_LOG_HOLD (60*SK_TICKS_PER_SEC)
|
||||
#endif
|
||||
#ifndef SK_SEN_WARN_TR_HOLD
|
||||
#define SK_SEN_WARN_TR_HOLD (15*SK_TICKS_PER_SEC)
|
||||
#endif
|
||||
#ifndef SK_SEN_WARN_LOG_HOLD
|
||||
#define SK_SEN_WARN_LOG_HOLD (15*60*SK_TICKS_PER_SEC)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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 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
|
||||
*/
|
||||
struct s_Sensor {
|
||||
char *SenDesc; /* Description */
|
||||
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 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_U64 SenErrCts; /* Error trap counter */
|
||||
SK_U64 SenWarnCts; /* Warning trap counter */
|
||||
SK_U64 SenBegErrTS; /* Begin error timestamp */
|
||||
SK_U64 SenBegWarnTS; /* Begin warning timestamp */
|
||||
SK_U64 SenLastErrTrapTS; /* Last error trap timestamp */
|
||||
SK_U64 SenLastErrLogTS; /* Last error log timestamp */
|
||||
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);
|
||||
/* Sensors read function */
|
||||
SK_U16 SenReg; /* Register Address 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 */
|
||||
SK_TIMER SenTimer; /* Sensors timer */
|
||||
#endif /* !SK_DIAG */
|
||||
} SK_I2C;
|
||||
|
||||
extern int SkI2cInit(SK_AC *pAC, SK_IOC IoC, int Level);
|
||||
extern int SkI2cWrite(SK_AC *pAC, SK_IOC IoC, SK_U32 Data, int Dev, int Size,
|
||||
int Reg, int Burst);
|
||||
extern int SkI2cReadSensor(SK_AC *pAC, SK_IOC IoC, SK_SENSOR *pSen);
|
||||
#ifdef SK_DIAG
|
||||
extern SK_U32 SkI2cRead(SK_AC *pAC, SK_IOC IoC, int Dev, int Size, int Reg,
|
||||
int Burst);
|
||||
#else /* !SK_DIAG */
|
||||
extern int SkI2cEvent(SK_AC *pAC, SK_IOC IoC, SK_U32 Event, SK_EVPARA Para);
|
||||
extern void SkI2cWaitIrq(SK_AC *pAC, SK_IOC IoC);
|
||||
extern void SkI2cIsr(SK_AC *pAC, SK_IOC IoC);
|
||||
#endif /* !SK_DIAG */
|
||||
#endif /* n_SKI2C_H */
|
||||
|
94
drivers/net/sk98lin/h/skqueue.h
Normal file
94
drivers/net/sk98lin/h/skqueue.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skqueue.h
|
||||
* Project: Gigabit Ethernet Adapters, Event Scheduler Module
|
||||
* Version: $Revision: 1.16 $
|
||||
* Date: $Date: 2003/09/16 12:50:32 $
|
||||
* Purpose: Defines for the Event queue
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* SKQUEUE.H contains all defines and types for the event queue
|
||||
*/
|
||||
|
||||
#ifndef _SKQUEUE_H_
|
||||
#define _SKQUEUE_H_
|
||||
|
||||
|
||||
/*
|
||||
* define the event classes to be served
|
||||
*/
|
||||
#define SKGE_DRV 1 /* Driver Event Class */
|
||||
#define SKGE_RLMT 2 /* RLMT Event Class */
|
||||
#define SKGE_I2C 3 /* I2C Event Class */
|
||||
#define SKGE_PNMI 4 /* PNMI Event Class */
|
||||
#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
|
||||
*/
|
||||
#define SK_MAX_EVENT 64
|
||||
|
||||
/*
|
||||
* Parameter union for the Para stuff
|
||||
*/
|
||||
typedef union u_EvPara {
|
||||
void *pParaPtr; /* Parameter Pointer */
|
||||
SK_U64 Para64; /* Parameter 64bit version */
|
||||
SK_U32 Para32[2]; /* Parameter Array of 32bit parameters */
|
||||
} SK_EVPARA;
|
||||
|
||||
/*
|
||||
* Event Queue
|
||||
* skqueue.c
|
||||
* events are class/value pairs
|
||||
* class is addressee, e.g. RLMT, PNMI etc.
|
||||
* value is command, e.g. line state change, ring op change etc.
|
||||
*/
|
||||
typedef struct s_EventElem {
|
||||
SK_U32 Class; /* Event class */
|
||||
SK_U32 Event; /* Event value */
|
||||
SK_EVPARA Para; /* Event parameter */
|
||||
} SK_EVENTELEM;
|
||||
|
||||
typedef struct s_Queue {
|
||||
SK_EVENTELEM EvQueue[SK_MAX_EVENT];
|
||||
SK_EVENTELEM *EvPut;
|
||||
SK_EVENTELEM *EvGet;
|
||||
} SK_QUEUE;
|
||||
|
||||
extern void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
|
||||
extern void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
|
||||
SK_EVPARA Para);
|
||||
extern int SkEventDispatcher(SK_AC *pAC, SK_IOC Ioc);
|
||||
|
||||
|
||||
/* Define Error Numbers and messages */
|
||||
#define SKERR_Q_E001 (SK_ERRBASE_QUEUE+0)
|
||||
#define SKERR_Q_E001MSG "Event queue overflow"
|
||||
#define SKERR_Q_E002 (SKERR_Q_E001+1)
|
||||
#define SKERR_Q_E002MSG "Undefined event class"
|
||||
#endif /* _SKQUEUE_H_ */
|
||||
|
438
drivers/net/sk98lin/h/skrlmt.h
Normal file
438
drivers/net/sk98lin/h/skrlmt.h
Normal file
@@ -0,0 +1,438 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skrlmt.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.37 $
|
||||
* Date: $Date: 2003/04/15 09:43:43 $
|
||||
* Purpose: Header file for Redundant Link ManagemenT.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* This is the header file for Redundant Link ManagemenT.
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
* "skdrv1st.h"
|
||||
* ...
|
||||
* "sktypes.h"
|
||||
* "skqueue.h"
|
||||
* "skaddr.h"
|
||||
* "skrlmt.h"
|
||||
* ...
|
||||
* "skdrv2nd.h"
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKRLMT_H
|
||||
#define __INC_SKRLMT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* cplusplus */
|
||||
|
||||
/* defines ********************************************************************/
|
||||
|
||||
#define SK_RLMT_NET_DOWN_TEMP 1 /* NET_DOWN due to last port down. */
|
||||
#define SK_RLMT_NET_DOWN_FINAL 2 /* NET_DOWN due to RLMT_STOP. */
|
||||
|
||||
/* ----- Default queue sizes - must be multiples of 8 KB ----- */
|
||||
|
||||
/* Less than 8 KB free in RX queue => pause frames. */
|
||||
#define SK_RLMT_STANDBY_QRXSIZE 128 /* Size of rx standby queue in KB. */
|
||||
#define SK_RLMT_STANDBY_QXASIZE 32 /* Size of async standby queue in KB. */
|
||||
#define SK_RLMT_STANDBY_QXSSIZE 0 /* Size of sync standby queue in KB. */
|
||||
|
||||
#define SK_RLMT_MAX_TX_BUF_SIZE 60 /* Maximum RLMT transmit size. */
|
||||
|
||||
/* ----- PORT states ----- */
|
||||
|
||||
#define SK_RLMT_PS_INIT 0 /* Port state: Init. */
|
||||
#define SK_RLMT_PS_LINK_DOWN 1 /* Port state: Link down. */
|
||||
#define SK_RLMT_PS_DOWN 2 /* Port state: Port down. */
|
||||
#define SK_RLMT_PS_GOING_UP 3 /* Port state: Going up. */
|
||||
#define SK_RLMT_PS_UP 4 /* Port state: Up. */
|
||||
|
||||
/* ----- RLMT states ----- */
|
||||
|
||||
#define SK_RLMT_RS_INIT 0 /* RLMT state: Init. */
|
||||
#define SK_RLMT_RS_NET_DOWN 1 /* RLMT state: Net down. */
|
||||
#define SK_RLMT_RS_NET_UP 2 /* RLMT state: Net up. */
|
||||
|
||||
/* ----- PORT events ----- */
|
||||
|
||||
#define SK_RLMT_LINK_UP 1001 /* Link came up. */
|
||||
#define SK_RLMT_LINK_DOWN 1002 /* Link went down. */
|
||||
#define SK_RLMT_PORT_ADDR 1003 /* Port address changed. */
|
||||
|
||||
/* ----- RLMT events ----- */
|
||||
|
||||
#define SK_RLMT_START 2001 /* Start RLMT. */
|
||||
#define SK_RLMT_STOP 2002 /* Stop RLMT. */
|
||||
#define SK_RLMT_PACKET_RECEIVED 2003 /* Packet was received for RLMT. */
|
||||
#define SK_RLMT_STATS_CLEAR 2004 /* Clear statistics. */
|
||||
#define SK_RLMT_STATS_UPDATE 2005 /* Update statistics. */
|
||||
#define SK_RLMT_PREFPORT_CHANGE 2006 /* Change preferred port. */
|
||||
#define SK_RLMT_MODE_CHANGE 2007 /* New RlmtMode. */
|
||||
#define SK_RLMT_SET_NETS 2008 /* Number of Nets (1 or 2). */
|
||||
|
||||
/* ----- RLMT mode bits ----- */
|
||||
|
||||
/*
|
||||
* CAUTION: These defines are private to RLMT.
|
||||
* Please use the RLMT mode defines below.
|
||||
*/
|
||||
|
||||
#define SK_RLMT_CHECK_LINK 1 /* Check Link. */
|
||||
#define SK_RLMT_CHECK_LOC_LINK 2 /* Check other link on same adapter. */
|
||||
#define SK_RLMT_CHECK_SEG 4 /* Check segmentation. */
|
||||
|
||||
#ifndef RLMT_CHECK_REMOTE
|
||||
#define SK_RLMT_CHECK_OTHERS SK_RLMT_CHECK_LOC_LINK
|
||||
#else /* RLMT_CHECK_REMOTE */
|
||||
#define SK_RLMT_CHECK_REM_LINK 8 /* Check link(s) on other adapter(s). */
|
||||
#define SK_RLMT_MAX_REMOTE_PORTS_CHECKED 3
|
||||
#define SK_RLMT_CHECK_OTHERS \
|
||||
(SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK)
|
||||
#endif /* RLMT_CHECK_REMOTE */
|
||||
|
||||
#ifndef SK_RLMT_ENABLE_TRANSPARENT
|
||||
#define SK_RLMT_TRANSPARENT 0 /* RLMT transparent - inactive. */
|
||||
#else /* SK_RLMT_ENABLE_TRANSPARENT */
|
||||
#define SK_RLMT_TRANSPARENT 128 /* RLMT transparent. */
|
||||
#endif /* SK_RLMT_ENABLE_TRANSPARENT */
|
||||
|
||||
/* ----- RLMT modes ----- */
|
||||
|
||||
/* Check Link State. */
|
||||
#define SK_RLMT_MODE_CLS (SK_RLMT_CHECK_LINK)
|
||||
|
||||
/* Check Local Ports: check other links on the same adapter. */
|
||||
#define SK_RLMT_MODE_CLP (SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK)
|
||||
|
||||
/* Check Local Ports and Segmentation Status. */
|
||||
#define SK_RLMT_MODE_CLPSS \
|
||||
(SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_SEG)
|
||||
|
||||
#ifdef RLMT_CHECK_REMOTE
|
||||
/* Check Local and Remote Ports: check links (local or remote). */
|
||||
Name of define TBD!
|
||||
#define SK_RLMT_MODE_CRP \
|
||||
(SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | SK_RLMT_CHECK_REM_LINK)
|
||||
|
||||
/* Check Local and Remote Ports and Segmentation Status. */
|
||||
Name of define TBD!
|
||||
#define SK_RLMT_MODE_CRPSS \
|
||||
(SK_RLMT_CHECK_LINK | SK_RLMT_CHECK_LOC_LINK | \
|
||||
SK_RLMT_CHECK_REM_LINK | SK_RLMT_CHECK_SEG)
|
||||
#endif /* RLMT_CHECK_REMOTE */
|
||||
|
||||
/* ----- RLMT lookahead result bits ----- */
|
||||
|
||||
#define SK_RLMT_RX_RLMT 1 /* Give packet to RLMT. */
|
||||
#define SK_RLMT_RX_PROTOCOL 2 /* Give packet to protocol. */
|
||||
|
||||
/* Macros */
|
||||
|
||||
#if 0
|
||||
SK_AC *pAC /* adapter context */
|
||||
SK_U32 PortNum /* receiving port */
|
||||
unsigned PktLen /* received packet's length */
|
||||
SK_BOOL IsBc /* Flag: packet is broadcast */
|
||||
unsigned *pOffset /* offs. of bytes to present to SK_RLMT_LOOKAHEAD */
|
||||
unsigned *pNumBytes /* #Bytes to present to SK_RLMT_LOOKAHEAD */
|
||||
#endif /* 0 */
|
||||
|
||||
#define SK_RLMT_PRE_LOOKAHEAD(pAC,PortNum,PktLen,IsBc,pOffset,pNumBytes) { \
|
||||
SK_AC *_pAC; \
|
||||
SK_U32 _PortNum; \
|
||||
_pAC = (pAC); \
|
||||
_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; \
|
||||
} \
|
||||
else if (IsBc) { \
|
||||
if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode != SK_RLMT_MODE_CLS) { \
|
||||
*(pNumBytes) = 6; \
|
||||
*(pOffset) = 6; \
|
||||
} \
|
||||
else { \
|
||||
*(pNumBytes) = 0; \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
if ((PktLen) > SK_RLMT_MAX_TX_BUF_SIZE) { \
|
||||
/* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
|
||||
*(pNumBytes) = 0; \
|
||||
} \
|
||||
else { \
|
||||
*(pNumBytes) = 6; \
|
||||
*(pOffset) = 0; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#if 0
|
||||
SK_AC *pAC /* adapter context */
|
||||
SK_U32 PortNum /* receiving port */
|
||||
SK_U8 *pLaPacket, /* received packet's data (points to pOffset) */
|
||||
SK_BOOL IsBc /* Flag: packet is broadcast */
|
||||
SK_BOOL IsMc /* Flag: packet is multicast */
|
||||
unsigned *pForRlmt /* Result: bits SK_RLMT_RX_RLMT, SK_RLMT_RX_PROTOCOL */
|
||||
SK_RLMT_LOOKAHEAD() expects *pNumBytes from
|
||||
packet offset *pOffset (s.a.) at *pLaPacket.
|
||||
|
||||
If you use SK_RLMT_LOOKAHEAD in a path where you already know if the packet is
|
||||
BC, MC, or UC, you should use constants for IsBc and IsMc, so that your compiler
|
||||
can trash unneeded parts of the if construction.
|
||||
#endif /* 0 */
|
||||
|
||||
#define SK_RLMT_LOOKAHEAD(pAC,PortNum,pLaPacket,IsBc,IsMc,pForRlmt) { \
|
||||
SK_AC *_pAC; \
|
||||
SK_U32 _PortNum; \
|
||||
SK_U8 *_pLaPacket; \
|
||||
_pAC = (pAC); \
|
||||
_PortNum = (SK_U32)(PortNum); \
|
||||
_pLaPacket = (SK_U8 *)(pLaPacket); \
|
||||
if (IsBc) {\
|
||||
if (!SK_ADDR_EQUAL(_pLaPacket, _pAC->Addr.Net[_pAC->Rlmt.Port[ \
|
||||
_PortNum].Net->NetNumber].CurrentMacAddress.a)) { \
|
||||
_pAC->Rlmt.Port[_PortNum].BcTimeStamp = SkOsGetTime(_pAC); \
|
||||
_pAC->Rlmt.CheckSwitch = SK_TRUE; \
|
||||
} \
|
||||
/* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
|
||||
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
|
||||
} \
|
||||
else if (IsMc) { \
|
||||
if (SK_ADDR_EQUAL(_pLaPacket, BridgeMcAddr.a)) { \
|
||||
_pAC->Rlmt.Port[_PortNum].BpduPacketsPerTimeSlot++; \
|
||||
if (_pAC->Rlmt.Port[_PortNum].Net->RlmtMode & SK_RLMT_CHECK_SEG) { \
|
||||
*(pForRlmt) = SK_RLMT_RX_RLMT | SK_RLMT_RX_PROTOCOL; \
|
||||
} \
|
||||
else { \
|
||||
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
|
||||
} \
|
||||
} \
|
||||
else if (SK_ADDR_EQUAL(_pLaPacket, SkRlmtMcAddr.a)) { \
|
||||
*(pForRlmt) = SK_RLMT_RX_RLMT; \
|
||||
} \
|
||||
else { \
|
||||
/* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
|
||||
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
if (SK_ADDR_EQUAL( \
|
||||
_pLaPacket, \
|
||||
_pAC->Addr.Port[_PortNum].CurrentMacAddress.a)) { \
|
||||
*(pForRlmt) = SK_RLMT_RX_RLMT; \
|
||||
} \
|
||||
else { \
|
||||
/* _pAC->Rlmt.Port[_PortNum].DataPacketsPerTimeSlot++; */ \
|
||||
*(pForRlmt) = SK_RLMT_RX_PROTOCOL; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifdef SK_RLMT_FAST_LOOKAHEAD
|
||||
Error: SK_RLMT_FAST_LOOKAHEAD no longer used. Use new macros for lookahead.
|
||||
#endif /* SK_RLMT_FAST_LOOKAHEAD */
|
||||
#ifdef SK_RLMT_SLOW_LOOKAHEAD
|
||||
Error: SK_RLMT_SLOW_LOOKAHEAD no longer used. Use new macros for lookahead.
|
||||
#endif /* SK_RLMT_SLOW_LOOKAHEAD */
|
||||
|
||||
/* typedefs *******************************************************************/
|
||||
|
||||
#ifdef SK_RLMT_MBUF_PRIVATE
|
||||
typedef struct s_RlmtMbuf {
|
||||
some content
|
||||
} SK_RLMT_MBUF;
|
||||
#endif /* SK_RLMT_MBUF_PRIVATE */
|
||||
|
||||
|
||||
#ifdef SK_LA_INFO
|
||||
typedef struct s_Rlmt_PacketInfo {
|
||||
unsigned PacketLength; /* Length of packet. */
|
||||
unsigned PacketType; /* Directed/Multicast/Broadcast. */
|
||||
} SK_RLMT_PINFO;
|
||||
#endif /* SK_LA_INFO */
|
||||
|
||||
|
||||
typedef struct s_RootId {
|
||||
SK_U8 Id[8]; /* Root Bridge Id. */
|
||||
} SK_RLMT_ROOT_ID;
|
||||
|
||||
|
||||
typedef struct s_port {
|
||||
SK_MAC_ADDR CheckAddr;
|
||||
SK_BOOL SuspectTx;
|
||||
} SK_PORT_CHECK;
|
||||
|
||||
|
||||
typedef struct s_RlmtNet SK_RLMT_NET;
|
||||
|
||||
|
||||
typedef struct s_RlmtPort {
|
||||
|
||||
/* ----- Public part (read-only) ----- */
|
||||
|
||||
SK_U8 PortState; /* Current state of this port. */
|
||||
|
||||
/* For PNMI */
|
||||
SK_BOOL LinkDown;
|
||||
SK_BOOL PortDown;
|
||||
SK_U8 Align01;
|
||||
|
||||
SK_U32 PortNumber; /* Number of port on adapter. */
|
||||
SK_RLMT_NET * Net; /* Net port belongs to. */
|
||||
|
||||
SK_U64 TxHelloCts;
|
||||
SK_U64 RxHelloCts;
|
||||
SK_U64 TxSpHelloReqCts;
|
||||
SK_U64 RxSpHelloCts;
|
||||
|
||||
/* ----- Private part ----- */
|
||||
|
||||
/* SK_U64 PacketsRx; */ /* Total packets received. */
|
||||
SK_U32 PacketsPerTimeSlot; /* Packets rxed between TOs. */
|
||||
/* SK_U32 DataPacketsPerTimeSlot; */ /* Data packets ... */
|
||||
SK_U32 BpduPacketsPerTimeSlot; /* BPDU packets rxed in TS. */
|
||||
SK_U64 BcTimeStamp; /* Time of last BC receive. */
|
||||
SK_U64 GuTimeStamp; /* Time of entering GOING_UP. */
|
||||
|
||||
SK_TIMER UpTimer; /* Timer struct Link/Port up. */
|
||||
SK_TIMER DownRxTimer; /* Timer struct down rx. */
|
||||
SK_TIMER DownTxTimer; /* Timer struct down tx. */
|
||||
|
||||
SK_U32 CheckingState; /* Checking State. */
|
||||
|
||||
SK_ADDR_PORT * AddrPort;
|
||||
|
||||
SK_U8 Random[4]; /* Random value. */
|
||||
unsigned PortsChecked; /* #ports checked. */
|
||||
unsigned PortsSuspect; /* #ports checked that are s. */
|
||||
SK_PORT_CHECK PortCheck[1];
|
||||
/* SK_PORT_CHECK PortCheck[SK_MAX_MACS - 1]; */
|
||||
|
||||
SK_BOOL PortStarted; /* Port is started. */
|
||||
SK_BOOL PortNoRx; /* NoRx for >= 1 time slot. */
|
||||
SK_BOOL RootIdSet;
|
||||
SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
|
||||
} SK_RLMT_PORT;
|
||||
|
||||
|
||||
struct s_RlmtNet {
|
||||
|
||||
/* ----- Public part (read-only) ----- */
|
||||
|
||||
SK_U32 NetNumber; /* Number of net. */
|
||||
|
||||
SK_RLMT_PORT * Port[SK_MAX_MACS]; /* Ports that belong to this net. */
|
||||
SK_U32 NumPorts; /* Number of ports. */
|
||||
SK_U32 PrefPort; /* Preferred port. */
|
||||
|
||||
/* 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. */
|
||||
|
||||
SK_U8 RlmtState; /* Current RLMT state. */
|
||||
|
||||
/* ----- Private part ----- */
|
||||
SK_BOOL RootIdSet;
|
||||
SK_U16 Align01;
|
||||
|
||||
int LinksUp; /* #Links up. */
|
||||
int PortsUp; /* #Ports up. */
|
||||
SK_U32 TimeoutValue; /* RLMT timeout value. */
|
||||
|
||||
SK_U32 CheckingState; /* Checking State. */
|
||||
SK_RLMT_ROOT_ID Root; /* Root Bridge Id. */
|
||||
|
||||
SK_TIMER LocTimer; /* Timer struct. */
|
||||
SK_TIMER SegTimer; /* Timer struct. */
|
||||
};
|
||||
|
||||
|
||||
typedef struct s_Rlmt {
|
||||
|
||||
/* ----- Public part (read-only) ----- */
|
||||
|
||||
SK_U32 NumNets; /* Number of nets. */
|
||||
SK_U32 NetsStarted; /* Number of nets started. */
|
||||
SK_RLMT_NET Net[SK_MAX_NETS]; /* Array of available nets. */
|
||||
SK_RLMT_PORT Port[SK_MAX_MACS]; /* Array of available ports. */
|
||||
|
||||
/* ----- Private part ----- */
|
||||
SK_BOOL CheckSwitch;
|
||||
SK_BOOL RlmtOff; /* set to zero if the Mac addresses
|
||||
are equal or the second one
|
||||
is zero */
|
||||
SK_U16 Align01;
|
||||
|
||||
} SK_RLMT;
|
||||
|
||||
|
||||
extern SK_MAC_ADDR BridgeMcAddr;
|
||||
extern SK_MAC_ADDR SkRlmtMcAddr;
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
|
||||
#ifndef SK_KR_PROTO
|
||||
|
||||
/* Functions provided by SkRlmt */
|
||||
|
||||
/* ANSI/C++ compliant function prototypes */
|
||||
|
||||
extern void SkRlmtInit(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int Level);
|
||||
|
||||
extern int SkRlmtEvent(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
SK_U32 Event,
|
||||
SK_EVPARA Para);
|
||||
|
||||
#else /* defined(SK_KR_PROTO) */
|
||||
|
||||
/* Non-ANSI/C++ compliant function prototypes */
|
||||
|
||||
#error KR-style function prototypes are not yet provided.
|
||||
|
||||
#endif /* defined(SK_KR_PROTO)) */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INC_SKRLMT_H */
|
63
drivers/net/sk98lin/h/sktimer.h
Normal file
63
drivers/net/sk98lin/h/sktimer.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: sktimer.h
|
||||
* Project: Gigabit Ethernet Adapters, Event Scheduler Module
|
||||
* Version: $Revision: 1.11 $
|
||||
* Date: $Date: 2003/09/16 12:58:18 $
|
||||
* Purpose: Defines for the timer functions
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* SKTIMER.H contains all defines and types for the timer functions
|
||||
*/
|
||||
|
||||
#ifndef _SKTIMER_H_
|
||||
#define _SKTIMER_H_
|
||||
|
||||
#include "h/skqueue.h"
|
||||
|
||||
/*
|
||||
* SK timer
|
||||
* - needed wherever a timer is used. Put this in your data structure
|
||||
* wherever you want.
|
||||
*/
|
||||
typedef struct s_Timer SK_TIMER;
|
||||
|
||||
struct s_Timer {
|
||||
SK_TIMER *TmNext; /* linked list */
|
||||
SK_U32 TmClass; /* Timer Event class */
|
||||
SK_U32 TmEvent; /* Timer Event value */
|
||||
SK_EVPARA TmPara; /* Timer Event parameter */
|
||||
SK_U32 TmDelta; /* delta time */
|
||||
int TmActive; /* flag: active/inactive */
|
||||
};
|
||||
|
||||
/*
|
||||
* Timer control struct.
|
||||
* - use in Adapters context name pAC->Tim
|
||||
*/
|
||||
typedef struct s_TimCtrl {
|
||||
SK_TIMER *StQueue; /* Head of Timer queue */
|
||||
} SK_TIMCTRL;
|
||||
|
||||
extern void SkTimerInit(SK_AC *pAC, SK_IOC Ioc, int Level);
|
||||
extern void SkTimerStop(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer);
|
||||
extern void SkTimerStart(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer,
|
||||
SK_U32 Time, SK_U32 Class, SK_U32 Event, SK_EVPARA Para);
|
||||
extern void SkTimerDone(SK_AC *pAC, SK_IOC Ioc);
|
||||
#endif /* _SKTIMER_H_ */
|
69
drivers/net/sk98lin/h/sktypes.h
Normal file
69
drivers/net/sk98lin/h/sktypes.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: sktypes.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.2 $
|
||||
* Date: $Date: 2003/10/07 08:16:51 $
|
||||
* Purpose: Define data types for Linux
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* In this file, all data types that are needed by the common modules
|
||||
* are mapped to Linux data types.
|
||||
*
|
||||
*
|
||||
* Include File Hierarchy:
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_SKTYPES_H
|
||||
#define __INC_SKTYPES_H
|
||||
|
||||
|
||||
/* defines *******************************************************************/
|
||||
|
||||
/*
|
||||
* Data types with a specific size. 'I' = signed, 'U' = unsigned.
|
||||
*/
|
||||
#define SK_I8 s8
|
||||
#define SK_U8 u8
|
||||
#define SK_I16 s16
|
||||
#define SK_U16 u16
|
||||
#define SK_I32 s32
|
||||
#define SK_U32 u32
|
||||
#define SK_I64 s64
|
||||
#define SK_U64 u64
|
||||
|
||||
#define SK_UPTR ulong /* casting pointer <-> integral */
|
||||
|
||||
/*
|
||||
* Boolean type.
|
||||
*/
|
||||
#define SK_BOOL SK_U8
|
||||
#define SK_FALSE 0
|
||||
#define SK_TRUE (!SK_FALSE)
|
||||
|
||||
/* typedefs *******************************************************************/
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#endif /* __INC_SKTYPES_H */
|
38
drivers/net/sk98lin/h/skversion.h
Normal file
38
drivers/net/sk98lin/h/skversion.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: version.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.5 $
|
||||
* Date: $Date: 2003/10/07 08:16:51 $
|
||||
* Purpose: SK specific Error log support
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef lint
|
||||
static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
|
||||
static const char SysKonnectBuildNumber[] =
|
||||
"@(#)SK-BUILD: 6.23 PL: 01";
|
||||
#endif /* !defined(lint) */
|
||||
|
||||
#define BOOT_STRING "sk98lin: Network Device Driver v6.23\n" \
|
||||
"(C)Copyright 1999-2004 Marvell(R)."
|
||||
|
||||
#define VER_STRING "6.23"
|
||||
#define DRIVER_FILE_NAME "sk98lin"
|
||||
#define DRIVER_REL_DATE "Feb-13-2004"
|
||||
|
||||
|
271
drivers/net/sk98lin/h/skvpd.h
Normal file
271
drivers/net/sk98lin/h/skvpd.h
Normal file
@@ -0,0 +1,271 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: skvpd.h
|
||||
* Project: GEnesis, PCI Gigabit Ethernet Adapter
|
||||
* Version: $Revision: 1.15 $
|
||||
* Date: $Date: 2003/01/13 10:39:38 $
|
||||
* Purpose: Defines and Macros for VPD handling
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* (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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The information in this file is provided "AS IS" without warranty.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* skvpd.h contains Diagnostic specific defines for VPD handling
|
||||
*/
|
||||
|
||||
#ifndef __INC_SKVPD_H_
|
||||
#define __INC_SKVPD_H_
|
||||
|
||||
/*
|
||||
* Define Resource Type Identifiers and VPD keywords
|
||||
*/
|
||||
#define RES_ID 0x82 /* Resource Type ID String (Product Name) */
|
||||
#define RES_VPD_R 0x90 /* start of VPD read only area */
|
||||
#define RES_VPD_W 0x91 /* start of VPD read/write area */
|
||||
#define RES_END 0x78 /* Resource Type End Tag */
|
||||
|
||||
#ifndef VPD_NAME
|
||||
#define VPD_NAME "Name" /* Product Name, VPD name of RES_ID */
|
||||
#endif /* VPD_NAME */
|
||||
#define VPD_PN "PN" /* Adapter Part Number */
|
||||
#define VPD_EC "EC" /* Adapter Engineering Level */
|
||||
#define VPD_MN "MN" /* Manufacture ID */
|
||||
#define VPD_SN "SN" /* Serial Number */
|
||||
#define VPD_CP "CP" /* Extended Capability */
|
||||
#define VPD_RV "RV" /* Checksum and Reserved */
|
||||
#define VPD_YA "YA" /* Asset Tag Identifier */
|
||||
#define VPD_VL "VL" /* First Error Log Message (SK specific) */
|
||||
#define VPD_VF "VF" /* Second Error Log Message (SK specific) */
|
||||
#define VPD_RW "RW" /* Remaining Read / Write Area */
|
||||
|
||||
/* 'type' values for vpd_setup_para() */
|
||||
#define VPD_RO_KEY 1 /* RO keys are "PN", "EC", "MN", "SN", "RV" */
|
||||
#define VPD_RW_KEY 2 /* RW keys are "Yx", "Vx", and "RW" */
|
||||
|
||||
/* 'op' values for vpd_setup_para() */
|
||||
#define ADD_KEY 1 /* add the key at the pos "RV" or "RW" */
|
||||
#define OWR_KEY 2 /* overwrite key if already exists */
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
#define VPD_STOP(pAC,IoC) VPD_OUT16(pAC,IoC,PCI_VPD_ADR_REG,VPD_WRITE)
|
||||
|
||||
#define VPD_GET_RES_LEN(p) ((unsigned int) \
|
||||
(* (SK_U8 *)&(p)[1]) |\
|
||||
((* (SK_U8 *)&(p)[2]) << 8))
|
||||
#define VPD_GET_VPD_LEN(p) ((unsigned int)(* (SK_U8 *)&(p)[2]))
|
||||
#define VPD_GET_VAL(p) ((char *)&(p)[3])
|
||||
|
||||
#define VPD_MAX_LEN 50
|
||||
|
||||
/* VPD status */
|
||||
/* bit 7..1 reserved */
|
||||
#define VPD_VALID (1<<0) /* VPD data buffer, vpd_free_ro, */
|
||||
/* and vpd_free_rw valid */
|
||||
|
||||
/*
|
||||
* VPD structs
|
||||
*/
|
||||
typedef struct s_vpd_status {
|
||||
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 */
|
||||
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 */
|
||||
} SK_VPD_PARA;
|
||||
|
||||
/*
|
||||
* structure of Large Resource Type Identifiers
|
||||
*/
|
||||
|
||||
/* was removed because of alignment problems */
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
} SK_VPD_KEY;
|
||||
|
||||
|
||||
/*
|
||||
* System specific VPD macros
|
||||
*/
|
||||
#ifndef SKDIAG
|
||||
#ifndef VPD_DO_IO
|
||||
#define VPD_OUT8(pAC,IoC,Addr,Val) (void)SkPciWriteCfgByte(pAC,Addr,Val)
|
||||
#define VPD_OUT16(pAC,IoC,Addr,Val) (void)SkPciWriteCfgWord(pAC,Addr,Val)
|
||||
#define VPD_OUT32(pAC,IoC,Addr,Val) (void)SkPciWriteCfgDWord(pAC,Addr,Val)
|
||||
#define VPD_IN8(pAC,IoC,Addr,pVal) (void)SkPciReadCfgByte(pAC,Addr,pVal)
|
||||
#define VPD_IN16(pAC,IoC,Addr,pVal) (void)SkPciReadCfgWord(pAC,Addr,pVal)
|
||||
#define VPD_IN32(pAC,IoC,Addr,pVal) (void)SkPciReadCfgDWord(pAC,Addr,pVal)
|
||||
#else /* VPD_DO_IO */
|
||||
#define VPD_OUT8(pAC,IoC,Addr,Val) SK_OUT8(IoC,PCI_C(Addr),Val)
|
||||
#define VPD_OUT16(pAC,IoC,Addr,Val) SK_OUT16(IoC,PCI_C(Addr),Val)
|
||||
#define VPD_OUT32(pAC,IoC,Addr,Val) SK_OUT32(IoC,PCI_C(Addr),Val)
|
||||
#define VPD_IN8(pAC,IoC,Addr,pVal) SK_IN8(IoC,PCI_C(Addr),pVal)
|
||||
#define VPD_IN16(pAC,IoC,Addr,pVal) SK_IN16(IoC,PCI_C(Addr),pVal)
|
||||
#define VPD_IN32(pAC,IoC,Addr,pVal) SK_IN32(IoC,PCI_C(Addr),pVal)
|
||||
#endif /* VPD_DO_IO */
|
||||
#else /* SKDIAG */
|
||||
#define VPD_OUT8(pAC,Ioc,Addr,Val) { \
|
||||
if ((pAC)->DgT.DgUseCfgCycle) \
|
||||
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); \
|
||||
else \
|
||||
SK_OUT16(pAC,PCI_C(Addr),Val); \
|
||||
}
|
||||
#define VPD_OUT32(pAC,Ioc,Addr,Val) { \
|
||||
if ((pAC)->DgT.DgUseCfgCycle) \
|
||||
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); \
|
||||
else \
|
||||
SK_IN8(pAC,PCI_C(Addr),pVal); \
|
||||
}
|
||||
#define VPD_IN16(pAC,Ioc,Addr,pVal) { \
|
||||
if ((pAC)->DgT.DgUseCfgCycle) \
|
||||
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); \
|
||||
else \
|
||||
SK_IN32(pAC,PCI_C(Addr),pVal); \
|
||||
}
|
||||
#endif /* nSKDIAG */
|
||||
|
||||
/* function prototypes ********************************************************/
|
||||
|
||||
#ifndef SK_KR_PROTO
|
||||
#ifdef SKDIAG
|
||||
extern SK_U32 VpdReadDWord(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
int addr);
|
||||
#endif /* SKDIAG */
|
||||
|
||||
extern int VpdSetupPara(
|
||||
SK_AC *pAC,
|
||||
const char *key,
|
||||
const char *buf,
|
||||
int len,
|
||||
int type,
|
||||
int op);
|
||||
|
||||
extern SK_VPD_STATUS *VpdStat(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC);
|
||||
|
||||
extern int VpdKeys(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
char *buf,
|
||||
int *len,
|
||||
int *elements);
|
||||
|
||||
extern int VpdRead(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
const char *key,
|
||||
char *buf,
|
||||
int *len);
|
||||
|
||||
extern SK_BOOL VpdMayWrite(
|
||||
char *key);
|
||||
|
||||
extern int VpdWrite(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
const char *key,
|
||||
const char *buf);
|
||||
|
||||
extern int VpdDelete(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
char *key);
|
||||
|
||||
extern int VpdUpdate(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC);
|
||||
|
||||
extern void VpdErrLog(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
char *msg);
|
||||
|
||||
#ifdef SKDIAG
|
||||
extern int VpdReadBlock(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
char *buf,
|
||||
int addr,
|
||||
int len);
|
||||
|
||||
extern int VpdWriteBlock(
|
||||
SK_AC *pAC,
|
||||
SK_IOC IoC,
|
||||
char *buf,
|
||||
int addr,
|
||||
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();
|
||||
#endif /* SK_KR_PROTO */
|
||||
|
||||
#endif /* __INC_SKVPD_H_ */
|
1579
drivers/net/sk98lin/h/xmac_ii.h
Normal file
1579
drivers/net/sk98lin/h/xmac_ii.h
Normal file
Plik diff jest za duży
Load Diff
Reference in New Issue
Block a user