aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorAdheer Chandravanshi <adheer.chandravanshi@qlogic.com>2013-03-25 08:08:32 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-04-11 18:35:34 -0400
commitc962c18bb72a7d9a70586908fed431f7c29b75c3 (patch)
tree88f9daf84bb18e46350790cede704db89358393c /drivers/scsi/qla4xxx
parent2902eb495d71e5cd410c9d94200d35e047404630 (diff)
[SCSI] qla4xxx: Replace dev type macros with generic portal type macros
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_def.h3
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c26
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h
index b487b0aa4dee..ddf16a86bbf5 100644
--- a/drivers/scsi/qla4xxx/ql4_def.h
+++ b/drivers/scsi/qla4xxx/ql4_def.h
@@ -159,9 +159,6 @@
159#define LSDW(x) ((u32)((u64)(x))) 159#define LSDW(x) ((u32)((u64)(x)))
160#define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16)) 160#define MSDW(x) ((u32)((((u64)(x)) >> 16) >> 16))
161 161
162#define DEV_TYPE_IPV4 "ipv4"
163#define DEV_TYPE_IPV6 "ipv6"
164
165#define DEV_DB_NON_PERSISTENT 0 162#define DEV_DB_NON_PERSISTENT 0
166#define DEV_DB_PERSISTENT 1 163#define DEV_DB_PERSISTENT 1
167 164
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 497ac681d733..95a951c6e579 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2021,11 +2021,13 @@ static int qla4xxx_copy_from_fwddb_param(struct iscsi_bus_flash_session *sess,
2021 options = le16_to_cpu(fw_ddb_entry->options); 2021 options = le16_to_cpu(fw_ddb_entry->options);
2022 conn->is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, &options); 2022 conn->is_fw_assigned_ipv6 = test_bit(OPT_IS_FW_ASSIGNED_IPV6, &options);
2023 if (test_bit(OPT_IPV6_DEVICE, &options)) { 2023 if (test_bit(OPT_IPV6_DEVICE, &options)) {
2024 rc = iscsi_switch_str_param(&sess->portal_type, DEV_TYPE_IPV6); 2024 rc = iscsi_switch_str_param(&sess->portal_type,
2025 PORTAL_TYPE_IPV6);
2025 if (rc) 2026 if (rc)
2026 goto exit_copy; 2027 goto exit_copy;
2027 } else { 2028 } else {
2028 rc = iscsi_switch_str_param(&sess->portal_type, DEV_TYPE_IPV4); 2029 rc = iscsi_switch_str_param(&sess->portal_type,
2030 PORTAL_TYPE_IPV4);
2029 if (rc) 2031 if (rc)
2030 goto exit_copy; 2032 goto exit_copy;
2031 } 2033 }
@@ -2161,7 +2163,7 @@ static int qla4xxx_copy_to_fwddb_param(struct iscsi_bus_flash_session *sess,
2161 2163
2162 options = le16_to_cpu(fw_ddb_entry->options); 2164 options = le16_to_cpu(fw_ddb_entry->options);
2163 SET_BITVAL(conn->is_fw_assigned_ipv6, options, BIT_11); 2165 SET_BITVAL(conn->is_fw_assigned_ipv6, options, BIT_11);
2164 if (!strncmp(sess->portal_type, DEV_TYPE_IPV6, 4)) 2166 if (!strncmp(sess->portal_type, PORTAL_TYPE_IPV6, 4))
2165 options |= BIT_8; 2167 options |= BIT_8;
2166 else 2168 else
2167 options &= ~BIT_8; 2169 options &= ~BIT_8;
@@ -5578,8 +5580,8 @@ static int qla4xxx_sysfs_ddb_add(struct Scsi_Host *shost, const char *buf,
5578 uint32_t options = 0; 5580 uint32_t options = 0;
5579 uint32_t rval = QLA_ERROR; 5581 uint32_t rval = QLA_ERROR;
5580 5582
5581 if (strncasecmp(DEV_TYPE_IPV4, buf, 4) && 5583 if (strncasecmp(PORTAL_TYPE_IPV4, buf, 4) &&
5582 strncasecmp(DEV_TYPE_IPV6, buf, 4)) { 5584 strncasecmp(PORTAL_TYPE_IPV6, buf, 4)) {
5583 DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Invalid portal type\n", 5585 DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Invalid portal type\n",
5584 __func__)); 5586 __func__));
5585 goto exit_ddb_add; 5587 goto exit_ddb_add;
@@ -5663,7 +5665,7 @@ static int qla4xxx_sysfs_ddb_apply(struct iscsi_bus_flash_session *fnode_sess,
5663 goto exit_ddb_apply; 5665 goto exit_ddb_apply;
5664 } 5666 }
5665 5667
5666 if (!strncasecmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 5668 if (!strncasecmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
5667 options |= IPV6_DEFAULT_DDB_ENTRY; 5669 options |= IPV6_DEFAULT_DDB_ENTRY;
5668 5670
5669 rval = qla4xxx_get_default_ddb(ha, options, fw_ddb_entry_dma); 5671 rval = qla4xxx_get_default_ddb(ha, options, fw_ddb_entry_dma);
@@ -5858,7 +5860,7 @@ static int qla4xxx_sysfs_ddb_login(struct iscsi_bus_flash_session *fnode_sess,
5858 goto exit_ddb_login; 5860 goto exit_ddb_login;
5859 } 5861 }
5860 5862
5861 if (!strncasecmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 5863 if (!strncasecmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
5862 options |= IPV6_DEFAULT_DDB_ENTRY; 5864 options |= IPV6_DEFAULT_DDB_ENTRY;
5863 5865
5864 ret = qla4xxx_get_default_ddb(ha, options, fw_ddb_entry_dma); 5866 ret = qla4xxx_get_default_ddb(ha, options, fw_ddb_entry_dma);
@@ -6038,7 +6040,7 @@ static int qla4xxx_sysfs_ddb_logout(struct iscsi_bus_flash_session *fnode_sess,
6038 strncpy(flash_tddb->iscsi_name, fnode_sess->targetname, 6040 strncpy(flash_tddb->iscsi_name, fnode_sess->targetname,
6039 ISCSI_NAME_SIZE); 6041 ISCSI_NAME_SIZE);
6040 6042
6041 if (!strncmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 6043 if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
6042 sprintf(flash_tddb->ip_addr, "%pI6", fnode_conn->ipaddress); 6044 sprintf(flash_tddb->ip_addr, "%pI6", fnode_conn->ipaddress);
6043 else 6045 else
6044 sprintf(flash_tddb->ip_addr, "%pI4", fnode_conn->ipaddress); 6046 sprintf(flash_tddb->ip_addr, "%pI4", fnode_conn->ipaddress);
@@ -6220,7 +6222,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
6220 fnode_sess->default_taskmgmt_timeout); 6222 fnode_sess->default_taskmgmt_timeout);
6221 break; 6223 break;
6222 case ISCSI_FLASHNODE_IPADDR: 6224 case ISCSI_FLASHNODE_IPADDR:
6223 if (!strncmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 6225 if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
6224 rc = sprintf(buf, "%pI6\n", fnode_conn->ipaddress); 6226 rc = sprintf(buf, "%pI6\n", fnode_conn->ipaddress);
6225 else 6227 else
6226 rc = sprintf(buf, "%pI4\n", fnode_conn->ipaddress); 6228 rc = sprintf(buf, "%pI4\n", fnode_conn->ipaddress);
@@ -6232,7 +6234,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
6232 rc = sprintf(buf, "\n"); 6234 rc = sprintf(buf, "\n");
6233 break; 6235 break;
6234 case ISCSI_FLASHNODE_REDIRECT_IPADDR: 6236 case ISCSI_FLASHNODE_REDIRECT_IPADDR:
6235 if (!strncmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 6237 if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
6236 rc = sprintf(buf, "%pI6\n", 6238 rc = sprintf(buf, "%pI6\n",
6237 fnode_conn->redirect_ipaddr); 6239 fnode_conn->redirect_ipaddr);
6238 else 6240 else
@@ -6249,7 +6251,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
6249 rc = sprintf(buf, "%u\n", fnode_conn->ipv4_tos); 6251 rc = sprintf(buf, "%u\n", fnode_conn->ipv4_tos);
6250 break; 6252 break;
6251 case ISCSI_FLASHNODE_IPV6_TC: 6253 case ISCSI_FLASHNODE_IPV6_TC:
6252 if (!strncmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 6254 if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
6253 rc = sprintf(buf, "%u\n", 6255 rc = sprintf(buf, "%u\n",
6254 fnode_conn->ipv6_traffic_class); 6256 fnode_conn->ipv6_traffic_class);
6255 else 6257 else
@@ -6259,7 +6261,7 @@ qla4xxx_sysfs_ddb_get_param(struct iscsi_bus_flash_session *fnode_sess,
6259 rc = sprintf(buf, "%u\n", fnode_conn->ipv6_flow_label); 6261 rc = sprintf(buf, "%u\n", fnode_conn->ipv6_flow_label);
6260 break; 6262 break;
6261 case ISCSI_FLASHNODE_LINK_LOCAL_IPV6: 6263 case ISCSI_FLASHNODE_LINK_LOCAL_IPV6:
6262 if (!strncmp(fnode_sess->portal_type, DEV_TYPE_IPV6, 4)) 6264 if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4))
6263 rc = sprintf(buf, "%pI6\n", 6265 rc = sprintf(buf, "%pI6\n",
6264 fnode_conn->link_local_ipv6_addr); 6266 fnode_conn->link_local_ipv6_addr);
6265 else 6267 else