/*

Copyright (c)   Stratus Computer. 

Module Name:

    sratype.h

Abstract:

    Stratus specific type definitions for hardened enet driver

*/

#ifndef _SRATYPE_H_
#define _SRATYPE_H_


#define DIGI_VENDOR_ID 0x114F
// New (BA) 5 Dec - handle Digi Async cards with 159C Vendor ID
#define DIGI_ASYNC_VEN_ID 0x159C
#define DIGI_ASYNC_DEV_ID 0x8002

#define START_TESTING   0        // initial state
#define TEST_COMPLETE   5    // ending state
#define ITEST_TIME      30       // 3 seconds between polls
#define ITEST_INTERVAL  300      // 30 seconds between iterations
#define PCI_SLOT_BREAK  1        // Breaker function


typedef struct DXB_DEVICE_EXTENSION DXB_DEVICE_EXTENSION, *PDXB_DEVICE_EXTENSION;
typedef struct _SRA_ADAPTER SRA_ADAPTER,*PSRA_ADAPTER;

#define ASSERT_OWNER()     ASSERT(gDxbLockOwner==KeGetCurrentThread())
#define ASSERT_NOTOWNER()  ASSERT(gDxbLockOwner!=KeGetCurrentThread())



#define SHUTDOWN_DELETE_DEVICE                          0x00000001
#define SHUTDOWN_DELETE_SYMLINK                         0x00000002

#define MAX_PARTNERS    4


//  Failure data Structure
#define MAX_DIAG_FAILURE_DATA   10

typedef struct DIAG_FAILURE_DATA {
    ULONG         TestNumber;
    ULONG         ErrorCode;
} DIAG_FAILURE_DATA, *PDIAG_FAILURE_DATA;

typedef struct {
    LARGE_INTEGER     TimeOfLastRun;
    USHORT            DiagFailureCount;
    DIAG_FAILURE_DATA DiagFailureData[MAX_DIAG_FAILURE_DATA];
} DIAG_STATUS, *PDIAG_STATUS;


//  Failure data Structure
#define MAX_DIAG_FAILURE_DATA   10
typedef struct _EXTENDED_PCI_DATA {

    ULONG   Bus;
    ULONG   Device;
    ULONG   Function;
    PCI_COMMON_CONFIG   ConfigInfo;

} EXTENDED_PCI_DATA, *PEXTENDED_PCI_DATA;


// Stratus DXB Adapter Structure
typedef struct _SRA_ADAPTER {
    LIST_ENTRY List;
    DEVICE_ID       DevicePathId;
    BOOLEAN         PendingDelete;
    BOOLEAN         bAsyncDevice;
    BOOLEAN         OfflineDesired;
    BOOLEAN         AdapterRemoved;   
    ULONG           RefCount;
    ULONG           State;
    ULONG           Reason;
    MTBF            Mtbf;
    UNICODE_STRING  SerialNumber;
    PDEVICE_OBJECT  pDo;
    PDEVICE_OBJECT  pWmiDo;
    PDEVICE_OBJECT  pDxbDevExt;
    USHORT          PartnerCount;
    PDXB_DEVICE_EXTENSION Adapter; 
//  DIAG_STATUS     DiagStatus;

};



#define PCI_MAX_DEVICES      32
#define MAX_PCI_BUSES       256




#endif _SRATYPE_H_


