Commit 45d8c30f authored by Tyrel Datwyler's avatar Tyrel Datwyler Committed by Martin K. Petersen

ibmvscsi: Replace magic values in set_adpater_info() with defines

Add defines for mad version and mad os_type, and replace the magic
numbers in set_adapter_info() accordingly.
Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarManoj Kumar <manoj@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 55c9b1e5
...@@ -283,8 +283,8 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata) ...@@ -283,8 +283,8 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
hostdata->madapter_info.partition_number = hostdata->madapter_info.partition_number =
cpu_to_be32(partition_number); cpu_to_be32(partition_number);
hostdata->madapter_info.mad_version = cpu_to_be32(1); hostdata->madapter_info.mad_version = cpu_to_be32(SRP_MAD_VERSION_1);
hostdata->madapter_info.os_type = cpu_to_be32(2); hostdata->madapter_info.os_type = cpu_to_be32(SRP_MAD_OS_LINUX);
} }
/** /**
...@@ -1398,7 +1398,7 @@ static void adapter_info_rsp(struct srp_event_struct *evt_struct) ...@@ -1398,7 +1398,7 @@ static void adapter_info_rsp(struct srp_event_struct *evt_struct)
hostdata->host->max_sectors = hostdata->host->max_sectors =
be32_to_cpu(hostdata->madapter_info.port_max_txu[0]) >> 9; be32_to_cpu(hostdata->madapter_info.port_max_txu[0]) >> 9;
if (be32_to_cpu(hostdata->madapter_info.os_type) == 3 && if (be32_to_cpu(hostdata->madapter_info.os_type) == SRP_MAD_OS_AIX &&
strcmp(hostdata->madapter_info.srp_version, "1.6a") <= 0) { strcmp(hostdata->madapter_info.srp_version, "1.6a") <= 0) {
dev_err(hostdata->dev, "host (Ver. %s) doesn't support large transfers\n", dev_err(hostdata->dev, "host (Ver. %s) doesn't support large transfers\n",
hostdata->madapter_info.srp_version); hostdata->madapter_info.srp_version);
...@@ -1407,7 +1407,7 @@ static void adapter_info_rsp(struct srp_event_struct *evt_struct) ...@@ -1407,7 +1407,7 @@ static void adapter_info_rsp(struct srp_event_struct *evt_struct)
hostdata->host->sg_tablesize = MAX_INDIRECT_BUFS; hostdata->host->sg_tablesize = MAX_INDIRECT_BUFS;
} }
if (be32_to_cpu(hostdata->madapter_info.os_type) == 3) { if (be32_to_cpu(hostdata->madapter_info.os_type) == SRP_MAD_OS_AIX) {
enable_fast_fail(hostdata); enable_fast_fail(hostdata);
return; return;
} }
......
...@@ -221,7 +221,10 @@ struct mad_adapter_info_data { ...@@ -221,7 +221,10 @@ struct mad_adapter_info_data {
char srp_version[8]; char srp_version[8];
char partition_name[96]; char partition_name[96];
__be32 partition_number; __be32 partition_number;
#define SRP_MAD_VERSION_1 1
__be32 mad_version; __be32 mad_version;
#define SRP_MAD_OS_LINUX 2
#define SRP_MAD_OS_AIX 3
__be32 os_type; __be32 os_type;
__be32 port_max_txu[8]; /* per-port maximum transfer */ __be32 port_max_txu[8]; /* per-port maximum transfer */
}; };
......
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