OpenCores
URL https://opencores.org/ocsvn/fade_ether_protocol/fade_ether_protocol/trunk

Subversion Repositories fade_ether_protocol

[/] [fade_ether_protocol/] [trunk/] [stable_jumbo_frames_version/] [linux/] [fpga_l3_fade.h] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 wzab
/*
2
 * fpga_l3_fade - header for L3 communication protocol with FPGA based system
3
 * Copyright (C) 2012 by Wojciech M. Zabolotny
4
 * Institute of Electronic Systems, Warsaw University of Technology
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 *
20
 * Additionally I (Wojciech Zabolotny) allow you to include this header file
21
 * to compile your closed source applications (however yo should check, that
22
 * license terms of other include files used by this one allow you to do it...).
23
 */
24
 
25
#ifndef _FPGA_L3_FADE_H_
26
 
27
 
28
#include <linux/socket.h>
29
#include <linux/if_ether.h>
30
#include <linux/if.h>
31
 
32
struct l3_v1_buf_pointers {
33
  int head;
34
  int tail;
35 18 wzab
  char eof;
36 15 wzab
} __attribute__ ((__packed__));
37
 
38
struct l3_v1_slave  {
39
    unsigned char  mac[ETH_ALEN];
40
    char           devname[IFNAMSIZ];
41
}  __attribute__ ((__packed__));
42
 
43
struct l3_v1_usercmd {
44
  uint16_t cmd;
45
  uint16_t nr_of_retries;
46
  uint32_t arg;
47
  uint32_t timeout;
48
  uint8_t resp[12];
49
}  __attribute__ ((__packed__));
50
 
51
#define L3_V1_IOC_MAGIC 0xa5
52
 
53
#define L3_V1_IOC_SETWAKEUP     _IO(L3_V1_IOC_MAGIC,0x30)
54
#define L3_V1_IOC_GETBUFLEN     _IO(L3_V1_IOC_MAGIC,0x31)
55
#define L3_V1_IOC_READPTRS      _IOR(L3_V1_IOC_MAGIC,0x32,struct l3_v1_buf_pointers)
56
#define L3_V1_IOC_WRITEPTRS     _IO(L3_V1_IOC_MAGIC,0x33)
57
#define L3_V1_IOC_GETMAC        _IOW(L3_V1_IOC_MAGIC,0x34,struct l3_v1_slave)
58
#define L3_V1_IOC_STARTMAC      _IO(L3_V1_IOC_MAGIC,0x35)
59
#define L3_V1_IOC_STOPMAC       _IO(L3_V1_IOC_MAGIC,0x36)
60
#define L3_V1_IOC_FREEMAC       _IO(L3_V1_IOC_MAGIC,0x37)
61
#define L3_V1_IOC_USERCMD       _IOWR(L3_V1_IOC_MAGIC,0x38,struct l3_v1_usercmd)
62 18 wzab
#define L3_V1_IOC_RESETMAC      _IO(L3_V1_IOC_MAGIC,0x39)
63 15 wzab
 
64
/* Error flags */
65
#define FADE_ERR_INCORRECT_PACKET_TYPE (1<<0)
66
#define FADE_ERR_INCORRECT_SET (1<<1)
67
#define FADE_ERR_INCORRECT_LENGTH (1<<2)
68
 
69 18 wzab
/* Commands understood by the FPGA */
70
#define FCMD_START 1
71
#define FCMD_STOP 2
72
#define FCMD_ACK 3
73
#define FCMD_NACK 4
74
#define FCMD_RESET 5
75 15 wzab
 
76
#define _FPGA_L3_FADE_H_
77
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.