Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_linux.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <string.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <dirent.h>
#include <unistd.h>
#include <fts.h>
#include <errno.h>
#include <ocs_ioctl.h>
#include <elxu_device.h>
#include <elxu_sli4.h>
#include <elxu_mbox.h>
#include "elxu_common.h"
#include "elx_pt_ioctl.h"
#include <ocsu_io.h>

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 
#define MAXDEVS   1024
 
#define ELX_PT_SERIAL_NUM_SIZE   32
 
#define MAX_CONNECTIONS   256
 

Functions

static char * format_ip_address (uint8_t *address, uint8_t address_type)
 
static void pt_device_init (elxu_device_t *device)
 
static int os_create_device_files (char *driver_path)
 
elxu_device_t * os_build_device_list (char *path)
 Build a list of devices. More...
 
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...
 
int os_ioctl_device (elxu_device_t *device, int req, void *arg)
 Send an ioctl to an open device. More...
 
void os_close_device (elxu_device_t *device)
 Close a device file. More...
 
int os_remove_device (elxu_device_t *device)
 
void elxu_get_connection_info (elxu_device_t *device)
 Print iSCSI connection info for the given device. More...
 

Macro Details

#define _GNU_SOURCE

Definition at line 33 of file elxu_linux.c.

#define ELX_PT_SERIAL_NUM_SIZE   32

Definition at line 61 of file elxu_linux.c.

#define MAX_CONNECTIONS   256
#define MAXDEVS   1024

Definition at line 60 of file elxu_linux.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 581 of file elxu_linux.c.

static char * format_ip_address ( uint8_t *  address,
uint8_t  address_type 
)
static

Definition at line 617 of file elxu_linux.c.

elxu_device_t* os_build_device_list_uspace ( char *  hostname)

Definition at line 346 of file elxu_linux.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 567 of file elxu_linux.c.

static int os_create_device_files ( char *  driver_path)
static

Definition at line 73 of file elxu_linux.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 555 of file elxu_linux.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 520 of file elxu_linux.c.

int os_remove_device ( elxu_device_t *  device)

Definition at line 576 of file elxu_linux.c.

static void pt_device_init ( elxu_device_t *  device)
static

Definition at line 394 of file elxu_linux.c.