blob: c7731d1bcd89da69559e342be57f2fe6aa1fae3d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef IEEE1394_RAW1394_PRIVATE_H
2#define IEEE1394_RAW1394_PRIVATE_H
3
4/* header for definitions that are private to the raw1394 driver
5 and not visible to user-space */
6
7#define RAW1394_DEVICE_MAJOR 171
8#define RAW1394_DEVICE_NAME "raw1394"
9
10#define RAW1394_MAX_USER_CSR_DIRS 16
11
12struct iso_block_store {
13 atomic_t refcount;
14 size_t data_size;
15 quadlet_t data[0];
16};
17
18enum raw1394_iso_state { RAW1394_ISO_INACTIVE = 0,
19 RAW1394_ISO_RECV = 1,
20 RAW1394_ISO_XMIT = 2 };
21
22struct file_info {
23 struct list_head list;
24
25 enum { opened, initialized, connected } state;
26 unsigned int protocol_version;
27
28 struct hpsb_host *host;
29
30 struct list_head req_pending;
31 struct list_head req_complete;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 spinlock_t reqlists_lock;
Stefan Richter45289bf2006-07-03 12:02:33 -040033 wait_queue_head_t wait_complete;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35 struct list_head addr_list;
36
37 u8 __user *fcp_buffer;
38
39 /* old ISO API */
40 u64 listen_channels;
41 quadlet_t __user *iso_buffer;
42 size_t iso_buffer_length;
43
44 u8 notification; /* (busreset-notification) RAW1394_NOTIFY_OFF/ON */
45
46 /* new rawiso API */
47 enum raw1394_iso_state iso_state;
48 struct hpsb_iso *iso_handle;
49
50 /* User space's CSR1212 dynamic ConfigROM directories */
51 struct csr1212_keyval *csr1212_dirs[RAW1394_MAX_USER_CSR_DIRS];
52
53 /* Legacy ConfigROM update flag */
54 u8 cfgrom_upd;
55};
56
57struct arm_addr {
58 struct list_head addr_list; /* file_info list */
59 u64 start, end;
60 u64 arm_tag;
61 u8 access_rights;
62 u8 notification_options;
63 u8 client_transactions;
64 u64 recvb;
65 u16 rec_length;
66 u8 *addr_space_buffer; /* accessed by read/write/lock */
67};
68
69struct pending_request {
70 struct list_head list;
71 struct file_info *file_info;
72 struct hpsb_packet *packet;
73 struct iso_block_store *ibs;
74 quadlet_t *data;
75 int free_data;
76 struct raw1394_request req;
77};
78
79struct host_info {
80 struct list_head list;
81 struct hpsb_host *host;
82 struct list_head file_info_list;
83};
84
85#endif /* IEEE1394_RAW1394_PRIVATE_H */