/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _VDC_H
#define _VDC_H
/*
* Virtual disk client implementation definitions
*/
#include <sys/sysmacros.h>
#include <sys/vio_mailbox.h>
#include <sys/vdsk_mailbox.h>
#include <sys/vdsk_common.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Bit-field values to indicate if parts of the vdc driver are initialised.
*/
/*
* Definitions of MD nodes/properties.
*/
/*
* Definition of actions to be carried out when processing the sequence ID
* of a message received from the vDisk server. The function verifying the
* sequence number checks the 'seq_num_xxx' fields in the soft state and
* returns whether the message should be processed (VDC_SEQ_NUM_TODO) or
* whether it was it was previously processed (VDC_SEQ_NUM_SKIP).
*/
/*
* DRing reserved entries. Entry 0 is reserved and only used for error
* checking. This is done so that error checking can be done even if the
*/
#define VDC_DRING_FIRST_ENTRY \
/*
* Flags for virtual disk operations.
*/
/*
* Macros to get UNIT and PART number
*/
/*
* Scheme to store the instance number and the slice number in the minor number.
* (NOTE: Uses the same format and definitions as the sd(7D) driver)
*/
/* max number of handshake retries per server */
/* minimum number of attribute negotiations before handshake failure */
/*
* This macro returns the number of Hz that the vdc driver should wait before
* a timeout is triggered. The 'timeout' parameter specifiecs the wait
* time in Hz. The 'mul' parameter allows for a multiplier to be
* specified allowing for a backoff to be implemented (e.g. using the
* retry number as a multiplier) where the wait time will get longer if
* there is no response on the previous retry.
*/
/*
* Macros to manipulate Descriptor Ring variables in the soft state
* structure.
*/
{ \
}
/* Initialise the Session ID and Sequence Num in the DRing msg */
/*
* The states that the read thread can be in.
*/
typedef enum vdc_rd_state {
/*
* The states that the vdc-vds connection can be in.
*/
typedef enum vdc_state {
} vdc_state_t;
/*
* States of the service provided by a vds server
*/
typedef enum vdc_service_state {
/*
* The states that the vdc instance can be in.
*/
typedef enum vdc_lc_state {
/*
* Local Descriptor Ring entry
*
* vdc creates a Local (private) descriptor ring the same size as the
* public descriptor ring it exports to vds.
*/
typedef enum {
typedef struct vdc_local_desc {
int slice;
/*
* I/O queue used for checking backend or failfast
*/
typedef struct vdc_io {
} vdc_io_t;
/*
* Per vDisk server channel states
*/
/*
* vDisk server information
*/
typedef struct vdc_server {
} vdc_server_t;
/*
* vdc soft state structure
*/
typedef struct vdc {
/*
* The ownership fields are protected by the lock mutex. The
* ownership_lock mutex is used to serialize ownership operations;
* it should be acquired before the lock mutex.
*/
/*
* The eio and failfast fields are protected by the lock mutex.
*/
/*
* kstats used to store I/O statistics consumed by iostat(1M).
* These are protected by the lock mutex.
*/
} vdc_t;
/*
* Ownership status flags
*/
/*
* Reservation conflict panic message
*/
/*
* Debugging macros
*/
#ifdef DEBUG
extern int vdc_msglevel;
extern uint64_t vdc_matchinst;
do { \
if (vdc_msglevel > err_level && \
__func__, __VA_ARGS__); \
} while (0);
do { \
if (vdc_msglevel > err_level) \
} while (0);
DMSGX(0, "sq:%lu start:%d end:%d ident:%lu\n", \
#else /* !DEBUG */
#endif /* !DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _VDC_H */