aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-transaction.h')
-rw-r--r--drivers/firewire/fw-transaction.h109
1 files changed, 36 insertions, 73 deletions
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 1d78e9cc5940..7112e62942ff 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -88,8 +88,7 @@
88#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) 88#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
89#define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) 89#define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)
90 90
91static inline void 91static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
92fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
93{ 92{
94 u32 *dst = _dst; 93 u32 *dst = _dst;
95 __be32 *src = _src; 94 __be32 *src = _src;
@@ -99,8 +98,7 @@ fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
99 dst[i] = be32_to_cpu(src[i]); 98 dst[i] = be32_to_cpu(src[i]);
100} 99}
101 100
102static inline void 101static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
103fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
104{ 102{
105 fw_memcpy_from_be32(_dst, _src, size); 103 fw_memcpy_from_be32(_dst, _src, size);
106} 104}
@@ -125,8 +123,7 @@ typedef void (*fw_packet_callback_t)(struct fw_packet *packet,
125 struct fw_card *card, int status); 123 struct fw_card *card, int status);
126 124
127typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, 125typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
128 void *data, 126 void *data, size_t length,
129 size_t length,
130 void *callback_data); 127 void *callback_data);
131 128
132/* 129/*
@@ -201,7 +198,6 @@ struct fw_address_handler {
201 struct list_head link; 198 struct list_head link;
202}; 199};
203 200
204
205struct fw_address_region { 201struct fw_address_region {
206 u64 start; 202 u64 start;
207 u64 end; 203 u64 end;
@@ -315,10 +311,8 @@ struct fw_iso_packet {
315struct fw_iso_context; 311struct fw_iso_context;
316 312
317typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, 313typedef void (*fw_iso_callback_t)(struct fw_iso_context *context,
318 u32 cycle, 314 u32 cycle, size_t header_length,
319 size_t header_length, 315 void *header, void *data);
320 void *header,
321 void *data);
322 316
323/* 317/*
324 * An iso buffer is just a set of pages mapped for DMA in the 318 * An iso buffer is just a set of pages mapped for DMA in the
@@ -344,36 +338,22 @@ struct fw_iso_context {
344 void *callback_data; 338 void *callback_data;
345}; 339};
346 340
347int 341int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
348fw_iso_buffer_init(struct fw_iso_buffer *buffer, 342 int page_count, enum dma_data_direction direction);
349 struct fw_card *card, 343int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma);
350 int page_count, 344void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
351 enum dma_data_direction direction); 345
352int 346struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
353fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); 347 int type, int channel, int speed, size_t header_size,
354void 348 fw_iso_callback_t callback, void *callback_data);
355fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); 349int fw_iso_context_queue(struct fw_iso_context *ctx,
356 350 struct fw_iso_packet *packet,
357struct fw_iso_context * 351 struct fw_iso_buffer *buffer,
358fw_iso_context_create(struct fw_card *card, int type, 352 unsigned long payload);
359 int channel, int speed, size_t header_size, 353int fw_iso_context_start(struct fw_iso_context *ctx,
360 fw_iso_callback_t callback, void *callback_data); 354 int cycle, int sync, int tags);
361 355int fw_iso_context_stop(struct fw_iso_context *ctx);
362void 356void fw_iso_context_destroy(struct fw_iso_context *ctx);
363fw_iso_context_destroy(struct fw_iso_context *ctx);
364
365int
366fw_iso_context_queue(struct fw_iso_context *ctx,
367 struct fw_iso_packet *packet,
368 struct fw_iso_buffer *buffer,
369 unsigned long payload);
370
371int
372fw_iso_context_start(struct fw_iso_context *ctx,
373 int cycle, int sync, int tags);
374
375int
376fw_iso_context_stop(struct fw_iso_context *ctx);
377 357
378struct fw_card_driver { 358struct fw_card_driver {
379 /* 359 /*
@@ -429,24 +409,18 @@ struct fw_card_driver {
429 int (*stop_iso)(struct fw_iso_context *ctx); 409 int (*stop_iso)(struct fw_iso_context *ctx);
430}; 410};
431 411
432int 412int fw_core_initiate_bus_reset(struct fw_card *card, int short_reset);
433fw_core_initiate_bus_reset(struct fw_card *card, int short_reset);
434 413
435void 414void fw_send_request(struct fw_card *card, struct fw_transaction *t,
436fw_send_request(struct fw_card *card, struct fw_transaction *t,
437 int tcode, int destination_id, int generation, int speed, 415 int tcode, int destination_id, int generation, int speed,
438 unsigned long long offset, void *data, size_t length, 416 unsigned long long offset, void *data, size_t length,
439 fw_transaction_callback_t callback, void *callback_data); 417 fw_transaction_callback_t callback, void *callback_data);
440
441int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
442 int generation, int speed, unsigned long long offset,
443 void *data, size_t length);
444
445int fw_cancel_transaction(struct fw_card *card, 418int fw_cancel_transaction(struct fw_card *card,
446 struct fw_transaction *transaction); 419 struct fw_transaction *transaction);
447
448void fw_flush_transactions(struct fw_card *card); 420void fw_flush_transactions(struct fw_card *card);
449 421int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
422 int generation, int speed, unsigned long long offset,
423 void *data, size_t length);
450void fw_send_phy_config(struct fw_card *card, 424void fw_send_phy_config(struct fw_card *card,
451 int node_id, int generation, int gap_count); 425 int node_id, int generation, int gap_count);
452 426
@@ -454,29 +428,18 @@ void fw_send_phy_config(struct fw_card *card,
454 * Called by the topology code to inform the device code of node 428 * Called by the topology code to inform the device code of node
455 * activity; found, lost, or updated nodes. 429 * activity; found, lost, or updated nodes.
456 */ 430 */
457void 431void fw_node_event(struct fw_card *card, struct fw_node *node, int event);
458fw_node_event(struct fw_card *card, struct fw_node *node, int event);
459 432
460/* API used by card level drivers */ 433/* API used by card level drivers */
461 434
462void 435void fw_card_initialize(struct fw_card *card,
463fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, 436 const struct fw_card_driver *driver, struct device *device);
464 struct device *device); 437int fw_card_add(struct fw_card *card,
465int 438 u32 max_receive, u32 link_speed, u64 guid);
466fw_card_add(struct fw_card *card, 439void fw_core_remove_card(struct fw_card *card);
467 u32 max_receive, u32 link_speed, u64 guid); 440void fw_core_handle_bus_reset(struct fw_card *card, int node_id,
468 441 int generation, int self_id_count, u32 *self_ids);
469void 442void fw_core_handle_request(struct fw_card *card, struct fw_packet *request);
470fw_core_remove_card(struct fw_card *card); 443void fw_core_handle_response(struct fw_card *card, struct fw_packet *packet);
471
472void
473fw_core_handle_bus_reset(struct fw_card *card,
474 int node_id, int generation,
475 int self_id_count, u32 *self_ids);
476void
477fw_core_handle_request(struct fw_card *card, struct fw_packet *request);
478
479void
480fw_core_handle_response(struct fw_card *card, struct fw_packet *packet);
481 444
482#endif /* __fw_transaction_h */ 445#endif /* __fw_transaction_h */