libxcoder  3.5.1
ni_nvme_logan.h File Reference

Definitions related to working with NI T-408 over NVME interface. More...

#include "ni_defs_logan.h"
#include "../build/xcoder_auto_headers.h"

Go to the source code of this file.

Data Structures

struct  _ni_logan_nvme_id_power_state
 
struct  _ni_logan_nvme_identity
 
struct  _ni_logan_nvme_write_complete_dw0_t
 

Macros

#define NI_LOGAN_NVME_IDENTITY_CMD_DATA_SZ   4096
 
#define NI_LOGAN_NO_CHECK_TS_NVME_CMD_OP   (-1)
 
#define WRITE_INSTANCE_SET_DW2_SUBFRAME_IDX(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define WRITE_INSTANCE_SET_DW3_SUBFRAME_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define CREATE_SESSION_SET_DW10_SUBTYPE(dst)   (dst = (nvme_open_xcoder_create_session & 0xFFFFUL))
 
#define CREATE_SESSION_SET_DW11_INSTANCE(dst, instance)   (dst = (instance & 0xFFFFUL))
 
#define CREATE_SESSION_SET_DW12_DEC_CID(dst, cid)   (dst = (cid & 0xFFFFUL))
 
#define CREATE_SESSION_SET_DW12_ENC_CID_FRWIDTH(dst, cid, width)   (dst = (((width << 16) & 0xFFFF0000UL) | (cid & 0xFFFFUL)))
 
#define CREATE_SESSION_SET_DW13_ENC_FRHIGHT(dst, hight)   (dst = (hight & 0xFFFFUL))
 
#define CREATE_SESSION_SET_DW14_MODEL_LOAD(dst, load)   (dst = (load & 0xFFFFFFFFUL))
 
#define CREATE_SESSION_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define DESTROY_SESSION_SET_DW10_INSTANCE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_close_xcoder_destroy_session & 0xFFFFUL)))
 
#define READ_INSTANCE_SET_DW10_SUBTYPE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_write_xcoder_write_instance & 0xFFFFUL)))
 
#define READ_INSTANCE_SET_DW11_INSTANCE(dst, instance)   (dst = (instance & 0xFFFFUL))
 
#define READ_INSTANCE_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define WRITE_INSTANCE_SET_DW10_SUBTYPE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_write_xcoder_write_instance & 0xFFFFUL)))
 
#define WRITE_INSTANCE_SET_DW11_INSTANCE(dst, instance)   (dst = (instance & 0xFFFFUL))
 
#define WRITE_INSTANCE_SET_DW11_PAGEOFFSET(dst, pageoffset)   (dst = (((pageoffset << 16) | dst)))
 
#define WRITE_INSTANCE_SET_DW12_ISHWDESC(dst, ishwdesc)   (dst = (ishwdesc & 0xFFFFUL))
 
#define WRITE_INSTANCE_SET_DW12_FRAMEINSTID(dst, fid)   (dst = (0xFFFFUL & dst) | ((fid<<16) & 0xFFFF0000UL))
 
#define WRITE_INSTANCE_SET_DW14_YUV_BYTEOFFSET(dst, byteoffset)   (dst = (byteoffset & 0xFFFFFFFFUL))
 
#define WRITE_INSTANCE_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define QUERY_SESSION_SET_DW10_SUBTYPE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_query_xcoder_query_session & 0xFFFFUL)))
 
#define QUERY_SESSION_SET_DW11_INSTANCE(dst, instance)   (dst = (instance & 0xFFFFUL))
 
#define QUERY_SESSION_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define QUERY_INSTANCE_SET_DW10_SUBTYPE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_query_xcoder_query_instance & 0xFFFFUL)))
 
#define QUERY_INSTANCE_SET_DW11_INSTANCE_STATUS(dst, instance)   (dst = (((nvme_query_xcoder_instance_get_status << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define QUERY_INSTANCE_SET_DW11_INSTANCE_STREAM_INFO(dst, instance)   (dst = (((nvme_query_xcoder_instance_get_stream_info << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define QUERY_INSTANCE_SET_DW11_INSTANCE_END_OF_OUTPUT(dst, instance)   (dst = (((nvme_query_xcoder_instance_get_end_of_output << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define QUERY_INSTANCE_SET_DW11_INSTANCE_BUF_INFO(dst, rw_type, inst_type)   (dst = (((rw_type << 16) & 0xFFFF0000UL) | (inst_type & 0xFFFFUL)))
 
#define QUERY_INSTANCE_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define QUERY_GENERAL_SET_DW10_SUBTYPE(dst)   (dst = ( (nvme_query_xcoder_query_general & 0xFFFFUL)))
 
#define QUERY_GENERAL_SET_DW11_INSTANCE_STATUS(dst, instance)   (dst = (((nvme_query_xcoder_general_get_status << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_SESSION_SET_DW10_SESSION_ID(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_config_xcoder_config_session & 0xFFFFUL)))
 
#define CONFIG_SESSION_SET_DW11_SUBTYPE(dst, subtype)   (dst = (((0 << 16) & 0xFFFF0000UL) | (subtype & 0xFFFFUL)))
 
