Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_bsd.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/ioctl.h>
#include <sys/pciio.h>
#include <fcntl.h>
#include <dirent.h>
#include <unistd.h>
#include <elxu_device.h>
#include <elxu_sli4.h>
#include "elxu_common.h"

Go to the source code of this file.

Data Structures

struct  elxu_bsd_command_t
 

Macros

#define OCS_DEV_TEMPLATE   "/dev/ocs"
 
#define ELXU_BSD_COMMAND   _IOWR('Q', 0, struct elxu_bsd_command_s)
 

Functions

elxu_device_t * os_build_device_list (char *path)
 
elxu_device_t * os_build_device_list_uspace (char *hostname)
 
elxu_device_t * os_open_device (elxu_device_name_t *devname)
 Open a device file. More...
 
void os_close_device (elxu_device_t *device)
 Close a device file. More...
 
int os_remove_device (elxu_device_t *device)
 
int os_ioctl_device (elxu_device_t *device, int req, void *arg)
 Send an ioctl to an open device. More...
 
void elxu_get_connection_info (elxu_device_t *device)
 Print iSCSI connection info for the given device. More...
 

Macro Details

#define ELXU_BSD_COMMAND   _IOWR('Q', 0, struct elxu_bsd_command_s)

Definition at line 69 of file elxu_bsd.c.

#define OCS_DEV_TEMPLATE   "/dev/ocs"

Definition at line 57 of file elxu_bsd.c.

Function Details

void elxu_get_connection_info ( elxu_device_t *  device)

Print iSCSI connection info for the given device.

Description
This function prints iSCSI connection information for the given device. BSD does not support iSCSI connection info, so this function prints an error message and returns.
Parameters
deviceThe device for which to print connection info.
Returns
Returns nothing.

Definition at line 230 of file elxu_bsd.c.

elxu_device_t* os_build_device_list ( char *  path)

Definition at line 71 of file elxu_bsd.c.

elxu_device_t* os_build_device_list_uspace ( char *  hostname)

Definition at line 123 of file elxu_bsd.c.

void os_close_device ( elxu_device_t *  device)

Close a device file.

Description
This function closes an open device file.
Parameters
deviceA pointer to an elxu_device_t to be closed.
Returns
Returns nothing.

Definition at line 187 of file elxu_bsd.c.

int os_ioctl_device ( elxu_device_t *  device,
int  req,
void *  arg 
)

Send an ioctl to an open device.

Description
This function sends an ioctl to an open device.
Parameters
deviceA pointer to the device.
reqThe request to be sent to the device.
argThe argument to be sent to the device.
Returns
Returns 0 on success; non-zero on failure.

Definition at line 211 of file elxu_bsd.c.

elxu_device_t* os_open_device ( elxu_device_name_t *  devname)

Open a device file.

Description
This function opens a device file on BSD. The input is an elxu_device_name_t which contains a device index and a hostname. If the hostname is non-NULL then the request is for a userspace driver, and the hostname is the host one which the driver is running. This is not supported on BSD. If the hostname is NULL then the index field specifies which device file to open.
Parameters
devnameAn elxu_device_name_t structure that specifies the device to be opened.
Returns
Returns a pointer to an elxu_device_t on success; NULL on failure.

Definition at line 148 of file elxu_bsd.c.

int os_remove_device ( elxu_device_t *  device)

Definition at line 193 of file elxu_bsd.c.