ZFCP HBA API Library  1
vlib_events.h
1 /*
2  * Copyright IBM Corp. 2003,2010
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.ibm.com/developerworks/library/os-cpl.html
7  *
8  * Authors: Sven Schuetz <sven@de.ibm.com>
9  *
10  * File: vlib_events.h
11  *
12  * Description:
13  * Event handling functions
14  *
15  */
16 
17 
18 #ifndef VLIB_EVENTS_H_
19 #define VLIB_EVENTS_H_
20 
21 void free_event_queue(struct vlib_adapter *);
22 void init_event_queue(struct vlib_adapter *);
23 void start_event_thread();
24 struct vlib_event *popEvent(struct vlib_adapter *);
25 
26 #endif /*VLIB_EVENTS_H_*/
vlib.h
Central header file for the library.
vlib_adapter::ident
struct vlib_adapter_ident ident
Adapter identification.
Definition: vlib.h:476
vlib_adapter::event_queue
struct vlib_event_queue event_queue
Event queue.
Definition: vlib.h:479
vlib_adapter::handle
HBA_HANDLE handle
Handle for this adapter.
Definition: vlib.h:477
HBA_RegisterForAdapterAddEvents
HBA_STATUS HBA_RegisterForAdapterAddEvents(void(*pCallback)(void *, HBA_WWN, HBA_UINT32), void *pUserData, HBA_CALLBACKHANDLE *pCallbackHandle)
Definition: vlib_callbacks.c:45
HBA_RegisterForTargetEvents
HBA_STATUS HBA_RegisterForTargetEvents(void(*pCallback)(void *, HBA_WWN, HBA_WWN, HBA_UINT32), void *pUserData, HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_CALLBACKHANDLE *pCallbackHandle, HBA_UINT32 allTargets)
Definition: vlib_callbacks.c:98
vlib_data::id
pthread_t id
Pthread ID of event handling thread.
Definition: vlib.h:497
HBA_RemoveCallback
HBA_STATUS HBA_RemoveCallback(HBA_CALLBACKHANDLE callbackHandle)
Definition: vlib_callbacks.c:35
HBA_RegisterForAdapterEvents
HBA_STATUS HBA_RegisterForAdapterEvents(void(*pCallback)(void *, HBA_WWN, HBA_UINT32), void *pUserData, HBA_HANDLE handle, HBA_CALLBACKHANDLE *pCallbackHandle)
Definition: vlib_callbacks.c:57
getAdapterByHostNo
struct vlib_adapter * getAdapterByHostNo(unsigned short host)
Get an adapter by SCSI Host number as in sysfs.
Definition: vlib_aux.c:202
HBA_RegisterForAdapterPortEvents
HBA_STATUS HBA_RegisterForAdapterPortEvents(void(*pCallback)(void *, HBA_WWN, HBA_UINT32, HBA_UINT32), void *pUserData, HBA_HANDLE handle, HBA_WWN PortWWN, HBA_CALLBACKHANDLE *pCallbackHandle)
Definition: vlib_callbacks.c:69
vlib_adapter_ident::did
fc_id_t did
FC did of the port.
Definition: vlib.h:462
VLIB_MUTEX_LOCK
#define VLIB_MUTEX_LOCK(mutex)
To lock a mutex, this macro is used, which checks for errors.
Definition: vlib.h:571
vlib_data
Primary data structure used in the library.
Definition: vlib.h:484
vlib_adapter
Represenation of an adapter in the library.
Definition: vlib.h:474
vlib_data::mutex
pthread_mutex_t mutex
Protects this structure.
Definition: vlib.h:499
VLIB_MUTEX_UNLOCK
#define VLIB_MUTEX_UNLOCK(mutex)
To unlock a mutex, this macro is used, which checks for errors.
Definition: vlib.h:594
HBA_RegisterForAdapterPortStatEvents
HBA_STATUS HBA_RegisterForAdapterPortStatEvents(void(*pCallback)(void *, HBA_WWN, HBA_UINT32), void *pUserData, HBA_HANDLE handle, HBA_WWN PortWWN, HBA_PORTSTATISTICS stats, HBA_UINT32 statType, HBA_CALLBACKHANDLE *pCallbackHandle)
Definition: vlib_callbacks.c:83
VLIB_PERROR
#define VLIB_PERROR(errnum, fmt, args...)
To log errors in the library, this macro is used which invokes vlib_print_error().
Definition: vlib.h:538
vlib_event
Event data structure used in the library.
Definition: vlib.h:412
HBA_RegisterForLinkEvents
HBA_STATUS HBA_RegisterForLinkEvents(void(*pCallback)(void *, HBA_WWN, HBA_UINT32, void *, HBA_UINT32), void *pUserData, void *pRLIRBuffer, HBA_UINT32 RLIRBufferSize, HBA_HANDLE handle, HBA_CALLBACKHANDLE *pCallbackHandle)
Definition: vlib_callbacks.c:113
VLIB_INVALID_HANDLE
#define VLIB_INVALID_HANDLE
This is the value of an invalid handle as used in this library.
Definition: vlib.h:400
vlib_adapter::free_event_list
struct vlib_event_queue free_event_list
Free slots.
Definition: vlib.h:480