From patchwork Fri Jun 16 05:56:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9790593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D4A460231 for ; Fri, 16 Jun 2017 05:57:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C1A02861F for ; Fri, 16 Jun 2017 05:57:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10F6628641; Fri, 16 Jun 2017 05:57:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B79612861F for ; Fri, 16 Jun 2017 05:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752101AbdFPF5X (ORCPT ); Fri, 16 Jun 2017 01:57:23 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:34414 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbdFPF5W (ORCPT ); Fri, 16 Jun 2017 01:57:22 -0400 Received: by mail-qt0-f195.google.com with SMTP id o21so7937233qtb.1 for ; Thu, 15 Jun 2017 22:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lm+T6JQCjHr5H7qt79G3NyIN+lg/RxW4J9gFOdBU4Eo=; b=CssjIB12890+oMxCwSXdsMhN3VJAT/3UBKDdw/nP8BGbcXLssR1mStIuVTec2cBUdl B2OtDjuNphXcN5iy/zKzxLDSEAWzJhPgYq9sFayPFFoUUumKfNesGuSfx8+IbpNpupfE L7lSPmOmuRpP4TnCd+vRLq8Hvt+R8tRf0EG+Z6maQ8ltkWEDi4ICDvVRieXDQzaHs7vy kmzjxHBL5lFz7Ec6CHl7bNEpSnM3tL6yWyD/eKgCw6+83/1OUhaolhFyt4c/nEzGc5mN E8zQhNEMMSZ5P6eMbBiE2GzYtyCURLlbSzpSQaGgBcMH9u3JyhgrXyo0aOOjiNBKsKTD TueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Lm+T6JQCjHr5H7qt79G3NyIN+lg/RxW4J9gFOdBU4Eo=; b=TiNbv3ND51IVzGtx8Uv8QlnrO3FhoGN99wsNUfY7DlRSCM1lDbMPz0kEZvuqWKW+MY Y59FYWz9ehZIz3CyRr+M4iAIxK/oM9fX4QnSyjGj9JGrZUrteG1Zpf5JWWQ+K6kRquuO zOuZIioyoNTmvc1srcZKJe3gFiLNXMuwjxwjuNrz0IsEHEXcxY4L1sxXGO1MyjWw0tbM mZm5XZB/UEeYViv1ByoJ8OO1WAqJnk8HyHWo9TcCj29uXHZzdcBoXU+jKLm9FOrC5Vic hZSSBbbmFV83uwJ/cWkFrpXi/OCFffRAD+jB3oGANHiV1nIW1E4oErJdI7wVKZC4pgn1 EUog== X-Gm-Message-State: AKS2vOx6IP7YnmWmWH98odjJX0nc5ynpf1B8iejOskfO3gA5lkjK0rpe ahPD6A6fmvp/N1px X-Received: by 10.55.217.136 with SMTP id q8mr10191426qkl.220.1497592640440; Thu, 15 Jun 2017 22:57:20 -0700 (PDT) Received: from localhost.localdomain ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id d16sm925428qke.5.2017.06.15.22.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 22:57:19 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 10/11] Driver responds LS_RJT to Beacon Off ELS - Linux Date: Thu, 15 Jun 2017 22:56:50 -0700 Message-Id: <20170616055651.9674-11-jsmart2021@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616055651.9674-1-jsmart2021@gmail.com> References: <20170616055651.9674-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_els.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 54de984d695f..6d1d6f691df4 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -5703,27 +5703,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; }