#define CONFIG_SESSION_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define CONFIG_INSTANCE_SET_DW10_SUBTYPE(dst, sid)   (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_config_xcoder_config_instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_SOS(dst, instance)   (dst = (((nvme_config_xcoder_config_set_sos << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_EOS(dst, instance)   (dst = (((nvme_config_xcoder_config_set_eos << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_ENC_PARAMS(dst, instance)   (dst = (((nvme_config_xcoder_config_set_enc_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_ENC_FRAME_PARAMS(dst, instance)   (dst = (((nvme_config_xcoder_config_set_enc_frame_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_FLUSH(dst, instance)   (dst = (((nvme_config_xcoder_config_flush << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW11_UPDATE_PARAMS(dst, instance)   (dst = (((nvme_config_xcoder_config_update_enc_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))
 
#define CONFIG_INSTANCE_SET_DW15_SIZE(dst, size)   (dst = (size & 0xFFFFFFFFUL))
 
#define NI_LOGAN_DATA_BUFFER_LEN   4096
 
#define LBA_BIT_OFFSET   12
 
#define NI_LOGAN_SUB_BIT_OFFSET   4
 
#define NI_LOGAN_OP_BIT_OFFSET   8
 
#define NI_LOGAN_INSTANCE_TYPE_OFFSET   18
 
#define NI_LOGAN_SESSION_ID_OFFSET   19
 
#define NI_LOGAN_HW_DESC_OFFSET   26
 
#define MBs(xMB)   ((xMB)*1024*1024)
 
#define MBs_to_4k(xMB)   ((xMB)*1024*1024/4096)
 
#define START_OFFSET_IN_4K   MBs_to_4k(512)
 
#define CTL_OFFSET_IN_4K(op, sub, subtype)
 
#define RD_OFFSET_IN_4K   (START_OFFSET_IN_4K + MBs_to_4k(128))
 
#define WR_OFFSET_IN_4K   (RD_OFFSET_IN_4K + MBs_to_4k(128))
 
#define HIGH_OFFSET_IN_4K(hw, sid, instance)   (((hw<<(NI_LOGAN_HW_DESC_OFFSET-NI_LOGAN_INSTANCE_TYPE_OFFSET))|((sid & 0x7FUL)<<1)|(instance))<<NI_LOGAN_INSTANCE_TYPE_OFFSET)
 
#define GAP(opcode)   ((opcode) - nvme_admin_cmd_xcoder_open)
 
#define WR_METADATA_OFFSET_IN_4K   (WR_OFFSET_IN_4K + MBs_to_4k(128) + MBs_to_4k(11))
 
#define WRITE_INSTANCE_W(hw, sid, instance)   HIGH_OFFSET_IN_4K(hw,sid,instance) + WR_OFFSET_IN_4K
 
#define WRITE_METADATA_W(hw, sid, instance)   HIGH_OFFSET_IN_4K(hw,sid, instance) + WR_METADATA_OFFSET_IN_4K
 
#define READ_INSTANCE_R(hw, sid, instance)   HIGH_OFFSET_IN_4K(hw,sid,instance) + RD_OFFSET_IN_4K
 
#define IDENTIFY_DEVICE_R   HIGH_OFFSET_IN_4K(0,0,0) + CTL_OFFSET_IN_4K(GAP(0xD7), 1, 0)
 
#define OPEN_GET_SID_R(hw, instance)
 
#define OPEN_SESSION_W(hw, sid, instance)
 
#define CLOSE_SESSION_R(sid, instance)
 
#define QUERY_SESSION_R(sid, instance)
 
#define QUERY_INSTANCE_STATUS_R(sid, instance)
 
#define QUERY_INSTANCE_CUR_STATUS_INFO_R(sid, instance)
 
#define QUERY_INSTANCE_STREAM_INFO_R(hw, sid, instance)
 
#define QUERY_INSTANCE_RBUFF_SIZE_R(hw, sid, instance)
 
#define QUERY_INSTANCE_WBUFF_SIZE_R(hw, sid, instance)
 
#define QUERY_INSTANCE_UPLOAD_ID_R(hw, sid, instance)
 
#define QUERY_INSTANCE_ACQUIRE_BUF(hw, sid, instance)
 
#define QUERY_GENERAL_GET_STATUS_R(instance)
 
#define QUERY_INSTANCE_DEBUG_INFO_R(sid, instance)
 
#define QUERY_INSTANCE_DEBUG_DATA_R(sid, instance)
 
#define CONFIG_INSTANCE_SetSOS_W(hw, sid, instance)
 
#define CONFIG_INSTANCE_SetEOS_W(sid, instance)
 
#define CONFIG_INSTANCE_SetFlush_W(sid, instance)
 
#define CONFIG_INSTANCE_SetEncPara_W(sid, instance)
 
#define CONFIG_INSTANCE_UpdateEncPara_W(sid, instance)
 
#define CONFIG_INSTANCE_SetPktSize_W(hw, sid, instance)
 
#define CONFIG_INSTANCE_InitFramePool_W(sid, instance)
 
#define CONFIG_INSTANCE_RecycleBuf_W(sid, instance)
 
#define CONFIG_INSTANCE_FrameIdx_W(sid, instance)
 
#define CONFIG_SESSION_KeepAlive_W(sid)
 
#define CONFIG_SESSION_KeepAliveTimeout_W(sid)
 
#define CONFIG_SESSION_Read_W(sid)
 
#define CONFIG_SESSION_Write_W(sid)
 

Typedefs

typedef struct _ni_logan_nvme_id_power_state ni_logan_nvme_id_power_state_t
 
typedef struct _ni_logan_nvme_identity ni_logan_nvme_identity_t
 
