From patchwork Tue Dec 22 10:11:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kashyap Desai X-Patchwork-Id: 11986231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08D39C433E6 for ; Tue, 22 Dec 2020 10:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7F322310D for ; Tue, 22 Dec 2020 10:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726329AbgLVKNr (ORCPT ); Tue, 22 Dec 2020 05:13:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbgLVKNr (ORCPT ); Tue, 22 Dec 2020 05:13:47 -0500 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E7BC0611CB for ; Tue, 22 Dec 2020 02:12:53 -0800 (PST) Received: by mail-pf1-x432.google.com with SMTP id d2so8190271pfq.5 for ; Tue, 22 Dec 2020 02:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5T0scFpIPt8lokGW6oEnqV/V1SJh3l6GKU/AG/F/ghE=; b=ga1i2hkdm6c0c+Olz5pfsc5df9jJSXGYLv5P9xNeTonu2JIny7NwLzCVtXLOIXesNl cS0fbkBchR+3VqrNK9ghTr1BPl+6xVBlZjzneBTNlGx4f/GnFIvl2dQZ7z3PPOUnZ8OM WVs4bUxTKQQUN6wqMV78uH8BNKpqZCncb7ejg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5T0scFpIPt8lokGW6oEnqV/V1SJh3l6GKU/AG/F/ghE=; b=AkncL+zvWrQZW1V6jIoggWCosdgCgA4l/lvg+XUfC0UtpAie+sV8brA5JQBmaD1ue9 8C0RantWMe62ongZK+H21UyEo4inQ3KnZQeEprgMxDVpaMNxLMWFWViZn6m5sEZSQdZR rxsMvd+xZdTKnXVhDqOooDCWypAtuWpJ7ehOxTJ1HfLwhi7Pi847WapJB71VhuYPtFvz bcEQv1B2UbmIwzPqJeIJWzT0AVimvck8o6swCpkOVBrxCA5Ud5t/V5LZO7/6dfgppuci dH/46bdmaU/6qA3FvmQeoJ2tOFINw7WRbU74FUbPjUabrkif8eCXVCa3XXKhSPWRKTqj ilkw== X-Gm-Message-State: AOAM532dei6XmBAGe1gJGVH/HVnuzPXh3OQ4E3T7b0qiNfEcMjS/JGlm 1GuMrMBhJ/Snd1yYg48/BZyu8Ag/b1A7IMT1vLmvZreEJVsSgBU6CfZaCTebIqEDTNIaGFzKrvF u7AKbPJH8PSGdTwJzesLwxgScFb9F9u/u7VcwfJatCoQ7YXfDQKvUn8RfGASKqwN5ctiakWGKcO +tRqEnc57E MIME-Version: 1.0 X-Google-Smtp-Source: ABdhPJz6oVlYpqxZebNzkUuEirgxHDfiNCpXTwOQd2H2ik8VE9/ca3Jq+mVmPTBOXZ3OVlDVv7RhaQ== X-Received: by 2002:a05:6a00:2382:b029:198:15a2:aaf9 with SMTP id f2-20020a056a002382b029019815a2aaf9mr19177943pfc.39.1608631972689; Tue, 22 Dec 2020 02:12:52 -0800 (PST) Received: from drv-bst-rhel8.static.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id p16sm19148624pju.47.2020.12.22.02.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 02:12:52 -0800 (PST) From: Kashyap Desai To: linux-scsi@vger.kernel.org Cc: jejb@linux.ibm.com, martin.petersen@oracle.com, steve.hagan@broadcom.com, peter.rivera@broadcom.com, mpi3mr-linuxdrv.pdl@broadcom.com, Kashyap Desai , sathya.prakash@broadcom.com Subject: [PATCH 11/24] mpi3mr: print ioc info for debugging Date: Tue, 22 Dec 2020 15:41:43 +0530 Message-Id: <20201222101156.98308-12-kashyap.desai@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20201222101156.98308-1-kashyap.desai@broadcom.com> References: <20201222101156.98308-1-kashyap.desai@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Signed-off-by: Kashyap Desai Cc: sathya.prakash@broadcom.com --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 10ff287e78db..aad0a2bd06b9 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2540,6 +2540,68 @@ int mpi3mr_issue_port_enable(struct mpi3mr_ioc *mrioc, u8 async) return retval; } +/** + * mpi3mr_print_ioc_info - Display controller information + * @mrioc: Adapter instance reference + * + * Display controller personalit, capability, supported + * protocols etc. + * + * Return: Nothing + */ +static void +mpi3mr_print_ioc_info(struct mpi3mr_ioc *mrioc) +{ + int i = 0; + char personality[16]; + struct mpi3mr_compimg_ver *fwver = &mrioc->facts.fw_ver; + + switch (mrioc->facts.personality) { + case MPI3_IOCFACTS_FLAGS_PERSONALITY_EHBA: + strcpy(personality, "Enhanced HBA"); + break; + case MPI3_IOCFACTS_FLAGS_PERSONALITY_RAID_DDR: + strcpy(personality, "RAID"); + break; + default: + strcpy(personality, "Unknown"); + break; + } + + ioc_info(mrioc, "Running in %s Personality", personality); + + ioc_info(mrioc, "FW Version(%d.%d.%d.%d.%d.%d)\n", + fwver->gen_major, fwver->gen_minor, fwver->ph_major, + fwver->ph_minor, fwver->cust_id, fwver->build_num); + + ioc_info(mrioc, "Protocol=("); + + if (mrioc->facts.protocol_flags & + MPI3_IOCFACTS_PROTOCOL_SCSI_INITIATOR) { + pr_cont("Initiator"); + i++; + } + + if (mrioc->facts.protocol_flags & + MPI3_IOCFACTS_PROTOCOL_SCSI_TARGET) { + pr_cont("%sTarget", i ? "," : ""); + i++; + } + + if (mrioc->facts.protocol_flags & + MPI3_IOCFACTS_PROTOCOL_NVME) { + pr_cont("%sNVMe attachment", i ? "," : ""); + i++; + } + pr_cont("), "); + pr_cont("Capabilities=("); + + if (mrioc->facts.ioc_capabilities & + MPI3_IOCFACTS_CAPABILITY_RAID_CAPABLE) + pr_cont("RAID"); + + pr_cont(")\n"); +} /** * mpi3mr_cleanup_resources - Free PCI resources @@ -2798,6 +2860,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc, u8 re_init) } } + mpi3mr_print_ioc_info(mrioc); retval = mpi3mr_alloc_reply_sense_bufs(mrioc); if (retval) {