summaryrefslogtreecommitdiffstats
path: root/src/kernel-raw1394.h
diff options
context:
space:
mode:
authorGravatar abombe 1999-12-02 23:07:38 +0000
committerGravatar abombe 1999-12-02 23:07:38 +0000
commit0f5ef10baaba0890f7e9bed6545e0614b65e7884 (patch)
tree115fc38dea3113e5937f33fba540764e0802c80b /src/kernel-raw1394.h
Initial revision
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@1 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to 'src/kernel-raw1394.h')
-rw-r--r--src/kernel-raw1394.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/kernel-raw1394.h b/src/kernel-raw1394.h
new file mode 100644
index 0000000..fe8ea72
--- /dev/null
+++ b/src/kernel-raw1394.h
@@ -0,0 +1,102 @@
+
+#ifndef IEEE1394_RAW1394_H
+#define IEEE1394_RAW1394_H
+
+#define RAW1394_DEVICE_MAJOR 171
+#define RAW1394_DEVICE_NAME "raw1394"
+
+#define RAW1394_KERNELAPI_VERSION 1
+
+/* state: opened */
+#define RAW1394_REQ_INITIALIZE 1
+
+/* state: initialized */
+#define RAW1394_REQ_LIST_CARDS 2
+#define RAW1394_REQ_SET_CARD 3
+
+/* state: connected */
+#define RAW1394_REQ_ASYNC_READ 100
+#define RAW1394_REQ_ASYNC_WRITE 101
+#define RAW1394_REQ_LOCK 102
+#define RAW1394_REQ_LOCK64 103
+
+#define RAW1394_REQ_ISO_LISTEN 200
+
+/* kernel to user */
+#define RAW1394_REQ_BUS_RESET 10000
+#define RAW1394_REQ_ISO_RECEIVE 10001
+
+/* error codes */
+#define RAW1394_ERROR_NONE 0
+#define RAW1394_ERROR_COMPAT (-1001)
+#define RAW1394_ERROR_STATE_ORDER (-1002)
+#define RAW1394_ERROR_GENERATION (-1003)
+#define RAW1394_ERROR_INVALID_ARG (-1004)
+#define RAW1394_ERROR_MEMFAULT (-1005)
+#define RAW1394_ERROR_ALREADY (-1006)
+
+#define RAW1394_ERROR_EXCESSIVE (-1020)
+#define RAW1394_ERROR_UNTIDY_LEN (-1021)
+
+#define RAW1394_ERROR_SEND_ERROR (-1100)
+#define RAW1394_ERROR_ABORTED (-1101)
+#define RAW1394_ERROR_TIMEOUT (-1102)
+
+
+struct raw1394_request {
+ int type;
+ int error;
+ int misc;
+
+ unsigned int generation;
+ octlet_t address;
+
+ unsigned long tag;
+
+ size_t length;
+ quadlet_t *sendb;
+ quadlet_t *recvb;
+};
+
+struct raw1394_khost_list {
+ int nodes;
+ char name[32];
+};
+
+#ifdef __KERNEL__
+
+struct file_info {
+ struct list_head list;
+
+ enum { opened, initialized, connected } state;
+
+ struct hpsb_host *host;
+
+ struct list_head req_pending;
+ struct list_head req_complete;
+ struct semaphore complete_sem;
+ spinlock_t reqlists_lock;
+ wait_queue_head_t poll_wait_complete;
+
+ u64 listen_channels;
+};
+
+struct pending_request {
+ struct list_head list;
+ struct file_info *file_info;
+ struct hpsb_packet *packet;
+ struct tq_struct tq;
+ quadlet_t *data;
+ int free_data;
+ struct raw1394_request req;
+};
+
+struct host_info {
+ struct list_head list;
+ struct hpsb_host *host;
+ struct list_head file_info_list;
+};
+
+#endif /* __KERNEL__ */
+
+#endif /* IEEE1394_RAW1394_H */