void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p); int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); int fw_csr_string(const u32 *directory, int key, char *buf, size_t size);
unsignedlonglong guid; unsigned max_receive; int link_speed; int config_rom_generation;
spinlock_t lock; /* Take this lock when handling the lists in
* this struct. */ struct fw_node *local_node; struct fw_node *root_node; struct fw_node *irm_node;
u8 color; /* must be u8 to match the definition in struct fw_node */ int gap_count; bool beta_repeaters_present;
int index; struct list_head link;
struct list_head phy_receiver_list;
struct delayed_work br_work; /* bus reset job */ bool br_short;
struct delayed_work bm_work; /* bus manager job */ int bm_retries; int bm_generation; int bm_node_id; bool bm_abdicate;
/* * Note, fw_device.generation always has to be read before fw_device.node_id. * Use SMP memory barriers to ensure this. Otherwise requests will be sent * to an outdated node_id if the generation was updated in the meantime due * to a bus reset. * * Likewise, fw-core will take care to update .node_id before .generation so * that whenever fw_device.generation is current WRT the actual bus generation, * fw_device.node_id is guaranteed to be current too. * * The same applies to fw_device.card->node_id vs. fw_device.generation. * * fw_device.config_rom and fw_device.config_rom_length may be accessed during * the lifetime of any fw_unit belonging to the fw_device, before device_del() * was called on the last fw_unit. Alternatively, they may be accessed while * holding fw_device_rwsem.
*/ struct fw_device {
atomic_t state; struct fw_node *node; int node_id; int generation; unsigned max_speed; struct fw_card *card; struct device device;
union fw_transaction_callback {
fw_transaction_callback_t without_tstamp;
fw_transaction_callback_with_tstamp_t with_tstamp;
};
/* * This callback handles an inbound request subaction. It is called in * RCU read-side context, therefore must not sleep. * * The callback should not initiate outbound request subactions directly. * Otherwise there is a danger of recursion of inbound and outbound * transactions from and to the local node. * * The callback is responsible that fw_send_response() is called on the @request, except for FCP * registers for which the core takes care of that.
*/ typedefvoid (*fw_address_callback_t)(struct fw_card *card, struct fw_request *request, int tcode, int destination, int source, int generation, unsignedlonglong offset, void *data, size_t length, void *callback_data);
/* * This callback is called when the packet transmission has completed. * For successful transmission, the status code is the ack received * from the destination. Otherwise it is one of the juju-specific * rcodes: RCODE_SEND_ERROR, _CANCELLED, _BUSY, _GENERATION, _NO_ACK. * The callback can be called from workqueue and thus must never block.
*/
fw_packet_callback_t callback; int ack; struct list_head link; void *driver_data;
};
struct fw_transaction { int node_id; /* The generation is implied; it is always the current. */ int tlabel; struct list_head link; struct fw_card *card; bool is_split_transaction; struct timer_list split_timeout_timer;
u32 split_timeout_cycle;
struct fw_packet packet;
/* * The data passed to the callback is valid only during the * callback.
*/ union fw_transaction_callback callback; bool with_tstamp; void *callback_data;
};
int fw_core_add_address_handler(struct fw_address_handler *handler, conststruct fw_address_region *region); void fw_core_remove_address_handler(struct fw_address_handler *handler); void fw_send_response(struct fw_card *card, struct fw_request *request, int rcode); int fw_get_request_speed(struct fw_request *request);
u32 fw_request_get_timestamp(conststruct fw_request *request);
void __fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode, int destination_id, int generation, int speed, unsignedlonglong offset, void *payload, size_t length, union fw_transaction_callback callback, bool with_tstamp, void *callback_data);
/** * fw_send_request() - submit a request packet for transmission to generate callback for response * subaction without time stamp. * @card: interface to send the request at * @t: transaction instance to which the request belongs * @tcode: transaction code * @destination_id: destination node ID, consisting of bus_ID and phy_ID * @generation: bus generation in which request and response are valid * @speed: transmission speed * @offset: 48bit wide offset into destination's address space * @payload: data payload for the request subaction * @length: length of the payload, in bytes * @callback: function to be called when the transaction is completed * @callback_data: data to be passed to the transaction completion callback * * A variation of __fw_send_request() to generate callback for response subaction without time * stamp. * * The callback is invoked in the workqueue context in most cases. However, if an error is detected * before queueing or the destination address refers to the local node, it is invoked in the * current context instead.
*/ staticinlinevoid fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode, int destination_id, int generation, int speed, unsignedlonglong offset, void *payload, size_t length,
fw_transaction_callback_t callback, void *callback_data)
{ union fw_transaction_callback cb = {
.without_tstamp = callback,
};
__fw_send_request(card, t, tcode, destination_id, generation, speed, offset, payload,
length, cb, false, callback_data);
}
/** * fw_send_request_with_tstamp() - submit a request packet for transmission to generate callback for * response with time stamp. * @card: interface to send the request at * @t: transaction instance to which the request belongs * @tcode: transaction code * @destination_id: destination node ID, consisting of bus_ID and phy_ID * @generation: bus generation in which request and response are valid * @speed: transmission speed * @offset: 48bit wide offset into destination's address space * @payload: data payload for the request subaction * @length: length of the payload, in bytes * @callback: function to be called when the transaction is completed * @callback_data: data to be passed to the transaction completion callback * * A variation of __fw_send_request() to generate callback for response subaction with time stamp. * * The callback is invoked in the workqueue context in most cases. However, if an error is detected * before queueing or the destination address refers to the local node, it is invoked in the current * context instead.
*/ staticinlinevoid fw_send_request_with_tstamp(struct fw_card *card, struct fw_transaction *t, int tcode, int destination_id, int generation, int speed, unsignedlonglong offset, void *payload, size_t length, fw_transaction_callback_with_tstamp_t callback, void *callback_data)
{ union fw_transaction_callback cb = {
.with_tstamp = callback,
};
__fw_send_request(card, t, tcode, destination_id, generation, speed, offset, payload,
length, cb, true, callback_data);
}
int fw_cancel_transaction(struct fw_card *card, struct fw_transaction *transaction); int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, int generation, int speed, unsignedlonglong offset, void *payload, size_t length); constchar *fw_rcode_string(int rcode);
staticinlineint fw_stream_packet_destination_id(int tag, int channel, int sy)
{ return tag << 14 | channel << 8 | sy;
}
int fw_core_add_descriptor(struct fw_descriptor *desc); void fw_core_remove_descriptor(struct fw_descriptor *desc);
/* * The iso packet format allows for an immediate header/payload part * stored in 'header' immediately after the packet info plus an * indirect payload part that is pointer to by the 'payload' field. * Applications can use one or the other or both to implement simple * low-bandwidth streaming (e.g. audio) or more advanced * scatter-gather streaming (e.g. assembling video frame automatically).
*/ struct fw_iso_packet {
u16 payload_length; /* Length of indirect payload */
u32 interrupt:1; /* Generate interrupt on this packet */
u32 skip:1; /* tx: Set to not send packet at all */ /* rx: Sync bit, wait for matching sy */
u32 tag:2; /* tx: Tag in packet header */
u32 sy:4; /* tx: Sy in packet header */
u32 header_length:8; /* Size of immediate header */
u32 header[]; /* tx: Top of 1394 isoch. data_block */
};
/* * An iso buffer is just a set of pages mapped for DMA in the * specified direction. Since the pages are to be used for DMA, they * are not mapped into the kernel virtual address space. We store the * DMA address in the page private. The helper function * fw_iso_buffer_map() will map the pages into a given vma.
*/ struct fw_iso_buffer { enum dma_data_direction direction; struct page **pages; int page_count; int page_count_mapped;
};
union fw_iso_callback {
fw_iso_callback_t sc;
fw_iso_mc_callback_t mc;
};
struct fw_iso_context { struct fw_card *card; struct work_struct work; int type; int channel; int speed; bool drop_overflow_headers;
size_t header_size; union fw_iso_callback callback; void *callback_data;
};
struct fw_iso_context *fw_iso_context_create(struct fw_card *card, int type, int channel, int speed, size_t header_size,
fw_iso_callback_t callback, void *callback_data); int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels); int fw_iso_context_queue(struct fw_iso_context *ctx, struct fw_iso_packet *packet, struct fw_iso_buffer *buffer, unsignedlong payload); void fw_iso_context_queue_flush(struct fw_iso_context *ctx); int fw_iso_context_flush_completions(struct fw_iso_context *ctx);
/** * fw_iso_context_schedule_flush_completions() - schedule work item to process isochronous context. * @ctx: the isochronous context * * Schedule a work item on workqueue to process the isochronous context. The registered callback * function is called by the worker when a queued packet buffer with the interrupt flag is * completed, either after transmission in the IT context or after being filled in the IR context. * The callback function is also called when the header buffer in the context becomes full, If it * is required to process the context in the current context, fw_iso_context_flush_completions() is * available instead. * * Context: Any context.
*/ staticinlinevoid fw_iso_context_schedule_flush_completions(struct fw_iso_context *ctx)
{
queue_work(ctx->card->isoc_wq, &ctx->work);
}
int fw_iso_context_start(struct fw_iso_context *ctx, int cycle, int sync, int tags); int fw_iso_context_stop(struct fw_iso_context *ctx); void fw_iso_context_destroy(struct fw_iso_context *ctx); void fw_iso_resource_manage(struct fw_card *card, int generation,
u64 channels_mask, int *channel, int *bandwidth, bool allocate);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.