AFHBA404
AFHBA404 connects ACQ2106 to PCI-Express
rtm-t_ioctl.h
Go to the documentation of this file.
1 /* rtm-t_ioctl.h RTM-T Driver external API */
2 /* ------------------------------------------------------------------------- */
3 /* Copyright (C) 2010 Peter Milne, D-TACQ Solutions Ltd
4  * <Peter dot Milne at D hyphen TACQ dot com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of Version 2 of the GNU General Public License
8  as published by the Free Software Foundation;
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
18 /* ------------------------------------------------------------------------- */
19 
22 #ifndef __RTM_T_IOCTL_H__
23 #define __RTM_T_IOCTL_H__
24 
25 #include <linux/ioctl.h>
26 
27 
28 struct LLC_DEF
29 {
36 };
37 
38 struct AO_LLC_DEF
39 {
40  int length;
43 };
44 
45 struct XLLC_DEF {
46  unsigned len;
47  u32 pa;
49 };
50 
51 struct AB {
52  struct XLLC_DEF buffers[2];
53 };
54 
55 #define MAXABN 256
56 
57 struct ABN {
58  int ndesc;
59  struct XLLC_DEF buffers[MAXABN];
60  /* others tag on behind */
61 };
62 
63 #define MAX_AO_BUF 4
64 
65 #define AO_BURST_ID 0xA0B55555
66 
67 struct AO_BURST {
68  unsigned id;
69  unsigned nbuf;
70  unsigned tickms; // msec per tick : 0 means use interrupt
71 };
72 
73 #define VALID_AO_BURST(p) (((struct AO_BURST*)p)->id == AO_BURST_ID)
74 
75 #define RTM_T_USE_HOSTBUF 0
76 
77 #define DMAGIC 0xDB
78 
79 #define RTM_T_START_STREAM _IO(DMAGIC, 1)
80 
81 #define RTM_T_START_LLC _IOW(DMAGIC, 2, struct LLC_DEF)
82 
85 #define RTM_T_START_STREAM_MAX _IOW(DMAGIC, 3, u32)
86 
88 #define RTM_T_START_AOLLC _IOW(DMAGIC, 4, struct AO_LLC_DEF)
89 
90 #define AFHBA_START_AI_LLC _IOWR(DMAGIC, 5, struct XLLC_DEF)
91 
95 #define AFHBA_START_AO_LLC _IOWR(DMAGIC, 6, struct XLLC_DEF)
96 
98 #define AFHBA_START_AI_AB _IOWR(DMAGIC, 7, struct AB)
99 
104 #define AFHBA_START_AI_ABN _IOWR(DMAGIC, 8, struct ABN)
105 
106 #define AFHBA_START_AO_ABN _IOWR(DMAGIC, 9, struct ABN)
107 
109 /* define an AO_BURST setup */
110 #define AFHBA_AO_BURST_INIT _IOWR(DMAGIC, 10, struct AO_BURST)
111 /* define current buffer id */
112 #define AFHBA_AO_BURST_SETBUF _IOWR(DMAGIC, 12, u32)
113 
115 #define RTM_T_START_STREAM_AO _IO(DMAGIC, 11)
116 
120 };
121 #define IBUF_MAGIC 0xb1f00000
122 #define IBUF_MAGIC_MASK 0xfff00000
123 #define IBUF_IDX 0x000f0000
124 #define IBUF_IDX_SHL 16
125 #define IBUF_IBUF 0x0000ffff
126 #define ESTA_CRC 0x0000ffff
127 #define SBDSZ sizeof(struct StreamBufferDef)
128 
129 #endif /* __RTM_T_IOCTL_H__ */
LLC_DEF::clk_pos
u8 clk_pos
1: clk rising
Definition: rtm-t_ioctl.h:32
AB::buffers
struct XLLC_DEF buffers[2]
Definition: rtm-t_ioctl.h:52
LLC_DEF::target_pa
u32 target_pa
target bus address round to 1K boundary.
Definition: rtm-t_ioctl.h:34
ABN::ndesc
int ndesc
Definition: rtm-t_ioctl.h:58
StreamBufferDef::ibuf
u32 ibuf
Definition: rtm-t_ioctl.h:118
AO_BURST::nbuf
unsigned nbuf
Definition: rtm-t_ioctl.h:69
AO_BURST::id
unsigned id
Definition: rtm-t_ioctl.h:68
XLLC_DEF::pa
u32 pa
SRC or DST buffer PA - round to 1K RTM_T_USE_HOSTBUF=> use Driver buffer 0.
Definition: rtm-t_ioctl.h:47
XLLC_DEF::len
unsigned len
length in bytes - will round up to next %64
Definition: rtm-t_ioctl.h:46
XLLC_DEF
Definition: rtm-t_ioctl.h:45
AO_LLC_DEF::length
int length
< arg for ioctl RTM_T_START_AOLLC
Definition: rtm-t_ioctl.h:40
AO_LLC_DEF
Definition: rtm-t_ioctl.h:39
StreamBufferDef::esta
u32 esta
Definition: rtm-t_ioctl.h:119
LLC_DEF::trg_pos
u8 trg_pos
1: trg rising
Definition: rtm-t_ioctl.h:33
LLC_DEF
< arg for ioctl RTM_T_START_LLC
Definition: rtm-t_ioctl.h:29
AO_BURST
Definition: rtm-t_ioctl.h:67
ABN
Definition: rtm-t_ioctl.h:57
AO_BURST::tickms
unsigned tickms
Definition: rtm-t_ioctl.h:70
AO_LLC_DEF::src_pa
u32 src_pa
source bus address round to 1k boundary.
Definition: rtm-t_ioctl.h:41
u8
unsigned char u8
Definition: local.h:62
ABN::buffers
struct XLLC_DEF buffers[MAXABN]
Definition: rtm-t_ioctl.h:59
LLC_DEF::clk_div
u8 clk_div
1..255: ECM value 1..255 usec with 1MHz EXTCLK
Definition: rtm-t_ioctl.h:30
AB
Definition: rtm-t_ioctl.h:51
StreamBufferDef
Definition: rtm-t_ioctl.h:117
u32
unsigned u32
Definition: local.h:60
LLC_DEF::fill
u8 fill
Definition: rtm-t_ioctl.h:31
MAXABN
#define MAXABN
Definition: rtm-t_ioctl.h:55