diff options
Diffstat (limited to 'include/linux/firewire.h')
| -rw-r--r-- | include/linux/firewire.h | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 72e2b8ac2a5a..1cd637ef62d2 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -32,11 +32,13 @@ | |||
| 32 | #define CSR_CYCLE_TIME 0x200 | 32 | #define CSR_CYCLE_TIME 0x200 |
| 33 | #define CSR_BUS_TIME 0x204 | 33 | #define CSR_BUS_TIME 0x204 |
| 34 | #define CSR_BUSY_TIMEOUT 0x210 | 34 | #define CSR_BUSY_TIMEOUT 0x210 |
| 35 | #define CSR_PRIORITY_BUDGET 0x218 | ||
| 35 | #define CSR_BUS_MANAGER_ID 0x21c | 36 | #define CSR_BUS_MANAGER_ID 0x21c |
| 36 | #define CSR_BANDWIDTH_AVAILABLE 0x220 | 37 | #define CSR_BANDWIDTH_AVAILABLE 0x220 |
| 37 | #define CSR_CHANNELS_AVAILABLE 0x224 | 38 | #define CSR_CHANNELS_AVAILABLE 0x224 |
| 38 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 | 39 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 |
| 39 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 | 40 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 |
| 41 | #define CSR_MAINT_UTILITY 0x230 | ||
| 40 | #define CSR_BROADCAST_CHANNEL 0x234 | 42 | #define CSR_BROADCAST_CHANNEL 0x234 |
| 41 | #define CSR_CONFIG_ROM 0x400 | 43 | #define CSR_CONFIG_ROM 0x400 |
| 42 | #define CSR_CONFIG_ROM_END 0x800 | 44 | #define CSR_CONFIG_ROM_END 0x800 |
| @@ -89,6 +91,11 @@ struct fw_card { | |||
| 89 | struct list_head transaction_list; | 91 | struct list_head transaction_list; |
| 90 | unsigned long reset_jiffies; | 92 | unsigned long reset_jiffies; |
| 91 | 93 | ||
| 94 | u32 split_timeout_hi; | ||
| 95 | u32 split_timeout_lo; | ||
| 96 | unsigned int split_timeout_cycles; | ||
| 97 | unsigned int split_timeout_jiffies; | ||
| 98 | |||
| 92 | unsigned long long guid; | 99 | unsigned long long guid; |
| 93 | unsigned max_receive; | 100 | unsigned max_receive; |
| 94 | int link_speed; | 101 | int link_speed; |
| @@ -104,18 +111,28 @@ struct fw_card { | |||
| 104 | bool beta_repeaters_present; | 111 | bool beta_repeaters_present; |
| 105 | 112 | ||
| 106 | int index; | 113 | int index; |
| 107 | |||
| 108 | struct list_head link; | 114 | struct list_head link; |
| 109 | 115 | ||
| 110 | /* Work struct for BM duties. */ | 116 | struct list_head phy_receiver_list; |
| 111 | struct delayed_work work; | 117 | |
| 118 | struct delayed_work br_work; /* bus reset job */ | ||
| 119 | bool br_short; | ||
| 120 | |||
| 121 | struct delayed_work bm_work; /* bus manager job */ | ||
| 112 | int bm_retries; | 122 | int bm_retries; |
| 113 | int bm_generation; | 123 | int bm_generation; |
| 114 | __be32 bm_transaction_data[2]; | 124 | __be32 bm_transaction_data[2]; |
| 125 | int bm_node_id; | ||
| 126 | bool bm_abdicate; | ||
| 127 | |||
| 128 | bool priority_budget_implemented; /* controller feature */ | ||
| 129 | bool broadcast_channel_auto_allocated; /* controller feature */ | ||
| 115 | 130 | ||
| 116 | bool broadcast_channel_allocated; | 131 | bool broadcast_channel_allocated; |
| 117 | u32 broadcast_channel; | 132 | u32 broadcast_channel; |
| 118 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 133 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
| 134 | |||
| 135 | __be32 maint_utility_register; | ||
| 119 | }; | 136 | }; |
| 120 | 137 | ||
| 121 | struct fw_attribute_group { | 138 | struct fw_attribute_group { |
| @@ -252,7 +269,7 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
| 252 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 269 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
| 253 | struct fw_request *request, | 270 | struct fw_request *request, |
| 254 | int tcode, int destination, int source, | 271 | int tcode, int destination, int source, |
| 255 | int generation, int speed, | 272 | int generation, |
| 256 | unsigned long long offset, | 273 | unsigned long long offset, |
| 257 | void *data, size_t length, | 274 | void *data, size_t length, |
| 258 | void *callback_data); | 275 | void *callback_data); |
| @@ -269,10 +286,10 @@ struct fw_packet { | |||
| 269 | u32 timestamp; | 286 | u32 timestamp; |
| 270 | 287 | ||
| 271 | /* | 288 | /* |
| 272 | * This callback is called when the packet transmission has | 289 | * This callback is called when the packet transmission has completed. |
| 273 | * completed; for successful transmission, the status code is | 290 | * For successful transmission, the status code is the ack received |
| 274 | * the ack received from the destination, otherwise it's a | 291 | * from the destination. Otherwise it is one of the juju-specific |
| 275 | * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO. | 292 | * rcodes: RCODE_SEND_ERROR, _CANCELLED, _BUSY, _GENERATION, _NO_ACK. |
| 276 | * The callback can be called from tasklet context and thus | 293 | * The callback can be called from tasklet context and thus |
| 277 | * must never block. | 294 | * must never block. |
| 278 | */ | 295 | */ |
| @@ -355,17 +372,19 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc); | |||
| 355 | * scatter-gather streaming (e.g. assembling video frame automatically). | 372 | * scatter-gather streaming (e.g. assembling video frame automatically). |
| 356 | */ | 373 | */ |
| 357 | struct fw_iso_packet { | 374 | struct fw_iso_packet { |
| 358 | u16 payload_length; /* Length of indirect payload. */ | 375 | u16 payload_length; /* Length of indirect payload */ |
| 359 | u32 interrupt:1; /* Generate interrupt on this packet */ | 376 | u32 interrupt:1; /* Generate interrupt on this packet */ |
| 360 | u32 skip:1; /* Set to not send packet at all. */ | 377 | u32 skip:1; /* tx: Set to not send packet at all */ |
| 361 | u32 tag:2; | 378 | /* rx: Sync bit, wait for matching sy */ |
| 362 | u32 sy:4; | 379 | u32 tag:2; /* tx: Tag in packet header */ |
| 363 | u32 header_length:8; /* Length of immediate header. */ | 380 | u32 sy:4; /* tx: Sy in packet header */ |
| 364 | u32 header[0]; | 381 | u32 header_length:8; /* Length of immediate header */ |
| 382 | u32 header[0]; /* tx: Top of 1394 isoch. data_block */ | ||
| 365 | }; | 383 | }; |
| 366 | 384 | ||
| 367 | #define FW_ISO_CONTEXT_TRANSMIT 0 | 385 | #define FW_ISO_CONTEXT_TRANSMIT 0 |
| 368 | #define FW_ISO_CONTEXT_RECEIVE 1 | 386 | #define FW_ISO_CONTEXT_RECEIVE 1 |
| 387 | #define FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2 | ||
| 369 | 388 | ||
| 370 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 | 389 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 |
| 371 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 | 390 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 |
| @@ -389,24 +408,31 @@ struct fw_iso_buffer { | |||
| 389 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | 408 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, |
| 390 | int page_count, enum dma_data_direction direction); | 409 | int page_count, enum dma_data_direction direction); |
| 391 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); | 410 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); |
| 411 | size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed); | ||
| 392 | 412 | ||
| 393 | struct fw_iso_context; | 413 | struct fw_iso_context; |
| 394 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, | 414 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, |
| 395 | u32 cycle, size_t header_length, | 415 | u32 cycle, size_t header_length, |
| 396 | void *header, void *data); | 416 | void *header, void *data); |
| 417 | typedef void (*fw_iso_mc_callback_t)(struct fw_iso_context *context, | ||
| 418 | dma_addr_t completed, void *data); | ||
| 397 | struct fw_iso_context { | 419 | struct fw_iso_context { |
| 398 | struct fw_card *card; | 420 | struct fw_card *card; |
| 399 | int type; | 421 | int type; |
| 400 | int channel; | 422 | int channel; |
| 401 | int speed; | 423 | int speed; |
| 402 | size_t header_size; | 424 | size_t header_size; |
| 403 | fw_iso_callback_t callback; | 425 | union { |
| 426 | fw_iso_callback_t sc; | ||
| 427 | fw_iso_mc_callback_t mc; | ||
| 428 | } callback; | ||
| 404 | void *callback_data; | 429 | void *callback_data; |
| 405 | }; | 430 | }; |
| 406 | 431 | ||
| 407 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, | 432 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, |
| 408 | int type, int channel, int speed, size_t header_size, | 433 | int type, int channel, int speed, size_t header_size, |
| 409 | fw_iso_callback_t callback, void *callback_data); | 434 | fw_iso_callback_t callback, void *callback_data); |
| 435 | int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels); | ||
| 410 | int fw_iso_context_queue(struct fw_iso_context *ctx, | 436 | int fw_iso_context_queue(struct fw_iso_context *ctx, |
| 411 | struct fw_iso_packet *packet, | 437 | struct fw_iso_packet *packet, |
| 412 | struct fw_iso_buffer *buffer, | 438 | struct fw_iso_buffer *buffer, |
