Functions handling I/O requests.
More...
|
| ptxStatus_t | ptxIoRq_Init (ptxIoRq_t *ioCpl) |
| | Initialise the I/O Request Structure.
|
| |
| ptxStatus_t | ptxIoRq_Push (ptxIoRq_t *ioCpl, pptxIoRqCompletion_t ioCompletionFn, void *ioData, size_t ioDataLength, void *ioCompletionComp) |
| | Push a new stack location to the I/O request object.
|
| |
| ptxStatus_t | ptxIoRq_Pop (ptxIoRq_t *ioCpl, pptxIoRqCompletion_t *ioCompletionFn, void **ioData, size_t *ioDataLength, void **ioCompletionComp) |
| | Pop the next stack location from the I/O request object.
|
| |
| ptxStatus_t | ptxIoRq_CallCompletion (pptxIoRqCompletion_t followingCompletion, struct ptxIoRq *ioRq, void *cplUpperLayer, void *data, size_t dataLength, ptxStatus_t cplStatus) |
| | I/O Completion Callback Invocation Helper.
|
| |
| ptxStatus_t | ptxIoRq_PopCallCompletion (struct ptxIoRq *ioRq, struct ptxLog *logComp, void *ioData, size_t ioDataLength, ptxStatus_t cplStatus) |
| | Pop next item and call following completion.
|
| |
| ptxStatus_t | ptxIoRq_SetPoolItem (ptxIoRq_t *ioRqItem, ptxBufferPool_Item_t *bufferItem) |
| | Set buffer item linked to the IO RQ object.
|
| |
| ptxBufferPool_Item_t * | ptxIoRq_GetPoolItem (ptxIoRq_t *ioRqItem) |
| | Get buffer item linked to the IO RQ object.
|
| |
| ptxStatus_t | ptxFifo_IoRq_Get (ptxFifoIoRq_t *fifoIoRq, ptxIoRq_t **ioRq) |
| | Get the entry of the FIFO that stores I/O requests.
|
| |
Functions handling I/O requests.
◆ pptxIoRqCompletion_t
| typedef void(* pptxIoRqCompletion_t) (struct ptxIoRq *ioRq, void *cplUpperLayer, void *data, size_t dataLength, ptxStatus_t cplStatus) |
I/O Completion Callback.
- Parameters
-
| [in] | ioRq | Pointer to the I/O request object. |
| [in] | cplUpperLayer | Pointer to a component further up the stack. |
| [in] | data | Pointer to data to be process on the completion function. |
| [in] | dataLength | Length of the data to be processed on the completion function. |
| [in] | cplStatus | Status of the I/O completion. |
◆ ptxFifo_IoRq_Get()
Get the entry of the FIFO that stores I/O requests.
This function provides the caller with a pointer to the first IORQ object available in the FIFO. The caller assumes that this pointer has been properly allocated before.
- Parameters
-
| [in] | fifoIoRq | Pointer to the structure of the FIFO. |
| [out] | ioRq | Double Pointer to the IO RQ that will get it. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_CallCompletion()
I/O Completion Callback Invocation Helper.
- Parameters
-
| [in] | followingCompletion | Pointer to the upper layer completion function. |
| [in] | ioRq | Pointer to the I/O request object. |
| [in] | cplUpperLayer | Pointer to a component further up the stack. |
| [in] | data | Pointer to data to be processed on the completion function. |
| [in] | dataLength | Length of the data to be processed on the completion function. |
| [in] | cplStatus | Status of the I/O completion. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_GetPoolItem()
Get buffer item linked to the IO RQ object.
- Parameters
-
| [in] | ioRqItem | Allocated and initialized item of ptxIoRq_t. |
- Returns
- Buffer pool item linked to the IO RQ. NULL in case of an error.
◆ ptxIoRq_Init()
Initialise the I/O Request Structure.
Initializes the IORQ. Requires an already-allocated IORQ object. Call this function before starting the use of the IORQ.
- Parameters
-
| [in] | ioCpl | Pointer to the I/O Completion structure. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_Pop()
Pop the next stack location from the I/O request object.
The I/O Request Structure will provide the next stack location through this function: When calling up the stack for completion each caller of the next higher layer will call this function to get the location of the upper layer from the stack of the used I/O Request object. The caller (top layer) will deallocate or return to a pool the I/O Request object.
- Parameters
-
| [in] | ioCpl | Pointer to the I/O Completion structure. |
| [out] | ioCompletionFn | Pointer to a location that will receive the completion function pointer of the next component. |
| [out] | ioData | Pointer to data to be handled by completion function. |
| [out] | ioDataLength | Pointer of the Length of data to be handled by completion function. |
| [out] | ioCompletionComp | Pointer to the component further up in the stack. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_PopCallCompletion()
Pop next item and call following completion.
The function pops the next item and calls following completion. Data can be provided via the parameters. Alternatively, using a special, reserved value for data length, the function takes the data from the I/O request item.
- Parameters
-
| [in] | ioRq | Pointer to the I/O request object. |
| [in] | logComp | Pointer to a logger component. |
| [in] | ioData | Pointer to data to be processed in the completion function. May be NULL. |
| [in] | ioDataLength | Length of the data to be processed in the completion function. May be 0. The special value PTX_IORQ_DATA_POP lets the function take the data from the I/O request item (through POP). Otherwise data is supplied via the parameters. |
| [in] | cplStatus | Status of the I/O completion. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_Push()
Push a new stack location to the I/O request object.
The I/O Request Structure will receive a new stack location by this function: The caller allocates/reserves a new I/O request object. When calling down the stack each layer will call this function to put its location and reference on the stack within the I/O Request Object used for the call and referenced by the first parameter.
- Parameters
-
| [in] | ioCpl | Pointer to the I/O Completion structure. |
| [in] | ioCompletionFn | Pointer to the completion function of the current component. |
| [in] | ioData | Pointer to data to be used by completion function in the response path for thi IO Request. |
| [in] | ioDataLength | Length of data to be handled by completion function. |
| [in] | ioCompletionComp | Pointer to the current component. |
- Returns
- Status of the operation. See definition of ptxStatus_t.
◆ ptxIoRq_SetPoolItem()
Set buffer item linked to the IO RQ object.
- Parameters
-
| [in] | ioRqItem | Allocated and initialized item of ptxIoRq_t. |
| [in] | bufferItem | Allocated and initialized buffer pool item to set ioRqItem. |
- Returns
- Status of the operation. See definition of ptxStatus_t.