diff options
Diffstat (limited to 'drivers/scsi/esas2r/esas2r_ioctl.c')
-rw-r--r-- | drivers/scsi/esas2r/esas2r_ioctl.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index e5b09027e066..d89a0277a8e1 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/scsi/esas2r/esas2r_ioctl.c | |||
@@ -347,7 +347,7 @@ static bool csmi_ioctl_tunnel(struct esas2r_adapter *a, | |||
347 | { | 347 | { |
348 | struct atto_vda_ioctl_req *ioctl = &rq->vrq->ioctl; | 348 | struct atto_vda_ioctl_req *ioctl = &rq->vrq->ioctl; |
349 | 349 | ||
350 | if (a->flags & AF_DEGRADED_MODE) | 350 | if (test_bit(AF_DEGRADED_MODE, &a->flags)) |
351 | return false; | 351 | return false; |
352 | 352 | ||
353 | esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge); | 353 | esas2r_sgc_init(sgc, a, rq, rq->vrq->ioctl.sge); |
@@ -463,7 +463,7 @@ static int csmi_ioctl_callback(struct esas2r_adapter *a, | |||
463 | gcc->bios_minor_rev = LOBYTE(HIWORD(a->flash_ver)); | 463 | gcc->bios_minor_rev = LOBYTE(HIWORD(a->flash_ver)); |
464 | gcc->bios_build_rev = LOWORD(a->flash_ver); | 464 | gcc->bios_build_rev = LOWORD(a->flash_ver); |
465 | 465 | ||
466 | if (a->flags2 & AF2_THUNDERLINK) | 466 | if (test_bit(AF2_THUNDERLINK, &a->flags2)) |
467 | gcc->cntlr_flags = CSMI_CNTLRF_SAS_HBA | 467 | gcc->cntlr_flags = CSMI_CNTLRF_SAS_HBA |
468 | | CSMI_CNTLRF_SATA_HBA; | 468 | | CSMI_CNTLRF_SATA_HBA; |
469 | else | 469 | else |
@@ -485,7 +485,7 @@ static int csmi_ioctl_callback(struct esas2r_adapter *a, | |||
485 | { | 485 | { |
486 | struct atto_csmi_get_cntlr_sts *gcs = &ioctl_csmi->cntlr_sts; | 486 | struct atto_csmi_get_cntlr_sts *gcs = &ioctl_csmi->cntlr_sts; |
487 | 487 | ||
488 | if (a->flags & AF_DEGRADED_MODE) | 488 | if (test_bit(AF_DEGRADED_MODE, &a->flags)) |
489 | gcs->status = CSMI_CNTLR_STS_FAILED; | 489 | gcs->status = CSMI_CNTLR_STS_FAILED; |
490 | else | 490 | else |
491 | gcs->status = CSMI_CNTLR_STS_GOOD; | 491 | gcs->status = CSMI_CNTLR_STS_GOOD; |
@@ -819,10 +819,10 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
819 | 819 | ||
820 | gai->adap_type = ATTO_GAI_AT_ESASRAID2; | 820 | gai->adap_type = ATTO_GAI_AT_ESASRAID2; |
821 | 821 | ||
822 | if (a->flags2 & AF2_THUNDERLINK) | 822 | if (test_bit(AF2_THUNDERLINK, &a->flags2)) |
823 | gai->adap_type = ATTO_GAI_AT_TLSASHBA; | 823 | gai->adap_type = ATTO_GAI_AT_TLSASHBA; |
824 | 824 | ||
825 | if (a->flags & AF_DEGRADED_MODE) | 825 | if (test_bit(AF_DEGRADED_MODE, &a->flags)) |
826 | gai->adap_flags |= ATTO_GAI_AF_DEGRADED; | 826 | gai->adap_flags |= ATTO_GAI_AF_DEGRADED; |
827 | 827 | ||
828 | gai->adap_flags |= ATTO_GAI_AF_SPT_SUPP | | 828 | gai->adap_flags |= ATTO_GAI_AF_SPT_SUPP | |
@@ -938,7 +938,7 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
938 | u32 total_len = ESAS2R_FWCOREDUMP_SZ; | 938 | u32 total_len = ESAS2R_FWCOREDUMP_SZ; |
939 | 939 | ||
940 | /* Size is zero if a core dump isn't present */ | 940 | /* Size is zero if a core dump isn't present */ |
941 | if (!(a->flags2 & AF2_COREDUMP_SAVED)) | 941 | if (!test_bit(AF2_COREDUMP_SAVED, &a->flags2)) |
942 | total_len = 0; | 942 | total_len = 0; |
943 | 943 | ||
944 | if (len > total_len) | 944 | if (len > total_len) |
@@ -960,8 +960,7 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
960 | memset(a->fw_coredump_buff, 0, | 960 | memset(a->fw_coredump_buff, 0, |
961 | ESAS2R_FWCOREDUMP_SZ); | 961 | ESAS2R_FWCOREDUMP_SZ); |
962 | 962 | ||
963 | esas2r_lock_clear_flags(&a->flags2, | 963 | clear_bit(AF2_COREDUMP_SAVED, &a->flags2); |
964 | AF2_COREDUMP_SAVED); | ||
965 | } else if (trc->trace_func != ATTO_TRC_TF_GET_INFO) { | 964 | } else if (trc->trace_func != ATTO_TRC_TF_GET_INFO) { |
966 | hi->status = ATTO_STS_UNSUPPORTED; | 965 | hi->status = ATTO_STS_UNSUPPORTED; |
967 | break; | 966 | break; |
@@ -973,7 +972,7 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
973 | trc->total_length = ESAS2R_FWCOREDUMP_SZ; | 972 | trc->total_length = ESAS2R_FWCOREDUMP_SZ; |
974 | 973 | ||
975 | /* Return zero length buffer if core dump not present */ | 974 | /* Return zero length buffer if core dump not present */ |
976 | if (!(a->flags2 & AF2_COREDUMP_SAVED)) | 975 | if (!test_bit(AF2_COREDUMP_SAVED, &a->flags2)) |
977 | trc->total_length = 0; | 976 | trc->total_length = 0; |
978 | } else { | 977 | } else { |
979 | hi->status = ATTO_STS_UNSUPPORTED; | 978 | hi->status = ATTO_STS_UNSUPPORTED; |
@@ -1048,6 +1047,7 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
1048 | else if (spt->flags & ATTO_SPTF_HEAD_OF_Q) | 1047 | else if (spt->flags & ATTO_SPTF_HEAD_OF_Q) |
1049 | rq->vrq->scsi.flags |= cpu_to_le32(FCP_CMND_TA_HEAD_Q); | 1048 | rq->vrq->scsi.flags |= cpu_to_le32(FCP_CMND_TA_HEAD_Q); |
1050 | 1049 | ||
1050 | |||
1051 | if (!esas2r_build_sg_list(a, rq, sgc)) { | 1051 | if (!esas2r_build_sg_list(a, rq, sgc)) { |
1052 | hi->status = ATTO_STS_OUT_OF_RSRC; | 1052 | hi->status = ATTO_STS_OUT_OF_RSRC; |
1053 | break; | 1053 | break; |
@@ -1139,15 +1139,15 @@ static int hba_ioctl_callback(struct esas2r_adapter *a, | |||
1139 | break; | 1139 | break; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | if (a->flags & AF_CHPRST_NEEDED) | 1142 | if (test_bit(AF_CHPRST_NEEDED, &a->flags)) |
1143 | ac->adap_state = ATTO_AC_AS_RST_SCHED; | 1143 | ac->adap_state = ATTO_AC_AS_RST_SCHED; |
1144 | else if (a->flags & AF_CHPRST_PENDING) | 1144 | else if (test_bit(AF_CHPRST_PENDING, &a->flags)) |
1145 | ac->adap_state = ATTO_AC_AS_RST_IN_PROG; | 1145 | ac->adap_state = ATTO_AC_AS_RST_IN_PROG; |
1146 | else if (a->flags & AF_DISC_PENDING) | 1146 | else if (test_bit(AF_DISC_PENDING, &a->flags)) |
1147 | ac->adap_state = ATTO_AC_AS_RST_DISC; | 1147 | ac->adap_state = ATTO_AC_AS_RST_DISC; |
1148 | else if (a->flags & AF_DISABLED) | 1148 | else if (test_bit(AF_DISABLED, &a->flags)) |
1149 | ac->adap_state = ATTO_AC_AS_DISABLED; | 1149 | ac->adap_state = ATTO_AC_AS_DISABLED; |
1150 | else if (a->flags & AF_DEGRADED_MODE) | 1150 | else if (test_bit(AF_DEGRADED_MODE, &a->flags)) |
1151 | ac->adap_state = ATTO_AC_AS_DEGRADED; | 1151 | ac->adap_state = ATTO_AC_AS_DEGRADED; |
1152 | else | 1152 | else |
1153 | ac->adap_state = ATTO_AC_AS_OK; | 1153 | ac->adap_state = ATTO_AC_AS_OK; |