Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/vmbus_reg.h
Show All 24 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _VMBUS_REG_H_ | #ifndef _VMBUS_REG_H_ | ||||
#define _VMBUS_REG_H_ | #define _VMBUS_REG_H_ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <dev/hyperv/vmbus/hyperv_reg.h> | |||||
/* | /* | ||||
* Hyper-V SynIC message format. | * Hyper-V SynIC message format. | ||||
*/ | */ | ||||
#define VMBUS_MSG_DSIZE_MAX 240 | #define VMBUS_MSG_DSIZE_MAX 240 | ||||
#define VMBUS_MSG_SIZE 256 | #define VMBUS_MSG_SIZE 256 | ||||
Show All 32 Lines | |||||
/* | /* | ||||
* Channel | * Channel | ||||
*/ | */ | ||||
#define VMBUS_CHAN_MAX_COMPAT 256 | #define VMBUS_CHAN_MAX_COMPAT 256 | ||||
#define VMBUS_CHAN_MAX (VMBUS_EVTFLAG_LEN * VMBUS_EVTFLAGS_MAX) | #define VMBUS_CHAN_MAX (VMBUS_EVTFLAG_LEN * VMBUS_EVTFLAGS_MAX) | ||||
/* | /* | ||||
* GPA range. | |||||
*/ | |||||
struct vmbus_gpa_range { | |||||
uint32_t gpa_len; | |||||
uint32_t gpa_ofs; | |||||
uint64_t gpa_page[]; | |||||
} __packed; | |||||
/* | |||||
* Channel messages | * Channel messages | ||||
* - Embedded in vmbus_message.msg_data, e.g. response. | * - Embedded in vmbus_message.msg_data, e.g. response. | ||||
* - Embedded in hypercall_postmsg_in.hc_data, e.g. request. | * - Embedded in hypercall_postmsg_in.hc_data, e.g. request. | ||||
*/ | */ | ||||
#define VMBUS_CHANMSG_TYPE_CHANNEL_REQ 3 /* REQ */ | #define VMBUS_CHANMSG_TYPE_CHANNEL_REQ 3 /* REQ */ | ||||
#define VMBUS_CHANMSG_TYPE_CHOPEN 5 /* REQ */ | #define VMBUS_CHANMSG_TYPE_CHOPEN 5 /* REQ */ | ||||
#define VMBUS_CHANMSG_TYPE_CHOPEN_RESP 6 /* RESP */ | #define VMBUS_CHANMSG_TYPE_CHOPEN_RESP 6 /* RESP */ | ||||
#define VMBUS_CHANMSG_TYPE_GPADL_CONN 8 /* REQ */ | |||||
#define VMBUS_CHANMSG_TYPE_GPADL_SUBCONN 9 /* REQ */ | |||||
#define VMBUS_CHANMSG_TYPE_GPADP_CONNRESP 10 /* RESP */ | |||||
#define VMBUS_CHANMSG_TYPE_INIT_CONTACT 14 /* REQ */ | #define VMBUS_CHANMSG_TYPE_INIT_CONTACT 14 /* REQ */ | ||||
#define VMBUS_CHANMSG_TYPE_VERSION_RESP 15 /* RESP */ | #define VMBUS_CHANMSG_TYPE_VERSION_RESP 15 /* RESP */ | ||||
#define VMBUS_CHANMSG_TYPE_UNLOAD 16 /* REQ */ | #define VMBUS_CHANMSG_TYPE_UNLOAD 16 /* REQ */ | ||||
struct vmbus_chanmsg_hdr { | struct vmbus_chanmsg_hdr { | ||||
uint32_t chm_type; /* VMBUS_CHANMSG_TYPE_ */ | uint32_t chm_type; /* VMBUS_CHANMSG_TYPE_ */ | ||||
uint32_t chm_rsvd; | uint32_t chm_rsvd; | ||||
} __packed; | } __packed; | ||||
Show All 36 Lines | #define VMBUS_CHANMSG_CHOPEN_UDATA_SIZE 120 | ||||
uint8_t chm_udata[VMBUS_CHANMSG_CHOPEN_UDATA_SIZE]; | uint8_t chm_udata[VMBUS_CHANMSG_CHOPEN_UDATA_SIZE]; | ||||
} __packed; | } __packed; | ||||
/* VMBUS_CHANMSG_TYPE_CHOPEN_RESP */ | /* VMBUS_CHANMSG_TYPE_CHOPEN_RESP */ | ||||
struct vmbus_chanmsg_chopen_resp { | struct vmbus_chanmsg_chopen_resp { | ||||
struct vmbus_chanmsg_hdr chm_hdr; | struct vmbus_chanmsg_hdr chm_hdr; | ||||
uint32_t chm_chanid; | uint32_t chm_chanid; | ||||
uint32_t chm_openid; | uint32_t chm_openid; | ||||
uint32_t chm_status; | |||||
} __packed; | |||||
/* VMBUS_CHANMSG_TYPE_GPADL_CONN */ | |||||
struct vmbus_chanmsg_gpadl_conn { | |||||
struct vmbus_chanmsg_hdr chm_hdr; | |||||
uint32_t chm_chanid; | |||||
uint32_t chm_gpadl; | |||||
uint16_t chm_range_len; | |||||
uint16_t chm_range_cnt; | |||||
struct vmbus_gpa_range chm_range; | |||||
} __packed; | |||||
#define VMBUS_CHANMSG_GPADL_CONN_PGMAX 26 | |||||
CTASSERT(__offsetof(struct vmbus_chanmsg_gpadl_conn, | |||||
chm_range.gpa_page[VMBUS_CHANMSG_GPADL_CONN_PGMAX]) <= | |||||
HYPERCALL_POSTMSGIN_DSIZE_MAX); | |||||
/* VMBUS_CHANMSG_TYPE_GPADL_SUBCONN */ | |||||
struct vmbus_chanmsg_gpadl_subconn { | |||||
struct vmbus_chanmsg_hdr chm_hdr; | |||||
uint32_t chm_msgno; | |||||
uint32_t chm_gpadl; | |||||
uint64_t chm_gpa_page[]; | |||||
} __packed; | |||||
#define VMBUS_CHANMSG_GPADL_SUBCONN_PGMAX 28 | |||||
CTASSERT(__offsetof(struct vmbus_chanmsg_gpadl_subconn, | |||||
chm_gpa_page[VMBUS_CHANMSG_GPADL_SUBCONN_PGMAX]) <= | |||||
HYPERCALL_POSTMSGIN_DSIZE_MAX); | |||||
/* VMBUS_CHANMSG_TYPE_GPADL_CONNRESP */ | |||||
struct vmbus_chanmsg_gpadl_connresp { | |||||
struct vmbus_chanmsg_hdr chm_hdr; | |||||
uint32_t chm_chanid; | |||||
uint32_t chm_gpadl; | |||||
uint32_t chm_status; | uint32_t chm_status; | ||||
} __packed; | } __packed; | ||||
#endif /* !_VMBUS_REG_H_ */ | #endif /* !_VMBUS_REG_H_ */ |