Go to the documentation of this file.
19 #ifndef _VLIB_SYSFS_H_
20 #define _VLIB_SYSFS_H_
23 #define ZFCP_SYSFS_PATH "/sys/bus/ccw/drivers/zfcp"
24 #define FC_HOST_PATH "/sys/class/fc_host"
27 #define DEVNO_LENGTH 8
43 void sysfs_waitForSgDev(
char *);
60 return HBA_STATUS_ERROR;
64 return HBA_STATUS_ERROR;
Central header file for the library.
unsigned int lun
SCSI LUN.
Definition: vlib.h:437
wwn_t wwnn
WWNN of the port.
Definition: vlib.h:446
struct vlib_adapter_ident ident
Adapter identification.
Definition: vlib.h:476
HBA_STATUS sysfs_getDiscoveredPortAttributes(HBA_PORTATTRIBUTES **pAttrs, struct vlib_port *port)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:408
unsigned int isLoaded
Library loaded or not.
Definition: vlib.h:485
static HBA_STATUS revalidateRepository(void)
Check status of the repository, and possibly revalidate it.
Definition: vlib_sysfs.h:57
wwn_t wwnn
WWN of adapter node.
Definition: vlib.h:459
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
HBA_STATUS sysfs_createAndReadConfigAdapter()
Read all adapters from /sys/bus/ccw/drivers/zfcp and add them to the repository.
Definition: vlib_sysfs.c:260
unsigned int host
SCSI host.
Definition: vlib.h:451
Representation of a FC port in the library.
Definition: vlib.h:443
devid_t devid
Unique id for adapter device.
Definition: vlib.h:458
static HBA_STATUS getPortAttributes(HBA_PORTATTRIBUTES **pPortattributes, char *classpath)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:145
static void vlib_wwn_to_HBA_WWN(uint64_t wwn, HBA_WWN *hba)
Convert uint64_t to HBA_WWN – hide ill-favoured type cast.
Definition: vlib_aux.h:81
Represenation of an FCP unit in the library.
Definition: vlib.h:432
HBA_STATUS sysfs_getAdapterPortAttributes(HBA_PORTATTRIBUTES **pAttrs, struct vlib_adapter *adapter)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:443
wwn_t wwpn
WWPN of the port.
Definition: vlib.h:445
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
wwn_t wwpn
WWN of adapter port.
Definition: vlib.h:460
char name[32]
name as in sysfs under fc_remote_ports
Definition: vlib.h:449
int addAdapterToRepos(struct vlib_adapter *adapter)
Add an adapter to the repository.
Definition: vlib_aux.c:472
static HBA_STATUS addPortByName(struct vlib_adapter *adapter, char *name)
add a port to the adapters repos
Definition: vlib_sysfs.c:36
HBA_STATUS sysfs_getAdapterPortAttributes(HBA_PORTATTRIBUTES **, struct vlib_adapter *)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:443
unsigned short host
SCSI host id of this adapter.
Definition: vlib.h:461
int addPortToRepos(struct vlib_adapter *adapter, struct vlib_port *port)
Add a port from to the repository.
Definition: vlib_aux.c:409
HBA_STATUS sysfs_createAndReadConfigPorts(struct vlib_adapter *)
Read and store all discovered ports of an adapter.
Definition: vlib_sysfs.c:226
HBA_STATUS sysfs_createAndReadConfigAdapter()
Read all adapters from /sys/bus/ccw/drivers/zfcp and add them to the repository.
Definition: vlib_sysfs.c:260
struct vlib_adapter * getAdapterByHostNo(unsigned short host)
Get an adapter by SCSI Host number as in sysfs.
Definition: vlib_aux.c:202
unsigned int isValid
Repositoy valid or not This flag is set for instance if a loss of events is detected.
Definition: vlib.h:487
int addUnitToRepos(struct vlib_port *port, struct vlib_unit *unit)
Add a unit to the repository.
Definition: vlib_aux.c:351
static int revalidatePorts(struct vlib_adapter *adapter)
Revalidate ports of an adapter in the repository.
Definition: vlib_sysfs.h:82
fc_id_t did
FC did of the port.
Definition: vlib.h:462
int sysfs_getUnitsFromPort(struct vlib_port *port)
Get unit configuration information for a port.
Definition: vlib_sysfs.c:310
Primary data structure used in the library.
Definition: vlib.h:484
unsigned int target
SCSI id.
Definition: vlib.h:453
Represenation of an adapter in the library.
Definition: vlib.h:474
HBA_COS vlibCharToIntCOS(char *s)
Map the result of a class of service string to an int.
Definition: vlib_aux.c:873
static int revalidateUnits(struct vlib_port *port)
Revalidate units of an adapter and port in the repository.
Definition: vlib_sysfs.h:103
uint64_t fcLun
FCP LUN.
Definition: vlib.h:438
unsigned int host
SCSI host.
Definition: vlib.h:434
fc_id_t did
FC did of the port.
Definition: vlib.h:447
static HBA_STATUS addAdapterByDevPath(char *dev_path)
add an adapter to the adapters repos
Definition: vlib_sysfs.c:72
unsigned int channel
SCSI channel.
Definition: vlib.h:435
char sg_dev[16]
name of sg device
Definition: vlib.h:439
HBA_STATUS sysfs_createAndReadConfigPorts(struct vlib_adapter *adapter)
Read and store all discovered ports of an adapter.
Definition: vlib_sysfs.c:226
int sysfs_getUnitsFromPort(struct vlib_port *)
Get unit configuration information for a port.
Definition: vlib_sysfs.c:310
char class_dev_name[9]
name of device as in /sys/class/fc_host in the form "hostxxxx"
Definition: vlib.h:466
HBA_PORTTYPE vlibCharToIntPortType(char *portType)
Map the result of a port type string from sysfs to an int.
Definition: vlib_aux.c:688
HBA_PORTSPEED vlibCharToIntPortSpeed(char *pS)
Map the result of a port speed string to the HBA_PORTSPEED int.
Definition: vlib_aux.c:810
struct block units
List of units.
Definition: vlib.h:448
int revalidateAdapters(void)
Revalidate adapters in the repository.
Definition: vlib_aux.c:546
HBA_STATUS sysfs_getAdapterAttributes(HBA_ADAPTERATTRIBUTES **pAttrs, struct vlib_adapter *adapter)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:495
HBA_STATUS sysfs_getPortStatistics(HBA_PORTSTATISTICS **, struct vlib_adapter *)
Retrieve adapter port statistics.
Definition: vlib_sysfs.c:595
HBA_PORTSTATE vlibCharToIntPortState(char *portState)
Map the result of a port state string from sysfs to an int.
Definition: vlib_aux.c:713
HBA_STATUS sysfs_getPortStatistics(HBA_PORTSTATISTICS **pS, struct vlib_adapter *adapter)
Retrieve adapter port statistics.
Definition: vlib_sysfs.c:595
unsigned int channel
SCSI channel.
Definition: vlib.h:452
size_t allocated
total number of elements in the array
Definition: vlib.h:428
HBA_STATUS sysfs_getDiscoveredPortAttributes(HBA_PORTATTRIBUTES **, struct vlib_port *)
Retrieve adapter attributes.
Definition: vlib_sysfs.c:408
unsigned int target
SCSI id.
Definition: vlib.h:436
struct block ports
List of ports.
Definition: vlib.h:478