📄 raw1394.h
字号:
* * Set the handler that will be called when an async read/write/lock arm_request * arrived. The default action is to call the arm_callback in the * raw1394_arm_reqhandle pointed to by arm_tag. * * Returns: old handler **/arm_tag_handler_t raw1394_set_arm_tag_handler(raw1394handle_t handle, arm_tag_handler_t new_h);typedef int (*fcp_handler_t)(raw1394handle_t, nodeid_t nodeid, int response, size_t length, unsigned char *data);/** * raw1394_set_fcp_handler - set FCP handler * @handle: libraw1394 handle * @new_h: pointer to new handler * * Function Control Protocol is defined in IEC 61883-1. * * Sets the handler to be called when either FCP command or FCP response * registers get written to @new_h. The default handler does nothing. * In order to actually get FCP events, you have to enable it with * raw1394_start_fcp_listen() and can stop it with raw1394_stop_fcp_listen(). * * Returns: the old handler **/fcp_handler_t raw1394_set_fcp_handler(raw1394handle_t handle, fcp_handler_t new_h);/** * req_callback_t - This is the general request handler * @req_callback_t: This is the general request handler * * It is used by the default tag handler * when a request completes, it calls the callback and passes it the data * pointer and the error code of the request. **/typedef int (*req_callback_t)(raw1394handle_t, void *data, raw1394_errcode_t err);struct raw1394_reqhandle { req_callback_t callback; void *data;};/** * arm_req_callback_t - This is the general arm-request handle * @arm_req_callback_t: This is the general arm-request handle * @handle: libraw1394 handle * * (arm = address range mapping) * It is used by the default arm-tag handler when a request has been * received, it calls the arm_callback. **/typedef int (*arm_req_callback_t) (raw1394handle_t, struct raw1394_arm_request_response *arm_req_resp, unsigned int requested_length, void *pcontext, byte_t request_type);struct raw1394_arm_reqhandle { arm_req_callback_t arm_callback; void *pcontext;};/** * raw1394_arm_register - register an AddressRangeMapping * @handle: libraw1394 handle * @start: identifies addressrange * @length: identifies addressrange * @initial_value: pointer to buffer containing (if necessary) initial value * NULL means undefined * @arm_tag: identifier for arm_tag_handler * (usually pointer to raw1394_arm_reqhandle) * @access_rights: access-rights for registered addressrange handled * by kernel-part. Value is one or more binary or of the * following flags - ARM_READ, ARM_WRITE, ARM_LOCK * @notification_options: identifies for which type of request you want * to be notified. Value is one or more binary or of the * following flags - ARM_READ, ARM_WRITE, ARM_LOCK * @client_transactions: identifies for which type of request you want * to handle the request by the client application. * for those requests no response will be generated, but * has to be generated by the application. * Value is one or more binary or of the * following flags - ARM_READ, ARM_WRITE, ARM_LOCK * For each bit set here, notification_options and * access_rights will be ignored. * * ARM = Adress Range Mapping * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_arm_register(raw1394handle_t handle, nodeaddr_t start, size_t length, byte_t *initial_value, octlet_t arm_tag, arm_options_t access_rights, arm_options_t notification_options, arm_options_t client_transactions);/** * raw1394_arm_unregister - unregister an AddressRangeMapping * @handle: libraw1394 handle * @start: identifies addressrange for unregistering * (value of start have to be the same value * used for registering this adressrange) * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_arm_unregister(raw1394handle_t handle, nodeaddr_t start);/** * raw1394_arm_set_buf - set the buffer of an AdressRangeMapping * @handle: libraw1394 handle * @start: identifies addressrange * @length: identifies addressrange * @buf: pointer to buffer * * This function copies @length bytes from user memory area @buf * to one ARM block in kernel memory area * with start offset @start. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_arm_set_buf (raw1394handle_t handle, nodeaddr_t start, size_t length, void *buf);/** * raw1394_arm_get_buf - get the buffer of an AdressRangeMapping * @handle: libraw1394 handle * @start: identifies addressrange * @length: identifies addressrange * @buf: pointer to buffer * * This function copies @length bytes from one * ARM block in kernel memory area with start offset @start * to user memory area @buf * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_arm_get_buf (raw1394handle_t handle, nodeaddr_t start, size_t length, void *buf);/** * raw1394_echo_request - send an echo request to the driver * @handle: libraw1394 handle * @data: arbitrary data; raw1394_loop_iterate will return it * * the driver then send back the * same request. raw1394_loop_iterate will return data as return value, * when it processes the echo. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_echo_request(raw1394handle_t handle, quadlet_t data);/** * raw1394_wake_up - wake up raw1394_loop_iterate * @handle: libraw1394 handle * * (or a blocking read from the device * file). actually this calls raw1394_echo_request with 0 as data. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_wake_up(raw1394handle_t handle); /** * raw1394_phy_packet_write - send physical request * @handle: libraw1394 handle * @data: the contents of the packet * * examples of physical requests are linkon, physicalconfigurationpacket, etc. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_phy_packet_write (raw1394handle_t handle, quadlet_t data);/** * raw1394_start_phy_packet_write - initiate sending a physical request * @handle: libraw1394 handle * @data: the contents of the packet * @tag: data to identify the request to completion handler * * examples of physical requests are linkon, physicalconfigurationpacket, etc. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_phy_packet_write(raw1394handle_t handle, quadlet_t data, unsigned long tag);/** * raw1394_start_read - initiate a read transaction * @handle: libraw1394 handle * @node: target node * @addr: address to read from * @length: amount of data to read * @buffer: pointer to buffer where data will be saved * @tag: data to identify the request to completion handler * * This function starts the specified read request. If * @length is %4 a quadlet read is initiated and a block read otherwise. * * The transaction is only started, no success of the transaction is implied * with a successful return of this function. When the transaction completes, a * raw1394_loop_iterate() will call the tag handler and pass it the tag and * error code of the transaction. @tag should therefore be set to something * that uniquely identifies this transaction (e.g. a struct pointer casted to * unsigned long). * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_read(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, size_t length, quadlet_t *buffer, unsigned long tag);/** * raw1394_start_write - initiate a write transaction * @handle: libraw1394 handle * @node: target node * @addr: address to write to * @length: amount of data to write * @data: pointer to data to be sent * @tag: data to identify the request to completion handler * * This function starts the specified write request. If * @length is %4 a quadlet write is initiated and a block write otherwise. * * The transaction is only started, no success of the transaction is implied * with a successful return of this function. When the transaction completes, a * raw1394_loop_iterate() will call the tag handler and pass it the tag and * error code of the transaction. @tag should therefore be set to something * that uniquely identifies this transaction (e.g. a struct pointer casted to * unsigned long). * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_write(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, size_t length, quadlet_t *data, unsigned long tag);/** * raw1394_start_lock - initiate a 32-bit compare-swap lock transaction * @handle: libraw1394 handle * @node: target node * @addr: address to read from * @extcode: extended transaction code determining the lock operation * @data: data part of lock parameters * @arg: arg part of lock parameters * @result: address where return value will be written * @tag: data to identify the request to completion handler * * This function starts the specified lock request. * The transaction is only started, no success of the transaction is implied * with a successful return of this function. When the transaction completes, a * raw1394_loop_iterate() will call the tag handler and pass it the tag and * error code of the transaction. @tag should therefore be set to something * that uniquely identifies this transaction (e.g. a struct pointer casted to * unsigned long). * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_lock(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, unsigned int extcode, quadlet_t data, quadlet_t arg, quadlet_t *result, unsigned long tag);/** * raw1394_start_lock64 - initiate a 64-bit compare-swap lock transaction * @handle: libraw1394 handle * @node: target node * @addr: address to read from * @extcode: extended transaction code determining the lock operation * @data: data part of lock parameters * @arg: arg part of lock parameters * @result: address where return value will be written * @tag: data to identify the request to completion handler * * This function starts the specified lock request. * The transaction is only started, no success of the transaction is implied * with a successful return of this function. When the transaction completes, a * raw1394_loop_iterate() will call the tag handler and pass it the tag and * error code of the transaction. @tag should therefore be set to something * that uniquely identifies this transaction (e.g. a struct pointer casted to * unsigned long). * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_lock64(raw1394handle_t handle, nodeid_t node, nodeaddr_t addr, unsigned int extcode, octlet_t data, octlet_t arg, octlet_t *result, unsigned long tag);/** * raw1394_start_read - initiate asynchronous stream * @handle: libraw1394 handle * @channel: the isochronous channel number to send on * @tag: data to be put into packet's tag field * @sy: data to be put into packet's sy field * @speed: speed at which to send * @length: amount of data to send * @data: pointer to data to send * @rawtag: data to identify the request to completion handler * * Passes custom tag. Use pointer to raw1394_reqhandle if you use the standard * tag handler. * * Returns: 0 on success or -1 on failure (sets errno) **/int raw1394_start_async_stream(raw1394handle_t handle, unsigned int channel, unsigned int tag, unsigned int sy, unsigned int speed, size_t length, quadlet_t *data,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -