From patchwork Tue Sep 19 17:09:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9959689 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 99E7C60208 for ; Tue, 19 Sep 2017 17:10:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85C0728E85 for ; Tue, 19 Sep 2017 17:10:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 778B328EE0; Tue, 19 Sep 2017 17:10:38 +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 8455628EB2 for ; Tue, 19 Sep 2017 17:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751378AbdISRKg (ORCPT ); Tue, 19 Sep 2017 13:10:36 -0400 Received: from mail-dm3nam03on0046.outbound.protection.outlook.com ([104.47.41.46]:48729 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751016AbdISRKe (ORCPT ); Tue, 19 Sep 2017 13:10:34 -0400 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=bAejawS5K56lp6yvG5scyI0QiRz7ohAGsXYTFErWZkk=; b=cNpVr3LIDoxd4adoEJA+Rz2XuhiqFGlFGiUG4BiyWJJfK4A08gQ8+R5lioz9zC558Lyhi/rql4jePbeLS76delyYecfvdFurQOPhF31K09OHoCBiPa5KEiSbwUEI8FcCO2ga7yHwv312viwUGxUUeO+6jPMQSIaHHKStfci4U7c= Received: from SN4PR0201CA0072.namprd02.prod.outlook.com (10.171.31.162) by CY1PR0201MB1451.namprd02.prod.outlook.com (10.163.139.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 17:10:33 +0000 Received: from BN1AFFO11FD044.protection.gbl (2a01:111:f400:7c10::109) by SN4PR0201CA0072.outlook.office365.com (2603:10b6:803:20::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Tue, 19 Sep 2017 17:10:33 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.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 BN1AFFO11FD044.mail.protection.outlook.com (10.58.52.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 17:10:32 +0000 Received: from localhost (10.187.72.81) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Tue, 19 Sep 2017 10:10:07 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V3 1/9] pm80xx : redefine sas_identify_frame structure Date: Tue, 19 Sep 2017 22:39:56 +0530 Message-ID: <20170919171004.10331-2-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170919171004.10331-1-Viswas.G@microsemi.com> References: <20170919171004.10331-1-Viswas.G@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)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(53936002)(50986999)(76176999)(47776003)(8676002)(356003)(305945005)(81156014)(81166006)(106466001)(5003940100001)(2351001)(68736007)(36756003)(54906002)(8936002)(69596002)(104016004)(57986006)(50226002)(76506005)(478600001)(189998001)(5660300001)(97736004)(2906002)(4326008)(6916009)(316002)(1076002)(16586007)(6666003)(2950100002)(77096006)(86362001)(50466002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1451; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD044; 1:pA+6ZoZyydLDW0Oxxzk0mYlx/S9Lr24WMCBQZMjoCYZqXCxV1YGyDFwF9oBZhFUezFV6nf6lfDoAg9YIEj+Le2tdM/eX19HoDIhGvdS9+hgfkoXvFNzh6c7yWqYI2fhL X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83faf131-d935-4f54-42ec-08d4ff815637 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0201MB1451; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1451; 3:oaBtAs511bPH0giF4p591ByQF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BX+1GmMrkpN+E5PKz1GmHtHwiyVFTn0b3hhrfH2F5CdNjysAIFudjoC4eKiejz5zsreSr15fM1H8worRWFLZpz+uAlhX8EhCqNn8CvBomr9Acoq15OUxBCfIv13L2Wita0kD7tj9QxJ0IuwkGjTv7q/5BVtx+L8UUzFe3qsQOYPEneDBINzCiqh2ZkOwQwHhnrhhNf4SlzxQXvOWFjHjViOdt+nI0Sg+M815uZ2o3KTrInhpJGgZlueb9zNq1bG9osfQ+kfXo6d6AJ2w3ZQTvrjudGuodTIaDvzRm2vDbXRJQ2wtllASKKLd/gzjzPCcvQmD2px24KKaSuu0Wya7WYGCDsoBy+NE6K53OXt7hUjWwPPuMr//LR5QCgkx6KFe/HCikzqYJGUgUPiNKyxkxspPqAtMhlnaD+VjmLLyQG6ZMKHUGqed X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0201MB1451; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0201MB1451; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1451; 4:5eTHtr5C1IsVL0ZJOyWENveQ9BkNGp11itA824jXf8cAEV73E8ETZRaeZLC9IblUZq7a82/uz0/l3UW2EthofyuHgRfrp9PalXsCCtNiss2nlM6G5vkS2Kh+pbJ9LPoFtynpREy8qu9kaw7lpKlzX0JfdsyE5OLPsWWRSrnF5UAn3XAsg5dWXPgrdXmmJcXQRvvo/kvgrQ0YMN0PHP4dA/jYLwsdFKIeU1dZukVWZeG/l44yIB/vA0hrcf3f7BHwyIsm+elf1cTPihdf8lSlrFUW8ixrEeY/+VGP8JmV5yw= X-Forefront-PRVS: 04359FAD81 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0201MB1451; 23:qU6oghRtWaMDwPKPQ/F3Q4yVBFNWu3ptadx5hOq?= =?us-ascii?Q?caiVztS3TWLExSMRAhe57uUNz1AfLaj1nJL4XkA29DLuqgQG013A1MA+QS4Q?= =?us-ascii?Q?0+SIOGnPo4m2prwoF7ZyUw6UTeEwDa9mNFNbW/qQY84IjHJGY5jgRzuGkDY0?= =?us-ascii?Q?ZJD9lEXTJIzP+cBMUxmE7lJUv/A1ZP1syYVmdygwnY2INCtL4vIqql/sbJW6?= =?us-ascii?Q?b+4pw82pAPNscsbQsIsPWbCBfYquuVrLi3BGYfLcD7C17KgnUKt/e8ZVmBsS?= =?us-ascii?Q?UUtckFL2nDQQn1g88/CL2gIuA5wX21VcVSfGj6uWtG2zcYwacJfvEcikzeg/?= =?us-ascii?Q?4Ykwflw6gQKMQqaO9z6711Ei/pJnWQ6g/NsI9buQtIfoIU0MmW0IA4hwH1NC?= =?us-ascii?Q?AJsx9bEPzTAvtL+ZV3J47TvYoEhjvbP450TGUM64/yviJ2Xs1lX/uFCqxEpJ?= =?us-ascii?Q?9+Ugtk8cu4fp+nb6DgUwUoe0HgE8kTUqZS7RlBUOr4MB4/AcDuupyx1tVs7J?= =?us-ascii?Q?nI2LPZEnwmLObs4zRQRddi4Wunpc0cxGpF6VBFXD1fWSna6TA6sbuLQS2UHx?= =?us-ascii?Q?cDcGuJXDBNnNVd3reL0uHHw5tLOv+itEVGW2PZpdfH4HtJ0IFMgv//DLh+9h?= =?us-ascii?Q?LqULZrzoVQbMNll4dKjCM3RnjSet7wgCacKAAhtir5b0SI3101CAQzgmLtpH?= =?us-ascii?Q?umubXYWmN54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6C63+z9wJuQ8DvyWo0lzvxqDVl3pAq3hJ32sZh/JFc=; 7:4dk3+ZXFUhK6N6+R/I1F9eDXKIhwWgvFomqHoIh8Z6iCoywQl6lwsLc3v8+a/J/VqklusDPCsjFcseQ4atagaAI0dFKR4Xe8vvolaIaYYf5KhOg/j7Sh8A7zRuVyPOxJsO9w2vCJmy+YM5bOPc/LrzTmYjzbUS5ZTxmklGLPap1hp+w9RNNuo/fvKRdg6v9YJbVNZz1QDHdKJhGOBSQ6Gc7WuGWJD35l8H7BH5h48zs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:10:32.4040 (UTC) 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: CY1PR0201MB1451 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 sas_identify structure defined by pm80xx doesn't have CRC field. So added a new sas_identify structure without CRC. v2: - Since the structure changes is applicable for only pm80xx, sas_identify_frame_local structure moved to pm80xx_hwi.h. Signed-off-by: Raj Dinesh Signed-off-by: Viswas G Acked-by: Jack Wang --- drivers/scsi/pm8001/pm80xx_hwi.h | 98 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h index 7a443bad6163..82b8cf581da9 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.h +++ b/drivers/scsi/pm8001/pm80xx_hwi.h @@ -229,6 +229,102 @@ #define IT_NEXUS_TIMEOUT 0x7D0 #define PORT_RECOVERY_TIMEOUT ((IT_NEXUS_TIMEOUT/100) + 30) +#ifdef __LITTLE_ENDIAN_BITFIELD +struct sas_identify_frame_local { + /* Byte 0 */ + u8 frame_type:4; + u8 dev_type:3; + u8 _un0:1; + + /* Byte 1 */ + u8 _un1; + + /* Byte 2 */ + union { + struct { + u8 _un20:1; + u8 smp_iport:1; + u8 stp_iport:1; + u8 ssp_iport:1; + u8 _un247:4; + }; + u8 initiator_bits; + }; + + /* Byte 3 */ + union { + struct { + u8 _un30:1; + u8 smp_tport:1; + u8 stp_tport:1; + u8 ssp_tport:1; + u8 _un347:4; + }; + u8 target_bits; + }; + + /* Byte 4 - 11 */ + u8 _un4_11[8]; + + /* Byte 12 - 19 */ + u8 sas_addr[SAS_ADDR_SIZE]; + + /* Byte 20 */ + u8 phy_id; + + u8 _un21_27[7]; + +} __packed; + +#elif defined(__BIG_ENDIAN_BITFIELD) +struct sas_identify_frame_local { + /* Byte 0 */ + u8 _un0:1; + u8 dev_type:3; + u8 frame_type:4; + + /* Byte 1 */ + u8 _un1; + + /* Byte 2 */ + union { + struct { + u8 _un247:4; + u8 ssp_iport:1; + u8 stp_iport:1; + u8 smp_iport:1; + u8 _un20:1; + }; + u8 initiator_bits; + }; + + /* Byte 3 */ + union { + struct { + u8 _un347:4; + u8 ssp_tport:1; + u8 stp_tport:1; + u8 smp_tport:1; + u8 _un30:1; + }; + u8 target_bits; + }; + + /* Byte 4 - 11 */ + u8 _un4_11[8]; + + /* Byte 12 - 19 */ + u8 sas_addr[SAS_ADDR_SIZE]; + + /* Byte 20 */ + u8 phy_id; + + u8 _un21_27[7]; +} __packed; +#else +#error "Bitfield order not defined!" +#endif + struct mpi_msg_hdr { __le32 header; /* Bits [11:0] - Message operation code */ /* Bits [15:12] - Message Category */ @@ -248,7 +344,7 @@ struct mpi_msg_hdr { struct phy_start_req { __le32 tag; __le32 ase_sh_lm_slr_phyid; - struct sas_identify_frame sas_identify; /* 28 Bytes */ + struct sas_identify_frame_local sas_identify; /* 28 Bytes */ __le32 spasti; u32 reserved[21]; } __attribute__((packed, aligned(4)));