typedef enum _ni_logan_nvme_admin_opcode ni_logan_nvme_admin_opcode_t
 
typedef enum _nvme_open_xcoder_subtype nvme_open_xcoder_subtype_t
 
typedef enum _nvme_close_xcoder_subtype nvme_close_xcoder_subtype_t
 
typedef enum _nvme_read_xcoder_subtype nvme_read_xcoder_subtype_t
 
typedef enum _nvme_write_xcoder_subtype nvme_write_xcoder_subtype_t
 
typedef enum _nvme_query_xcoder_subtype nvme_query_xcoder_subtype_t
 
typedef enum _nvme_query_xcoder_session_subtype nvme_query_xcoder_session_subtype_t
 
typedef enum _nvme_query_xcoder_instance_subtype nvme_query_xcoder_instance_subtype_t
 
typedef enum _nvme_query_xcoder_general_subtype nvme_query_xcoder_general_subtype_t
 
typedef enum _nvme_config_xcoder_subtype nvme_config_xcoder_subtype_t
 
typedef enum _nvme_config_xcoder_config_session_subtype nvme_config_xcoder_config_session_subtype_t
 
typedef enum _nvme_config_xcoder_config_instance_subtype nvme_config_xcoder_config_instance_subtype_t
 
typedef struct _ni_logan_nvme_write_complete_dw0_t ni_logan_nvme_write_complete_dw0_t
 
typedef uint32_t ni_logan_nvme_result_t
 

Enumerations

enum  _ni_logan_nvme_admin_opcode {
  nvme_admin_cmd_delete_sq = 0x00 , nvme_admin_cmd_create_sq = 0x01 , nvme_admin_cmd_get_log_page = 0x02 , nvme_admin_cmd_delete_cq = 0x04 ,
  nvme_admin_cmd_create_cq = 0x05 , nvme_admin_cmd_identify = 0x06 , nvme_admin_cmd_abort_cmd = 0x08 , nvme_admin_cmd_set_features = 0x09 ,
  nvme_admin_cmd_get_features = 0x0a , nvme_admin_cmd_async_event = 0x0c , nvme_admin_cmd_ns_mgmt = 0x0d , nvme_admin_cmd_activate_fw = 0x10 ,
  nvme_admin_cmd_download_fw = 0x11 , nvme_admin_cmd_ns_attach = 0x15 , nvme_admin_cmd_format_nvm = 0x80 , nvme_admin_cmd_security_send = 0x81 ,
  nvme_admin_cmd_security_recv = 0x82 , nvme_admin_cmd_xcoder_open = 0xD0 , nvme_admin_cmd_xcoder_close = 0xD1 , nvme_admin_cmd_xcoder_query = 0xD2 ,
  nvme_admin_cmd_xcoder_connect = 0xD3 , nvme_admin_cmd_xcoder_read = 0xD4 , nvme_admin_cmd_xcoder_write = 0xD5 , nvme_admin_cmd_xcoder_config = 0xD6 ,
  nvme_admin_cmd_xcoder_identity = 0xD7
}
 
enum  _nvme_open_xcoder_subtype { nvme_open_xcoder_create_session = 0x0000 }
 
enum  _nvme_close_xcoder_subtype { nvme_close_xcoder_destroy_session = 0x0000 }
 
enum  _nvme_read_xcoder_subtype { nvme_read_xcoder_read_instance = 0x0001 }
 
enum  _nvme_write_xcoder_subtype { nvme_write_xcoder_write_instance = 0x0001 }
 
enum  _nvme_query_xcoder_subtype { nvme_query_xcoder_query_session = 0x0000 , nvme_query_xcoder_query_instance = 0x0001 , nvme_query_xcoder_query_general = 0x0002 }
 
enum  _nvme_query_xcoder_session_subtype { nvme_query_xcoder_session = 0x0001 }
 
enum  _nvme_query_xcoder_instance_subtype {
  nvme_query_xcoder_instance_get_status = 0x0002 , nvme_query_xcoder_instance_get_current_status = 0x0003 , nvme_query_xcoder_instance_get_stream_info = 0x0004 , nvme_query_xcoder_instance_read_buf_size = 0x0006 ,
  nvme_query_xcoder_instance_write_buf_size = 0x0007 , nvme_query_xcoder_instance_upload_idx = 0x0008 , nvme_query_xcoder_instance_acquire_buf = 0x000f , nvme_query_xcoder_config_get_sub_inst_debug_info = 0x000d ,
  nvme_query_xcoder_config_get_sub_inst_debug_data = 0x000e
}
 
enum  _nvme_query_xcoder_general_subtype { nvme_query_xcoder_general_get_status = 0x0002 }
 
enum  _nvme_config_xcoder_subtype { nvme_config_xcoder_config_session = 0x0000 , nvme_config_xcoder_config_instance = 0x0001 }
 
enum  _nvme_config_xcoder_config_session_subtype { nvme_config_xcoder_config_session_keep_alive = 0x0000 , nvme_config_xcoder_config_session_keep_alive_timeout = 0x0001 , nvme_config_xcoder_config_session_read = 0x0002 , nvme_config_xcoder_config_session_write = 0x0003 }
 
