diff --git a/usb/ddk/v1_0/IUsbDdk.idl b/usb/ddk/v1_0/IUsbDdk.idl index ea075e09350c87efb368ce78e19a8f41ac2bbe9e..9cc2ac94712c07b00ebe27f4fa971e326f052c7e 100644 --- a/usb/ddk/v1_0/IUsbDdk.idl +++ b/usb/ddk/v1_0/IUsbDdk.idl @@ -169,6 +169,20 @@ interface IUsbDdk */ SendPipeRequest([in] struct UsbRequestPipe pipe, [in] unsigned int size, [in] unsigned int offset, [in] unsigned int length, [out] unsigned int transferedLength); + /* * + * @brief Sends a pipe request. This API works in a synchronous manner. This API applies to interrupt transfer\n + * and bulk transfer. + * + * @param pipe Pipe used to transfer data. + * @param ashmem Share memory used to transfer data; + * @param transferredLength Length of the transferred data; + * + * @return 0 if the operation is successful; a negative value otherwise. + * @since 5.0 + * @version 1.0 + */ + SendPipeRequestWithAshmem([in] struct UsbRequestPipe pipe, [in] UsbAshmem ashmem, [out] unsigned int transferredLength); + /* * * @brief Gets the file descriptor for memory mapping. * diff --git a/usb/ddk/v1_0/UsbDdkTypes.idl b/usb/ddk/v1_0/UsbDdkTypes.idl index 033752c8cd158c9404e705c243b5965a70cf55d9..6ed8bd4575a073a503a37dc68bd061d8003847d3 100644 --- a/usb/ddk/v1_0/UsbDdkTypes.idl +++ b/usb/ddk/v1_0/UsbDdkTypes.idl @@ -99,4 +99,29 @@ struct UsbRequestPipe { unsigned int timeout; /** Endpoint address. */ unsigned char endpoint; +}; + +/** + * @brief Usb Ashmem. + * + * @since 5.0 + * @version 1.0 + */ +struct UsbAshmem { + /** File descriptor of the shared memory. */ + FileDescriptor ashmemFd; + /** Buffer address. */ + unsigned char[] address; + /** Buffer size. */ + unsigned int size; + /** Offset of the used buffer. The default value is 0, which indicates that there is no offset\n + * and the buffer starts from the specified address. + */ + unsigned int offset; + /** Length of the used buffer. By default, the value is equal to the size, which indicates that\n + * the entire buffer is used. + */ + unsigned int bufferLength; + /** Length of the transferred data. */ + unsigned int transferredLength; }; \ No newline at end of file