aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c2
-rw-r--r--drivers/scsi/be2iscsi/be_main.c12
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c23
3 files changed, 18 insertions, 19 deletions
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index fd284ff36ecf..86162811812d 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -914,7 +914,7 @@ void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
914 stats->r2t_pdus = conn->r2t_pdus_cnt; 914 stats->r2t_pdus = conn->r2t_pdus_cnt;
915 stats->digest_err = 0; 915 stats->digest_err = 0;
916 stats->timeout_err = 0; 916 stats->timeout_err = 0;
917 stats->custom_length = 0; 917 stats->custom_length = 1;
918 strcpy(stats->custom[0].desc, "eh_abort_cnt"); 918 strcpy(stats->custom[0].desc, "eh_abort_cnt");
919 stats->custom[0].value = conn->eh_abort_cnt; 919 stats->custom[0].value = conn->eh_abort_cnt;
920} 920}
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 56467df3d6de..915c26b23ab6 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -539,7 +539,7 @@ static umode_t beiscsi_eth_get_attr_visibility(void *data, int type)
539} 539}
540 540
541/*------------------- PCI Driver operations and data ----------------- */ 541/*------------------- PCI Driver operations and data ----------------- */
542static DEFINE_PCI_DEVICE_TABLE(beiscsi_pci_id_table) = { 542static const struct pci_device_id beiscsi_pci_id_table[] = {
543 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) }, 543 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
544 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) }, 544 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) },
545 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) }, 545 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
@@ -3538,10 +3538,9 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,
3538 q->len = len; 3538 q->len = len;
3539 q->entry_size = entry_size; 3539 q->entry_size = entry_size;
3540 mem->size = len * entry_size; 3540 mem->size = len * entry_size;
3541 mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma); 3541 mem->va = pci_zalloc_consistent(phba->pcidev, mem->size, &mem->dma);
3542 if (!mem->va) 3542 if (!mem->va)
3543 return -ENOMEM; 3543 return -ENOMEM;
3544 memset(mem->va, 0, mem->size);
3545 return 0; 3544 return 0;
3546} 3545}
3547 3546
@@ -4320,9 +4319,9 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
4320 "BM_%d : No boot session\n"); 4319 "BM_%d : No boot session\n");
4321 return ret; 4320 return ret;
4322 } 4321 }
4323 nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev, 4322 nonemb_cmd.va = pci_zalloc_consistent(phba->ctrl.pdev,
4324 sizeof(*session_resp), 4323 sizeof(*session_resp),
4325 &nonemb_cmd.dma); 4324 &nonemb_cmd.dma);
4326 if (nonemb_cmd.va == NULL) { 4325 if (nonemb_cmd.va == NULL) {
4327 beiscsi_log(phba, KERN_ERR, 4326 beiscsi_log(phba, KERN_ERR,
4328 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 4327 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
@@ -4332,7 +4331,6 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
4332 return -ENOMEM; 4331 return -ENOMEM;
4333 } 4332 }
4334 4333
4335 memset(nonemb_cmd.va, 0, sizeof(*session_resp));
4336 tag = mgmt_get_session_info(phba, s_handle, 4334 tag = mgmt_get_session_info(phba, s_handle,
4337 &nonemb_cmd); 4335 &nonemb_cmd);
4338 if (!tag) { 4336 if (!tag) {
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 07934b0b9ee1..665afcb74a56 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -900,13 +900,12 @@ free_cmd:
900static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd, 900static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd,
901 int iscsi_cmd, int size) 901 int iscsi_cmd, int size)
902{ 902{
903 cmd->va = pci_alloc_consistent(phba->ctrl.pdev, size, &cmd->dma); 903 cmd->va = pci_zalloc_consistent(phba->ctrl.pdev, size, &cmd->dma);
904 if (!cmd->va) { 904 if (!cmd->va) {
905 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, 905 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
906 "BG_%d : Failed to allocate memory for if info\n"); 906 "BG_%d : Failed to allocate memory for if info\n");
907 return -ENOMEM; 907 return -ENOMEM;
908 } 908 }
909 memset(cmd->va, 0, size);
910 cmd->size = size; 909 cmd->size = size;
911 be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size); 910 be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size);
912 return 0; 911 return 0;
@@ -1015,7 +1014,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1015 if (if_info->dhcp_state) { 1014 if (if_info->dhcp_state) {
1016 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, 1015 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
1017 "BG_%d : DHCP Already Enabled\n"); 1016 "BG_%d : DHCP Already Enabled\n");
1018 return 0; 1017 goto exit;
1019 } 1018 }
1020 /* The ip_param->len is 1 in DHCP case. Setting 1019 /* The ip_param->len is 1 in DHCP case. Setting
1021 proper IP len as this it is used while 1020 proper IP len as this it is used while
@@ -1033,7 +1032,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1033 sizeof(*reldhcp)); 1032 sizeof(*reldhcp));
1034 1033
1035 if (rc) 1034 if (rc)
1036 return rc; 1035 goto exit;
1037 1036
1038 reldhcp = nonemb_cmd.va; 1037 reldhcp = nonemb_cmd.va;
1039 reldhcp->interface_hndl = phba->interface_handle; 1038 reldhcp->interface_hndl = phba->interface_handle;
@@ -1044,7 +1043,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1044 beiscsi_log(phba, KERN_WARNING, 1043 beiscsi_log(phba, KERN_WARNING,
1045 BEISCSI_LOG_CONFIG, 1044 BEISCSI_LOG_CONFIG,
1046 "BG_%d : Failed to Delete existing dhcp\n"); 1045 "BG_%d : Failed to Delete existing dhcp\n");
1047 return rc; 1046 goto exit;
1048 } 1047 }
1049 } 1048 }
1050 } 1049 }
@@ -1054,7 +1053,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1054 rc = mgmt_static_ip_modify(phba, if_info, ip_param, NULL, 1053 rc = mgmt_static_ip_modify(phba, if_info, ip_param, NULL,
1055 IP_ACTION_DEL); 1054 IP_ACTION_DEL);
1056 if (rc) 1055 if (rc)
1057 return rc; 1056 goto exit;
1058 } 1057 }
1059 1058
1060 /* Delete the Gateway settings if mode change is to DHCP */ 1059 /* Delete the Gateway settings if mode change is to DHCP */
@@ -1064,7 +1063,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1064 if (rc) { 1063 if (rc) {
1065 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, 1064 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
1066 "BG_%d : Failed to Get Gateway Addr\n"); 1065 "BG_%d : Failed to Get Gateway Addr\n");
1067 return rc; 1066 goto exit;
1068 } 1067 }
1069 1068
1070 if (gtway_addr_set.ip_addr.addr[0]) { 1069 if (gtway_addr_set.ip_addr.addr[0]) {
@@ -1076,7 +1075,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1076 beiscsi_log(phba, KERN_WARNING, 1075 beiscsi_log(phba, KERN_WARNING,
1077 BEISCSI_LOG_CONFIG, 1076 BEISCSI_LOG_CONFIG,
1078 "BG_%d : Failed to clear Gateway Addr Set\n"); 1077 "BG_%d : Failed to clear Gateway Addr Set\n");
1079 return rc; 1078 goto exit;
1080 } 1079 }
1081 } 1080 }
1082 } 1081 }
@@ -1087,7 +1086,7 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1087 OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR, 1086 OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR,
1088 sizeof(*dhcpreq)); 1087 sizeof(*dhcpreq));
1089 if (rc) 1088 if (rc)
1090 return rc; 1089 goto exit;
1091 1090
1092 dhcpreq = nonemb_cmd.va; 1091 dhcpreq = nonemb_cmd.va;
1093 dhcpreq->flags = BLOCKING; 1092 dhcpreq->flags = BLOCKING;
@@ -1095,12 +1094,14 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
1095 dhcpreq->interface_hndl = phba->interface_handle; 1094 dhcpreq->interface_hndl = phba->interface_handle;
1096 dhcpreq->ip_type = BE2_DHCP_V4; 1095 dhcpreq->ip_type = BE2_DHCP_V4;
1097 1096
1098 return mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0); 1097 rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
1099 } else { 1098 } else {
1100 return mgmt_static_ip_modify(phba, if_info, ip_param, 1099 rc = mgmt_static_ip_modify(phba, if_info, ip_param,
1101 subnet_param, IP_ACTION_ADD); 1100 subnet_param, IP_ACTION_ADD);
1102 } 1101 }
1103 1102
1103exit:
1104 kfree(if_info);
1104 return rc; 1105 return rc;
1105} 1106}
1106 1107