From patchwork Wed Sep 20 19:14:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 13393289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A15BC04FF9 for ; Wed, 20 Sep 2023 19:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbjITTPa (ORCPT ); Wed, 20 Sep 2023 15:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbjITTP1 (ORCPT ); Wed, 20 Sep 2023 15:15:27 -0400 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0348192; Wed, 20 Sep 2023 12:15:00 -0700 (PDT) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2746ab05409so72778a91.0; Wed, 20 Sep 2023 12:15:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695237300; x=1695842100; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+H1FOxnhDByXxYVS4N7lGmsSndMwiTiWuFLv9FuLudk=; b=gkATPVSZwS2kD9M0/OXPhjml3yDuOXr6V2sZtR6oKT67IIZU2IWTPRy8BJ7sPPHs/1 DGknAgyxAGQC5qK5qiMb+NcKT9SRaGjmye/0oyZLxXG0NejSLbqt204/c76STqhiGaJY LchNbyxKJxkVglPJiz6nUjrMkgJpJ8Rcl7bIiddPDMoQe5EvnxkvXKhL96Rek8uPGlMx tohTTOJwGzGZ9oKN6u37T8HnckCdjmVuM18OFlLKjSVBwS81Kk31lU+TvJh3X+74Tk+i g0KR21DQIU0tU0/UAT1LzpH8EEJPAMkuMFMQt/RFqNVqpM+n49LzUn8GNVJMp3CB6UnY //tg== X-Gm-Message-State: AOJu0YzGHJf6vaAN8rN1cwbdbSdBbMBHqZtyfe1ITx0NoRI19mFfxlav 6v0fOvfGf0OuJ0J+YnqfRPw= X-Google-Smtp-Source: AGHT+IFMO7bJ2K5PZlLh44y+YE7KTgq3gNaxS0NyMhDKnXe+DwJ196hSEowVxx0ZvSMyFnu3770nnQ== X-Received: by 2002:a17:90b:8d6:b0:274:8330:c7da with SMTP id ds22-20020a17090b08d600b002748330c7damr3690498pjb.28.1695237299975; Wed, 20 Sep 2023 12:14:59 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:b0c6:e5b6:49ef:e0bd]) by smtp.gmail.com with ESMTPSA id a13-20020a17090a8c0d00b002633fa95ac2sm1656318pjo.13.2023.09.20.12.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 12:14:59 -0700 (PDT) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Martin K . Petersen" , Christoph Hellwig , Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH 06/13] scsi_proto: Add struct io_group_descriptor Date: Wed, 20 Sep 2023 12:14:31 -0700 Message-ID: <20230920191442.3701673-7-bvanassche@acm.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230920191442.3701673-1-bvanassche@acm.org> References: <20230920191442.3701673-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Prepare for adding code that will fill in and parse this data structure. Cc: Martin K. Petersen Signed-off-by: Bart Van Assche Reviewed-by: Avri Altman Reviewed-by: Daejun Park --- include/scsi/scsi_proto.h | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h index 07d65c1f59db..4e3691cb67da 100644 --- a/include/scsi/scsi_proto.h +++ b/include/scsi/scsi_proto.h @@ -10,6 +10,7 @@ #ifndef _SCSI_PROTO_H_ #define _SCSI_PROTO_H_ +#include #include /* @@ -275,6 +276,45 @@ struct scsi_lun { __u8 scsi_lun[8]; }; +/* SBC-5 IO advice hints group descriptor */ +struct scsi_io_group_descriptor { +#if defined(__BIG_ENDIAN) + u8 io_advice_hints_mode: 2; + u8 reserved1: 3; + u8 st_enble: 1; + u8 cs_enble: 1; + u8 ic_enable: 1; +#elif defined(__LITTLE_ENDIAN) + u8 ic_enable: 1; + u8 cs_enble: 1; + u8 st_enble: 1; + u8 reserved1: 3; + u8 io_advice_hints_mode: 2; +#else +#error +#endif + u8 reserved2[3]; + /* Logical block markup descriptor */ +#if defined(__BIG_ENDIAN) + u8 acdlu: 1; + u8 reserved3: 1; + u8 rlbsr: 2; + u8 lbm_descriptor_type: 4; +#elif defined(__LITTLE_ENDIAN) + u8 lbm_descriptor_type: 4; + u8 rlbsr: 2; + u8 reserved3: 1; + u8 acdlu: 1; +#else +#error +#endif + u8 params[2]; + u8 reserved4; + u8 reserved5[8]; +}; + +static_assert(sizeof(struct scsi_io_group_descriptor) == 16); + /* SPC asymmetric access states */ #define SCSI_ACCESS_STATE_OPTIMAL 0x00 #define SCSI_ACCESS_STATE_ACTIVE 0x01