NVIDIA DRIVE OS Linux API Reference5.1.0.2 Release |
Declares the APIs for Quickboot device driver framework.
Data Structures | |
struct | QbDev |
struct | QbDevOperations |
Holds callbacks for device drivers. More... | |
Macros | |
#define | QB_MAX_DEV_INSTANCE 16 |
#define | QB_MAX_DRIVER_TYPES 100 |
Enumerations | |
enum | QbDeviceStatus { QbDeviceStatus_None = 0, QbDeviceStatus_Idle, QbDeviceStatus_ReadInProgress, QbDeviceStatus_ReadFailure, QbDeviceStatus_WriteInProgress, QbDeviceStatus_WriteFailure, QbDeviceStatus_EccFailure, QbDeviceStatus_CorrectedEccFailure, QbDeviceStatus_DataCrcFailure, QbDeviceStatus_DataTimeout, QbDeviceStatus_DataEndBitError, QbDeviceStatus_CorrectedReadFailure, QbDeviceStatus_UnknownFailure, QbDeviceStatus_Max, QbDeviceStatus_Force32 = 0x7fffffff } |
Defines the current status of a transfer request. More... | |
Functions | |
NvError | QbDeviceRead (QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset) |
Performs a read operation for the device and instance passed as parameter. More... | |
NvError | QbDevicePartRead (NvU32 PartitionId, void *Buffer, NvU64 Size, NvU64 Offset) |
Performs a read operation on the partition passed as parameter. More... | |
NvError | QbDeviceWrite (QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset) |
Performs a write operation on the device passed as parameter. More... | |
NvError | QbDevicePartWrite (NvU32 PartitionId, void *Buffer, NvU64 Size, NvU64 Offset) |
Performs a write operation for partition passed as parameter. More... | |
NvError | QbDeviceIoctl (QbDriver DriverType, NvU32 Instance, NvU32 Cmd, void *Buffer) |
Performs a ioctl operation on given driver. More... | |
NvError | QbCleanExit (QbDriver DriverType, NvU32 Instance) |
Function to trigger clean exit of driver when it's not longer used. More... | |
NvError | QbRegisterDriver (QbDriver Driver, struct QbDevOperations *pDevOps) |
Registers a driver to the device driver framework. More... | |
NvError | QbRegisterDevice (struct QbDev *pDevice) |
Registers a device to the device driver framework. More... | |
NvError | QbLateRegisterDevice (QbDriver DriverType, NvU32 Instance) |
Board Call back to trigger registration and intialization of driver. More... | |
NvBool | QbIsDeviceRegistered (QbDriver DriverType, NvU32 Instance) |
Function to check if Device is registered already in the driver framework. More... | |
enum QbDeviceStatus |
Defines the current status of a transfer request.
NvError QbCleanExit | ( | QbDriver | DriverType, |
NvU32 | Instance | ||
) |
Function to trigger clean exit of driver when it's not longer used.
This serves as a cleanup function, so that controller is passed to OS in a clean state.
DriverType | Driver type as defined in the QbDriver enumeration. |
Instance | Device instance for which to perform the cleanup. |
NvSuccess | if successful, or the appropriate error code. |
NvError QbDeviceIoctl | ( | QbDriver | DriverType, |
NvU32 | Instance, | ||
NvU32 | Cmd, | ||
void * | Buffer | ||
) |
Performs a ioctl operation on given driver.
Perform IOCTL Cmd on the given driver. Cmd will be driver specific and the buffer as well will be driver specific
DriverType | Driver type as defined in the QbDriver enumeration. |
Instance | Device instance for which to perform the write. |
Cmd | Command which need to be perform by the driver |
Buffer | A pointer to a buffer location containing structure for corresponding command |
NvSuccess | if successful, or the appropriate error code. |
NvError QbDevicePartRead | ( | NvU32 | PartitionId, |
void * | Buffer, | ||
NvU64 | Size, | ||
NvU64 | Offset | ||
) |
Performs a read operation on the partition passed as parameter.
This function is applicable for storage devices only and it must have a partition on it. (Partitions are created while flashing.) Internally, QbDevicePartRead
translates the PartitionId into a device ID and device instance and adjusts the offset with the start of the device.
PartitionId | Partition ID in the partition table |
Buffer | A pointer to the buffer location in memory. |
Size | Size of the data to be read. |
Offset | Offset from the start of the partition. |
NvError QbDevicePartWrite | ( | NvU32 | PartitionId, |
void * | Buffer, | ||
NvU64 | Size, | ||
NvU64 | Offset | ||
) |
Performs a write operation for partition passed as parameter.
Use this function for storage devices only, where the devices have a partition. (Partitions are created during flashing.) Internally, QbDevicePartWrite
translates the PartitionId into device ID and device instance and adjusts the offset with the start of the device.
PartitionId | Partition ID. |
Buffer | A pointer to a buffer location in memory to which data must be written to the device. |
Size | Size of the data to be written. |
Offset | Offset from the start of the partition. |
NvSuccess | if successful, or the appropriate error code. |
NvError QbDeviceRead | ( | QbDriver | DriverType, |
NvU32 | Instance, | ||
void * | Buffer, | ||
NvU64 | Size, | ||
NvU64 | Offset | ||
) |
Performs a read operation for the device and instance passed as parameter.
This function can be used for both storage and non-storage devices. For storage devices, QbDevicePartRead is also supported, which can be used to read a given partition.
DriverType | Driver type as defined in the QbDriver enumeration. |
Instance | Device Instance on which to perform the read. |
Buffer | A pointer to the buffer location in memory. |
Size | Size of the data to be read. |
Offset | Offset from the start of the device. |
NvError QbDeviceWrite | ( | QbDriver | DriverType, |
NvU32 | Instance, | ||
void * | Buffer, | ||
NvU64 | Size, | ||
NvU64 | Offset | ||
) |
Performs a write operation on the device passed as parameter.
This function can be used for both storage and non-storage devices. For storage devices, QbDevicePartWrite is also supported, which can be used to write to a given parition.
DriverType | Driver type as defined in the QbDriver enumeration. |
Instance | Device instance for which to perform the write. |
Buffer | A pointer to a buffer location in memory. |
Size | Size of the data to be read. |
Offset | Offset from the start of the device. |
NvSuccess | if successful, or the appropriate error code. |
NvBool QbIsDeviceRegistered | ( | QbDriver | DriverType, |
NvU32 | Instance | ||
) |
Function to check if Device is registered already in the driver framework.
DriverType | Device for which query need to be made. |
Instance | Instance for which query need to be made |
NV_TRUE | if instance is registered else NV_FALSE |
NvError QbLateRegisterDevice | ( | QbDriver | DriverType, |
NvU32 | Instance | ||
) |
Board Call back to trigger registration and intialization of driver.
Internally this function will first find deviceID and Instance for given PartId. And then look-up if device is registered or not. If device is not registered, it will register the same after retrieving the platform data from DT for corresponding instance
DriverType | Driver to register. |
Instance | Instance to be registered |
NvSuccess | if successful, or the appropriate error code. |
NvError QbRegisterDevice | ( | struct QbDev * | pDevice | ) |
Registers a device to the device driver framework.
Internally this fuction calls the probe function to probe and initialize the device
pDevice | A pointer to the device-specific information. |
NvError QbRegisterDriver | ( | QbDriver | Driver, |
struct QbDevOperations * | pDevOps | ||
) |
Registers a driver to the device driver framework.
Driver | Driver to register. |
pDevOps | A pointer to the set of callbacks defined through function pointers. |