vlib.h
Go to the documentation of this file.
/*
* Copyright IBM Corp. 2003,2010
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.ibm.com/developerworks/library/os-cpl.html
*
* Authors: Andreas Herrmann
* Stefan Voelkel
* Sven Schuetz <sven@de.ibm.com>
*
* File: vlib.h
*
* Description:
* Contains typedefs, structure definitions, some inline functions and macros
* needed in the library.
*
*/
#ifndef _VLIB_H_
#define _VLIB_H_
#include "config.h"
#define _GNU_SOURCE
#include <execinfo.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <time.h>
#include <stdint.h>
#include <dirent.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <scsi/scsi_netlink_fc.h>
#include <dirent.h>
#include <hbaapi.h>
#ifdef HBAAPI_VENDOR_LIB /* compile as vendor specific library */
/*
* prototypes for vendor libraries
*/
/* library control */
typedef HBA_UINT32(*HBAGetVersionFunc)(void);
typedef HBA_STATUS(*HBALoadLibraryFunc)(void);
typedef HBA_STATUS(*HBAFreeLibraryFunc)(void);
typedef HBA_UINT32(*HBAGetVendorLibraryAttributesFunc)(HBA_LIBRARYATTRIBUTES *);
typedef HBA_UINT32(*HBAGetNumberOfAdaptersFunc)(void);
typedef void(*HBARefreshInformationFunc)(HBA_HANDLE);
typedef void(*HBARefreshAdapterConfigurationFunc)(void);
typedef void(*HBAResetStatisticsFunc)(HBA_HANDLE, HBA_UINT32);
/* adapter and port information */
typedef HBA_STATUS(*HBAGetAdapterNameFunc)(HBA_UINT32, char *);
typedef HBA_HANDLE(*HBAOpenAdapterFunc)(char *);
typedef HBA_STATUS(*HBAOpenAdapterByWWNFunc)(HBA_HANDLE *, HBA_WWN);
typedef void(*HBACloseAdapterFunc)(HBA_HANDLE);
typedef HBA_STATUS(*HBAGetAdapterAttributesFunc)
(HBA_HANDLE, HBA_ADAPTERATTRIBUTES *);
typedef HBA_STATUS(*HBAGetAdapterPortAttributesFunc)
(HBA_HANDLE, HBA_UINT32, HBA_PORTATTRIBUTES *);
typedef HBA_STATUS(*HBAGetDiscoveredPortAttributesFunc)
(HBA_HANDLE, HBA_UINT32, HBA_UINT32, HBA_PORTATTRIBUTES *);
typedef HBA_STATUS(*HBAGetPortAttributesByWWNFunc)
(HBA_HANDLE, HBA_WWN, HBA_PORTATTRIBUTES *);
typedef HBA_STATUS(*HBAGetPortStatisticsFunc)
(HBA_HANDLE, HBA_UINT32, HBA_PORTSTATISTICS *);
typedef HBA_STATUS(*HBAGetFC4StatisticsFunc)
(HBA_HANDLE, HBA_WWN, HBA_UINT8, HBA_FC4STATISTICS *);
/* FCP information */
typedef HBA_STATUS(*HBAGetBindingCapabilityFunc)
(HBA_HANDLE, HBA_WWN, HBA_BIND_CAPABILITY *);
typedef HBA_STATUS(*HBAGetBindingSupportFunc)
(HBA_HANDLE, HBA_WWN, HBA_BIND_CAPABILITY *);
typedef HBA_STATUS(*HBASetBindingSupportFunc)
(HBA_HANDLE, HBA_WWN, HBA_BIND_CAPABILITY);
typedef HBA_STATUS(*HBAGetFcpTargetMappingFunc)
(HBA_HANDLE, HBA_FCPTARGETMAPPING *);
typedef HBA_STATUS(*HBAGetFcpTargetMappingV2Func)
(HBA_HANDLE, HBA_WWN, HBA_FCPTARGETMAPPINGV2 *);
typedef HBA_STATUS(*HBAGetFcpPersistentBindingFunc)
(HBA_HANDLE, HBA_FCPBINDING *);
typedef HBA_STATUS(*HBAGetPersistentBindingV2Func)
(HBA_HANDLE, HBA_WWN, HBA_FCPBINDING2 *);
typedef HBA_STATUS(*HBASetPersistentBindingV2Func)
(HBA_HANDLE, HBA_WWN, HBA_FCPBINDING2 *);
typedef HBA_STATUS(*HBARemovePersistentBindingFunc)
(HBA_HANDLE, HBA_WWN, HBA_FCPBINDING2 *);
typedef HBA_STATUS(*HBARemoveAllPersistentBindingsFunc)(HBA_HANDLE, HBA_WWN);
typedef HBA_STATUS(*HBAGetFCPStatisticsFunc)
(HBA_HANDLE, const HBA_SCSIID *, HBA_FC4STATISTICS *);
/* SCSI information */
typedef HBA_STATUS(*HBASendScsiInquiryFunc)
(HBA_HANDLE, HBA_WWN, HBA_UINT64, HBA_UINT8, HBA_UINT32, void *,
HBA_UINT32, void *, HBA_UINT32);
typedef HBA_STATUS(*HBAScsiInquiryV2Func)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT64, HBA_UINT8, HBA_UINT8, void *,
HBA_UINT32 *, HBA_UINT8 *, void *, HBA_UINT32 *);
typedef HBA_STATUS(*HBASendReportLUNsFunc)
(HBA_HANDLE, HBA_WWN, void *, HBA_UINT32, void *, HBA_UINT32);
typedef HBA_STATUS(*HBAScsiReportLUNsV2Func)
(HBA_HANDLE, HBA_WWN, HBA_WWN, void *, HBA_UINT32 *, HBA_UINT8 *, void *,
HBA_UINT32 *);
typedef HBA_STATUS(*HBASendReadCapacityFunc)
(HBA_HANDLE, HBA_WWN, HBA_UINT64, void *, HBA_UINT32, void *, HBA_UINT32);
typedef HBA_STATUS(*HBAScsiReadCapacityV2Func)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT64, void *, HBA_UINT32 *,
HBA_UINT8 *, void *, HBA_UINT32 *);
/* fabric management */
typedef HBA_STATUS(*HBASendCTPassThruFunc)
(HBA_HANDLE, void *, HBA_UINT32, void *, HBA_UINT32);
typedef HBA_STATUS(*HBASendCTPassThruV2Func)
(HBA_HANDLE, HBA_WWN, void *, HBA_UINT32, void *, HBA_UINT32 *);
typedef HBA_STATUS(*HBASetRNIDMgmtInfoFunc)(HBA_HANDLE, HBA_MGMTINFO *);
typedef HBA_STATUS(*HBAGetRNIDMgmtInfoFunc)(HBA_HANDLE, HBA_MGMTINFO *);
typedef HBA_STATUS(*HBASendRNIDFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWNTYPE, void *, HBA_UINT32 *);
typedef HBA_STATUS(*HBASendRNIDV2Func)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, HBA_UINT32, void *,
HBA_UINT32 *);
typedef HBA_STATUS(*HBASendRPLFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, HBA_UINT32, void *,
HBA_UINT32 *);
typedef HBA_STATUS(*HBASendRPSFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, HBA_WWN, HBA_UINT32, void *,
HBA_UINT32 *);
typedef HBA_STATUS(*HBASendSRLFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, void *, HBA_UINT32 *);
typedef HBA_STATUS(*HBASendLIRRFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT8, HBA_UINT8, void *, HBA_UINT32 *);
typedef HBA_STATUS(*HBASendRLSFunc)
(HBA_HANDLE, HBA_WWN, HBA_WWN, void *, HBA_UINT32 *);
/* event handling */
typedef HBA_STATUS(*HBAGetEventBufferFunc)
(HBA_HANDLE, HBA_EVENTINFO *, HBA_UINT32 *);
typedef HBA_STATUS(*HBARegisterForAdapterAddEventsFunc)
(void (*)(void *, HBA_WWN, HBA_UINT32), void *, HBA_CALLBACKHANDLE *);
typedef HBA_STATUS(*HBARegisterForAdapterEventsFunc)
(void (*)(void *, HBA_WWN, HBA_UINT32), void *, HBA_HANDLE,
HBA_CALLBACKHANDLE *);
typedef HBA_STATUS(*HBARegisterForAdapterPortEventsFunc)
(void (*)(void *, HBA_WWN, HBA_UINT32, HBA_UINT32), void *, HBA_HANDLE,
HBA_WWN, HBA_CALLBACKHANDLE *);
typedef HBA_STATUS(*HBARegisterForAdapterPortStatEventsFunc)
(void (*)(void *, HBA_WWN, HBA_UINT32), void *, HBA_HANDLE, HBA_WWN,
HBA_PORTSTATISTICS, HBA_UINT32, HBA_CALLBACKHANDLE *);
typedef HBA_STATUS(*HBARegisterForTargetEventsFunc)
(void (*)(void *, HBA_WWN, HBA_WWN, HBA_UINT32), void *, HBA_HANDLE,
HBA_WWN, HBA_WWN, HBA_CALLBACKHANDLE *, HBA_UINT32);
typedef HBA_STATUS(*HBARegisterForLinkEventsFunc)
(void (*)(void *, HBA_WWN, HBA_UINT32, void *, HBA_UINT32), void *,
void *, HBA_UINT32, HBA_HANDLE, HBA_CALLBACKHANDLE *);
typedef HBA_STATUS(*HBARemoveCallbackFunc)(HBA_CALLBACKHANDLE);
/* libraries with support for HBA API Phase 1 and 2 must provide both structs,
HBA_EntryPoints and HBA_EntryPoints2 */
typedef struct HBA_EntryPoints {
HBAGetVersionFunc GetVersionHandler;
HBALoadLibraryFunc LoadLibraryHandler;
HBAFreeLibraryFunc FreeLibraryHandler;
HBAGetNumberOfAdaptersFunc GetNumberOfAdaptersHandler;
HBAGetAdapterNameFunc GetAdapterNameHandler;
HBAOpenAdapterFunc OpenAdapterHandler;
HBACloseAdapterFunc CloseAdapterHandler;
HBAGetAdapterAttributesFunc GetAdapterAttributesHandler;
HBAGetAdapterPortAttributesFunc GetAdapterPortAttributesHandler;
HBAGetPortStatisticsFunc GetPortStatisticsHandler;
HBAGetDiscoveredPortAttributesFunc
GetDiscoveredPortAttributesHandler;
HBAGetPortAttributesByWWNFunc GetPortAttributesByWWNHandler;
HBASendCTPassThruFunc SendCTPassThruHandler;
HBARefreshInformationFunc RefreshInformationHandler;
HBAResetStatisticsFunc ResetStatisticsHandler;
HBAGetFcpTargetMappingFunc GetFcpTargetMappingHandler;
HBAGetFcpPersistentBindingFunc GetFcpPersistentBindingHandler;
HBAGetEventBufferFunc GetEventBufferHandler;
HBASetRNIDMgmtInfoFunc SetRNIDMgmtInfoHandler;
HBAGetRNIDMgmtInfoFunc GetRNIDMgmtInfoHandler;
HBASendRNIDFunc SendRNIDHandler;
HBASendScsiInquiryFunc ScsiInquiryHandler;
HBASendReportLUNsFunc ReportLUNsHandler;
HBASendReadCapacityFunc ReadCapacityHandler;
} HBA_ENTRYPOINTS;
HBA_STATUS HBA_RegisterLibrary(HBA_ENTRYPOINTS *);
typedef struct HBA_EntryPointsV2 {
HBAGetVersionFunc GetVersionHandler;
HBALoadLibraryFunc LoadLibraryHandler;
HBAFreeLibraryFunc FreeLibraryHandler;
HBAGetNumberOfAdaptersFunc GetNumberOfAdaptersHandler;
HBAGetAdapterNameFunc GetAdapterNameHandler;
HBAOpenAdapterFunc OpenAdapterHandler;
HBACloseAdapterFunc CloseAdapterHandler;
HBAGetAdapterAttributesFunc GetAdapterAttributesHandler;
HBAGetAdapterPortAttributesFunc GetAdapterPortAttributesHandler;
HBAGetPortStatisticsFunc GetPortStatisticsHandler;
HBAGetDiscoveredPortAttributesFunc
GetDiscoveredPortAttributesHandler;
HBAGetPortAttributesByWWNFunc GetPortAttributesByWWNHandler;
HBASendCTPassThruFunc SendCTPassThruHandler;
HBARefreshInformationFunc RefreshInformationHandler;
HBAResetStatisticsFunc ResetStatisticsHandler;
HBAGetFcpTargetMappingFunc GetFcpTargetMappingHandler;
HBAGetFcpPersistentBindingFunc GetFcpPersistentBindingHandler;
HBAGetEventBufferFunc GetEventBufferHandler;
HBASetRNIDMgmtInfoFunc SetRNIDMgmtInfoHandler;
HBAGetRNIDMgmtInfoFunc GetRNIDMgmtInfoHandler;
HBASendRNIDFunc SendRNIDHandler;
HBASendScsiInquiryFunc ScsiInquiryHandler;
HBASendReportLUNsFunc ReportLUNsHandler;
HBASendReadCapacityFunc ReadCapacityHandler;
HBAOpenAdapterByWWNFunc OpenAdapterByWWNHandler;
HBAGetFcpTargetMappingV2Func GetFcpTargetMappingV2Handler;
HBASendCTPassThruV2Func SendCTPassThruV2Handler;
HBARefreshAdapterConfigurationFunc RefreshAdapterConfigurationHandler;
HBAGetBindingCapabilityFunc GetBindingCapabilityHandler;
HBAGetBindingSupportFunc GetBindingSupportHandler;
HBASetBindingSupportFunc SetBindingSupportHandler;
HBASetPersistentBindingV2Func SetPersistentBindingV2Handler;
HBAGetPersistentBindingV2Func GetPersistentBindingV2Handler;
HBARemovePersistentBindingFunc RemovePersistentBindingHandler;
HBARemoveAllPersistentBindingsFunc
RemoveAllPersistentBindingsHandler;
HBASendRNIDV2Func SendRNIDV2Handler;
HBAScsiInquiryV2Func ScsiInquiryV2Handler;
HBAScsiReportLUNsV2Func ScsiReportLUNsV2Handler;
HBAScsiReadCapacityV2Func ScsiReadCapacityV2Handler;
HBAGetVendorLibraryAttributesFunc
GetVendorLibraryAttributesHandler;
HBARemoveCallbackFunc RemoveCallbackHandler;
HBARegisterForAdapterAddEventsFunc
RegisterForAdapterAddEventsHandler;
HBARegisterForAdapterEventsFunc RegisterForAdapterEventsHandler;
HBARegisterForAdapterPortEventsFunc
RegisterForAdapterPortEventsHandler;
HBARegisterForAdapterPortStatEventsFunc
RegisterForAdapterPortStatEventsHandler;
HBARegisterForTargetEventsFunc RegisterForTargetEventsHandler;
HBARegisterForLinkEventsFunc RegisterForLinkEventsHandler;
HBASendRPLFunc SendRPLHandler;
HBASendRPSFunc SendRPSHandler;
HBASendSRLFunc SendSRLHandler;
HBASendLIRRFunc SendLIRRHandler;
HBAGetFC4StatisticsFunc GetFC4StatisticsHandler;
HBAGetFCPStatisticsFunc GetFCPStatisticsHandler;
HBASendRLSFunc SendRLSHandler;
} HBA_ENTRYPOINTSV2;
HBA_STATUS HBA_RegisterLibraryV2(HBA_ENTRYPOINTSV2 *);
#endif /* HBAAPI_VENDOR_LIB */
#define HBAAPI_LIBRARY_VERSION 2
#define HBAAPI_LIBRARY_FINAL 0
#define HBAAPI_LIBRARY_REVISION VERSION
#define VLIB_ENV_LOG_LEVEL "LIB_ZFCP_HBAAPI_LOG_LEVEL"
#define VLIB_ENV_LOG_FILE "LIB_ZFCP_HBAAPI_LOG_FILE"
#define VLIB_ADAPTERNAME_PREFIX "com.ibm-FICON-FCP-"
#define VLIB_ADAPTERNAME_LEN 256
#define VLIB_INVALID_HANDLE 0
#define REPORTLUNS_WLUN 0xc101000000000000
#define REPORTLUNS_WLUN_DEC 49409
typedef uint64_t devid_t;
typedef uint64_t wwn_t;
typedef uint32_t fc_id_t;
typedef uint64_t fcp_lun_t;
struct vlib_event {
HBA_EVENTINFO hbaapi_event;
struct vlib_event *next;
};
struct vlib_event_queue {
unsigned int slots_used;
struct vlib_event *first;
struct vlib_event *last;
};
struct block {
void *data;
size_t used;
size_t allocated;
};
struct vlib_unit {
unsigned int isInvalid:1;
unsigned int host;
unsigned int channel;
unsigned int target;
unsigned int lun;
uint64_t fcLun;
char sg_dev[16];
};
struct vlib_port {
unsigned int isInvalid:1;
wwn_t wwpn;
wwn_t wwnn;
fc_id_t did;
struct block units;
char name[32];
unsigned int host;
unsigned int channel;
unsigned int target;
};
struct vlib_adapter_ident {
devid_t devid;
wwn_t wwnn;
wwn_t wwpn;
unsigned short host;
fc_id_t did;
char bus_dev_name[9];
char class_dev_name[9];
char sysfsPath[PATH_MAX];
};
struct vlib_adapter {
unsigned int isInvalid:1;
struct vlib_adapter_ident ident;
HBA_HANDLE handle;
struct block ports;
struct vlib_event_queue event_queue;
struct vlib_event_queue free_event_list;
};
struct vlib_data {
unsigned int isLoaded:1;
unsigned int unloading:1;
unsigned int isValid:1;
int loglevel;
FILE *errfp;
struct block adapters;
pthread_t id;
pthread_mutex_t mutex;
};
extern struct vlib_data vlib_data;
static inline void vlib_print_error(int errnum, const char *function,
const char *file, int line,
char *fmt, ...)
{
char buffer[256];
va_list ap;
if (0 == vlib_data.loglevel)
return;
fprintf(vlib_data.errfp, "(%s:%d)%s: ", file, line, function);
va_start(ap, fmt);
vfprintf(vlib_data.errfp, fmt, ap);
va_end(ap);
if (errnum != 0) {
fprintf(vlib_data.errfp, ": %s\n",
strerror_r(errnum, buffer, 256));
}
}
#define VLIB_PERROR(errnum, fmt, args...) \
vlib_print_error(errnum, __func__, __FILE__, __LINE__, fmt, ##args)
#define VLIB_LOG(fmt, args...) \
vlib_print_error(0, __func__, __FILE__, __LINE__, fmt, ##args)
#ifdef HBAAPI_BACKTRACE
#define BT_SIZE 50
static inline void vlib_bt(void)
{
int num;
void *array[BT_SIZE] = { 0 };
num = backtrace(array, BT_SIZE);
backtrace_symbols_fd(array, num, fileno(stderr));
}
#else
#define vlib_bt()
#endif
#define VLIB_MUTEX_LOCK(mutex) \
do { \
int __ret; \
__ret = pthread_mutex_lock(mutex); \
if (__ret == EDEADLK) { \
VLIB_LOG("BUG: VLIB_MUTEX_LOCK: deadlock detected!\n"); \
vlib_bt(); \
exit(1); \
} else if (__ret == EINVAL) { \
VLIB_LOG("BUG: VLIB_MUTEX_LOCK: mutex not properly " \
"initialized\n"); \
vlib_bt(); \
exit(1); \
} \
} while (0)
#define VLIB_MUTEX_UNLOCK(mutex) \
do { \
int __ret; \
__ret = pthread_mutex_unlock(mutex); \
if (__ret == EPERM) { \
VLIB_LOG("BUG: VLIB_MUTEX_UNLOCK: thread does not own " \
"mutex!\n"); \
vlib_bt(); \
exit(1); \
} else if (__ret == EINVAL) { \
VLIB_LOG("BUG: VLIB_MUTEX_UNLOCK: " \
"mutex not properly initialized\n"); \
vlib_bt(); \
exit(1); \
} \
} while (0)
/* Include auxiliary stuff, like inline and helper functions etc. */
#include "vlib_aux.h"
#include "vlib_sysfs.h"
#include "vlib_sg.h"
#include "vlib_sg_io.h"
#include "vlib_events.h"
#include "vlib_sfhelper.h"
#endif /* _VLIB_H_ */
config.h
Configuration header file after configure script was run.
hbaapi.h
C header file descriping the HBA API.
block
Block structure used to hold all needed data for growable arrays.
Definition vlib.h:425
block::allocated
size_t allocated
total number of elements in the array
Definition vlib.h:428
block::data
void * data
pointer to an array
Definition vlib.h:426
block::used
size_t used
number of used elements in the array
Definition vlib.h:427
vlib_adapter_ident
Identification of an adapter in the library.
Definition vlib.h:457
vlib_adapter_ident::did
fc_id_t did
FC did of the port.
Definition vlib.h:462
vlib_adapter_ident::devid
devid_t devid
Unique id for adapter device.
Definition vlib.h:458
vlib_adapter_ident::wwnn
wwn_t wwnn
WWN of adapter node.
Definition vlib.h:459
vlib_adapter_ident::class_dev_name
char class_dev_name[9]
name of device as in /sys/class/fc_host in the form "hostxxxx"
Definition vlib.h:466
vlib_adapter_ident::wwpn
wwn_t wwpn
WWN of adapter port.
Definition vlib.h:460
vlib_adapter_ident::bus_dev_name
char bus_dev_name[9]
name of device as in /sys/bus/ccw/drivers/zfcp in the form "x.x.xxxx"
Definition vlib.h:463
vlib_adapter_ident::host
unsigned short host
SCSI host id of this adapter.
Definition vlib.h:461
vlib_adapter_ident::sysfsPath
char sysfsPath[PATH_MAX]
path of adapter in sysfs in the form /sys/devices/css0/0.0.0010/0.0.5923
Definition vlib.h:469
vlib_adapter
Represenation of an adapter in the library.
Definition vlib.h:474
vlib_adapter::event_queue
struct vlib_event_queue event_queue
Event queue.
Definition vlib.h:479
vlib_adapter::free_event_list
struct vlib_event_queue free_event_list
Free slots.
Definition vlib.h:480
vlib_adapter::handle
HBA_HANDLE handle
Handle for this adapter.
Definition vlib.h:477
vlib_adapter::ident
struct vlib_adapter_ident ident
Adapter identification.
Definition vlib.h:476
vlib_adapter::isInvalid
unsigned int isInvalid
Adapter invalid or not.
Definition vlib.h:475
vlib_adapter::ports
struct block ports
List of ports.
Definition vlib.h:478
vlib_data
Primary data structure used in the library.
Definition vlib.h:484
vlib_data::mutex
pthread_mutex_t mutex
Protects this structure.
Definition vlib.h:499
vlib_data::id
pthread_t id
Pthread ID of event handling thread.
Definition vlib.h:497
vlib_data::unloading
unsigned int unloading
Library unloaded.
Definition vlib.h:486
vlib_data::isValid
unsigned int isValid
Repositoy valid or not This flag is set for instance if a loss of events is detected.
Definition vlib.h:487
vlib_data::adapters
struct block adapters
List of adapters In fact this is the anchor of the library's repository.
Definition vlib.h:494
vlib_data::loglevel
int loglevel
loglevel for library Default is 0 – no logging.
Definition vlib.h:490
vlib_data::errfp
FILE * errfp
file used for logging Default is stderr.
Definition vlib.h:492
vlib_data::isLoaded
unsigned int isLoaded
Library loaded or not.
Definition vlib.h:485
vlib_event_queue
Event queue data structure used in the library.
Definition vlib.h:418
vlib_event
Event data structure used in the library.
Definition vlib.h:412
vlib_port
Representation of a FC port in the library.
Definition vlib.h:443
vlib_port::wwnn
wwn_t wwnn
WWNN of the port.
Definition vlib.h:446
vlib_port::wwpn
wwn_t wwpn
WWPN of the port.
Definition vlib.h:445
vlib_port::target
unsigned int target
SCSI id.
Definition vlib.h:453
vlib_port::isInvalid
unsigned int isInvalid
Port invalid or not.
Definition vlib.h:444
vlib_port::units
struct block units
List of units.
Definition vlib.h:448
vlib_port::host
unsigned int host
SCSI host.
Definition vlib.h:451
vlib_port::channel
unsigned int channel
SCSI channel.
Definition vlib.h:452
vlib_port::did
fc_id_t did
FC did of the port.
Definition vlib.h:447
vlib_port::name
char name[32]
name as in sysfs under fc_remote_ports
Definition vlib.h:449
vlib_unit
Represenation of an FCP unit in the library.
Definition vlib.h:432
vlib_unit::host
unsigned int host
SCSI host.
Definition vlib.h:434
vlib_unit::isInvalid
unsigned int isInvalid
Unit invalid or not.
Definition vlib.h:433
vlib_unit::target
unsigned int target
SCSI id.
Definition vlib.h:436
vlib_unit::channel
unsigned int channel
SCSI channel.
Definition vlib.h:435
vlib_unit::lun
unsigned int lun
SCSI LUN.
Definition vlib.h:437
vlib_unit::sg_dev
char sg_dev[16]
name of sg device
Definition vlib.h:439
vlib_unit::fcLun
uint64_t fcLun
FCP LUN.
Definition vlib.h:438
vlib_print_error
static void vlib_print_error(int errnum, const char *function, const char *file, int line, char *fmt,...)
This is a wrapper for the usage of strerror_r().
Definition vlib.h:514
vlib_bt
#define vlib_bt()
Print a stack backtrace.
Definition vlib.h:561
vlib_aux.h
Auxiliary functions used in the library.
vlib_sysfs.h
All calls that need the sysfs.