enum  _nvme_config_xcoder_config_instance_subtype {
  nvme_config_xcoder_config_set_sos = 0x0000 , nvme_config_xcoder_config_set_eos = 0x0001 , nvme_config_xcoder_config_set_enc_params = 0x0005 , nvme_config_xcoder_config_set_dec_packet_size = 0x0009 ,
  nvme_config_xcoder_config_init_buf_params = 0x000a , nvme_config_xcoder_config_recycle_buf_params = 0x000b , nvme_config_xcoder_config_read_frame_idx = 0x000c , nvme_config_xcoder_config_set_flush = 0x000d
}
 

Functions

ni_logan_retcode_t ni_logan_nvme_check_error_code (int rc, ni_logan_nvme_admin_opcode_t opcode, uint32_t xcoder_type, uint32_t hw_id, int32_t *inst_id)
 Check f/w error return code, and if it's a fatal one return NI_LOGAN_RETCODE_FAILURE. Application shall handle this gracefully. More...
 
int ni_logan_nvme_enumerate_devices (char ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN], int max_handles)
 prints a report on detected nvme devices More...
 
int32_t ni_logan_nvme_send_read_cmd (ni_device_handle_t handle, ni_event_handle_t event_handle, void *p_data, uint32_t data_len, uint32_t lba)
 Compose a io read command. More...
 
int32_t ni_logan_nvme_send_write_cmd (ni_device_handle_t handle, ni_event_handle_t event_handle, void *p_data, uint32_t data_len, uint32_t lba)
 Compose a io write command. More...
 

Detailed Description

Definitions related to working with NI T-408 over NVME interface.


Definition in file ni_nvme_logan.h.

Macro Definition Documentation

◆ CLOSE_SESSION_R

#define CLOSE_SESSION_R (   sid,
  instance 
)
Value:
#define CTL_OFFSET_IN_4K(op, sub, subtype)
#define GAP(opcode)
@ nvme_admin_cmd_xcoder_close
#define HIGH_OFFSET_IN_4K(hw, sid, instance)
@ nvme_close_xcoder_destroy_session

Definition at line 590 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_FrameIdx_W

#define CONFIG_INSTANCE_FrameIdx_W (   sid,
  instance 
)
Value:

Definition at line 635 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_InitFramePool_W

#define CONFIG_INSTANCE_InitFramePool_W (   sid,
  instance 
)

◆ CONFIG_INSTANCE_RecycleBuf_W

#define CONFIG_INSTANCE_RecycleBuf_W (   sid,
  instance 
)

◆ CONFIG_INSTANCE_SET_DW10_SUBTYPE

#define CONFIG_INSTANCE_SET_DW10_SUBTYPE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_config_xcoder_config_instance & 0xFFFFUL)))

Definition at line 490 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_ENC_FRAME_PARAMS

#define CONFIG_INSTANCE_SET_DW11_ENC_FRAME_PARAMS (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_set_enc_frame_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 494 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_ENC_PARAMS

#define CONFIG_INSTANCE_SET_DW11_ENC_PARAMS (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_set_enc_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 493 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_EOS

#define CONFIG_INSTANCE_SET_DW11_EOS (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_set_eos << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 492 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_FLUSH

#define CONFIG_INSTANCE_SET_DW11_FLUSH (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_flush << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 495 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_SOS

#define CONFIG_INSTANCE_SET_DW11_SOS (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_set_sos << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 491 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW11_UPDATE_PARAMS

#define CONFIG_INSTANCE_SET_DW11_UPDATE_PARAMS (   dst,
  instance 
)    (dst = (((nvme_config_xcoder_config_update_enc_params << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 496 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SET_DW15_SIZE

#define CONFIG_INSTANCE_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 497 of file ni_nvme_logan.h.

◆ CONFIG_INSTANCE_SetEncPara_W

#define CONFIG_INSTANCE_SetEncPara_W (   sid,
  instance 
)

◆ CONFIG_INSTANCE_SetEOS_W

#define CONFIG_INSTANCE_SetEOS_W (   sid,
  instance 
)

◆ CONFIG_INSTANCE_SetFlush_W

#define CONFIG_INSTANCE_SetFlush_W (   sid,
  instance 
)

◆ CONFIG_INSTANCE_SetPktSize_W

#define CONFIG_INSTANCE_SetPktSize_W (   hw,
  sid,
  instance 
)

◆ CONFIG_INSTANCE_SetSOS_W

#define CONFIG_INSTANCE_SetSOS_W (   hw,
  sid,
  instance 
)

◆ CONFIG_INSTANCE_UpdateEncPara_W

#define CONFIG_INSTANCE_UpdateEncPara_W (   sid,
  instance 
)
Value:
nvme_config_xcoder_config_instance,nvme_config_xcoder_config_update_enc_params)

Definition at line 627 of file ni_nvme_logan.h.

◆ CONFIG_SESSION_KeepAlive_W

#define CONFIG_SESSION_KeepAlive_W (   sid)

◆ CONFIG_SESSION_KeepAliveTimeout_W

#define CONFIG_SESSION_KeepAliveTimeout_W (   sid)

◆ CONFIG_SESSION_Read_W

#define CONFIG_SESSION_Read_W (   sid)

◆ CONFIG_SESSION_SET_DW10_SESSION_ID

#define CONFIG_SESSION_SET_DW10_SESSION_ID (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_config_xcoder_config_session & 0xFFFFUL)))

Definition at line 485 of file ni_nvme_logan.h.

◆ CONFIG_SESSION_SET_DW11_SUBTYPE

#define CONFIG_SESSION_SET_DW11_SUBTYPE (   dst,
  subtype 
)    (dst = (((0 << 16) & 0xFFFF0000UL) | (subtype & 0xFFFFUL)))

