Newer
Older
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
#ifndef FLXNET_H
#define FLXNET_H
#include <linux/etherdevice.h>
struct flxnet_peer {
struct list_head list_head;
void __iomem *regs;
unsigned int reg_send;
unsigned int reg_recv;
unsigned int reg_status;
unsigned char mac_addr[ETH_ALEN];
bool reserved;
unsigned int role;
struct module *owner;
};
// determine role based on cpu
#ifdef __x86_64__
#define IS_ROLE_HOST
#else
#define IS_ROLE_TARGET
#endif
#define MIN_MMAP_SIZE 0x20
// fifo operators
#define HOST_ADDR_SEND 0x00
#define HOST_ADDR_RECV 0x10
#define HOST_ADDR_STATUS 0x20
#define HOST_MAGIC_REG 0x60
#define TARGET_ADDR_SEND 0x0C
#define TARGET_ADDR_RECV 0x10
#define TARGET_ADDR_STATUS 0x14
#define TARGET_MAGIC_REG 0x18
#define SEND_IS_EOP 5
#define RECV_IS_EOP 4
#define HAS_ROOM_FOR_BLOCK 3
#define HAS_ROOM_FOR_WORD 2
#define BLOCK_AVAILABLE 1
#define WORD_AVAILABLE 0
#define FLX_DEV_MAGIC 0xCECABABAUL
#define MAXCARDS 1 // max number of FLX cards in a server