From patchwork Thu Dec 21 17:34:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghava Aditya Renukunta X-Patchwork-Id: 10128109 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 5A65B60390 for ; Thu, 21 Dec 2017 17:35:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47DF629CE3 for ; Thu, 21 Dec 2017 17:35:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C78229D1B; Thu, 21 Dec 2017 17:35:09 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 C0E2A29CE3 for ; Thu, 21 Dec 2017 17:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754805AbdLURfG (ORCPT ); Thu, 21 Dec 2017 12:35:06 -0500 Received: from mail-bl2nam02on0070.outbound.protection.outlook.com ([104.47.38.70]:32704 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754059AbdLURem (ORCPT ); Thu, 21 Dec 2017 12:34:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OpxddyMU8AfnCBdHCXwsR8uig1Xlbwr0KhXFjYQqiVs=; b=IaYtAtiz3J65IVkRATZ2APbsjOC7w6IqgP0sJllgANa8EKrQhonq83lfoF6HUcWHYPU4M42aAKcNWuTZiqs60zWLvUNt1vM0QmkXkgBHd7WPiW1eMK3dXPiJeYfoOn6Ed9qBrJn0iqb7eXFd46KpEl4OjsuqS6L75FV47PlY8O8= Received: from MWHPR02CA0045.namprd02.prod.outlook.com (2603:10b6:301:60::34) by CO1PR02MB142.namprd02.prod.outlook.com (2a01:111:e400:101e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Thu, 21 Dec 2017 17:34:38 +0000 Received: from BN1BFFO11FD036.protection.gbl (2a01:111:f400:7c10::1:195) by MWHPR02CA0045.outlook.office365.com (2603:10b6:301:60::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Thu, 21 Dec 2017 17:34:38 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; linux.vnet.ibm.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BN1BFFO11FD036.mail.protection.outlook.com (10.58.144.99) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Thu, 21 Dec 2017 17:34:23 +0000 Received: from localhost (10.181.72.13) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 21 Dec 2017 09:34:24 -0800 From: Raghava Aditya Renukunta To: , , CC: , , , "Guilherme G . Piccoli" Subject: [PATCH 12/29] scsi: aacraid: Add target setup helper function Date: Thu, 21 Dec 2017 09:34:03 -0800 Message-ID: <20171221173420.8213-13-RaghavaAditya.Renukunta@microsemi.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> References: <20171221173420.8213-1-RaghavaAditya.Renukunta@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(39380400002)(2980300002)(438002)(199004)(189003)(54906003)(575784001)(86362001)(106002)(2201001)(16586007)(36756003)(50226002)(81166006)(76176011)(316002)(110136005)(69596002)(356003)(51416003)(50466002)(53936002)(6666003)(76506005)(8936002)(48376002)(97736004)(104016004)(47776003)(2950100002)(5660300001)(68736007)(106466001)(72206003)(4326008)(305945005)(77096006)(57986006)(1076002)(8676002)(81156014)(2906002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB142; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD036; 1:QmXJtVJgwl1VLBlTv2Nd5AeT3vsM+nwUw/U9zdPe6n5mtTNVkkIQais0N3GQd2iXmfbaj13h3S5og8UT4myh8c1JVK6ZXRtsfq+gY1urvRopR3I+PFnE7upAFKHofSpV X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6967192-50cf-411f-60f4-08d5489913c8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4608076)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:CO1PR02MB142; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB142; 3:x5kXz/tfrmx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asztjnMJem5lOj7Z+hLasjNVfvP+e2+0aTv5OSgUcMtx6Oco2vou1eR7XKVVYnfH0mxO/SJNq9MKW4z24PC3srMUUHLGfmlC+VbZSMlRwSHUpPtOVtk0zfHHw7QAku1EgUMMBh747pavspimc1QuthQqO/Ryu23GlEh15rT06Q3M/mvpTabS9z4nBdE3OhlZrXaPvGZ2di3xSE53LL6OjsZyiRZmi0aUoLtep5Wj0VCOtlyBpp8PjPvbbfnA2RiXZ3u10pN9apjk0KqCwUhzE9nIDaEhwWmrTcYFrj9sA30VMTdKwH+65XWyB93AAnUGIDkquBs1dYm3aru/SjcVxmsyWL/aKXKEGSohiZV4UX8W67eYDnr0ZPDUufFwQcY6czlekfjFumCi6XBnfycIbjDPmXB26NQP684+K4t++h+vEEj0++lbSnW+ZtSmyyAT9kHvTVRNizsaLORmoa3wX+s86CZddWvqbtbsfBwfWGxa5XKcXBsAiFDb4XUsdTwF/K2+OSmnI+stPpTRdIy0vgabKSgPokHWFUFw+uwBKF0o= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(93006095)(93004095)(3002001)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:CO1PR02MB142; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO1PR02MB142; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB142; 4:8zEQ7TN39jSi2UmOKzBUXAPbHLCgLn0YZMHIu/226yqdYvwA97Yal+qoVpA6TLZgl0qWGzxfJXnijifE79HlC6v/DP0/mZKLDkmaHxc/DVssbnIcuOY0QKpungrncQMz+xlMUf7YJPZbl2n1yrrhYuxDtRQyUyYj36YDvKHTnNow1xOjf3rRJjD1UhCZttzxzqkKH1OMhwgZK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Apkd/fwSHil+jkw0VKlT8ZTMN3yIsSFDPx00MahtiXj8fHFaApSCRj3kZZpTeM5KwZ2kUfCISjr+8ZTdjLyVlzIBkezoYGp4=; 7:m4tsb9RYF7zS8v/Vy+wvGsfaFoYACllE+UXj02y4a9TrS7eQxYtf7X3Pjr/Lg3QSS72s2Pq7D7Iy3U0mLfaSeyl3i4z6kg0LCj7hiCpUwkjk+p9svDDce/5bUgiooQnEw2LBNPNUaw54JBlHeNnBw7KrSV0vIMxX4n5siGgdO1x0Y92O/9yNEe7rGRx9ucEO4pzD77Ica2bERqZx/6MOMo672GBCBlkjUmztKvTQOJpz5ioFa1NVFQcECKP8u1dE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2017 17:34:23.8456 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6967192-50cf-411f-60f4-08d5489913c8 X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB142 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 Add helper function to setup targets devices and create the base for the upcoming patches Signed-off-by: Raghava Aditya Renukunta --- drivers/scsi/aacraid/aachba.c | 18 +++++++++++++----- drivers/scsi/aacraid/aacraid.h | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index d6b626d..90377b1 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1863,7 +1863,7 @@ static void aac_set_safw_attr_all_targets(struct aac_dev *dev, * Execute a CISS REPORT PHYS LUNS and process the results into * the current hba_map. */ -int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) +static int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) { int rcode = -ENOMEM; int datasize; @@ -1901,6 +1901,16 @@ int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan) return rcode; } +static int aac_setup_safw_targets(struct aac_dev *dev, int rescan) +{ + return aac_get_safw_ciss_luns(dev, rescan); +} + +int aac_setup_safw_adapter(struct aac_dev *dev, int rescan) +{ + return aac_setup_safw_targets(dev, rescan); +} + int aac_get_adapter_info(struct aac_dev* dev) { struct fib* fibptr; @@ -2004,10 +2014,8 @@ int aac_get_adapter_info(struct aac_dev* dev) } if (!dev->sync_mode && dev->sa_firmware && - dev->supplement_adapter_info.virt_device_bus != 0xffff) { - /* Thor SA Firmware -> CISS_REPORT_PHYSICAL_LUNS */ - rcode = aac_get_safw_ciss_luns(dev, AAC_INIT); - } + dev->supplement_adapter_info.virt_device_bus != 0xffff) + rcode = aac_setup_safw_adapter(dev, AAC_INIT); if (!dev->in_reset) { char buffer[16]; diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index d81d0aa..5690767 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2639,7 +2639,7 @@ static inline int aac_adapter_check_health(struct aac_dev *dev) int aac_acquire_irq(struct aac_dev *dev); void aac_free_irq(struct aac_dev *dev); -int aac_get_safw_ciss_luns(struct aac_dev *dev, int rescan); +int aac_setup_safw_adapter(struct aac_dev *dev, int rescan); const char *aac_driverinfo(struct Scsi_Host *); void aac_fib_vector_assign(struct aac_dev *dev); struct fib *aac_fib_alloc(struct aac_dev *dev); diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 82ddc74..f3077b3 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -1945,7 +1945,7 @@ static void aac_handle_sa_aif(struct aac_dev *dev, struct fib *fibptr) for (target = 0; target < AAC_MAX_TARGETS; target++) dev->hba_map[bus][target].new_devtype = 0; - rcode = aac_get_safw_ciss_luns(dev, AAC_RESCAN); + rcode = aac_setup_safw_adapter(dev, AAC_RESCAN); aac_resolve_luns(dev);