Definition at line 486 of file ni_nvme_logan.h.

◆ CONFIG_SESSION_SET_DW15_SIZE

#define CONFIG_SESSION_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 487 of file ni_nvme_logan.h.

◆ CONFIG_SESSION_Write_W

#define CONFIG_SESSION_Write_W (   sid)

◆ CREATE_SESSION_SET_DW10_SUBTYPE

#define CREATE_SESSION_SET_DW10_SUBTYPE (   dst)    (dst = (nvme_open_xcoder_create_session & 0xFFFFUL))

Definition at line 447 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW11_INSTANCE

#define CREATE_SESSION_SET_DW11_INSTANCE (   dst,
  instance 
)    (dst = (instance & 0xFFFFUL))

Definition at line 448 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW12_DEC_CID

#define CREATE_SESSION_SET_DW12_DEC_CID (   dst,
  cid 
)    (dst = (cid & 0xFFFFUL))

Definition at line 449 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW12_ENC_CID_FRWIDTH

#define CREATE_SESSION_SET_DW12_ENC_CID_FRWIDTH (   dst,
  cid,
  width 
)    (dst = (((width << 16) & 0xFFFF0000UL) | (cid & 0xFFFFUL)))

Definition at line 451 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW13_ENC_FRHIGHT

#define CREATE_SESSION_SET_DW13_ENC_FRHIGHT (   dst,
  hight 
)    (dst = (hight & 0xFFFFUL))

Definition at line 452 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW14_MODEL_LOAD

#define CREATE_SESSION_SET_DW14_MODEL_LOAD (   dst,
  load 
)    (dst = (load & 0xFFFFFFFFUL))

Definition at line 453 of file ni_nvme_logan.h.

◆ CREATE_SESSION_SET_DW15_SIZE

#define CREATE_SESSION_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 454 of file ni_nvme_logan.h.

◆ CTL_OFFSET_IN_4K

#define CTL_OFFSET_IN_4K (   op,
  sub,
  subtype 
)
Value:
((sub)<<NI_LOGAN_SUB_BIT_OFFSET)+subtype))
#define NI_LOGAN_SUB_BIT_OFFSET
#define START_OFFSET_IN_4K
#define NI_LOGAN_OP_BIT_OFFSET

Definition at line 561 of file ni_nvme_logan.h.

◆ DESTROY_SESSION_SET_DW10_INSTANCE

#define DESTROY_SESSION_SET_DW10_INSTANCE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_close_xcoder_destroy_session & 0xFFFFUL)))

Definition at line 456 of file ni_nvme_logan.h.

◆ GAP

#define GAP (   opcode)    ((opcode) - nvme_admin_cmd_xcoder_open)

Definition at line 566 of file ni_nvme_logan.h.

◆ HIGH_OFFSET_IN_4K

#define HIGH_OFFSET_IN_4K (   hw,
  sid,
  instance 
)    (((hw<<(NI_LOGAN_HW_DESC_OFFSET-NI_LOGAN_INSTANCE_TYPE_OFFSET))|((sid & 0x7FUL)<<1)|(instance))<<NI_LOGAN_INSTANCE_TYPE_OFFSET)

Definition at line 565 of file ni_nvme_logan.h.

◆ IDENTIFY_DEVICE_R

#define IDENTIFY_DEVICE_R   HIGH_OFFSET_IN_4K(0,0,0) + CTL_OFFSET_IN_4K(GAP(0xD7), 1, 0)

Definition at line 581 of file ni_nvme_logan.h.

◆ LBA_BIT_OFFSET

#define LBA_BIT_OFFSET   12

Definition at line 547 of file ni_nvme_logan.h.

◆ MBs

#define MBs (   xMB)    ((xMB)*1024*1024)

Definition at line 556 of file ni_nvme_logan.h.

◆ MBs_to_4k

#define MBs_to_4k (   xMB)    ((xMB)*1024*1024/4096)

Definition at line 557 of file ni_nvme_logan.h.

◆ NI_LOGAN_DATA_BUFFER_LEN

#define NI_LOGAN_DATA_BUFFER_LEN   4096

Definition at line 546 of file ni_nvme_logan.h.

◆ NI_LOGAN_HW_DESC_OFFSET

#define NI_LOGAN_HW_DESC_OFFSET   26

Definition at line 554 of file ni_nvme_logan.h.

◆ NI_LOGAN_INSTANCE_TYPE_OFFSET

#define NI_LOGAN_INSTANCE_TYPE_OFFSET   18

Definition at line 552 of file ni_nvme_logan.h.

◆ NI_LOGAN_NO_CHECK_TS_NVME_CMD_OP

#define NI_LOGAN_NO_CHECK_TS_NVME_CMD_OP   (-1)

Definition at line 260 of file ni_nvme_logan.h.

◆ NI_LOGAN_NVME_IDENTITY_CMD_DATA_SZ

#define NI_LOGAN_NVME_IDENTITY_CMD_DATA_SZ   4096

Definition at line 42 of file ni_nvme_logan.h.

◆ NI_LOGAN_OP_BIT_OFFSET

#define NI_LOGAN_OP_BIT_OFFSET   8

Definition at line 551 of file ni_nvme_logan.h.

◆ NI_LOGAN_SESSION_ID_OFFSET

#define NI_LOGAN_SESSION_ID_OFFSET   19

