libxcoder  5.2.0
ni_nvme.c File Reference

Private definitions for interfacing with NETINT video processing devices over NVMe. More...

#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include "ni_nvme.h"
#include "ni_util.h"

Go to the source code of this file.

Macros

#define ROUND_TO_ULONG(x)   ni_round_up(x,sizeof(uint32_t))
 

Functions

ni_retcode_t ni_nvme_check_error_code (int rc, int opcode, uint32_t xcoder_type, uint32_t hw_id, uint32_t *p_instance_id)
 Check f/w error return code, and if it's a fatal one, terminate application's decoding/encoding processing by sending self a SIGTERM signal. Application shall handle this gracefully. More...
 
int32_t ni_nvme_send_admin_cmd (ni_nvme_admin_opcode_t opcode, ni_device_handle_t handle, ni_nvme_command_t *p_ni_nvme_cmd, uint32_t data_len, void *p_data, uint32_t *p_result)
 Compose a nvme admin command. More...
 
int32_t ni_nvme_send_io_cmd (ni_nvme_opcode_t opcode, ni_device_handle_t handle, ni_nvme_command_t *p_ni_nvme_cmd, uint32_t data_len, void *p_data, uint32_t *p_result)
 Compose a nvme io command. More...
 
void ni_parse_lba (uint64_t lba)
 parse the lba opcode, subtype, option It's called only if a I/O read/write fails, so just use the print level "NI_LOG_ERROR" now. More...
 
int32_t ni_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 an io read command. More...
 
int32_t ni_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

Private definitions for interfacing with NETINT video processing devices over NVMe.


Definition in file ni_nvme.c.

Macro Definition Documentation

◆ ROUND_TO_ULONG

#define ROUND_TO_ULONG (   x)    ni_round_up(x,sizeof(uint32_t))

Definition at line 51 of file ni_nvme.c.

Function Documentation

◆ ni_nvme_check_error_code()

ni_retcode_t ni_nvme_check_error_code ( int  rc,
int  opcode,
uint32_t  xcoder_type,
uint32_t  hw_id,
uint32_t *  p_instance_id 
)

Check f/w error return code, and if it's a fatal one, terminate application's decoding/encoding processing by sending self a SIGTERM signal. Application shall handle this gracefully.


Parameters

Definition at line 62 of file ni_nvme.c.

◆ ni_nvme_send_admin_cmd()

int32_t ni_nvme_send_admin_cmd ( ni_nvme_admin_opcode_t  opcode,
ni_device_handle_t  handle,
ni_nvme_command_t p_ni_nvme_cmd,
uint32_t  data_len,
void *  p_data,
uint32_t *  p_result 
)

Compose a nvme admin command.


Parameters

Definition at line 324 of file ni_nvme.c.

◆ ni_nvme_send_io_cmd()

int32_t ni_nvme_send_io_cmd ( ni_nvme_opcode_t  opcode,
ni_device_handle_t  handle,
ni_nvme_command_t p_ni_nvme_cmd,
uint32_t  data_len,
void *  p_data,
uint32_t *  p_result 
)

Compose a nvme io command.


Parameters

Definition at line 371 of file ni_nvme.c.

◆ ni_nvme_send_read_cmd()

int32_t ni_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 an io read command.


Parameters

Definition at line 528 of file ni_nvme.c.

◆ ni_nvme_send_write_cmd()

int32_t ni_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 634 of file ni_nvme.c.

◆ ni_parse_lba()

void ni_parse_lba ( uint64_t  lba)

parse the lba opcode, subtype, option It's called only if a I/O read/write fails, so just use the print level "NI_LOG_ERROR" now.


Parameters
lbais 4k aligned
Returns

Definition at line 461 of file ni_nvme.c.