From patchwork Wed Oct 18 06:09:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 10013471 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 69C0360215 for ; Wed, 18 Oct 2017 06:09:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AF0A27B81 for ; Wed, 18 Oct 2017 06:09:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA4328138; Wed, 18 Oct 2017 06:09:29 +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 A721F27B81 for ; Wed, 18 Oct 2017 06:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933429AbdJRGJ2 (ORCPT ); Wed, 18 Oct 2017 02:09:28 -0400 Received: from mail-by2nam01on0080.outbound.protection.outlook.com ([104.47.34.80]:1536 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933199AbdJRGJ1 (ORCPT ); Wed, 18 Oct 2017 02:09:27 -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=HKGR5NTrQAs/wQ7YuWdbA5a0JLb9ngXTJRQMS2FzuPdoenDQbERb7eSfeZ4XlJyWhfYKHEw2zNLX4ghrcuheyb5aKT6qKZ4gZIrqO7lxkSe+l3TuyT8a273ij1HtdeJxwF18sRlU16azV42JgqdMAdZgCMTC2k7CDA1R6hS7nQQ= Received: from BN6PR02CA0081.namprd02.prod.outlook.com (2603:10b6:405:60::22) by DM2PR0201MB0751.namprd02.prod.outlook.com (2a01:111:e400:3c06::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 18 Oct 2017 06:09:24 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:144) by BN6PR02CA0081.outlook.office365.com (2603:10b6:405:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Wed, 18 Oct 2017 06:09:24 +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 BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Wed, 18 Oct 2017 06:09:24 +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, 17 Oct 2017 23:09:19 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V4 1/9] pm80xx : redefine sas_identify_frame structure Date: Wed, 18 Oct 2017 11:39:07 +0530 Message-ID: <20171018060915.8549-2-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20171018060915.8549-1-Viswas.G@microsemi.com> References: <20171018060915.8549-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)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(54906003)(69596002)(5660300001)(2351001)(16586007)(76176999)(316002)(48376002)(77096006)(2950100002)(76506005)(189998001)(6666003)(50986999)(50226002)(36756003)(68736007)(106002)(57986006)(6916009)(1076002)(5003940100001)(47776003)(50466002)(305945005)(4326008)(53936002)(81156014)(2906002)(86362001)(97736004)(106466001)(478600001)(81166006)(8676002)(8936002)(356003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0751; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD017; 1:Ifhe9ckG+TtagUeaN3SmFZxWeM6CRq3zKK8i5KHmk8cpd8iM+6tXxuH4MtlNOT0U9293eOJ0nWTuD33/r9lnP021uO/fUgNn3rti0B3/x/TQowlKj/gC/Bquhxx0Qz1w X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0450e5ef-1d73-4311-703a-08d515eec7fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR0201MB0751; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0751; 3:jvekPVs6uFXezdKcfohaC0UMxxR8+UNuK0wzEYv1/z27umVeDUTb5iuSOsMAsdgWahiViYhPG2DxJOfkAlMSZ91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EwNGJMJJg4FdcgWrVvCqNviETtxEgHj+wYnMe6FZav4JjmGp5Y864ZoMTROIKmXCyb6AwcWJAYIZqE2DGPMJPopRCqoeDU3OSMwtRmWcS445ACTLCxdx/Mcxj9iAQgd8a3LO99HTH+MADv7uAYUr0t5uGBokg25rL58VHr4CadT1Hr0u63P1Ra8qYKscLNz+IHrtXvFSREusPHZTge1Mj2HVDnKrbUL/vhLO08QgviGqoMTczKQnjVVjxD209RKWzHHxiCYyRVIyFHtgCfztzRf5kk3NjSALCG+U9bKnXIN70cvMMKWkW1FIlfv5OhEJjeKBIYjb3XUen6yMAWUWZM2zo15GGXGnymxPbP6SB321+19YFoH0NhGKtYPML7IsgHi0B 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)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0201MB0751; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0201MB0751; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0201MB0751; 4:3vqjcE4RdZDw2NitAQl/P1NL01MyRmrdbLTs82hvhT+c118SibRLG1oKwROGB82kCi1zyGDxxNdP80MDGcg/hyg/XucPsxsf1tEXAkEKDmzMcg7Zj8GriOuc1kplVa6BK4XU36i3Zdl28TtBIHnt4I5BMYyFrCW8GRX87Vj5zK5/t+azFxG59dCVONDM0fP4Py5d1d2JyzwF30Dy+kw6m0vW65Y8HrzQTffXqC5nN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WnjRRJ9FJ2gs0eeZjTELxojgqzR2kSsJxgv1g2S5ot+3I0oNvxpu5PDv+D0lli/DwahK15yC/MmYsHwPoJlRxCTxF7gxxExTy8/+2SZ/5cwZHGvNypQQdH7z9DPXNul+4B6JS9gILSY/aN1MxM5690Hqc6tLubR8GhnsZrYQRmuQOrtNHWllvSfSSeeKc/THUrwg/uhDAPullWO5wBY5ZpbYTlIo8axWtce8bY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2017 06:09:24.0683 (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: DM2PR0201MB0751 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)));