forked from awm22/NetFPGA-P33
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nf2util.h
64 lines (55 loc) · 1.98 KB
/
nf2util.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
64
/* ****************************************************************************
* $Id: nf2util.h 6008 2010-03-14 08:17:15Z grg $
*
* Module: nf2util.h
* Project: NetFPGA 2 Linux Kernel Driver
* Description: Header file for kernel driver
*
* Change history:
*
*/
#ifndef _NF2UTIL_H
#define _NF2UTIL_H 1
#define PATHLEN 80
#define DEVICE_STR_LEN 100
#define DEVICE_INFO_STR_LEN 1024
#define MAX_IPADDR_LEN 32
#define PROJ_UNKNOWN "Unknown"
#define VERSION_ANY -1
/*
* Structure to represent an nf2 device to a user mode programs
*/
struct nf2device {
char *device_name;
int fd;
int net_iface;
char server_ip_addr[MAX_IPADDR_LEN];
int server_port_num;
};
/* Function declarations */
int readReg(struct nf2device *nf2, unsigned reg, unsigned *val);
int writeReg(struct nf2device *nf2, unsigned reg, unsigned val);
int check_iface(struct nf2device *nf2);
int openDescriptor(struct nf2device *nf2);
int closeDescriptor(struct nf2device *nf2);
void nf2_read_info(struct nf2device *nf2);
void printHello (struct nf2device *nf2, int *val);
unsigned getCPCIVersion(struct nf2device *nf2);
unsigned getCPCIRevsion(struct nf2device *nf2);
unsigned getDeviceCPCIVersion(struct nf2device *nf2);
unsigned getDeviceCPCIRevsion(struct nf2device *nf2);
unsigned getDeviceID(struct nf2device *nf2);
unsigned getDeviceMajor(struct nf2device *nf2);
unsigned getDeviceMinor(struct nf2device *nf2);
unsigned getDeviceRevision(struct nf2device *nf2);
unsigned getDeviceIDModuleVersion(struct nf2device *nf2);
const char* getProjDir(struct nf2device *nf2);
const char* getProjName(struct nf2device *nf2);
const char* getProjDesc(struct nf2device *nf2);
const char* getDeviceInfoStr(struct nf2device *nf2);
int isVirtexProgrammed(struct nf2device *nf2);
int checkVirtexBitfile(struct nf2device *nf2, char *projDir,
int minVerMajor, int minVerMinor, int minVerRev,
int maxVerMajor, int maxVerMinor, int maxVerRev);
const char *getVirtexBitfileErr();
#endif