Definition at line 553 of file ni_nvme_logan.h.

◆ NI_LOGAN_SUB_BIT_OFFSET

#define NI_LOGAN_SUB_BIT_OFFSET   4

Definition at line 550 of file ni_nvme_logan.h.

◆ OPEN_GET_SID_R

#define OPEN_GET_SID_R (   hw,
  instance 
)
Value:

Definition at line 584 of file ni_nvme_logan.h.

◆ OPEN_SESSION_W

#define OPEN_SESSION_W (   hw,
  sid,
  instance 
)

◆ QUERY_GENERAL_GET_STATUS_R

#define QUERY_GENERAL_GET_STATUS_R (   instance)
Value:

Definition at line 610 of file ni_nvme_logan.h.

◆ QUERY_GENERAL_SET_DW10_SUBTYPE

#define QUERY_GENERAL_SET_DW10_SUBTYPE (   dst)    (dst = ( (nvme_query_xcoder_query_general & 0xFFFFUL)))

Definition at line 483 of file ni_nvme_logan.h.

◆ QUERY_GENERAL_SET_DW11_INSTANCE_STATUS

#define QUERY_GENERAL_SET_DW11_INSTANCE_STATUS (   dst,
  instance 
)    (dst = (((nvme_query_xcoder_general_get_status << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 484 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_ACQUIRE_BUF

#define QUERY_INSTANCE_ACQUIRE_BUF (   hw,
  sid,
  instance 
)

◆ QUERY_INSTANCE_CUR_STATUS_INFO_R

#define QUERY_INSTANCE_CUR_STATUS_INFO_R (   sid,
  instance 
)

◆ QUERY_INSTANCE_DEBUG_DATA_R

#define QUERY_INSTANCE_DEBUG_DATA_R (   sid,
  instance 
)

◆ QUERY_INSTANCE_DEBUG_INFO_R

#define QUERY_INSTANCE_DEBUG_INFO_R (   sid,
  instance 
)

◆ QUERY_INSTANCE_RBUFF_SIZE_R

#define QUERY_INSTANCE_RBUFF_SIZE_R (   hw,
  sid,
  instance 
)

◆ QUERY_INSTANCE_SET_DW10_SUBTYPE

#define QUERY_INSTANCE_SET_DW10_SUBTYPE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_query_xcoder_query_instance & 0xFFFFUL)))

Definition at line 474 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_SET_DW11_INSTANCE_BUF_INFO

#define QUERY_INSTANCE_SET_DW11_INSTANCE_BUF_INFO (   dst,
  rw_type,
  inst_type 
)    (dst = (((rw_type << 16) & 0xFFFF0000UL) | (inst_type & 0xFFFFUL)))

Definition at line 479 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_SET_DW11_INSTANCE_END_OF_OUTPUT

#define QUERY_INSTANCE_SET_DW11_INSTANCE_END_OF_OUTPUT (   dst,
  instance 
)    (dst = (((nvme_query_xcoder_instance_get_end_of_output << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 477 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_SET_DW11_INSTANCE_STATUS

#define QUERY_INSTANCE_SET_DW11_INSTANCE_STATUS (   dst,
  instance 
)    (dst = (((nvme_query_xcoder_instance_get_status << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 475 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_SET_DW11_INSTANCE_STREAM_INFO

#define QUERY_INSTANCE_SET_DW11_INSTANCE_STREAM_INFO (   dst,
  instance 
)    (dst = (((nvme_query_xcoder_instance_get_stream_info << 16) & 0xFFFF0000UL) | (instance & 0xFFFFUL)))

Definition at line 476 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_SET_DW15_SIZE

#define QUERY_INSTANCE_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 481 of file ni_nvme_logan.h.

◆ QUERY_INSTANCE_STATUS_R

#define QUERY_INSTANCE_STATUS_R (   sid,
  instance 
)

◆ QUERY_INSTANCE_STREAM_INFO_R

#define QUERY_INSTANCE_STREAM_INFO_R (   hw,
  sid,
  instance 
)

◆ QUERY_INSTANCE_UPLOAD_ID_R

#define QUERY_INSTANCE_UPLOAD_ID_R (   hw,
  sid,
  instance 
)

◆ QUERY_INSTANCE_WBUFF_SIZE_R

#define QUERY_INSTANCE_WBUFF_SIZE_R (   hw,
  sid,
  instance 
)

◆ QUERY_SESSION_R

#define QUERY_SESSION_R (   sid,
  instance 
)
Value:

Definition at line 594 of file ni_nvme_logan.h.

◆ QUERY_SESSION_SET_DW10_SUBTYPE

#define QUERY_SESSION_SET_DW10_SUBTYPE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_query_xcoder_query_session & 0xFFFFUL)))

Definition at line 470 of file ni_nvme_logan.h.

◆ QUERY_SESSION_SET_DW11_INSTANCE

#define QUERY_SESSION_SET_DW11_INSTANCE (   dst,
  instance 
)    (dst = (instance & 0xFFFFUL))

Definition at line 471 of file ni_nvme_logan.h.

◆ QUERY_SESSION_SET_DW15_SIZE

#define QUERY_SESSION_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 472 of file ni_nvme_logan.h.

◆ RD_OFFSET_IN_4K

#define RD_OFFSET_IN_4K   (START_OFFSET_IN_4K + MBs_to_4k(128))

Definition at line 563 of file ni_nvme_logan.h.

