]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: Driver responds LS_RJT to Beacon Off
authorJames Smart <james.smart@broadcom.com>
Wed, 12 Jul 2017 22:54:55 +0000 (18:54 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 14 Jul 2017 00:14:33 +0000 (17:14 -0700)
[backport of 6c29ac6512240659455456b36bfe7d6f3b839312]
From: rkennedy <dick.kennedy@avagotech.com>

Orabug: 26439257

Beacon OFF from switch is rejected by driver.

Driver fails Beacon OFF if frequency is set to 0. As per fc-ls spec,
status, capability, frequency and duration fields are only applicable
for Beacon ON.

Remove frequency and type checks. Reject Beacon ON if duration is non
zero.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/lpfc/lpfc_els.c

index 643049918ddf314b3421f5cf2291806a1c0310db..4f218f4c105aa2611e61a3816846902548e47871 100644 (file)
@@ -5505,27 +5505,13 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
                rjt_err = LSRJT_CMD_UNSUPPORTED;
                goto rjt;
        }
-       if (beacon->lcb_frequency == 0) {
+       if (beacon->lcb_sub_command != LPFC_LCB_ON &&
+           beacon->lcb_sub_command != LPFC_LCB_OFF) {
                rjt_err = LSRJT_CMD_UNSUPPORTED;
                goto rjt;
        }
-       if ((beacon->lcb_type != LPFC_LCB_GREEN) &&
-           (beacon->lcb_type != LPFC_LCB_AMBER)) {
-               rjt_err = LSRJT_CMD_UNSUPPORTED;
-               goto rjt;
-       }
-       if ((beacon->lcb_sub_command != LPFC_LCB_ON) &&
-           (beacon->lcb_sub_command != LPFC_LCB_OFF)) {
-               rjt_err = LSRJT_CMD_UNSUPPORTED;
-               goto rjt;
-       }
-       if ((beacon->lcb_sub_command == LPFC_LCB_ON) &&
-           (beacon->lcb_type != LPFC_LCB_GREEN) &&
-           (beacon->lcb_type != LPFC_LCB_AMBER)) {
-               rjt_err = LSRJT_CMD_UNSUPPORTED;
-               goto rjt;
-       }
-       if (be16_to_cpu(beacon->lcb_duration) != 0) {
+       if (beacon->lcb_sub_command == LPFC_LCB_ON &&
+           be16_to_cpu(beacon->lcb_duration) != 0) {
                rjt_err = LSRJT_CMD_UNSUPPORTED;
                goto rjt;
        }