Functions | |
| static void | post_one_ua (ocs_node_t *node, uint32_t lun, uint8_t asc, uint8_t ascq) |
| Post a Unit Attention condition to a node/LUN (I_T nexus). More... | |
| void | ocs_ramd_post_ua (ocs_t *ocs, ocs_ramdisc_t *ramdisc, uint8_t asc, uint8_t ascq, ocs_node_t *except_node) |
| Post a Unit Attention condition to a ramdisc. More... | |
| int32_t | ocs_ramd_get_ua (ocs_t *ocs, ocs_node_t *node, uint32_t lun, uint8_t *asc, uint8_t *ascq) |
| Get a pending Unit Attention, if any. More... | |
| void | ocs_ramd_clear_ua (ocs_t *ocs, ocs_node_t *node, uint32_t lun, uint8_t asc, uint8_t ascq) |
| Clear a Unit Attention condition. More... | |
| int32_t | ocs_new_ramdisc (ocs_t *ocs, ocs_ramdisc_t *ramdisc, uint32_t block_size, uint32_t blocks_per_segment, uint64_t block_count) |
| Create a new ramdisc instance (LUN). More... | |
| int32_t | ocs_del_ramdisc (ocs_t *ocs, ocs_ramdisc_t *ramdisc) |
| Delete a ramdisc instance. More... | |
| int32_t | ocs_ramdisc_sgl (ocs_t *ocs, ocs_ramdisc_t *ramdisc, ocs_ramdisc_sgl_t *sgl, uint32_t max_sgl, uint32_t max_sge_size, uint32_t lba, uint32_t *block_count, uint32_t req_flags, uint8_t dump_buffer) |
| Build an SGL list for blocks in a ramdisc. More... | |
| int32_t | ocs_format_ramdisc (ocs_t *ocs, ocs_ramdisc_t *ramdisc, uint32_t block_size, uint8_t p_type, uint8_t prot_en, uint8_t dif_separate) |
| Reformat an existing ramdisc, possibly the changing block size and/or protection. More... | |
| void | ocs_set_ramdisc_blocksize (ocs_t *ocs, ocs_ramdisc_t *ramdisc, uint32_t block_size) |
| Set the ramdisc block size. More... | |
| uint32_t | ocs_get_ramdisc_blocksize (ocs_t *ocs, ocs_ramdisc_t *ramdisc) |
| Get the ramdisc block size. More... | |
| uint8_t * | ocs_ramdisc_lba_address (ocs_ramdisc_t *ramdisc, uint64_t lba) |
| Return the address of a ramdisc logical block. More... | |
| dif_t * | ocs_ramdisc_dif_address (ocs_ramdisc_t *ramdisc, uint64_t lba) |
| Return the address of the DIF block if protection is enabled. More... | |
| int32_t ocs_del_ramdisc | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc | ||
| ) |
Delete a ramdisc instance.
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc instance to free. |
Definition at line 151 of file ocs_ramdisc.c.
| int32_t ocs_format_ramdisc | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc, | ||
| uint32_t | block_size, | ||
| uint8_t | p_type, | ||
| uint8_t | prot_en, | ||
| uint8_t | dif_separate | ||
| ) |
Reformat an existing ramdisc, possibly the changing block size and/or protection.
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc instance. |
| block_size | Requested block size |
| p_type | Requested new protection type. |
| prot_en | Requested new protection enabled flag. |
| dif_separate | Requested DIF separates |
Definition at line 359 of file ocs_ramdisc.c.
| uint32_t ocs_get_ramdisc_blocksize | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc | ||
| ) |
Get the ramdisc block size.
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc object. |
Definition at line 555 of file ocs_ramdisc.c.
| int32_t ocs_new_ramdisc | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc, | ||
| uint32_t | block_size, | ||
| uint32_t | blocks_per_segment, | ||
| uint64_t | block_count | ||
| ) |
Create a new ramdisc instance (LUN).
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc instance to initialize. |
| block_size | Ramdisc block size. |
| blocks_per_segment | Ramdisc blocks per storage segment. |
| block_count | Ramdisc total device block count. |
Definition at line 72 of file ocs_ramdisc.c.
| void ocs_ramd_clear_ua | ( | ocs_t * | ocs, |
| ocs_node_t * | node, | ||
| uint32_t | lun, | ||
| uint8_t | asc, | ||
| uint8_t | ascq | ||
| ) |
Clear a Unit Attention condition.
| ocs | Pointer to the ocs structure. |
| node | Pointer to the node structure. |
| lun | Logical Unit Number. |
| asc | Additional Sense Code. |
| ascq | Additional Sense Code Qualifier. |
Definition at line 6945 of file ocs_ramd.c.
| int32_t ocs_ramd_get_ua | ( | ocs_t * | ocs, |
| ocs_node_t * | node, | ||
| uint32_t | lun, | ||
| uint8_t * | asc, | ||
| uint8_t * | ascq | ||
| ) |
Get a pending Unit Attention, if any.
| ocs | Pointer to the ocs structure. |
| node | Pointer to the node structure. |
| lun | Logical Unit Number. |
| asc | Pointer to the location to store the Additional Sense Code. |
| ascq | Pointer to the location to store the Additional Sense Code Qualifier. |
Definition at line 6899 of file ocs_ramd.c.
| void ocs_ramd_post_ua | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc, | ||
| uint8_t | asc, | ||
| uint8_t | ascq, | ||
| ocs_node_t * | except_node | ||
| ) |
Post a Unit Attention condition to a ramdisc.
except_node points to a node structure, then that node does not get the UA posted. This is used when the ramdisc has been formatted so that the UA can be posted to all nodes other than the one that requested the format. See SBC 4.10.| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc. |
| asc | Additional Sense Code. |
| ascq | Additional Sense Code Qualifier. |
| except_node | Node which should not get the UA posted. May be NULL. |
Definition at line 6826 of file ocs_ramd.c.
| dif_t* ocs_ramdisc_dif_address | ( | ocs_ramdisc_t * | ramdisc, |
| uint64_t | lba | ||
| ) |
Return the address of the DIF block if protection is enabled.
| ramdisc | Pointer to the ramdisc structure. |
| lba | Logical Block Address. |
Definition at line 605 of file ocs_ramdisc.c.
| uint8_t* ocs_ramdisc_lba_address | ( | ocs_ramdisc_t * | ramdisc, |
| uint64_t | lba | ||
| ) |
Return the address of a ramdisc logical block.
| ramdisc | Pointer to the ramdisc structure. |
| lba | Logical Block Address. |
Definition at line 577 of file ocs_ramdisc.c.
| int32_t ocs_ramdisc_sgl | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc, | ||
| ocs_ramdisc_sgl_t * | sgl, | ||
| uint32_t | max_sgl, | ||
| uint32_t | max_sge_size, | ||
| uint32_t | lba, | ||
| uint32_t * | block_count, | ||
| uint32_t | req_flags, | ||
| uint8_t | dump_buffer | ||
| ) |
Build an SGL list for blocks in a ramdisc.
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to a ramdisc instance. |
| sgl | Pointer to the SGL. |
| max_sgl | Maximum number of scatter gather entries in an SGL. |
| max_sge_size | Maximum size of an SGE, in bytes. |
| lba | Starting block address. |
| block_count | The number of blocks to transfer for the IO. May be updated to contain the number of blocks in the SGLs, which may be less if the max_sgl count or max_xfer_size is reached. |
| req_flags | SGL flags indicating the type of SGL to be built. If the SGL_REQ_FLAGS_PHYS (1U << 0) bit is set, then the SGL includes the block data and DIF. Otherwise, the SGL builds a DIF or non-DIF SGL. Note: In the case of a separate DIF, an SGL_REQ_FLAGS_PHYS results in a one block data SGE followed by an 8-byte SGE containing the DIF data, repeating. |
| dump_buffer | If TRUE and debug is enabled, the memory pointed to by the SGE is dumped to the log. |
Definition at line 218 of file ocs_ramdisc.c.
| void ocs_set_ramdisc_blocksize | ( | ocs_t * | ocs, |
| ocs_ramdisc_t * | ramdisc, | ||
| uint32_t | block_size | ||
| ) |
Set the ramdisc block size.
| ocs | Pointer to the ocs structure. |
| ramdisc | Pointer to the ramdisc object to initialize. |
| block_size | Ramdisc device block size. |
Definition at line 537 of file ocs_ramdisc.c.
|
static |
Post a Unit Attention condition to a node/LUN (I_T nexus).
| node | Pointer to a node structure. |
| lun | LUN number. |
| asc | Additional Sense Code. |
| ascq | Additional Sense Code Qualifier. |
Definition at line 6758 of file ocs_ramd.c.