18 #ifndef INCLUDED_UHD_TRANSPORT_NIRIO_NIRIO_DRIVER_IFACE_H 19 #define INCLUDED_UHD_TRANSPORT_NIRIO_NIRIO_DRIVER_IFACE_H 26 #if defined(UHD_PLATFORM_WIN32) 28 #pragma warning(disable:4201) // nonstandard extension used : nameless struct/union 30 #pragma warning(default:4201) 31 #elif !defined(UHD_PLATFORM_LINUX) 32 #include <IOKit/IOKitLib.h> 36 #ifndef UHD_PLATFORM_WIN32 37 #define CTL_CODE(a,controlCode,b,c) (controlCode) 48 FILE_READ_DATA | FILE_WRITE_DATA);
74 NIRIO_IOCTL_BASE + 10,
80 #if defined(UHD_PLATFORM_LINUX) 82 #elif defined(UHD_PLATFORM_WIN32) 90 #if defined(UHD_PLATFORM_LINUX) 96 bool is_null() {
return (size == 0 || addr == NULL); }
98 #elif defined(UHD_PLATFORM_WIN32) 104 struct rio_mmap_params_t
106 uint64_t mapped_va_ptr;
107 uint64_t map_ready_event_handle;
113 struct rio_mmap_threadargs_t
115 rio_dev_handle_t device_handle;
116 rio_mmap_params_t params;
124 HANDLE map_thread_handle;
125 rio_mmap_threadargs_t map_thread_args;
127 bool is_null() {
return addr == NULL; }
139 const std::string& device_path,
140 rio_dev_handle_t& device_handle);
143 rio_dev_handle_t& device_handle);
146 rio_dev_handle_t device_handle);
149 rio_dev_handle_t device_handle,
151 const void *write_buf,
152 size_t write_buf_len,
154 size_t read_buf_len);
157 rio_dev_handle_t device_handle,
158 uint16_t memory_type,
rio_mmap_t()
Definition: nirio_driver_iface.h:131
nirio_status rio_mmap(rio_dev_handle_t device_handle, uint16_t memory_type, size_t size, bool writable, rio_mmap_t &map)
const uint32_t NIRIO_IOCTL_GET_IFACE_NUM
Get the interface number for a device.
Definition: nirio_driver_iface.h:54
nirio_status rio_munmap(rio_mmap_t &map)
const uint32_t NIRIO_IOCTL_GET_SESSION
Gets a previously opened session to a device.
Definition: nirio_driver_iface.h:60
bool is_null()
Definition: nirio_driver_iface.h:134
const uint32_t NIRIO_IOCTL_POST_OPEN
Called after opening a session.
Definition: nirio_driver_iface.h:66
io_connect_t rio_dev_handle_t
Definition: nirio_driver_iface.h:85
nirio_status rio_open(const std::string &device_path, rio_dev_handle_t &device_handle)
#define CTL_CODE(a, controlCode, b, c)
Definition: nirio_driver_iface.h:37
Definition: nirio_driver_iface.h:130
bool rio_isopen(rio_dev_handle_t device_handle)
int32_t nirio_status
Definition: status.h:31
const uint32_t NIRIO_IOCTL_SYNCOP
Definition: nirio_driver_iface.h:44
const uint32_t NIRIO_IOCTL_PRE_CLOSE
Called before closing a session.
Definition: nirio_driver_iface.h:72
Definition: nirio_driver_iface.h:40
nirio_status rio_ioctl(rio_dev_handle_t device_handle, uint32_t ioctl_code, const void *write_buf, size_t write_buf_len, void *read_buf, size_t read_buf_len)
const uint32_t NIRIO_IOCTL_BASE
Definition: nirio_driver_iface.h:42
void rio_close(rio_dev_handle_t &device_handle)
void * addr
Definition: nirio_driver_iface.h:132