NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
nvmnand_ufs_util.h File Reference

Go to the source code of this file.

Macros

#define UPIU_QUERY_OPCODE_READ_DESC   0x01
 Common functions/definitions used on UFS. More...
 
#define UPIU_QUERY_OPCODE_WRITE_DESC   0x02
 
#define UPIU_QUERY_OPCODE_READ_ATTR   0x03
 
#define UPIU_QUERY_OPCODE_WRITE_ATTR   0x04
 
#define UPIU_QUERY_OPCODE_READ_FLAG   0x05
 
#define UPIU_QUERY_OPCODE_SET_FLAG   0x06
 
#define UPIU_QUERY_OPCODE_CLEAR_FLAG   0x07
 
#define UPIU_QUERY_OPCODE_TOGGLE_FLAG   0x08
 
#define QUERY_DESC_IDN_DEVICE   0x0
 
#define QUERY_DESC_IDN_CONFIGURAION   0x1
 
#define QUERY_DESC_IDN_UNIT   0x2
 
#define QUERY_DESC_IDN_GEOMETRY   0x7
 
#define QUERY_DESC_IDN_DEVICE_HEALTH   0x9
 
#define QUERY_FLAG_IDN_BKOPS_EN   0x4
 
#define QUERY_FLAG_IDN_PURGE_EN   0x6
 
#define QUERY_FLAG_IDN_RFSH_EN   0x7
 
#define QUERY_ATTR_IDN_BKOPS_STATUS   0x5
 
#define QUERY_ATTR_IDN_PURGE_STATUS   0x6
 
#define QUERY_ATTR_IDN_FFU_STATUS   0x14
 
#define MNAND_UFS_GEO_DESC_SIZE   0x48
 
#define MNAND_UFS_CFG_DESC_SIZE   0x90
 
#define MNAND_UFS_DEV_DESC_SIZE   0x40
 
#define MNAND_UFS_UNIT_DESC_SIZE   0x23
 
#define MNAND_UFS_HEALTH_DESC_SIZE   0x30
 
#define SCSI_INQUIRY_CMD_CODE   0x12
 
#define SCSI_MODE_SENSE_CMD_CODE   0x5A
 
#define SCSI_MODE_SELECT_CMD_CODE   0x55
 
#define SCSI_SYNC_CACHE10_CMD_CODE   0x35
 
#define SCSI_UNMAP_CMD_CODE   0x42
 
#define SCSI_READ_CAPACITY_CMD_CODE   0x25
 
#define SCSI_WRITE_BUFFER_CMD_CODE   0x3B
 
#define SCSI_INQUIRY_CMD_BLK_LEN   6
 
#define SCSI_MODE_SENSE_CMD_BLK_LEN   10
 
#define SCSI_MODE_SELECT_CMD_BLK_LEN   10
 
#define SCSI_SYNC_CACHE10_CMD_BLK_LEN   10
 
#define SCSI_UNMAP_CMD_BLK_LEN   10
 
#define SCSI_READ_CAPACITY_CMD_BLK_LEN   16
 
#define SCSI_WRITE_BUFFER_CMD_LEN   10
 
#define SCSI_STD_INQUIRY_REPLY_LEN   36
 
#define UFS_POWER_MODE_POWER_DOWN   3
 
#define MAX_CMD_PER_QUERY_COMBO   10
 
#define UNMAP_BLOCK_COUNT_MAX   0xFFFFFFFF
 
#define PURGE_STATUS_INPROGRESS   1
 
#define PURGE_STATUS_COMPLETED   3
 
#define SCSI_MODE_FFU_VAL   0xE
 
#define MNAND_UFS_FW_DEVICE_OFFSET   (32U)
 Offset to the FW as returned by UFS. More...
 
#define MNAND_UFS_PRN_DEVICE_OFFSET   (16U)
 Offset to the PRN as returned by UFS. More...
 
#define MNAND_UFS_FFU_SUPPORT_DEVICE_OFFSET   (0x1FU)
 Offset to the FFU support as returned by UFS. More...
 

Functions

