1999-12-02 18:07:38 -05:00
|
|
|
|
|
|
|
#ifndef _RAW1394_PRIVATE_H
|
|
|
|
#define _RAW1394_PRIVATE_H
|
|
|
|
|
2002-10-23 17:18:49 -04:00
|
|
|
#define HBUF_SIZE 8192
|
|
|
|
#define ARM_REC_LENGTH 4096
|
|
|
|
|
1999-12-02 18:07:38 -05:00
|
|
|
struct raw1394_handle {
|
|
|
|
int fd;
|
2000-08-07 20:29:08 -04:00
|
|
|
int protocol_version;
|
1999-12-02 18:07:38 -05:00
|
|
|
unsigned int generation;
|
|
|
|
|
|
|
|
nodeid_t local_id;
|
|
|
|
int num_of_nodes;
|
2000-08-07 20:29:08 -04:00
|
|
|
nodeid_t irm_id;
|
1999-12-02 18:07:38 -05:00
|
|
|
|
2001-01-18 20:11:48 -05:00
|
|
|
raw1394_errcode_t err;
|
|
|
|
void *userdata;
|
|
|
|
|
1999-12-02 18:07:38 -05:00
|
|
|
bus_reset_handler_t bus_reset_handler;
|
2002-10-23 17:18:49 -04:00
|
|
|
tag_handler_t tag_handler;
|
|
|
|
arm_tag_handler_t arm_tag_handler;
|
|
|
|
fcp_handler_t fcp_handler;
|
|
|
|
iso_handler_t iso_handler[64];
|
1999-12-02 18:07:38 -05:00
|
|
|
|
2002-11-18 02:40:21 -05:00
|
|
|
/* new ISO API */
|
|
|
|
|
|
|
|
/* memory mapping of the DMA buffer */
|
|
|
|
unsigned char *iso_buffer;
|
2002-12-23 22:01:11 -05:00
|
|
|
|
|
|
|
/* iso XMIT only: */
|
|
|
|
unsigned int iso_buf_stride; /* offset between successive packets */
|
|
|
|
unsigned int next_packet; /* index of next packet to be transmitted */
|
|
|
|
|
2002-11-18 02:40:21 -05:00
|
|
|
/* status buffer, updated from _raw1394_iso_iterate() */
|
|
|
|
struct raw1394_iso_status iso_status;
|
|
|
|
unsigned int iso_packets_dropped;
|
|
|
|
|
|
|
|
/* user-supplied handlers */
|
|
|
|
raw1394_iso_xmit_handler_t iso_xmit_handler;
|
|
|
|
raw1394_iso_recv_handler_t iso_recv_handler;
|
2002-12-23 22:01:11 -05:00
|
|
|
|
1999-12-02 18:07:38 -05:00
|
|
|
struct raw1394_request req;
|
2002-10-23 17:18:49 -04:00
|
|
|
quadlet_t buffer[HBUF_SIZE/4]; /* 2048 */
|
1999-12-02 18:07:38 -05:00
|
|
|
};
|
|
|
|
|
1999-12-29 17:24:32 -05:00
|
|
|
struct sync_cb_data {
|
|
|
|
int done;
|
|
|
|
int errcode;
|
|
|
|
};
|
|
|
|
|
|
|
|
int _raw1394_sync_cb(struct raw1394_handle*, struct sync_cb_data*, int);
|
2002-11-18 02:40:21 -05:00
|
|
|
int _raw1394_iso_iterate(raw1394handle_t handle);
|
1999-12-29 17:24:32 -05:00
|
|
|
|
1999-12-02 18:07:38 -05:00
|
|
|
#define CLEAR_REQ(reqp) memset((reqp), 0, sizeof(struct raw1394_request))
|
|
|
|
|
2000-09-10 18:18:49 -04:00
|
|
|
#if SIZEOF_VOID_P == 4
|
|
|
|
#define int2ptr(x) ((void *)(__u32)x)
|
|
|
|
#define ptr2int(x) ((__u64)(__u32)x)
|
|
|
|
#else
|
|
|
|
#define int2ptr(x) ((void *)x)
|
|
|
|
#define ptr2int(x) ((__u64)x)
|
|
|
|
#endif
|
|
|
|
|
1999-12-02 18:07:38 -05:00
|
|
|
#endif /* _RAW1394_PRIVATE_H */
|