-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOlsDef.h
63 lines (54 loc) · 2.28 KB
/
OlsDef.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//-----------------------------------------------------------------------------
// Author : hiyohiyo
// Mail : hiyohiyo@crystalmark.info
// Web : http://openlibsys.org/
// License : The modified BSD license
//
// Copyright 2007 OpenLibSys.org. All rights reserved.
//-----------------------------------------------------------------------------
#pragma once
//-----------------------------------------------------------------------------
//
// DLL Status Code
//
//-----------------------------------------------------------------------------
#define OLS_DLL_NO_ERROR 0
#define OLS_DLL_UNSUPPORTED_PLATFORM 1
#define OLS_DLL_DRIVER_NOT_LOADED 2
#define OLS_DLL_DRIVER_NOT_FOUND 3
#define OLS_DLL_DRIVER_UNLOADED 4
#define OLS_DLL_DRIVER_NOT_LOADED_ON_NETWORK 5
#define OLS_DLL_UNKNOWN_ERROR 9
//-----------------------------------------------------------------------------
//
// Driver Type
//
//-----------------------------------------------------------------------------
#define OLS_DRIVER_TYPE_UNKNOWN 0
#define OLS_DRIVER_TYPE_WIN_9X 1
#define OLS_DRIVER_TYPE_WIN_NT 2
#define OLS_DRIVER_TYPE_WIN_NT4 3 // Obsolete
#define OLS_DRIVER_TYPE_WIN_NT_X64 4
#define OLS_DRIVER_TYPE_WIN_NT_IA64 5 // Reseved
//-----------------------------------------------------------------------------
//
// PCI Error Code
//
//-----------------------------------------------------------------------------
#define OLS_ERROR_PCI_BUS_NOT_EXIST (0xE0000001L)
#define OLS_ERROR_PCI_NO_DEVICE (0xE0000002L)
#define OLS_ERROR_PCI_WRITE_CONFIG (0xE0000003L)
#define OLS_ERROR_PCI_READ_CONFIG (0xE0000004L)
//-----------------------------------------------------------------------------
//
// Support Macros
//
//-----------------------------------------------------------------------------
// Bus Number, Device Number and Function Number to PCI Device Address
#define PciBusDevFunc(Bus, Dev, Func) ((Bus&0xFF)<<8) | ((Dev&0x1F)<<3) | (Func&7)
// PCI Device Address to Bus Number
#define PciGetBus(address) ((address>>8) & 0xFF)
// PCI Device Address to Device Number
#define PciGetDev(address) ((address>>3) & 0x1F)
// PCI Device Address to Function Number
#define PciGetFunc(address) (address&7)