Commit dcc18f48 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Enable data division support for FCP devices

Try to enable data division support for FCP devices and indicate in
the adapter status flag if it succeeded.
Reviewed-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent d23948ea
...@@ -84,6 +84,7 @@ struct qdr { ...@@ -84,6 +84,7 @@ struct qdr {
#define QIB_AC_OUTBOUND_PCI_SUPPORTED 0x40 #define QIB_AC_OUTBOUND_PCI_SUPPORTED 0x40
#define QIB_RFLAGS_ENABLE_QEBSM 0x80 #define QIB_RFLAGS_ENABLE_QEBSM 0x80
#define QIB_RFLAGS_ENABLE_DATA_DIV 0x02
/** /**
* struct qib - queue information block (QIB) * struct qib - queue information block (QIB)
...@@ -284,6 +285,9 @@ struct slsb { ...@@ -284,6 +285,9 @@ struct slsb {
u8 val[QDIO_MAX_BUFFERS_PER_Q]; u8 val[QDIO_MAX_BUFFERS_PER_Q];
} __attribute__ ((packed, aligned(256))); } __attribute__ ((packed, aligned(256)));
#define CHSC_AC2_DATA_DIV_AVAILABLE 0x0010
#define CHSC_AC2_DATA_DIV_ENABLED 0x0002
struct qdio_ssqd_desc { struct qdio_ssqd_desc {
u8 flags; u8 flags;
u8:8; u8:8;
...@@ -332,6 +336,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int, ...@@ -332,6 +336,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int,
* @adapter_name: name for the adapter * @adapter_name: name for the adapter
* @qib_param_field_format: format for qib_parm_field * @qib_param_field_format: format for qib_parm_field
* @qib_param_field: pointer to 128 bytes or NULL, if no param field * @qib_param_field: pointer to 128 bytes or NULL, if no param field
* @qib_rflags: rflags to set
* @input_slib_elements: pointer to no_input_qs * 128 words of data or NULL * @input_slib_elements: pointer to no_input_qs * 128 words of data or NULL
* @output_slib_elements: pointer to no_output_qs * 128 words of data or NULL * @output_slib_elements: pointer to no_output_qs * 128 words of data or NULL
* @no_input_qs: number of input queues * @no_input_qs: number of input queues
...@@ -348,6 +353,7 @@ struct qdio_initialize { ...@@ -348,6 +353,7 @@ struct qdio_initialize {
unsigned char adapter_name[8]; unsigned char adapter_name[8];
unsigned int qib_param_field_format; unsigned int qib_param_field_format;
unsigned char *qib_param_field; unsigned char *qib_param_field;
unsigned char qib_rflags;
unsigned long *input_slib_elements; unsigned long *input_slib_elements;
unsigned long *output_slib_elements; unsigned long *output_slib_elements;
unsigned int no_input_qs; unsigned int no_input_qs;
......
...@@ -368,6 +368,8 @@ static void setup_qib(struct qdio_irq *irq_ptr, ...@@ -368,6 +368,8 @@ static void setup_qib(struct qdio_irq *irq_ptr,
if (qebsm_possible()) if (qebsm_possible())
irq_ptr->qib.rflags |= QIB_RFLAGS_ENABLE_QEBSM; irq_ptr->qib.rflags |= QIB_RFLAGS_ENABLE_QEBSM;
irq_ptr->qib.rflags |= init_data->qib_rflags;
irq_ptr->qib.qfmt = init_data->q_format; irq_ptr->qib.qfmt = init_data->q_format;
if (init_data->no_input_qs) if (init_data->no_input_qs)
irq_ptr->qib.isliba = irq_ptr->qib.isliba =
......
...@@ -77,6 +77,7 @@ struct zfcp_reqlist; ...@@ -77,6 +77,7 @@ struct zfcp_reqlist;
#define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010 #define ZFCP_STATUS_ADAPTER_HOST_CON_INIT 0x00000010
#define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100 #define ZFCP_STATUS_ADAPTER_ERP_PENDING 0x00000100
#define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200 #define ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED 0x00000200
#define ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED 0x00000400
/* remote port status */ /* remote port status */
#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001
......
...@@ -283,6 +283,7 @@ static void zfcp_qdio_setup_init_data(struct qdio_initialize *id, ...@@ -283,6 +283,7 @@ static void zfcp_qdio_setup_init_data(struct qdio_initialize *id,
id->q_format = QDIO_ZFCP_QFMT; id->q_format = QDIO_ZFCP_QFMT;
memcpy(id->adapter_name, dev_name(&id->cdev->dev), 8); memcpy(id->adapter_name, dev_name(&id->cdev->dev), 8);
ASCEBC(id->adapter_name, 8); ASCEBC(id->adapter_name, 8);
id->qib_rflags = QIB_RFLAGS_ENABLE_DATA_DIV;
id->qib_param_field_format = 0; id->qib_param_field_format = 0;
id->qib_param_field = NULL; id->qib_param_field = NULL;
id->input_slib_elements = NULL; id->input_slib_elements = NULL;
...@@ -294,8 +295,8 @@ static void zfcp_qdio_setup_init_data(struct qdio_initialize *id, ...@@ -294,8 +295,8 @@ static void zfcp_qdio_setup_init_data(struct qdio_initialize *id,
id->int_parm = (unsigned long) qdio; id->int_parm = (unsigned long) qdio;
id->input_sbal_addr_array = (void **) (qdio->res_q); id->input_sbal_addr_array = (void **) (qdio->res_q);
id->output_sbal_addr_array = (void **) (qdio->req_q); id->output_sbal_addr_array = (void **) (qdio->req_q);
} }
/** /**
* zfcp_qdio_allocate - allocate queue memory and initialize QDIO data * zfcp_qdio_allocate - allocate queue memory and initialize QDIO data
* @adapter: pointer to struct zfcp_adapter * @adapter: pointer to struct zfcp_adapter
...@@ -358,6 +359,7 @@ int zfcp_qdio_open(struct zfcp_qdio *qdio) ...@@ -358,6 +359,7 @@ int zfcp_qdio_open(struct zfcp_qdio *qdio)
struct qdio_initialize init_data; struct qdio_initialize init_data;
struct zfcp_adapter *adapter = qdio->adapter; struct zfcp_adapter *adapter = qdio->adapter;
struct ccw_device *cdev = adapter->ccw_device; struct ccw_device *cdev = adapter->ccw_device;
struct qdio_ssqd_desc ssqd;
int cc; int cc;
if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP) if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)
...@@ -368,6 +370,13 @@ int zfcp_qdio_open(struct zfcp_qdio *qdio) ...@@ -368,6 +370,13 @@ int zfcp_qdio_open(struct zfcp_qdio *qdio)
if (qdio_establish(&init_data)) if (qdio_establish(&init_data))
goto failed_establish; goto failed_establish;
if (qdio_get_ssqd_desc(init_data.cdev, &ssqd))
goto failed_qdio;
if (ssqd.qdioac2 & CHSC_AC2_DATA_DIV_ENABLED)
atomic_set_mask(ZFCP_STATUS_ADAPTER_DATA_DIV_ENABLED,
&qdio->adapter->status);
if (qdio_activate(cdev)) if (qdio_activate(cdev))
goto failed_qdio; goto failed_qdio;
......
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