aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/core.h')
-rw-r--r--drivers/firewire/core.h87
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);
97int fw_compute_block_crc(u32 *block); 96int fw_compute_block_crc(u32 *block);
98void fw_schedule_bm_work(struct fw_card *card, unsigned long delay); 97void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
99 98
100struct fw_descriptor {
101 struct list_head link;
102 size_t length;
103 u32 immediate;
104 u32 key;
105 const u32 *data;
106};
107
108int fw_core_add_descriptor(struct fw_descriptor *desc);
109void 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 */
141struct 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 */
167struct fw_iso_buffer {
168 enum dma_data_direction direction;
169 struct page **pages;
170 int page_count;
171};
172
173typedef void (*fw_iso_callback_t)(struct fw_iso_context *context,
174 u32 cycle, size_t header_length,
175 void *header, void *data);
176
177struct 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
187int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
188 int page_count, enum dma_data_direction direction);
189int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); 121int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma);
190void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
191
192struct 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);
195int 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);
199int fw_iso_context_start(struct fw_iso_context *ctx,
200 int cycle, int sync, int tags);
201int fw_iso_context_stop(struct fw_iso_context *ctx);
202void fw_iso_context_destroy(struct fw_iso_context *ctx);
203
204void fw_iso_resource_manage(struct fw_card *card, int generation, 122void 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);
285void fw_send_phy_config(struct fw_card *card, 203void 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
288static 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 */