◆ READ_INSTANCE_R

#define READ_INSTANCE_R (   hw,
  sid,
  instance 
)    HIGH_OFFSET_IN_4K(hw,sid,instance) + RD_OFFSET_IN_4K

Definition at line 577 of file ni_nvme_logan.h.

◆ READ_INSTANCE_SET_DW10_SUBTYPE

#define READ_INSTANCE_SET_DW10_SUBTYPE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_write_xcoder_write_instance & 0xFFFFUL)))

Definition at line 458 of file ni_nvme_logan.h.

◆ READ_INSTANCE_SET_DW11_INSTANCE

#define READ_INSTANCE_SET_DW11_INSTANCE (   dst,
  instance 
)    (dst = (instance & 0xFFFFUL))

Definition at line 459 of file ni_nvme_logan.h.

◆ READ_INSTANCE_SET_DW15_SIZE

#define READ_INSTANCE_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 460 of file ni_nvme_logan.h.

◆ START_OFFSET_IN_4K

#define START_OFFSET_IN_4K   MBs_to_4k(512)

Definition at line 559 of file ni_nvme_logan.h.

◆ WR_METADATA_OFFSET_IN_4K

#define WR_METADATA_OFFSET_IN_4K   (WR_OFFSET_IN_4K + MBs_to_4k(128) + MBs_to_4k(11))

Definition at line 567 of file ni_nvme_logan.h.

◆ WR_OFFSET_IN_4K

#define WR_OFFSET_IN_4K   (RD_OFFSET_IN_4K + MBs_to_4k(128))

Definition at line 564 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW10_SUBTYPE

#define WRITE_INSTANCE_SET_DW10_SUBTYPE (   dst,
  sid 
)    (dst = (((sid << 16) & 0xFFFF0000UL) | (nvme_write_xcoder_write_instance & 0xFFFFUL)))

Definition at line 462 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW11_INSTANCE

#define WRITE_INSTANCE_SET_DW11_INSTANCE (   dst,
  instance 
)    (dst = (instance & 0xFFFFUL))

Definition at line 463 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW11_PAGEOFFSET

#define WRITE_INSTANCE_SET_DW11_PAGEOFFSET (   dst,
  pageoffset 
)    (dst = (((pageoffset << 16) | dst)))

Definition at line 464 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW12_FRAMEINSTID

#define WRITE_INSTANCE_SET_DW12_FRAMEINSTID (   dst,
  fid 
)    (dst = (0xFFFFUL & dst) | ((fid<<16) & 0xFFFF0000UL))

Definition at line 466 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW12_ISHWDESC

#define WRITE_INSTANCE_SET_DW12_ISHWDESC (   dst,
  ishwdesc 
)    (dst = (ishwdesc & 0xFFFFUL))

Definition at line 465 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW14_YUV_BYTEOFFSET

#define WRITE_INSTANCE_SET_DW14_YUV_BYTEOFFSET (   dst,
  byteoffset 
)    (dst = (byteoffset & 0xFFFFFFFFUL))

Definition at line 467 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW15_SIZE

#define WRITE_INSTANCE_SET_DW15_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 468 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW2_SUBFRAME_IDX

#define WRITE_INSTANCE_SET_DW2_SUBFRAME_IDX (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 444 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_SET_DW3_SUBFRAME_SIZE

#define WRITE_INSTANCE_SET_DW3_SUBFRAME_SIZE (   dst,
  size 
)    (dst = (size & 0xFFFFFFFFUL))

Definition at line 445 of file ni_nvme_logan.h.

◆ WRITE_INSTANCE_W

#define WRITE_INSTANCE_W (   hw,
  sid,
  instance 
)    HIGH_OFFSET_IN_4K(hw,sid,instance) + WR_OFFSET_IN_4K

Definition at line 571 of file ni_nvme_logan.h.

◆ WRITE_METADATA_W

#define WRITE_METADATA_W (   hw,
  sid,
  instance 
)    HIGH_OFFSET_IN_4K(hw,sid, instance) + WR_METADATA_OFFSET_IN_4K

Definition at line 574 of file ni_nvme_logan.h.

Typedef Documentation

◆ ni_logan_nvme_admin_opcode_t

◆ ni_logan_nvme_id_power_state_t

◆ ni_logan_nvme_identity_t

◆ ni_logan_nvme_result_t

typedef uint32_t ni_logan_nvme_result_t

Definition at line 377 of file ni_nvme_logan.h.

◆ ni_logan_nvme_write_complete_dw0_t

◆ nvme_close_xcoder_subtype_t

◆ nvme_config_xcoder_config_instance_subtype_t

◆ nvme_config_xcoder_config_session_subtype_t

◆ nvme_config_xcoder_subtype_t

◆ nvme_open_xcoder_subtype_t

◆ nvme_query_xcoder_general_subtype_t

◆ nvme_query_xcoder_instance_subtype_t

◆ nvme_query_xcoder_session_subtype_t

◆ nvme_query_xcoder_subtype_t

◆ nvme_read_xcoder_subtype_t

◆ nvme_write_xcoder_subtype_t

Enumeration Type Documentation

◆ _ni_logan_nvme_admin_opcode