MNAND_STATUS mnand_ufs_send_combo_query_command (int fd, mnand_ufs_query_req *query_buf, uint8_t num_cmds, uint8_t need_cq_empty, uint8_t ret_on_err)
 Send UFS combo query request. More...
 
MNAND_STATUS mnand_ufs_query_desc_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Descriptor Read Request. More...
 
MNAND_STATUS mnand_ufs_query_desc_write (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Descriptor Write Request. More...
 
MNAND_STATUS mnand_ufs_query_device_desc_read (int fd, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Device Descriptor Read. More...
 
MNAND_STATUS mnand_ufs_query_config_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Config Descriptor Read. More...
 
MNAND_STATUS mnand_ufs_query_config_desc_write (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Config Descriptor Write. More...
 
MNAND_STATUS mnand_ufs_query_geo_desc_read (int fd, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Geometry Descriptor Read. More...
 
MNAND_STATUS mnand_ufs_query_unit_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Unit Descriptor Read. More...
 
MNAND_STATUS mnand_ufs_query_health_desc_read (int fd, uint8_t index, uint8_t *buffer, uint32_t *buf_size)
 Send UFS Query - Health Descriptor Read. More...
 
MNAND_STATUS mnand_ufs_query_attr_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint32_t *attr)
 Send UFS Query - Attribute Read Request. More...
 
MNAND_STATUS mnand_ufs_query_attr_write (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint32_t *attr)
 Send UFS Query - Attribute Write Request. More...
 
MNAND_STATUS mnand_ufs_query_flag_read (int fd, uint8_t idn, uint8_t index, uint8_t sel, uint8_t *flag)
 Send UFS Query - Attribute Read Request. More...
 
MNAND_STATUS mnand_ufs_query_flag_set (int fd, uint8_t idn, uint8_t index, uint8_t sel)
 Send UFS Query - Set Flag Request. More...
 
MNAND_STATUS mnand_ufs_query_flag_clear (int fd, uint8_t idn, uint8_t index, uint8_t sel)
 Send UFS Query - Clear Flag Request. More...
 
MNAND_STATUS mnand_ufs_query_flag_toggle (int fd, uint8_t idn, uint8_t index, uint8_t sel)
 Send UFS Query - Toggle Flag Request. More...
 
MNAND_STATUS mnand_ufs_scsi_inquiry (int fd, int8_t evpd, uint8_t page_code, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Inquiry Request. More...
 
MNAND_STATUS mnand_ufs_scsi_mode_sense (int fd, uint8_t page_code, uint8_t sub_page_code, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Mode Sense Request. More...
 
MNAND_STATUS mnand_ufs_scsi_mode_select (int fd, int8_t save_pages, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Mode Select Request. More...
 
MNAND_STATUS mnand_ufs_scsi_sync_cache (int fd)
 Send SCSI Sync Cache Request. More...
 
MNAND_STATUS mnand_ufs_unmap (int fd, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Mode Select Request. More...
 
MNAND_STATUS mnand_ufs_read_capacity (int fd, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Read Capacity Request. More...
 
MNAND_STATUS mnand_ufs_set_power_mode (int fd, uint32_t power_mode)
 Set UFS power mode. More...
 
MNAND_STATUS mnand_ufs_scsi_read_buffer (int fd, uint8_t *cmd_blk, uint32_t cmd_blk_len, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Read Buffer. More...
 
MNAND_STATUS mnand_ufs_scsi_write_buffer (int fd, uint8_t *cmd_blk, uint32_t cmd_blk_len, uint8_t *buffer, uint32_t *buf_size)
 Send SCSI Write Buffer. More...
 
MNAND_STATUS mnand_ufs_scsi_cmd (int fd, uint8_t *cmd_blk, uint32_t cmd_len, int dxfer_dir, uint8_t *data_buffer, uint32_t *data_buf_size)
 Send SCSI Command. More...
 

Macro Definition Documentation

◆ MAX_CMD_PER_QUERY_COMBO

#define MAX_CMD_PER_QUERY_COMBO   10

Definition at line 81 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_CFG_DESC_SIZE

#define MNAND_UFS_CFG_DESC_SIZE   0x90

Definition at line 51 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_DEV_DESC_SIZE

#define MNAND_UFS_DEV_DESC_SIZE   0x40

Definition at line 52 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_FFU_SUPPORT_DEVICE_OFFSET

#define MNAND_UFS_FFU_SUPPORT_DEVICE_OFFSET   (0x1FU)

Offset to the FFU support as returned by UFS.

Definition at line 100 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_FW_DEVICE_OFFSET

#define MNAND_UFS_FW_DEVICE_OFFSET   (32U)

Offset to the FW as returned by UFS.

Definition at line 94 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_GEO_DESC_SIZE

#define MNAND_UFS_GEO_DESC_SIZE   0x48

Definition at line 50 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_HEALTH_DESC_SIZE

#define MNAND_UFS_HEALTH_DESC_SIZE   0x30

Definition at line 54 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_PRN_DEVICE_OFFSET

#define MNAND_UFS_PRN_DEVICE_OFFSET   (16U)

Offset to the PRN as returned by UFS.

Definition at line 97 of file nvmnand_ufs_util.h.

◆ MNAND_UFS_UNIT_DESC_SIZE

#define MNAND_UFS_UNIT_DESC_SIZE   0x23

Definition at line 53 of file nvmnand_ufs_util.h.

◆ PURGE_STATUS_COMPLETED

#define PURGE_STATUS_COMPLETED   3

Definition at line 88 of file nvmnand_ufs_util.h.

◆ PURGE_STATUS_INPROGRESS

#define PURGE_STATUS_INPROGRESS   1

Definition at line 87 of file nvmnand_ufs_util.h.

◆ QUERY_ATTR_IDN_BKOPS_STATUS

#define QUERY_ATTR_IDN_BKOPS_STATUS   0x5

Definition at line 45 of file nvmnand_ufs_util.h.

◆ QUERY_ATTR_IDN_FFU_STATUS

#define QUERY_ATTR_IDN_FFU_STATUS   0x14

Definition at line 47 of file nvmnand_ufs_util.h.

◆ QUERY_ATTR_IDN_PURGE_STATUS

#define QUERY_ATTR_IDN_PURGE_STATUS   0x6

Definition at line 46 of file nvmnand_ufs_util.h.

◆ QUERY_DESC_IDN_CONFIGURAION

#define QUERY_DESC_IDN_CONFIGURAION   0x1

Definition at line 34 of file nvmnand_ufs_util.h.

◆ QUERY_DESC_IDN_DEVICE

#define QUERY_DESC_IDN_DEVICE   0x0

Definition at line 33 of file nvmnand_ufs_util.h.

◆ QUERY_DESC_IDN_DEVICE_HEALTH

#define QUERY_DESC_IDN_DEVICE_HEALTH   0x9

Definition at line 37 of file nvmnand_ufs_util.h.

◆ QUERY_DESC_IDN_GEOMETRY

#define QUERY_DESC_IDN_GEOMETRY   0x7

Definition at line 36 of file nvmnand_ufs_util.h.

◆ QUERY_DESC_IDN_UNIT

#define QUERY_DESC_IDN_UNIT   0x2

Definition at line 35 of file nvmnand_ufs_util.h.

◆ QUERY_FLAG_IDN_BKOPS_EN

#define QUERY_FLAG_IDN_BKOPS_EN   0x4

Definition at line 40 of file nvmnand_ufs_util.h.

◆ QUERY_FLAG_IDN_PURGE_EN

#define QUERY_FLAG_IDN_PURGE_EN   0x6

Definition at line 41 of file nvmnand_ufs_util.h.

◆ QUERY_FLAG_IDN_RFSH_EN

#define QUERY_FLAG_IDN_RFSH_EN   0x7

Definition at line 42 of file nvmnand_ufs_util.h.

◆ SCSI_INQUIRY_CMD_BLK_LEN

#define SCSI_INQUIRY_CMD_BLK_LEN   6

Definition at line 66 of file nvmnand_ufs_util.h.

◆ SCSI_INQUIRY_CMD_CODE

#define SCSI_INQUIRY_CMD_CODE   0x12

Definition at line 57 of file nvmnand_ufs_util.h.

◆ SCSI_MODE_FFU_VAL

#define SCSI_MODE_FFU_VAL   0xE

Definition at line 91 of file nvmnand_ufs_util.h.

◆ SCSI_MODE_SELECT_CMD_BLK_LEN

#define SCSI_MODE_SELECT_CMD_BLK_LEN   10

Definition at line 68 of file nvmnand_ufs_util.h.

◆ SCSI_MODE_SELECT_CMD_CODE

#define SCSI_MODE_SELECT_CMD_CODE   0x55

Definition at line 59 of file nvmnand_ufs_util.h.

◆ SCSI_MODE_SENSE_CMD_BLK_LEN

#define SCSI_MODE_SENSE_CMD_BLK_LEN   10

Definition at line 67 of file nvmnand_ufs_util.h.

◆ SCSI_MODE_SENSE_CMD_CODE

#define SCSI_MODE_SENSE_CMD_CODE   0x5A

Definition at line 58 of file nvmnand_ufs_util.h.

◆ SCSI_READ_CAPACITY_CMD_BLK_LEN

#define SCSI_READ_CAPACITY_CMD_BLK_LEN   16

Definition at line 71 of file nvmnand_ufs_util.h.

◆ SCSI_READ_CAPACITY_CMD_CODE

#define SCSI_READ_CAPACITY_CMD_CODE   0x25

Definition at line 62 of file nvmnand_ufs_util.h.

◆ SCSI_STD_INQUIRY_REPLY_LEN

#define SCSI_STD_INQUIRY_REPLY_LEN   36

Definition at line 75 of file nvmnand_ufs_util.h.

◆ SCSI_SYNC_CACHE10_CMD_BLK_LEN

#define SCSI_SYNC_CACHE10_CMD_BLK_LEN   10

Definition at line 69 of file nvmnand_ufs_util.h.

◆ SCSI_SYNC_CACHE10_CMD_CODE

#define SCSI_SYNC_CACHE10_CMD_CODE   0x35

Definition at line 60 of file nvmnand_ufs_util.h.

◆ SCSI_UNMAP_CMD_BLK_LEN

#define SCSI_UNMAP_CMD_BLK_LEN   10

Definition at line 70 of file nvmnand_ufs_util.h.

◆ SCSI_UNMAP_CMD_CODE

#define SCSI_UNMAP_CMD_CODE   0x42

Definition at line 61 of file nvmnand_ufs_util.h.

◆ SCSI_WRITE_BUFFER_CMD_CODE

#define SCSI_WRITE_BUFFER_CMD_CODE   0x3B

Definition at line 63 of file nvmnand_ufs_util.h.

◆ SCSI_WRITE_BUFFER_CMD_LEN

#define SCSI_WRITE_BUFFER_CMD_LEN   10

Definition at line 72 of file nvmnand_ufs_util.h.

◆ UFS_POWER_MODE_POWER_DOWN

#define UFS_POWER_MODE_POWER_DOWN   3

Definition at line 78 of file nvmnand_ufs_util.h.

◆ UNMAP_BLOCK_COUNT_MAX

#define UNMAP_BLOCK_COUNT_MAX   0xFFFFFFFF

Definition at line 84 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_CLEAR_FLAG

#define UPIU_QUERY_OPCODE_CLEAR_FLAG   0x07

Definition at line 29 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_READ_ATTR

#define UPIU_QUERY_OPCODE_READ_ATTR   0x03

Definition at line 25 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_READ_DESC

#define UPIU_QUERY_OPCODE_READ_DESC   0x01

Common functions/definitions used on UFS.

Chip independent

Definition at line 23 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_READ_FLAG

#define UPIU_QUERY_OPCODE_READ_FLAG   0x05

Definition at line 27 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_SET_FLAG

#define UPIU_QUERY_OPCODE_SET_FLAG   0x06

Definition at line 28 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_TOGGLE_FLAG

#define UPIU_QUERY_OPCODE_TOGGLE_FLAG   0x08

Definition at line 30 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_WRITE_ATTR

#define UPIU_QUERY_OPCODE_WRITE_ATTR   0x04

Definition at line 26 of file nvmnand_ufs_util.h.

◆ UPIU_QUERY_OPCODE_WRITE_DESC

#define UPIU_QUERY_OPCODE_WRITE_DESC   0x02

Definition at line 24 of file nvmnand_ufs_util.h.

Function Documentation

◆ mnand_ufs_query_attr_read()

MNAND_STATUS mnand_ufs_query_attr_read ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel,
uint32_t *  attr 
)

Send UFS Query - Attribute Read Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Attribute identifier
index- index
sel- selector
attr- buffer to store the attribute read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_attr_write()

MNAND_STATUS mnand_ufs_query_attr_write ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel,
uint32_t *  attr 
)

Send UFS Query - Attribute Write Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Attribute identifier
index- index
sel- selector
attr- buffer to store the attribute to be written
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_config_desc_read()

MNAND_STATUS mnand_ufs_query_config_desc_read ( int  fd,
uint8_t  index,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Config Descriptor Read.

Parameters
fd- file descriptor to opened mNAND device
index- index
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_config_desc_write()

MNAND_STATUS mnand_ufs_query_config_desc_write ( int  fd,
uint8_t  index,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Config Descriptor Write.

Parameters
fd- file descriptor to opened mNAND device
index- index
buffer- buffer to store the descriptor data to be updated in device
buf_size- size of the buffer passed/size of the descriptor written
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_desc_read()

MNAND_STATUS mnand_ufs_query_desc_read ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Descriptor Read Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Descriptor identifier
index- index
sel- selector
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_desc_write()

MNAND_STATUS mnand_ufs_query_desc_write ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Descriptor Write Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Descriptor identifier
index- index
sel- selector
buffer- buffer to store the descriptor to be written
buf_size- size of the buffer passed/size of the descriptor written
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_device_desc_read()

MNAND_STATUS mnand_ufs_query_device_desc_read ( int  fd,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Device Descriptor Read.

Parameters
fd- file descriptor to opened mNAND device
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_flag_clear()

MNAND_STATUS mnand_ufs_query_flag_clear ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel 
)

Send UFS Query - Clear Flag Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Flag identifier
index- index
sel- selector
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_flag_read()

MNAND_STATUS mnand_ufs_query_flag_read ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel,
uint8_t *  flag 
)

Send UFS Query - Attribute Read Request.

Parameters
fd- file descriptor to opened mNAND device
idn- flag identifier
index- index
sel- selector
attr- buffer to store the flag read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_flag_set()

MNAND_STATUS mnand_ufs_query_flag_set ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel 
)

Send UFS Query - Set Flag Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Flag identifier
index- index
sel- selector
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_flag_toggle()

MNAND_STATUS mnand_ufs_query_flag_toggle ( int  fd,
uint8_t  idn,
uint8_t  index,
uint8_t  sel 
)

Send UFS Query - Toggle Flag Request.

Parameters
fd- file descriptor to opened mNAND device
idn- Flag identifier
index- index
sel- selector
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_geo_desc_read()

MNAND_STATUS mnand_ufs_query_geo_desc_read ( int  fd,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Geometry Descriptor Read.

Parameters
fd- file descriptor to opened mNAND device
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_health_desc_read()

MNAND_STATUS mnand_ufs_query_health_desc_read ( int  fd,
uint8_t  index,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Health Descriptor Read.

Parameters
fd- file descriptor to opened mNAND device
index- index
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_query_unit_desc_read()

MNAND_STATUS mnand_ufs_query_unit_desc_read ( int  fd,
uint8_t  index,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send UFS Query - Unit Descriptor Read.

Parameters
fd- file descriptor to opened mNAND device
index- index
buffer- buffer to store the descriptor read
buf_size- size of the buffer passed/size of the descriptor read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_read_capacity()

MNAND_STATUS mnand_ufs_read_capacity ( int  fd,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Read Capacity Request.

Parameters
fd- file descriptor to opened mNAND device
buffer- pointer to the buffer to store the read capacity response data
buf_size- size of the buffer/size of read capacity data received
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_cmd()

MNAND_STATUS mnand_ufs_scsi_cmd ( int  fd,
uint8_t *  cmd_blk,
uint32_t  cmd_len,
int  dxfer_dir,
uint8_t *  data_buffer,
uint32_t *  data_buf_size 
)

Send SCSI Command.

Parameters
fd- file descriptor to opened mNAND device
cmd_blk- pointer to the buffer for command block
cmd_len- command block buffer length
data_buffer- pointer to the buffer which has the data to be read/written
data_buf_size- size of the read/write buffer
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_inquiry()

MNAND_STATUS mnand_ufs_scsi_inquiry ( int  fd,
int8_t  evpd,
uint8_t  page_code,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Inquiry Request.

Parameters
fd- file descriptor to opened mNAND device
evpd- evpd flag for inquiry request
page_code-page code for inquiry request
buffer- pointer to the buffer to store the inquiry data response
buf_size- size of the buffer/size of inquiry data read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_mode_select()

MNAND_STATUS mnand_ufs_scsi_mode_select ( int  fd,
int8_t  save_pages,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Mode Select Request.

Parameters
fd- file descriptor to opened mNAND device
page_code- save pages option for mode select request
buffer- pointer to the buffer to store the mode select data
buf_size- size of the buffer/size of mode sense data written
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_mode_sense()

MNAND_STATUS mnand_ufs_scsi_mode_sense ( int  fd,
uint8_t  page_code,
uint8_t  sub_page_code,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Mode Sense Request.

Parameters
fd- file descriptor to opened mNAND device
page_code- page code for mode sense request
sub_page_code- sub page code for mode sense request
buffer- pointer to the buffer to store the mode sense data response
buf_size- size of the buffer/size of mode sense data read
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_read_buffer()

MNAND_STATUS mnand_ufs_scsi_read_buffer ( int  fd,
uint8_t *  cmd_blk,
uint32_t  cmd_blk_len,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Read Buffer.

Parameters
fd- file descriptor to opened mNAND device
cmd_blk- pointer to the buffer for command block
cmd_blk_len- command block buffer length
buffer- pointer to the buffer that stores the data read
buf_size- size of the read buffer
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_sync_cache()

MNAND_STATUS mnand_ufs_scsi_sync_cache ( int  fd)

Send SCSI Sync Cache Request.

Parameters
fd- file descriptor to opened mNAND device
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_scsi_write_buffer()

MNAND_STATUS mnand_ufs_scsi_write_buffer ( int  fd,
uint8_t *  cmd_blk,
uint32_t  cmd_blk_len,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Write Buffer.

Parameters
fd- file descriptor to opened mNAND device
cmd_blk- pointer to the buffer for command block
cmd_blk_len- command block buffer length
buffer- pointer to the buffer which has the data to be written
buf_size- size of the write buffer
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_send_combo_query_command()

MNAND_STATUS mnand_ufs_send_combo_query_command ( int  fd,
mnand_ufs_query_req query_buf,
uint8_t  num_cmds,
uint8_t  need_cq_empty,
uint8_t  ret_on_err 
)

Send UFS combo query request.

Parameters
fd- file descriptor to opened mNAND device
query_buf- pointer to query request buffer
num_cmds- number of query requests in this combo request
need_cq_empty- Flag to specify if this request needs cq to be empty
ret_on_err- Flag to specify to return on error or continue furthur
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_set_power_mode()

MNAND_STATUS mnand_ufs_set_power_mode ( int  fd,
uint32_t  power_mode 
)

Set UFS power mode.

Parameters
fd- file descriptor to opened mNAND device
power_mode- power mode to be set
Return values
MNAND_OK,success
elseproblem with operation

◆ mnand_ufs_unmap()

MNAND_STATUS mnand_ufs_unmap ( int  fd,
uint8_t *  buffer,
uint32_t *  buf_size 
)

Send SCSI Mode Select Request.

Parameters
fd- file descriptor to opened mNAND device
buffer- pointer to the buffer to store the unmap data
buf_size- size of the buffer/size of unmap data written
Return values
MNAND_OK,success
elseproblem with operation