firewire-cdev.h

来自「linux 内核源代码」· C头文件 代码 · 共 478 行 · 第 1/2 页

H
478 行
字号
 * struct fw_cdev_send_response - Send an asynchronous response packet * @rcode:	Response code as determined by the userspace handler * @length:	Length of outgoing payload, in bytes * @data:	Userspace pointer to payload * @handle:	The handle from the &fw_cdev_event_request * * Send a response to an incoming request.  By setting up an address range using * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests.  An * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must * send a reply using this ioctl.  The event has a handle to the kernel-side * pending transaction, which should be used with this ioctl. */struct fw_cdev_send_response {	__u32 rcode;	__u32 length;	__u64 data;	__u32 handle;};/** * struct fw_cdev_allocate - Allocate a CSR address range * @offset:	Start offset of the address range * @closure:	To be passed back to userspace in request events * @length:	Length of the address range, in bytes * @handle:	Handle to the allocation, written by the kernel * * Allocate an address range in the 48-bit address space on the local node * (the controller).  This allows userspace to listen for requests with an * offset within that address range.  When the kernel receives a request * within the range, an &fw_cdev_event_request event will be written back. * The @closure field is passed back to userspace in the response event. * The @handle field is an out parameter, returning a handle to the allocated * range to be used for later deallocation of the range. */struct fw_cdev_allocate {	__u64 offset;	__u64 closure;	__u32 length;	__u32 handle;};/** * struct fw_cdev_deallocate - Free an address range allocation * @handle:	Handle to the address range, as returned by the kernel when the *		range was allocated */struct fw_cdev_deallocate {	__u32 handle;};#define FW_CDEV_LONG_RESET	0#define FW_CDEV_SHORT_RESET	1/** * struct fw_cdev_initiate_bus_reset - Initiate a bus reset * @type:	%FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET * * Initiate a bus reset for the bus this device is on.  The bus reset can be * either the original (long) bus reset or the arbitrated (short) bus reset * introduced in 1394a-2000. */struct fw_cdev_initiate_bus_reset {	__u32 type;	/* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */};/** * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM * @immediate:	If non-zero, immediate key to insert before pointer * @key:	Upper 8 bits of root directory pointer * @data:	Userspace pointer to contents of descriptor block * @length:	Length of descriptor block data, in bytes * @handle:	Handle to the descriptor, written by the kernel * * Add a descriptor block and optionally a preceding immediate key to the local * node's configuration ROM. * * The @key field specifies the upper 8 bits of the descriptor root directory * pointer and the @data and @length fields specify the contents. The @key * should be of the form 0xXX000000. The offset part of the root directory entry * will be filled in by the kernel. * * If not 0, the @immediate field specifies an immediate key which will be * inserted before the root directory pointer. * * If successful, the kernel adds the descriptor and writes back a handle to the * kernel-side object to be used for later removal of the descriptor block and * immediate key. */struct fw_cdev_add_descriptor {	__u32 immediate;	__u32 key;	__u64 data;	__u32 length;	__u32 handle;};/** * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM * @handle:	Handle to the descriptor, as returned by the kernel when the *		descriptor was added * * Remove a descriptor block and accompanying immediate key from the local * node's configuration ROM. */struct fw_cdev_remove_descriptor {	__u32 handle;};#define FW_CDEV_ISO_CONTEXT_TRANSMIT	0#define FW_CDEV_ISO_CONTEXT_RECEIVE	1/** * struct fw_cdev_create_iso_context - Create a context for isochronous IO * @type:	%FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE * @header_size: Header size to strip for receive contexts * @channel:	Channel to bind to * @speed:	Speed to transmit at * @closure:	To be returned in &fw_cdev_event_iso_interrupt * @handle:	Handle to context, written back by kernel * * Prior to sending or receiving isochronous I/O, a context must be created. * The context records information about the transmit or receive configuration * and typically maps to an underlying hardware resource.  A context is set up * for either sending or receiving.  It is bound to a specific isochronous * channel. * * If a context was successfully created, the kernel writes back a handle to the * context, which must be passed in for subsequent operations on that context. */struct fw_cdev_create_iso_context {	__u32 type;	__u32 header_size;	__u32 channel;	__u32 speed;	__u64 closure;	__u32 handle;};#define FW_CDEV_ISO_PAYLOAD_LENGTH(v)	(v)#define FW_CDEV_ISO_INTERRUPT		(1 << 16)#define FW_CDEV_ISO_SKIP		(1 << 17)#define FW_CDEV_ISO_SYNC		(1 << 17)#define FW_CDEV_ISO_TAG(v)		((v) << 18)#define FW_CDEV_ISO_SY(v)		((v) << 20)#define FW_CDEV_ISO_HEADER_LENGTH(v)	((v) << 24)/** * struct fw_cdev_iso_packet - Isochronous packet * @control:	Contains the header length (8 uppermost bits), the sy field *		(4 bits), the tag field (2 bits), a sync flag (1 bit), *		a skip flag (1 bit), an interrupt flag (1 bit), and the *		payload length (16 lowermost bits) * @header:	Header and payload * * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. * * Use the FW_CDEV_ISO_ macros to fill in @control.  The sy and tag fields are * specified by IEEE 1394a and IEC 61883. * * FIXME - finish this documentation */struct fw_cdev_iso_packet {	__u32 control;	__u32 header[0];};/** * struct fw_cdev_queue_iso - Queue isochronous packets for I/O * @packets:	Userspace pointer to packet data * @data:	Pointer into mmap()'ed payload buffer * @size:	Size of packet data in bytes * @handle:	Isochronous context handle * * Queue a number of isochronous packets for reception or transmission. * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, * which describe how to transmit from or receive into a contiguous region * of a mmap()'ed payload buffer.  As part of the packet descriptors, * a series of headers can be supplied, which will be prepended to the * payload during DMA. * * The kernel may or may not queue all packets, but will write back updated * values of the @packets, @data and @size fields, so the ioctl can be * resubmitted easily. */struct fw_cdev_queue_iso {	__u64 packets;	__u64 data;	__u32 size;	__u32 handle;};#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0		 1#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1		 2#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2		 4#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3		 8#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS	15/** * struct fw_cdev_start_iso - Start an isochronous transmission or reception * @cycle:	Cycle in which to start I/O.  If @cycle is greater than or *		equal to 0, the I/O will start on that cycle. * @sync:	Determines the value to wait for for receive packets that have *		the %FW_CDEV_ISO_SYNC bit set * @tags:	Tag filter bit mask.  Only valid for isochronous reception. *		Determines the tag values for which packets will be accepted. *		Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags. * @handle:	Isochronous context handle within which to transmit or receive */struct fw_cdev_start_iso {	__s32 cycle;	__u32 sync;	__u32 tags;	__u32 handle;};/** * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception * @handle:	Handle of isochronous context to stop */struct fw_cdev_stop_iso {	__u32 handle;};/** * struct fw_cdev_get_cycle_timer - read cycle timer register * @local_time:   system time, in microseconds since the Epoch * @cycle_timer:  isochronous cycle timer, as per OHCI 1.1 clause 5.13 * * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer * and also the system clock.  This allows to express the receive time of an * isochronous packet as a system time with microsecond accuracy. */struct fw_cdev_get_cycle_timer {	__u64 local_time;	__u32 cycle_timer;};#endif /* _LINUX_FIREWIRE_CDEV_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?