more debug output
[linux-2.4.git] / drivers / ieee1394 / raw1394.h
1 #ifndef IEEE1394_RAW1394_H
2 #define IEEE1394_RAW1394_H
3
4 /* header for the raw1394 API that is exported to user-space */
5
6 #define RAW1394_KERNELAPI_VERSION 4
7
8 /* state: opened */
9 #define RAW1394_REQ_INITIALIZE    1
10
11 /* state: initialized */
12 #define RAW1394_REQ_LIST_CARDS    2
13 #define RAW1394_REQ_SET_CARD      3
14
15 /* state: connected */
16 #define RAW1394_REQ_ASYNC_READ      100
17 #define RAW1394_REQ_ASYNC_WRITE     101
18 #define RAW1394_REQ_LOCK            102
19 #define RAW1394_REQ_LOCK64          103
20 #define RAW1394_REQ_ISO_SEND        104
21 #define RAW1394_REQ_ASYNC_SEND      105
22 #define RAW1394_REQ_ASYNC_STREAM    106
23
24 #define RAW1394_REQ_ISO_LISTEN      200
25 #define RAW1394_REQ_FCP_LISTEN      201
26 #define RAW1394_REQ_RESET_BUS       202
27 #define RAW1394_REQ_GET_ROM         203
28 #define RAW1394_REQ_UPDATE_ROM      204
29 #define RAW1394_REQ_ECHO            205
30
31 #define RAW1394_REQ_ARM_REGISTER    300
32 #define RAW1394_REQ_ARM_UNREGISTER  301
33
34 #define RAW1394_REQ_RESET_NOTIFY    400
35
36 #define RAW1394_REQ_PHYPACKET       500
37
38 /* kernel to user */
39 #define RAW1394_REQ_BUS_RESET        10000
40 #define RAW1394_REQ_ISO_RECEIVE      10001
41 #define RAW1394_REQ_FCP_REQUEST      10002
42 #define RAW1394_REQ_ARM              10003
43 #define RAW1394_REQ_RAWISO_ACTIVITY  10004
44
45 /* error codes */
46 #define RAW1394_ERROR_NONE        0
47 #define RAW1394_ERROR_COMPAT      (-1001)
48 #define RAW1394_ERROR_STATE_ORDER (-1002)
49 #define RAW1394_ERROR_GENERATION  (-1003)
50 #define RAW1394_ERROR_INVALID_ARG (-1004)
51 #define RAW1394_ERROR_MEMFAULT    (-1005)
52 #define RAW1394_ERROR_ALREADY     (-1006)
53
54 #define RAW1394_ERROR_EXCESSIVE   (-1020)
55 #define RAW1394_ERROR_UNTIDY_LEN  (-1021)
56
57 #define RAW1394_ERROR_SEND_ERROR  (-1100)
58 #define RAW1394_ERROR_ABORTED     (-1101)
59 #define RAW1394_ERROR_TIMEOUT     (-1102)
60
61 /* arm_codes */
62 #define ARM_READ   1
63 #define ARM_WRITE  2
64 #define ARM_LOCK   4
65
66 #define RAW1394_LONG_RESET  0
67 #define RAW1394_SHORT_RESET 1
68
69 /* busresetnotify ... */
70 #define RAW1394_NOTIFY_OFF 0
71 #define RAW1394_NOTIFY_ON  1
72
73 #include <asm/types.h>
74
75 struct raw1394_request {
76         __u32 type;
77         __s32 error;
78         __u32 misc;
79
80         __u32 generation;
81         __u32 length;
82
83         __u64 address;
84
85         __u64 tag;
86
87         __u64 sendb;
88         __u64 recvb;
89 };
90
91 struct raw1394_khost_list {
92         __u32 nodes;
93         __u8 name[32];
94 };
95
96 typedef struct arm_request {
97         __u16           destination_nodeid;
98         __u16           source_nodeid;
99         __u64           destination_offset;
100         __u8            tlabel;
101         __u8            tcode;
102         __u8            extended_transaction_code;
103         __u32           generation;
104         __u16           buffer_length;
105         __u8            *buffer;
106 } *arm_request_t;
107
108 typedef struct arm_response {
109         __s32           response_code;
110         __u16           buffer_length;
111         __u8            *buffer;
112 } *arm_response_t;
113
114 typedef struct arm_request_response {
115         struct arm_request  *request;
116         struct arm_response *response;
117 } *arm_request_response_t;
118
119 /* rawiso API */
120 #include "ieee1394-ioctl.h"
121
122 /* per-packet metadata embedded in the ringbuffer */
123 /* must be identical to hpsb_iso_packet_info in iso.h! */
124 struct raw1394_iso_packet_info {
125         __u32 offset;
126         __u16 len;
127         __u16 cycle;   /* recv only */
128         __u8  channel; /* recv only */
129         __u8  tag;
130         __u8  sy;
131 };
132
133 /* argument for RAW1394_ISO_RECV/XMIT_PACKETS ioctls */
134 struct raw1394_iso_packets {
135         __u32 n_packets;
136         struct raw1394_iso_packet_info *infos;
137 };
138
139 struct raw1394_iso_config {
140         /* size of packet data buffer, in bytes (will be rounded up to PAGE_SIZE) */
141         __u32 data_buf_size;
142
143         /* # of packets to buffer */
144         __u32 buf_packets;
145
146         /* iso channel (set to -1 for multi-channel recv) */
147         __s32 channel;
148
149         /* xmit only - iso transmission speed */
150         __u8 speed;
151
152         /* max. latency of buffer, in packets (-1 if you don't care) */
153         __s32 irq_interval;
154 };
155
156 /* argument to RAW1394_ISO_XMIT/RECV_INIT and RAW1394_ISO_GET_STATUS */
157 struct raw1394_iso_status {
158         /* current settings */
159         struct raw1394_iso_config config;
160
161         /* number of packets waiting to be filled with data (ISO transmission)
162            or containing data received (ISO reception) */
163         __u32 n_packets;
164
165         /* approximate number of packets dropped due to overflow or
166            underflow of the packet buffer (a value of zero guarantees
167            that no packets have been dropped) */
168         __u32 overflows;
169
170         /* cycle number at which next packet will be transmitted;
171            -1 if not known */
172         __s16 xmit_cycle;
173 };
174
175 #endif /* IEEE1394_RAW1394_H */