| 1 | /************************************************************************/ | 
|---|
| 2 | /*                                                                      */ | 
|---|
| 3 | /*  This is the application  header file for the IO_RCC                 */ | 
|---|
| 4 | /*  library & applications                                              */ | 
|---|
| 5 | /*                                                                      */ | 
|---|
| 6 | /*   6. Jun. 02  MAJO  created                                          */ | 
|---|
| 7 | /*                                                                      */ | 
|---|
| 8 | /*******C 2002 - The software with that certain something****************/ | 
|---|
| 9 |  | 
|---|
| 10 | #ifndef _IO_RCC_H | 
|---|
| 11 | #define _IO_RCC_H | 
|---|
| 12 |  | 
|---|
| 13 | #include "io_rcc_common.h" | 
|---|
| 14 |  | 
|---|
| 15 | //Definitions used in IO_GetHostInfo | 
|---|
| 16 | //Board type definitions are in io_rcc_common.h | 
|---|
| 17 |  | 
|---|
| 18 | //Board manufacturers | 
|---|
| 19 | #define CCT 1 | 
|---|
| 20 |  | 
|---|
| 21 | //Operating system type | 
|---|
| 22 | #define LINUX 1 | 
|---|
| 23 |  | 
|---|
| 24 | //Operating system version | 
|---|
| 25 | #define K249 1 | 
|---|
| 26 |  | 
|---|
| 27 | //Error strings | 
|---|
| 28 | #define IO_RCC_SUCCESS_STR       "No error" | 
|---|
| 29 | #define IO_RCC_ERROR_FAIL_STR    "Failed to install the error library" | 
|---|
| 30 | #define IO_RCC_FILE_STR          "Failed to open /dev/io_rcc" | 
|---|
| 31 | #define IO_RCC_NOTOPEN_STR       "Library has not yet been opened" | 
|---|
| 32 | #define IO_RCC_MMAP_STR          "Error from call to mmap function" | 
|---|
| 33 | #define IO_RCC_MUNMAP_STR        "Error from call to munmap function" | 
|---|
| 34 | #define IO_RCC_ILLMANUF_STR      "Unable to determine board manufacturer" | 
|---|
| 35 | #define IO_RCC_IOFAIL_STR        "Error from IO_IOPeek or IO_IOPoke" | 
|---|
| 36 | #define IO_RCC_NO_CODE_STR       "Unknown error" | 
|---|
| 37 | #define IO_PCI_TABLEFULL_STR     "Internal device table is full" | 
|---|
| 38 | #define IO_PCI_NOT_FOUND_STR     "PCI Device not found" | 
|---|
| 39 | #define IO_PCI_ILL_HANDLE_STR    "Illegal handle" | 
|---|
| 40 | #define IO_PCI_CONFIGRW_STR      "Error from pci_(read/write)_config_dword system call" | 
|---|
| 41 | #define IO_PCI_UNKNOWN_BOARD_STR "Board type can not be determined" | 
|---|
| 42 | #define IO_RCC_ILL_OFFSET_STR    "Illegal offset (alignment)" | 
|---|
| 43 | #define IO_PCI_REMAP_STR         "Error from remap_page_range system call" | 
|---|
| 44 |  | 
|---|
| 45 | #ifdef __cplusplus | 
|---|
| 46 | extern "C" { | 
|---|
| 47 | #endif | 
|---|
| 48 | IO_ErrorCode_t IO_Open(void); | 
|---|
| 49 | IO_ErrorCode_t IO_Close(void); | 
|---|
| 50 | IO_ErrorCode_t IO_PCIMemMap(u_int pci_addr, u_int size, u_long *virt_addr); | 
|---|
| 51 | IO_ErrorCode_t IO_PCIMemUnmap(u_long virt_addr, u_int size); | 
|---|
| 52 | IO_ErrorCode_t IO_IOPeekUInt(u_int address, u_int *data); | 
|---|
| 53 | IO_ErrorCode_t IO_IOPokeUInt(u_int address, u_int data); | 
|---|
| 54 | IO_ErrorCode_t IO_IOPeekUShort(u_int address, u_short *data); | 
|---|
| 55 | IO_ErrorCode_t IO_IOPokeUShort(u_int address, u_short data); | 
|---|
| 56 | IO_ErrorCode_t IO_IOPeekUChar(u_int address, u_char *data); | 
|---|
| 57 | IO_ErrorCode_t IO_IOPokeUChar(u_int address, u_char data); | 
|---|
| 58 | IO_ErrorCode_t IO_PCIDeviceLink(u_int vendor_id, u_int device_id, u_int occurrence, u_int *handle); | 
|---|
| 59 | IO_ErrorCode_t IO_PCIDeviceUnlink(u_int handle); | 
|---|
| 60 | IO_ErrorCode_t IO_PCIDeviceInfo(u_int handle, pci_info_t *info); | 
|---|
| 61 | IO_ErrorCode_t IO_PCIConfigReadUInt(u_int handle, u_int offset, u_int *data); | 
|---|
| 62 | IO_ErrorCode_t IO_PCIConfigWriteUInt(u_int handle, u_int offset, u_int data); | 
|---|
| 63 | IO_ErrorCode_t IO_PCIConfigReadUShort(u_int handle, u_int offset, u_short *data); | 
|---|
| 64 | IO_ErrorCode_t IO_PCIConfigWriteUShort(u_int handle, u_int offset, u_short data); | 
|---|
| 65 | IO_ErrorCode_t IO_PCIConfigReadUChar(u_int handle, u_int offset, u_char *data); | 
|---|
| 66 | IO_ErrorCode_t IO_PCIConfigWriteUChar(u_int handle, u_int offset, u_char data); | 
|---|
| 67 | IO_ErrorCode_t IO_GetHostInfo(HostInfo_t *host_info); | 
|---|
| 68 | IO_ErrorCode_t IO_Mark(u_int bus); | 
|---|
| 69 | unsigned int IO_RCC_err_get(err_pack err, err_str pid, err_str code); | 
|---|
| 70 | #ifdef __cplusplus | 
|---|
| 71 | } | 
|---|
| 72 | #endif | 
|---|
| 73 |  | 
|---|
| 74 | #endif | 
|---|