Go to the source code of this file.
Data Structures | |
| struct | ocs_dif_t |
Functions | |
| uint32_t | ocs_scsi_dif_blocksize (ocs_scsi_dif_info_t *dif_info) |
| Return blocksize given SCSI API DIF block size. More... | |
| int32_t | ocs_scsi_dif_set_blocksize (ocs_scsi_dif_info_t *dif_info, uint32_t blocksize) |
| Set SCSI API DIF blocksize. More... | |
| int32_t | ocs_scsi_dif_mem_blocksize (ocs_scsi_dif_info_t *dif_info, int wiretomem) |
| Return memory block size given SCSI DIF API. More... | |
| int32_t | ocs_scsi_dif_wire_blocksize (ocs_scsi_dif_info_t *dif_info, int wiretomem) |
| Return wire block size given SCSI DIF API. More... | |
| uint32_t | ocs_hal_dif_blocksize (ocs_hal_dif_info_t *dif_info) |
| Return blocksize given HAL API DIF block size. More... | |
| int32_t | ocs_hal_dif_mem_blocksize (ocs_hal_dif_info_t *dif_info, int wiretomem) |
| Return memory block size given HAL DIF API. More... | |
| int32_t | ocs_hal_dif_wire_blocksize (ocs_hal_dif_info_t *dif_info, int wiretomem) |
| Return wire block size given HAL DIF API. More... | |
| uint16_t | ocs_scsi_dif_calc_crc (const uint8_t *, uint32_t size, uint16_t crc) |
| Calculate the T10 PI CRC guard value for a block. More... | |
| uint16_t | ocs_scsi_dif_calc_checksum (ocs_scsi_vaddr_len_t addrlen[], uint32_t addrlen_count) |
| Calculate the IP-checksum guard value for a block. More... | |
| uint32_t ocs_hal_dif_blocksize | ( | ocs_hal_dif_info_t * | dif_info | ) |
Return blocksize given HAL API DIF block size.
Given the DIF block size enumerated value, return the block size value. (e.g. OCS_SCSI_DIF_BLK_SIZE_512 returns 512)
| dif_info | Pointer to HAL API DIF info block |
| int32_t ocs_hal_dif_mem_blocksize | ( | ocs_hal_dif_info_t * | dif_info, |
| int | wiretomem | ||
| ) |
Return memory block size given HAL DIF API.
The blocksize in memory for the DIF transfer is returned, given the HAL DIF info block and the direction of transfer.
| dif_info | Pointer to DIF info block |
| wiretomem | Transfer direction, 1 is wire to memory, 0 is memory to wire |
WARNING: the order of initialization of the adj[] arrays MUST match the declarations of OCS_HAL_DIF_OPER_*
| int32_t ocs_hal_dif_wire_blocksize | ( | ocs_hal_dif_info_t * | dif_info, |
| int | wiretomem | ||
| ) |
Return wire block size given HAL DIF API.
The blocksize on the wire for the DIF transfer is returned, given the HAL DIF info block and the direction of transfer.
| dif_info | Pointer to DIF info block |
| wiretomem | Transfer direction, 1 is wire to memory, 0 is memory to wire |
WARNING: the order of initialization of the adj[] arrays MUST match the declarations of OCS_HAL_DIF_OPER_*
| uint32_t ocs_scsi_dif_blocksize | ( | ocs_scsi_dif_info_t * | dif_info | ) |
Return blocksize given SCSI API DIF block size.
Given the DIF block size enumerated value, return the block size value. (e.g. OCS_SCSI_DIF_BLK_SIZE_512 returns 512)
| dif_info | Pointer to SCSI API DIF info block |
| uint16_t ocs_scsi_dif_calc_checksum | ( | ocs_scsi_vaddr_len_t | addrlen[], |
| uint32_t | addrlen_count | ||
| ) |
Calculate the IP-checksum guard value for a block.
| addrlen | array of address length pairs |
| addrlen_count | number of entries in the addrlen[] array |
Algorithm: Sum all all the 16-byte words in the block Add in the "carry", which is everything in excess of 16-bits Flip all the bits
| uint16_t ocs_scsi_dif_calc_crc | ( | const uint8_t * | buffer, |
| uint32_t | size, | ||
| uint16_t | crc | ||
| ) |
| int32_t ocs_scsi_dif_mem_blocksize | ( | ocs_scsi_dif_info_t * | dif_info, |
| int | wiretomem | ||
| ) |
Return memory block size given SCSI DIF API.
The blocksize in memory for the DIF transfer is returned, given the SCSI DIF info block and the direction of transfer.
| dif_info | Pointer to DIF info block |
| wiretomem | Transfer direction, 1 is wire to memory, 0 is memory to wire |
WARNING: the order of initialization of the adj[] arrays MUST match the declarations of OCS_SCSI_DIF_OPER_*
| int32_t ocs_scsi_dif_set_blocksize | ( | ocs_scsi_dif_info_t * | dif_info, |
| uint32_t | blocksize | ||
| ) |
Set SCSI API DIF blocksize.
Given a blocksize value (512, 1024, etc.), set the SCSI API DIF blocksize in the DIF info block
| dif_info | Pointer to the SCSI API DIF info block |
| blocksize | Block size |
| int32_t ocs_scsi_dif_wire_blocksize | ( | ocs_scsi_dif_info_t * | dif_info, |
| int | wiretomem | ||
| ) |
Return wire block size given SCSI DIF API.
The blocksize on the wire for the DIF transfer is returned, given the SCSI DIF info block and the direction of transfer.
| dif_info | Pointer to DIF info block |
| wiretomem | Transfer direction, 1 is wire to memory, 0 is memory to wire |
WARNING: the order of initialization of the adj[] arrays MUST match the declarations of OCS_SCSI_DIF_OPER_*