From patchwork Tue Nov 17 16:50:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 56839 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2053366lbb; Tue, 17 Nov 2015 08:51:39 -0800 (PST) X-Received: by 10.107.137.27 with SMTP id l27mr40370964iod.102.1447779099236; Tue, 17 Nov 2015 08:51:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i101si25614131iod.13.2015.11.17.08.51.38; Tue, 17 Nov 2015 08:51:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754393AbbKQQuy (ORCPT + 28 others); Tue, 17 Nov 2015 11:50:54 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:37297 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754125AbbKQQgn (ORCPT ); Tue, 17 Nov 2015 11:36:43 -0500 Received: from 172.24.1.49 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CZG01728; Wed, 18 Nov 2015 00:36:31 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Wed, 18 Nov 2015 00:36:20 +0800 From: John Garry To: , , , , , , CC: , , , , , , , , Subject: [PATCH v5 01/32] [SCSI] sas: centralise ssp frame information units Date: Wed, 18 Nov 2015 00:50:28 +0800 Message-ID: <1447779059-136143-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447779059-136143-1-git-send-email-john.garry@huawei.com> References: <1447779059-136143-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.564B5791.0122, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 53fa9f74502edc05d2961eee33abc1f0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The xfer_rdy, command, and task frame's iu structures are not available in , but only aic94xx driver folder. Add them to include/scsi/sas.h Signed-off-by: John Garry --- drivers/scsi/aic94xx/aic94xx_sas.h | 49 ++++--------------------- include/scsi/sas.h | 74 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 43 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/scsi/aic94xx/aic94xx_sas.h b/drivers/scsi/aic94xx/aic94xx_sas.h index 912e6b7..101072c 100644 --- a/drivers/scsi/aic94xx/aic94xx_sas.h +++ b/drivers/scsi/aic94xx/aic94xx_sas.h @@ -327,46 +327,9 @@ struct scb_header { #define LUN_SIZE 8 -/* See SAS spec, task IU - */ -struct ssp_task_iu { - u8 lun[LUN_SIZE]; /* BE */ - u16 _r_a; - u8 tmf; - u8 _r_b; - __be16 tag; /* BE */ - u8 _r_c[14]; -} __attribute__ ((packed)); - -/* See SAS spec, command IU - */ -struct ssp_command_iu { - u8 lun[LUN_SIZE]; - u8 _r_a; - u8 efb_prio_attr; /* enable first burst, task prio & attr */ -#define EFB_MASK 0x80 -#define TASK_PRIO_MASK 0x78 -#define TASK_ATTR_MASK 0x07 - - u8 _r_b; - u8 add_cdb_len; /* in dwords, since bit 0,1 are reserved */ - union { - u8 cdb[16]; - struct { - __le64 long_cdb_addr; /* bus address, LE */ - __le32 long_cdb_size; /* LE */ - u8 _r_c[3]; - u8 eol_ds; /* eol:6,6, ds:5,4 */ - } long_cdb; /* sequencer extension */ - }; -} __attribute__ ((packed)); - -struct xfer_rdy_iu { - __be32 requested_offset; /* BE */ - __be32 write_data_len; /* BE */ - __be32 _r_a; -} __attribute__ ((packed)); - +#define EFB_MASK 0x80 +#define TASK_PRIO_MASK 0x78 +#define TASK_ATTR_MASK 0x07 /* ---------- SCB tasks ---------- */ /* This is both ssp_task and long_ssp_task @@ -511,7 +474,7 @@ struct abort_task { u8 proto_conn_rate; __le32 _r_a; struct ssp_frame_hdr ssp_frame; - struct ssp_task_iu ssp_task; + struct ssp_tmf_iu ssp_task; __le16 sister_scb; __le16 conn_handle; u8 flags; /* ovrd_itnl_timer:3,3, suspend_data_trans:2,2 */ @@ -549,7 +512,7 @@ struct clear_nexus { u8 _r_b[3]; u8 conn_mask; u8 _r_c[19]; - struct ssp_task_iu ssp_task; /* LUN and TAG */ + struct ssp_tmf_iu ssp_task; /* LUN and TAG */ __le16 _r_d; __le16 conn_handle; __le64 _r_e; @@ -562,7 +525,7 @@ struct initiate_ssp_tmf { u8 proto_conn_rate; __le32 _r_a; struct ssp_frame_hdr ssp_frame; - struct ssp_task_iu ssp_task; + struct ssp_tmf_iu ssp_task; __le16 sister_scb; __le16 conn_handle; u8 flags; /* itnl override and suspend data tx */ diff --git a/include/scsi/sas.h b/include/scsi/sas.h index 0d2607d..42a84ef 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -344,6 +344,43 @@ struct ssp_response_iu { u8 sense_data[0]; } __attribute__ ((packed)); +struct ssp_command_iu { + u8 lun[8]; + u8 _r_a; + + union { + struct { + u8 attr:3; + u8 prio:4; + u8 efb:1; + }; + u8 efb_prio_attr; + }; + + u8 _r_b; + + u8 _r_c:2; + u8 add_cdb_len:6; + + u8 cdb[16]; + u8 add_cdb[0]; +} __attribute__ ((packed)); + +struct xfer_rdy_iu { + __be32 requested_offset; + __be32 write_data_len; + __be32 _r_a; +} __attribute__ ((packed)); + +struct ssp_tmf_iu { + u8 lun[8]; + u16 _r_a; + u8 tmf; + u8 _r_b; + __be16 tag; + u8 _r_c[14]; +} __attribute__ ((packed)); + /* ---------- SMP ---------- */ struct report_general_resp { @@ -538,6 +575,43 @@ struct ssp_response_iu { u8 sense_data[0]; } __attribute__ ((packed)); +struct ssp_command_iu { + u8 lun[8]; + u8 _r_a; + + union { + struct { + u8 efb:1; + u8 prio:4; + u8 attr:3; + }; + u8 efb_prio_attr; + }; + + u8 _r_b; + + u8 add_cdb_len:6; + u8 _r_c:2; + + u8 cdb[16]; + u8 add_cdb[0]; +} __attribute__ ((packed)); + +struct xfer_rdy_iu { + __be32 requested_offset; + __be32 write_data_len; + __be32 _r_a; +} __attribute__ ((packed)); + +struct ssp_tmf_iu { + u8 lun[8]; + u16 _r_a; + u8 tmf; + u8 _r_b; + __be16 tag; + u8 _r_c[14]; +} __attribute__ ((packed)); + /* ---------- SMP ---------- */ struct report_general_resp {