Commit 126c5cc3 authored by Brian King's avatar Brian King Committed by James Bottomley

[SCSI] ibmvscsi: Add support for capabilities MAD

Add support to ibmvscsi for the capabilities MAD. This command gets sent
to the Virtual I/O server prior to login in order to communicate client
capabilities. Additionally it returns information regarding capabilities
that the server supports. The two main capabilities communicated in this
MAD are related to partition migration and client reserve. Client reserve
allows for SCSI-2 reservations to be sent to virtual disks which are backed
by physical LUNs and will result in the reservation being sent to the
physical LUN.
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent c1988e31
This diff is collapsed.
......@@ -90,6 +90,7 @@ struct event_pool {
/* all driver data associated with a host adapter */
struct ibmvscsi_host_data {
atomic_t request_limit;
int client_migrated;
struct device *dev;
struct event_pool pool;
struct crq_queue queue;
......@@ -97,6 +98,9 @@ struct ibmvscsi_host_data {
struct list_head sent;
struct Scsi_Host *host;
struct mad_adapter_info_data madapter_info;
struct capabilities caps;
dma_addr_t caps_addr;
dma_addr_t adapter_info_addr;
};
/* routines for managing a command/response queue */
......
......@@ -37,6 +37,7 @@
#define SRP_VERSION "16.a"
#define SRP_MAX_IU_LEN 256
#define SRP_MAX_LOC_LEN 32
union srp_iu {
struct srp_login_req login_req;
......@@ -87,6 +88,7 @@ enum viosrp_mad_types {
VIOSRP_ERROR_LOG_TYPE = 0x02,
VIOSRP_ADAPTER_INFO_TYPE = 0x03,
VIOSRP_HOST_CONFIG_TYPE = 0x04,
VIOSRP_CAPABILITIES_TYPE = 0x05,
VIOSRP_ENABLE_FAST_FAIL = 0x08,
};
......@@ -96,6 +98,28 @@ enum viosrp_mad_status {
VIOSRP_MAD_FAILED = 0xF7,
};
enum viosrp_capability_type {
MIGRATION_CAPABILITIES = 0x01,
RESERVATION_CAPABILITIES = 0x02,
};
enum viosrp_capability_support {
SERVER_DOES_NOT_SUPPORTS_CAP = 0x0,
SERVER_SUPPORTS_CAP = 0x01,
SERVER_CAP_DATA = 0x02,
};
enum viosrp_reserve_type {
CLIENT_RESERVE_SCSI_2 = 0x01,
};
enum viosrp_capability_flag {
CLIENT_MIGRATED = 0x01,
CLIENT_RECONNECT = 0x02,
CAP_LIST_SUPPORTED = 0x04,
CAP_LIST_DATA = 0x08,
};
/*
* Common MAD header
*/
......@@ -138,12 +162,42 @@ struct viosrp_fast_fail {
struct mad_common common;
};
struct viosrp_capabilities {
struct mad_common common;
u64 buffer;
};
struct mad_capability_common {
u32 cap_type;
u16 length;
u16 server_support;
};
struct mad_reserve_cap {
struct mad_capability_common common;
u32 type;
};
struct mad_migration_cap {
struct mad_capability_common common;
u32 ecl;
};
struct capabilities{
u32 flags;
char name[SRP_MAX_LOC_LEN];
char loc[SRP_MAX_LOC_LEN];
struct mad_migration_cap migration;
struct mad_reserve_cap reserve;
};
union mad_iu {
struct viosrp_empty_iu empty_iu;
struct viosrp_error_log error_log;
struct viosrp_adapter_info adapter_info;
struct viosrp_host_config host_config;
struct viosrp_fast_fail fast_fail;
struct viosrp_capabilities capabilities;
};
union viosrp_iu {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment