linux-bk/drivers/net/sk98lin/h/skdrv2nd.h
<<
>>
Prefs
   1/******************************************************************************
   2 *
   3 * Name:        skdrv2nd.h
   4 * Project:     GEnesis, PCI Gigabit Ethernet Adapter
   5 * Version:     $Revision: 1.3 $
   6 * Date:        $Date: 2003/08/12 16:51:18 $
   7 * Purpose:     Second header file for driver and all other modules
   8 *
   9 ******************************************************************************/
  10
  11/******************************************************************************
  12 *
  13 *      (C)Copyright 1998-2003 SysKonnect GmbH.
  14 *
  15 *      This program is free software; you can redistribute it and/or modify
  16 *      it under the terms of the GNU General Public License as published by
  17 *      the Free Software Foundation; either version 2 of the License, or
  18 *      (at your option) any later version.
  19 *
  20 *      The information in this file is provided "AS IS" without warranty.
  21 *
  22 ******************************************************************************/
  23
  24/******************************************************************************
  25 *
  26 * History:
  27 *
  28 *      $Log: skdrv2nd.h,v $
  29 *      Revision 1.3  2003/08/12 16:51:18  mlindner
  30 *      Fix: UDP and TCP Proto checks
  31 *      Fix: UDP header offset
  32 *      
  33 *      Revision 1.2  2003/08/07 10:50:54  mlindner
  34 *      Add: Speed and HW-Csum support for Yukon Lite chipset
  35 *      
  36 *      Revision 1.1  2003/07/21 07:25:29  rroesler
  37 *      Fix: Re-Enter after CVS crash
  38 *      
  39 *      Revision 1.19  2003/07/07 09:53:10  rroesler
  40 *      Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
  41 *      
  42 *      Revision 1.18  2003/06/12 07:54:14  mlindner
  43 *      Fix: Changed Descriptor Alignment to 64 Byte
  44 *      
  45 *      Revision 1.17  2003/05/26 12:56:39  mlindner
  46 *      Add: Support for Kernel 2.5/2.6
  47 *      Add: New SkOsGetTimeCurrent function
  48 *      Add: SK_PNMI_HUNDREDS_SEC definition
  49 *      Fix: SK_TICKS_PER_SEC on Intel Itanium2
  50 *      
  51 *      Revision 1.16  2003/03/21 14:56:18  rroesler
  52 *      Added code regarding interrupt moderation
  53 *      
  54 *      Revision 1.15  2003/02/25 14:16:40  mlindner
  55 *      Fix: Copyright statement
  56 *      
  57 *      Revision 1.14  2003/02/25 13:26:26  mlindner
  58 *      Add: Support for various vendors
  59 *      
  60 *      Revision 1.13  2002/10/02 12:46:02  mlindner
  61 *      Add: Support for Yukon
  62 *      
  63 *      Revision 1.12.2.2  2001/09/05 12:14:50  mlindner
  64 *      add: New hardware revision int
  65 *      
  66 *      Revision 1.12.2.1  2001/03/12 16:50:59  mlindner
  67 *      chg: kernel 2.4 adaption
  68 *      
  69 *      Revision 1.12  2001/03/01 12:52:15  mlindner
  70 *      Fixed ring size
  71 *
  72 *      Revision 1.11  2001/02/19 13:28:02  mlindner
  73 *      Changed PNMI parameter values
  74 *
  75 *      Revision 1.10  2001/01/22 14:16:04  mlindner
  76 *      added ProcFs functionality
  77 *      Dual Net functionality integrated
  78 *      Rlmt networks added
  79 *
  80 *      Revision 1.1  2000/10/05 19:46:50  phargrov
  81 *      Add directory src/vipk_devs_nonlbl/vipk_sk98lin/
  82 *      This is the SysKonnect SK-98xx Gigabit Ethernet driver,
  83 *      contributed by SysKonnect.
  84 *
  85 *      Revision 1.9  2000/02/21 10:39:55  cgoos
  86 *      Added flag for jumbo support usage.
  87 *
  88 *      Revision 1.8  1999/11/22 13:50:44  cgoos
  89 *      Changed license header to GPL.
  90 *      Fixed two comments.
  91 *
  92 *      Revision 1.7  1999/09/28 12:38:21  cgoos
  93 *      Added CheckQueue to SK_AC.
  94 *      
  95 *      Revision 1.6  1999/07/27 08:04:05  cgoos
  96 *      Added checksumming variables to SK_AC.
  97 *      
  98 *      Revision 1.5  1999/03/29 12:33:26  cgoos
  99 *      Rreversed to fine lock granularity.
 100 *      
 101 *      Revision 1.4  1999/03/15 12:14:02  cgoos
 102 *      Added DriverLock to SK_AC.
 103 *      Removed other locks.
 104 *      
 105 *      Revision 1.3  1999/03/01 08:52:27  cgoos
 106 *      Changed pAC->PciDev declaration.
 107 *      
 108 *      Revision 1.2  1999/02/18 10:57:14  cgoos
 109 *      Removed SkDrvTimeStamp prototype.
 110 *      Fixed SkGeOsGetTime prototype.
 111 *      
 112 *      Revision 1.1  1999/02/16 07:41:01  cgoos
 113 *      First version.
 114 *      
 115 *      
 116 *
 117 ******************************************************************************/
 118
 119/******************************************************************************
 120 *
 121 * Description:
 122 *
 123 * This is the second include file of the driver, which includes all other
 124 * neccessary files and defines all structures and constants used by the
 125 * driver and the common modules.
 126 *
 127 * Include File Hierarchy:
 128 *
 129 *      see skge.c
 130 *
 131 ******************************************************************************/
 132
 133#ifndef __INC_SKDRV2ND_H
 134#define __INC_SKDRV2ND_H
 135
 136#include "h/skqueue.h"
 137#include "h/skgehwt.h"
 138#include "h/sktimer.h"
 139#include "h/ski2c.h"
 140#include "h/skgepnmi.h"
 141#include "h/skvpd.h"
 142#include "h/skgehw.h"
 143#include "h/skgeinit.h"
 144#include "h/skaddr.h"
 145#include "h/skgesirq.h"
 146#include "h/skcsum.h"
 147#include "h/skrlmt.h"
 148#include "h/skgedrv.h"
 149
 150#define SK_PCI_ISCOMPLIANT(result, pdev) {     \
 151    result = SK_FALSE; /* default */     \
 152    /* 3Com (0x10b7) */     \
 153    if (pdev->vendor == 0x10b7) {     \
 154        /* Gigabit Ethernet Adapter (0x1700) */     \
 155        if ((pdev->device == 0x1700)) { \
 156            result = SK_TRUE;     \
 157        }     \
 158    /* SysKonnect (0x1148) */     \
 159    } else if (pdev->vendor == 0x1148) {     \
 160        /* SK-98xx Gigabit Ethernet Server Adapter (0x4300) */     \
 161        /* SK-98xx V2.0 Gigabit Ethernet Adapter (0x4320) */     \
 162        if ((pdev->device == 0x4300) || \
 163            (pdev->device == 0x4320)) { \
 164            result = SK_TRUE;     \
 165        }     \
 166    /* D-Link (0x1186) */     \
 167    } else if (pdev->vendor == 0x1186) {     \
 168        /* Gigabit Ethernet Adapter (0x4c00) */     \
 169        if ((pdev->device == 0x4c00)) { \
 170            result = SK_TRUE;     \
 171        }     \
 172    /* Marvell (0x11ab) */     \
 173    } else if (pdev->vendor == 0x11ab) {     \
 174        /* Gigabit Ethernet Adapter (0x4320) */     \
 175        if ((pdev->device == 0x4320)) { \
 176            result = SK_TRUE;     \
 177        }     \
 178    /* CNet (0x1371) */     \
 179    } else if (pdev->vendor == 0x1371) {     \
 180        /* GigaCard Network Adapter (0x434e) */     \
 181        if ((pdev->device == 0x434e)) { \
 182            result = SK_TRUE;     \
 183        }     \
 184    /* Linksys (0x1737) */     \
 185    } else if (pdev->vendor == 0x1737) {     \
 186        /* Gigabit Network Adapter (0x1032) */     \
 187        /* Gigabit Network Adapter (0x1064) */     \
 188        if ((pdev->device == 0x1032) || \
 189            (pdev->device == 0x1064)) { \
 190            result = SK_TRUE;     \
 191        }     \
 192    } else {     \
 193        result = SK_FALSE;     \
 194    }     \
 195}
 196
 197
 198extern SK_MBUF          *SkDrvAllocRlmtMbuf(SK_AC*, SK_IOC, unsigned);
 199extern void             SkDrvFreeRlmtMbuf(SK_AC*, SK_IOC, SK_MBUF*);
 200extern SK_U64           SkOsGetTime(SK_AC*);
 201extern int              SkPciReadCfgDWord(SK_AC*, int, SK_U32*);
 202extern int              SkPciReadCfgWord(SK_AC*, int, SK_U16*);
 203extern int              SkPciReadCfgByte(SK_AC*, int, SK_U8*);
 204extern int              SkPciWriteCfgDWord(SK_AC*, int, SK_U32);
 205extern int              SkPciWriteCfgWord(SK_AC*, int, SK_U16);
 206extern int              SkPciWriteCfgByte(SK_AC*, int, SK_U8);
 207extern int              SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
 208
 209struct s_DrvRlmtMbuf {
 210        SK_MBUF         *pNext;         /* Pointer to next RLMT Mbuf. */
 211        SK_U8           *pData;         /* Data buffer (virtually contig.). */
 212        unsigned        Size;           /* Data buffer size. */
 213        unsigned        Length;         /* Length of packet (<= Size). */
 214        SK_U32          PortIdx;        /* Receiving/transmitting port. */
 215#ifdef SK_RLMT_MBUF_PRIVATE
 216        SK_RLMT_MBUF    Rlmt;           /* Private part for RLMT. */
 217#endif  /* SK_RLMT_MBUF_PRIVATE */
 218        struct sk_buff  *pOs;           /* Pointer to message block */
 219};
 220
 221
 222/*
 223 * Time macros
 224 */
 225#if SK_TICKS_PER_SEC == 100
 226#define SK_PNMI_HUNDREDS_SEC(t) (t)
 227#else
 228#define SK_PNMI_HUNDREDS_SEC(t) ((((unsigned long)t) * 100) / \
 229                                                                                (SK_TICKS_PER_SEC))
 230#endif
 231
 232/*
 233 * New SkOsGetTime
 234 */
 235#define SkOsGetTimeCurrent(pAC, pUsec) {\
 236        struct timeval t;\
 237        do_gettimeofday(&t);\
 238        *pUsec = ((((t.tv_sec) * 1000000L)+t.tv_usec)/10000);\
 239}
 240
 241
 242/*
 243 * ioctl definitions
 244 */
 245#define         SK_IOCTL_BASE           (SIOCDEVPRIVATE)
 246#define         SK_IOCTL_GETMIB         (SK_IOCTL_BASE + 0)
 247#define         SK_IOCTL_SETMIB         (SK_IOCTL_BASE + 1)
 248#define         SK_IOCTL_PRESETMIB      (SK_IOCTL_BASE + 2)
 249#define         SK_IOCTL_GEN            (SK_IOCTL_BASE + 3)
 250
 251typedef struct s_IOCTL  SK_GE_IOCTL;
 252
 253struct s_IOCTL {
 254        char*           pData;
 255        unsigned int    Len;
 256};
 257
 258
 259/*
 260 * define sizes of descriptor rings in bytes
 261 */
 262
 263#define         TX_RING_SIZE    (8*1024)
 264#define         RX_RING_SIZE    (24*1024)
 265
 266/*
 267 * Buffer size for ethernet packets
 268 */
 269#define ETH_BUF_SIZE    1540
 270#define ETH_MAX_MTU     1514
 271#define ETH_MIN_MTU     60
 272#define ETH_MULTICAST_BIT       0x01
 273#define SK_JUMBO_MTU    9000
 274
 275/*
 276 * transmit priority selects the queue: LOW=asynchron, HIGH=synchron
 277 */
 278#define TX_PRIO_LOW     0
 279#define TX_PRIO_HIGH    1
 280
 281/*
 282 * alignment of rx/tx descriptors
 283 */
 284#define DESCR_ALIGN     64
 285
 286/*
 287 * definitions for pnmi. TODO
 288 */
 289#define SK_DRIVER_RESET(pAC, IoC)       0
 290#define SK_DRIVER_SENDEVENT(pAC, IoC)   0
 291#define SK_DRIVER_SELFTEST(pAC, IoC)    0
 292/* For get mtu you must add an own function */
 293#define SK_DRIVER_GET_MTU(pAc,IoC,i)    0
 294#define SK_DRIVER_SET_MTU(pAc,IoC,i,v)  0
 295#define SK_DRIVER_PRESET_MTU(pAc,IoC,i,v)       0
 296
 297/*
 298** Interim definition of SK_DRV_TIMER placed in this file until 
 299** common modules have boon finallized
 300*/
 301#define SK_DRV_TIMER                    11 
 302#define SK_DRV_MODERATION_TIMER         1
 303#define SK_DRV_MODERATION_TIMER_LENGTH  1000000  /* 1 second */
 304#define SK_DRV_RX_CLEANUP_TIMER         2
 305#define SK_DRV_RX_CLEANUP_TIMER_LENGTH  1000000  /* 100 millisecs */
 306
 307/*
 308** Definitions regarding transmitting frames 
 309** any calculating any checksum.
 310*/
 311#define C_LEN_ETHERMAC_HEADER_DEST_ADDR 6
 312#define C_LEN_ETHERMAC_HEADER_SRC_ADDR  6
 313#define C_LEN_ETHERMAC_HEADER_LENTYPE   2
 314#define C_LEN_ETHERMAC_HEADER           ( (C_LEN_ETHERMAC_HEADER_DEST_ADDR) + \
 315                                          (C_LEN_ETHERMAC_HEADER_SRC_ADDR)  + \
 316                                          (C_LEN_ETHERMAC_HEADER_LENTYPE) )
 317
 318#define C_LEN_ETHERMTU_MINSIZE          46
 319#define C_LEN_ETHERMTU_MAXSIZE_STD      1500
 320#define C_LEN_ETHERMTU_MAXSIZE_JUMBO    9000
 321
 322#define C_LEN_ETHERNET_MINSIZE          ( (C_LEN_ETHERMAC_HEADER) + \
 323                                          (C_LEN_ETHERMTU_MINSIZE) )
 324
 325#define C_OFFSET_IPHEADER               C_LEN_ETHERMAC_HEADER
 326#define C_OFFSET_IPHEADER_IPPROTO       9
 327#define C_OFFSET_TCPHEADER_TCPCS        16
 328#define C_OFFSET_UDPHEADER_UDPCS        6
 329
 330#define C_OFFSET_IPPROTO                ( (C_LEN_ETHERMAC_HEADER) + \
 331                                          (C_OFFSET_IPHEADER_IPPROTO) )
 332
 333#define C_PROTO_ID_UDP                  17       /* refer to RFC 790 or Stevens'   */
 334#define C_PROTO_ID_TCP                  6        /* TCP/IP illustrated for details */
 335
 336/* TX and RX descriptors *****************************************************/
 337
 338typedef struct s_RxD RXD; /* the receive descriptor */
 339
 340struct s_RxD {
 341        volatile SK_U32 RBControl;      /* Receive Buffer Control */
 342        SK_U32          VNextRxd;       /* Next receive descriptor,low dword */
 343        SK_U32          VDataLow;       /* Receive buffer Addr, low dword */
 344        SK_U32          VDataHigh;      /* Receive buffer Addr, high dword */
 345        SK_U32          FrameStat;      /* Receive Frame Status word */
 346        SK_U32          TimeStamp;      /* Time stamp from XMAC */
 347        SK_U32          TcpSums;        /* TCP Sum 2 / TCP Sum 1 */
 348        SK_U32          TcpSumStarts;   /* TCP Sum Start 2 / TCP Sum Start 1 */
 349        RXD             *pNextRxd;      /* Pointer to next Rxd */
 350        struct sk_buff  *pMBuf;         /* Pointer to Linux' socket buffer */
 351};
 352
 353typedef struct s_TxD TXD; /* the transmit descriptor */
 354
 355struct s_TxD {
 356        volatile SK_U32 TBControl;      /* Transmit Buffer Control */
 357        SK_U32          VNextTxd;       /* Next transmit descriptor,low dword */
 358        SK_U32          VDataLow;       /* Transmit Buffer Addr, low dword */
 359        SK_U32          VDataHigh;      /* Transmit Buffer Addr, high dword */
 360        SK_U32          FrameStat;      /* Transmit Frame Status Word */
 361        SK_U32          TcpSumOfs;      /* Reserved / TCP Sum Offset */
 362        SK_U16          TcpSumSt;       /* TCP Sum Start */
 363        SK_U16          TcpSumWr;       /* TCP Sum Write */
 364        SK_U32          TcpReserved;    /* not used */
 365        TXD             *pNextTxd;      /* Pointer to next Txd */
 366        struct sk_buff  *pMBuf;         /* Pointer to Linux' socket buffer */
 367};
 368
 369/* Used interrupt bits in the interrupts source register *********************/
 370
 371#define DRIVER_IRQS     ((IS_IRQ_SW)   | \
 372                        (IS_R1_F)      |(IS_R2_F)  | \
 373                        (IS_XS1_F)     |(IS_XA1_F) | \
 374                        (IS_XS2_F)     |(IS_XA2_F))
 375
 376#define SPECIAL_IRQS    ((IS_HW_ERR)   |(IS_I2C_READY)  | \
 377                        (IS_EXT_REG)   |(IS_TIMINT)     | \
 378                        (IS_PA_TO_RX1) |(IS_PA_TO_RX2)  | \
 379                        (IS_PA_TO_TX1) |(IS_PA_TO_TX2)  | \
 380                        (IS_MAC1)      |(IS_LNK_SYNC_M1)| \
 381                        (IS_MAC2)      |(IS_LNK_SYNC_M2)| \
 382                        (IS_R1_C)      |(IS_R2_C)       | \
 383                        (IS_XS1_C)     |(IS_XA1_C)      | \
 384                        (IS_XS2_C)     |(IS_XA2_C))
 385
 386#define IRQ_MASK        ((IS_IRQ_SW)   | \
 387                        (IS_R1_B)      |(IS_R1_F)     |(IS_R2_B) |(IS_R2_F) | \
 388                        (IS_XS1_B)     |(IS_XS1_F)    |(IS_XA1_B)|(IS_XA1_F)| \
 389                        (IS_XS2_B)     |(IS_XS2_F)    |(IS_XA2_B)|(IS_XA2_F)| \
 390                        (IS_HW_ERR)    |(IS_I2C_READY)| \
 391                        (IS_EXT_REG)   |(IS_TIMINT)   | \
 392                        (IS_PA_TO_RX1) |(IS_PA_TO_RX2)| \
 393                        (IS_PA_TO_TX1) |(IS_PA_TO_TX2)| \
 394                        (IS_MAC1)      |(IS_MAC2)     | \
 395                        (IS_R1_C)      |(IS_R2_C)     | \
 396                        (IS_XS1_C)     |(IS_XA1_C)    | \
 397                        (IS_XS2_C)     |(IS_XA2_C))
 398
 399#define IRQ_HWE_MASK    (IS_ERR_MSK) /* enable all HW irqs */
 400
 401typedef struct s_DevNet DEV_NET;
 402
 403struct s_DevNet {
 404        struct                  proc_dir_entry *proc;
 405        int             PortNr;
 406        int             NetNr;
 407        int             Mtu;
 408        int             Up;
 409        SK_AC   *pAC;
 410};  
 411
 412typedef struct s_TxPort         TX_PORT;
 413
 414struct s_TxPort {
 415        /* the transmit descriptor rings */
 416        caddr_t         pTxDescrRing;   /* descriptor area memory */
 417        SK_U64          VTxDescrRing;   /* descr. area bus virt. addr. */
 418        TXD             *pTxdRingHead;  /* Head of Tx rings */
 419        TXD             *pTxdRingTail;  /* Tail of Tx rings */
 420        TXD             *pTxdRingPrev;  /* descriptor sent previously */
 421        int             TxdRingFree;    /* # of free entrys */
 422        spinlock_t      TxDesRingLock;  /* serialize descriptor accesses */
 423        caddr_t         HwAddr;         /* bmu registers address */
 424        int             PortIndex;      /* index number of port (0 or 1) */
 425};
 426
 427typedef struct s_RxPort         RX_PORT;
 428
 429struct s_RxPort {
 430        /* the receive descriptor rings */
 431        caddr_t         pRxDescrRing;   /* descriptor area memory */
 432        SK_U64          VRxDescrRing;   /* descr. area bus virt. addr. */
 433        RXD             *pRxdRingHead;  /* Head of Rx rings */
 434        RXD             *pRxdRingTail;  /* Tail of Rx rings */
 435        RXD             *pRxdRingPrev;  /* descriptor given to BMU previously */
 436        int             RxdRingFree;    /* # of free entrys */
 437        spinlock_t      RxDesRingLock;  /* serialize descriptor accesses */
 438        int             RxFillLimit;    /* limit for buffers in ring */
 439        caddr_t         HwAddr;         /* bmu registers address */
 440        int             PortIndex;      /* index number of port (0 or 1) */
 441};
 442
 443/* Definitions needed for interrupt moderation *******************************/
 444
 445#define IRQ_EOF_AS_TX     ((IS_XA1_F)     | (IS_XA2_F))
 446#define IRQ_EOF_SY_TX     ((IS_XS1_F)     | (IS_XS2_F))
 447#define IRQ_MASK_TX_ONLY  ((IRQ_EOF_AS_TX)| (IRQ_EOF_SY_TX))
 448#define IRQ_MASK_RX_ONLY  ((IS_R1_F)      | (IS_R2_F))
 449#define IRQ_MASK_SP_ONLY  (SPECIAL_IRQS)
 450#define IRQ_MASK_TX_RX    ((IRQ_MASK_TX_ONLY)| (IRQ_MASK_RX_ONLY))
 451#define IRQ_MASK_SP_RX    ((SPECIAL_IRQS)    | (IRQ_MASK_RX_ONLY))
 452#define IRQ_MASK_SP_TX    ((SPECIAL_IRQS)    | (IRQ_MASK_TX_ONLY))
 453#define IRQ_MASK_RX_TX_SP ((SPECIAL_IRQS)    | (IRQ_MASK_TX_RX))
 454
 455#define C_INT_MOD_NONE                 1
 456#define C_INT_MOD_STATIC               2
 457#define C_INT_MOD_DYNAMIC              4
 458
 459#define C_CLK_FREQ_GENESIS      53215000 /* shorter: 53.125 MHz  */
 460#define C_CLK_FREQ_YUKON        78215000 /* shorter: 78.125 MHz  */
 461
 462#define C_INTS_PER_SEC_DEFAULT      2000 
 463#define C_INT_MOD_ENABLE_PERCENTAGE   50 /* if higher 50% enable */
 464#define C_INT_MOD_DISABLE_PERCENTAGE  50 /* if lower 50% disable */
 465
 466typedef struct s_DynIrqModInfo  DIM_INFO;
 467struct s_DynIrqModInfo {
 468        unsigned long   PrevTimeVal;
 469        unsigned int    PrevSysLoad;
 470        unsigned int    PrevUsedTime;
 471        unsigned int    PrevTotalTime;
 472        int             PrevUsedDescrRatio;
 473        int             NbrProcessedDescr;
 474        SK_U64          PrevPort0RxIntrCts;
 475        SK_U64          PrevPort1RxIntrCts;
 476        SK_U64          PrevPort0TxIntrCts;
 477        SK_U64          PrevPort1TxIntrCts;
 478        SK_BOOL         ModJustEnabled;     /* Moderation just enabled yes/no */
 479
 480        int             MaxModIntsPerSec;            /* Moderation Threshold */
 481        int             MaxModIntsPerSecUpperLimit;  /* Upper limit for DIM  */
 482        int             MaxModIntsPerSecLowerLimit;  /* Lower limit for DIM  */
 483
 484        long            MaskIrqModeration;   /* ModIrqType (eg. 'TxRx')      */
 485        SK_BOOL         DisplayStats;        /* Stats yes/no                 */
 486        SK_BOOL         AutoSizing;          /* Resize DIM-timer on/off      */
 487        int             IntModTypeSelect;    /* EnableIntMod (eg. 'dynamic') */
 488
 489        SK_TIMER        ModTimer; /* just some timer */
 490};
 491
 492typedef struct s_PerStrm        PER_STRM;
 493
 494#define SK_ALLOC_IRQ    0x00000001
 495
 496/****************************************************************************
 497 * Per board structure / Adapter Context structure:
 498 *      Allocated within attach(9e) and freed within detach(9e).
 499 *      Contains all 'per device' necessary handles, flags, locks etc.:
 500 */
 501struct s_AC  {
 502        SK_GEINIT       GIni;           /* GE init struct */
 503        SK_PNMI         Pnmi;           /* PNMI data struct */
 504        SK_VPD          vpd;            /* vpd data struct */
 505        SK_QUEUE        Event;          /* Event queue */
 506        SK_HWT          Hwt;            /* Hardware Timer control struct */
 507        SK_TIMCTRL      Tim;            /* Software Timer control struct */
 508        SK_I2C          I2c;            /* I2C relevant data structure */
 509        SK_ADDR         Addr;           /* for Address module */
 510        SK_CSUM         Csum;           /* for checksum module */
 511        SK_RLMT         Rlmt;           /* for rlmt module */
 512        spinlock_t      SlowPathLock;   /* Normal IRQ lock */
 513        SK_PNMI_STRUCT_DATA PnmiStruct; /* structure to get all Pnmi-Data */
 514        int                     RlmtMode;       /* link check mode to set */
 515        int                     RlmtNets;       /* Number of nets */
 516        
 517        SK_IOC          IoBase;         /* register set of adapter */
 518        int             BoardLevel;     /* level of active hw init (0-2) */
 519        char            DeviceStr[80];  /* adapter string from vpd */
 520        SK_U32          AllocFlag;      /* flag allocation of resources */
 521        struct pci_dev  *PciDev;        /* for access to pci config space */
 522        SK_U32          PciDevId;       /* pci device id */
 523        struct SK_NET_DEVICE    *dev[2];        /* pointer to device struct */
 524        char            Name[30];       /* driver name */
 525        struct SK_NET_DEVICE    *Next;          /* link all devices (for clearing) */
 526        int             RxBufSize;      /* length of receive buffers */
 527        struct net_device_stats stats;  /* linux 'netstat -i' statistics */
 528        int             Index;          /* internal board index number */
 529
 530        /* adapter RAM sizes for queues of active port */
 531        int             RxQueueSize;    /* memory used for receive queue */
 532        int             TxSQueueSize;   /* memory used for sync. tx queue */
 533        int             TxAQueueSize;   /* memory used for async. tx queue */
 534
 535        int             PromiscCount;   /* promiscuous mode counter  */
 536        int             AllMultiCount;  /* allmulticast mode counter */
 537        int             MulticCount;    /* number of different MC    */
 538                                        /*  addresses for this board */
 539                                        /*  (may be more than HW can)*/
 540
 541        int             HWRevision;     /* Hardware revision */
 542        int             ActivePort;     /* the active XMAC port */
 543        int             MaxPorts;               /* number of activated ports */
 544        int             TxDescrPerRing; /* # of descriptors per tx ring */
 545        int             RxDescrPerRing; /* # of descriptors per rx ring */
 546
 547        caddr_t         pDescrMem;      /* Pointer to the descriptor area */
 548        dma_addr_t      pDescrMemDMA;   /* PCI DMA address of area */
 549
 550        /* the port structures with descriptor rings */
 551        TX_PORT         TxPort[SK_MAX_MACS][2];
 552        RX_PORT         RxPort[SK_MAX_MACS];
 553
 554        unsigned int    CsOfs1;         /* for checksum calculation */
 555        unsigned int    CsOfs2;         /* for checksum calculation */
 556        SK_U32          CsOfs;          /* for checksum calculation */
 557
 558        SK_BOOL         CheckQueue;     /* check event queue soon */
 559        SK_TIMER        DrvCleanupTimer;/* to check for pending descriptors */
 560        DIM_INFO        DynIrqModInfo;  /* all data related to DIM */
 561
 562        /* Only for tests */
 563        int             PortUp;
 564        int             PortDown;
 565        int             ChipsetType;    /*  Chipset family type 
 566                                                         *  0 == Genesis family support
 567                                                         *  1 == Yukon family support
 568                                                         */
 569};
 570
 571
 572#endif /* __INC_SKDRV2ND_H */
 573
 574
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.