diff options
Diffstat (limited to 'drivers/firewire/core.h')
-rw-r--r-- | drivers/firewire/core.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 0a25a7b38a80..c3cfc647e5e3 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _FIREWIRE_CORE_H | 1 | #ifndef _FIREWIRE_CORE_H |
2 | #define _FIREWIRE_CORE_H | 2 | #define _FIREWIRE_CORE_H |
3 | 3 | ||
4 | #include <linux/dma-mapping.h> | ||
5 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
6 | #include <linux/list.h> | 5 | #include <linux/list.h> |
7 | #include <linux/idr.h> | 6 | #include <linux/idr.h> |
@@ -97,17 +96,6 @@ int fw_core_initiate_bus_reset(struct fw_card *card, int short_reset); | |||
97 | int fw_compute_block_crc(u32 *block); | 96 | int fw_compute_block_crc(u32 *block); |
98 | void fw_schedule_bm_work(struct fw_card *card, unsigned long delay); | 97 | void fw_schedule_bm_work(struct fw_card *card, unsigned long delay); |
99 | 98 | ||
100 | struct fw_descriptor { | ||
101 | struct list_head link; | ||
102 | size_t length; | ||
103 | u32 immediate; | ||
104 | u32 key; | ||
105 | const u32 *data; | ||
106 | }; | ||
107 | |||
108 | int fw_core_add_descriptor(struct fw_descriptor *desc); | ||
109 | void fw_core_remove_descriptor(struct fw_descriptor *desc); | ||
110 | |||
111 | 99 | ||
112 | /* -cdev */ | 100 | /* -cdev */ |
113 | 101 | ||
@@ -130,77 +118,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event); | |||
130 | 118 | ||
131 | /* -iso */ | 119 | /* -iso */ |
132 | 120 | ||
133 | /* | ||
134 | * The iso packet format allows for an immediate header/payload part | ||
135 | * stored in 'header' immediately after the packet info plus an | ||
136 | * indirect payload part that is pointer to by the 'payload' field. | ||
137 | * Applications can use one or the other or both to implement simple | ||
138 | * low-bandwidth streaming (e.g. audio) or more advanced | ||
139 | * scatter-gather streaming (e.g. assembling video frame automatically). | ||
140 | */ | ||
141 | struct fw_iso_packet { | ||
142 | u16 payload_length; /* Length of indirect payload. */ | ||
143 | u32 interrupt:1; /* Generate interrupt on this packet */ | ||
144 | u32 skip:1; /* Set to not send packet at all. */ | ||
145 | u32 tag:2; | ||
146 | u32 sy:4; | ||
147 | u32 header_length:8; /* Length of immediate header. */ | ||
148 | u32 header[0]; | ||
149 | }; | ||
150 | |||
151 | #define FW_ISO_CONTEXT_TRANSMIT 0 | ||
152 | #define FW_ISO_CONTEXT_RECEIVE 1 | ||
153 | |||
154 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 | ||
155 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 | ||
156 | #define FW_ISO_CONTEXT_MATCH_TAG2 4 | ||
157 | #define FW_ISO_CONTEXT_MATCH_TAG3 8 | ||
158 | #define FW_ISO_CONTEXT_MATCH_ALL_TAGS 15 | ||
159 | |||
160 | /* | ||
161 | * An iso buffer is just a set of pages mapped for DMA in the | ||
162 | * specified direction. Since the pages are to be used for DMA, they | ||
163 | * are not mapped into the kernel virtual address space. We store the | ||
164 | * DMA address in the page private. The helper function | ||
165 | * fw_iso_buffer_map() will map the pages into a given vma. | ||
166 | */ | ||
167 | struct fw_iso_buffer { | ||
168 | enum dma_data_direction direction; | ||
169 | struct page **pages; | ||
170 | int page_count; | ||
171 | }; | ||
172 | |||
173 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, | ||
174 | u32 cycle, size_t header_length, | ||
175 | void *header, void *data); | ||
176 | |||
177 | struct fw_iso_context { | ||
178 | struct fw_card *card; | ||
179 | int type; | ||
180 | int channel; | ||
181 | int speed; | ||
182 | size_t header_size; | ||
183 | fw_iso_callback_t callback; | ||
184 | void *callback_data; | ||
185 | }; | ||
186 | |||
187 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | ||
188 | int page_count, enum dma_data_direction direction); | ||
189 | int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); | 121 | int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); |
190 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); | ||
191 | |||
192 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, | ||
193 | int type, int channel, int speed, size_t header_size, | ||
194 | fw_iso_callback_t callback, void *callback_data); | ||
195 | int fw_iso_context_queue(struct fw_iso_context *ctx, | ||
196 | struct fw_iso_packet *packet, | ||
197 | struct fw_iso_buffer *buffer, | ||
198 | unsigned long payload); | ||
199 | int fw_iso_context_start(struct fw_iso_context *ctx, | ||
200 | int cycle, int sync, int tags); | ||
201 | int fw_iso_context_stop(struct fw_iso_context *ctx); | ||
202 | void fw_iso_context_destroy(struct fw_iso_context *ctx); | ||
203 | |||
204 | void fw_iso_resource_manage(struct fw_card *card, int generation, | 122 | void fw_iso_resource_manage(struct fw_card *card, int generation, |
205 | u64 channels_mask, int *channel, int *bandwidth, bool allocate); | 123 | u64 channels_mask, int *channel, int *bandwidth, bool allocate); |
206 | 124 | ||
@@ -285,9 +203,4 @@ void fw_flush_transactions(struct fw_card *card); | |||
285 | void fw_send_phy_config(struct fw_card *card, | 203 | void fw_send_phy_config(struct fw_card *card, |
286 | int node_id, int generation, int gap_count); | 204 | int node_id, int generation, int gap_count); |
287 | 205 | ||
288 | static inline int fw_stream_packet_destination_id(int tag, int channel, int sy) | ||
289 | { | ||
290 | return tag << 14 | channel << 8 | sy; | ||
291 | } | ||
292 | |||
293 | #endif /* _FIREWIRE_CORE_H */ | 206 | #endif /* _FIREWIRE_CORE_H */ |