NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
device.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2018, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 
18 #ifndef INCLUDED_DEVICE_H
19 #define INCLUDED_DEVICE_H
20 
28 #include <nvcommon.h>
29 #ifndef QB_BL_BUILD
30 #include <flashtools_nverror.h>
31 #else
32 #include <nverror.h>
33 #endif
34 #include <device_id.h>
35 
36 #define QB_MAX_DEV_INSTANCE 16
37 #define QB_MAX_DRIVER_TYPES 100
38 
39 struct QbDev {
41  NvU32 Instance;
42  void *DevInfo;
43 };
44 
48 typedef enum
49 {
67 
72  NvError (*Probe)(struct QbDev *Dev);
73  NvError (*Read)(QbDriver DriverType, NvU32 Instance, void *Buffer,
74  NvU64 Size, NvU64 Offset);
75  NvError (*Write)(QbDriver DriverType, NvU32 Instance, void *Buffer,
76  NvU64 Size, NvU64 Offset);
77  NvError (*Ioctl)(QbDriver DriverType, NvU32 Instance, NvU32 Cmd, void *Buf);
78  NvError (*CleanExit)(QbDriver DriverType, NvU32 Instance);
79 
80  NvBool Initialized;
81 
83 };
84 
100 NvError QbDeviceRead(QbDriver DriverType, NvU32 Instance,
101  void *Buffer, NvU64 Size, NvU64 Offset);
102 
119 NvError QbDevicePartRead(
120  NvU32 PartitionId,
121  void *Buffer,
122  NvU64 Size,
123  NvU64 Offset);
124 
140 NvError QbDeviceWrite(
141  QbDriver DriverType,
142  NvU32 Instance,
143  void *Buffer,
144  NvU64 Size,
145  NvU64 Offset);
146 
164 NvError QbDevicePartWrite(
165  NvU32 PartitionId,
166  void *Buffer,
167  NvU64 Size,
168  NvU64 Offset);
184 NvError QbDeviceIoctl(
185  QbDriver DriverType,
186  NvU32 Instance,
187  NvU32 Cmd,
188  void *Buffer);
189 
200 NvError QbCleanExit(QbDriver DriverType, NvU32 Instance);
201 
202 
212 NvError QbRegisterDriver(
214  struct QbDevOperations *pDevOps);
215 
227 NvError QbRegisterDevice(struct QbDev *pDevice);
228 
242 NvError QbLateRegisterDevice(QbDriver DriverType, NvU32 Instance);
243 
253 NvBool QbIsDeviceRegistered(QbDriver DriverType, NvU32 Instance);
254 
257 #endif //INCLUDED_DEVICE_H
QbDriver
Defines Quickboot device driver types.
Definition: device_id.h:34
QbDeviceStatus
Defines the current status of a transfer request.
Definition: device.h:48
NvError(* Write)(QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset)
Definition: device.h:75
NvError QbDeviceRead(QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset)
Performs a read operation for the device and instance passed as parameter.
NvBool DevInstanceIntialized[QB_MAX_DEV_INSTANCE]
Definition: device.h:82
NvError QbDevicePartWrite(NvU32 PartitionId, void *Buffer, NvU64 Size, NvU64 Offset)
Performs a write operation for partition passed as parameter.
NvBool QbIsDeviceRegistered(QbDriver DriverType, NvU32 Instance)
Function to check if Device is registered already in the driver framework.
#define QB_MAX_DEV_INSTANCE
Definition: device.h:36
NvError(* Read)(QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset)
Definition: device.h:73
NvError QbDeviceWrite(QbDriver DriverType, NvU32 Instance, void *Buffer, NvU64 Size, NvU64 Offset)
Performs a write operation on the device passed as parameter.
Definition: device.h:39
NvError(* CleanExit)(QbDriver DriverType, NvU32 Instance)
Definition: device.h:78
NvError(* Ioctl)(QbDriver DriverType, NvU32 Instance, NvU32 Cmd, void *Buf)
Definition: device.h:77
NvBool Initialized
Definition: device.h:80
Holds callbacks for device drivers.
Definition: device.h:71
NvError QbCleanExit(QbDriver DriverType, NvU32 Instance)
Function to trigger clean exit of driver when it's not longer used.
NVIDIA Quickboot Interface: Error Handling (Parker)
NvError QbDevicePartRead(NvU32 PartitionId, void *Buffer, NvU64 Size, NvU64 Offset)
Performs a read operation on the partition passed as parameter.
NvError QbLateRegisterDevice(QbDriver DriverType, NvU32 Instance)
Board Call back to trigger registration and intialization of driver.
void * DevInfo
Definition: device.h:42
Read error occurred but was corrected.
Definition: device.h:62
NvError(* Probe)(struct QbDev *Dev)
Definition: device.h:72
NvError QbRegisterDriver(QbDriver Driver, struct QbDevOperations *pDevOps)
Registers a driver to the device driver framework.
NvU32 Instance
Definition: device.h:41
NVIDIA Quickboot Interface: Device Driver Types
NvError QbRegisterDevice(struct QbDev *pDevice)
Registers a device to the device driver framework.
NvError QbDeviceIoctl(QbDriver DriverType, NvU32 Instance, NvU32 Cmd, void *Buffer)
Performs a ioctl operation on given driver.
QbDriver Driver
Definition: device.h:40