Enumerator
nvme_admin_cmd_delete_sq 
nvme_admin_cmd_create_sq 
nvme_admin_cmd_get_log_page 
nvme_admin_cmd_delete_cq 
nvme_admin_cmd_create_cq 
nvme_admin_cmd_identify 
nvme_admin_cmd_abort_cmd 
nvme_admin_cmd_set_features 
nvme_admin_cmd_get_features 
nvme_admin_cmd_async_event 
nvme_admin_cmd_ns_mgmt 
nvme_admin_cmd_activate_fw 
nvme_admin_cmd_download_fw 
nvme_admin_cmd_ns_attach 
nvme_admin_cmd_format_nvm 
nvme_admin_cmd_security_send 
nvme_admin_cmd_security_recv 
nvme_admin_cmd_xcoder_open 
nvme_admin_cmd_xcoder_close 
nvme_admin_cmd_xcoder_query 
nvme_admin_cmd_xcoder_connect 
nvme_admin_cmd_xcoder_read 
nvme_admin_cmd_xcoder_write 
nvme_admin_cmd_xcoder_config 
nvme_admin_cmd_xcoder_identity 

Definition at line 262 of file ni_nvme_logan.h.

◆ _nvme_close_xcoder_subtype

Enumerator
nvme_close_xcoder_destroy_session 

Definition at line 297 of file ni_nvme_logan.h.

◆ _nvme_config_xcoder_config_instance_subtype

Enumerator
nvme_config_xcoder_config_set_sos 
nvme_config_xcoder_config_set_eos 
nvme_config_xcoder_config_set_enc_params 
nvme_config_xcoder_config_set_dec_packet_size 
nvme_config_xcoder_config_init_buf_params 
nvme_config_xcoder_config_recycle_buf_params 
nvme_config_xcoder_config_read_frame_idx 
nvme_config_xcoder_config_set_flush 

Definition at line 356 of file ni_nvme_logan.h.

◆ _nvme_config_xcoder_config_session_subtype

Enumerator
nvme_config_xcoder_config_session_keep_alive 
nvme_config_xcoder_config_session_keep_alive_timeout 
nvme_config_xcoder_config_session_read 
nvme_config_xcoder_config_session_write 

Definition at line 348 of file ni_nvme_logan.h.

◆ _nvme_config_xcoder_subtype

Enumerator
nvme_config_xcoder_config_session 
nvme_config_xcoder_config_instance 

Definition at line 342 of file ni_nvme_logan.h.

◆ _nvme_open_xcoder_subtype

Enumerator
nvme_open_xcoder_create_session 

Definition at line 292 of file ni_nvme_logan.h.

◆ _nvme_query_xcoder_general_subtype

Enumerator
nvme_query_xcoder_general_get_status 

Definition at line 337 of file ni_nvme_logan.h.

◆ _nvme_query_xcoder_instance_subtype

Enumerator
nvme_query_xcoder_instance_get_status 
nvme_query_xcoder_instance_get_current_status 
nvme_query_xcoder_instance_get_stream_info 
nvme_query_xcoder_instance_read_buf_size 
nvme_query_xcoder_instance_write_buf_size 
nvme_query_xcoder_instance_upload_idx 
nvme_query_xcoder_instance_acquire_buf 
nvme_query_xcoder_config_get_sub_inst_debug_info 
nvme_query_xcoder_config_get_sub_inst_debug_data 

Definition at line 324 of file ni_nvme_logan.h.

◆ _nvme_query_xcoder_session_subtype

Enumerator
nvme_query_xcoder_session 

Definition at line 319 of file ni_nvme_logan.h.

◆ _nvme_query_xcoder_subtype

Enumerator
nvme_query_xcoder_query_session 
nvme_query_xcoder_query_instance 
nvme_query_xcoder_query_general 

Definition at line 312 of file ni_nvme_logan.h.

◆ _nvme_read_xcoder_subtype

Enumerator
nvme_read_xcoder_read_instance 

Definition at line 302 of file ni_nvme_logan.h.

◆ _nvme_write_xcoder_subtype

Enumerator
nvme_write_xcoder_write_instance 

Definition at line 307 of file ni_nvme_logan.h.

Function Documentation

◆ ni_logan_nvme_check_error_code()

ni_logan_retcode_t ni_logan_nvme_check_error_code ( int  rc,
ni_logan_nvme_admin_opcode_t  opcode,
uint32_t  xcoder_type,
uint32_t  hw_id,
int32_t *  p_instance_id 
)

Check f/w error return code, and if it's a fatal one return NI_LOGAN_RETCODE_FAILURE. Application shall handle this gracefully.


Parameters

Definition at line 55 of file ni_nvme_logan.c.

◆ ni_logan_nvme_enumerate_devices()

int ni_logan_nvme_enumerate_devices ( char  ni_logan_devices[][NI_LOGAN_MAX_DEVICE_NAME_LEN],
int  max_handles 
)

prints a report on detected nvme devices


Parameters

◆ ni_logan_nvme_send_read_cmd()

int32_t ni_logan_nvme_send_read_cmd ( ni_device_handle_t  handle,
ni_event_handle_t  event_handle,
void *  p_data,
uint32_t  data_len,
uint32_t  lba 
)

Compose a io read command.


Parameters

Definition at line 382 of file ni_nvme_logan.c.

◆ ni_logan_nvme_send_write_cmd()

int32_t ni_logan_nvme_send_write_cmd ( ni_device_handle_t  handle,
ni_event_handle_t  event_handle,
void *  p_data,
uint32_t  data_len,
uint32_t  lba 
)

Compose a io write command.


Parameters

Definition at line 454 of file ni_nvme_logan.c.