From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web10.2689.1587391842861345926 for ; Mon, 20 Apr 2020 07:10:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GIYGaKcM; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MPuQdwiO8NVneTJZbmI1RVhBONJP+n8drOwv9B2eeVA=; b=GIYGaKcMgIQ8CViFQCpdqDwnl8r+09DslRPWz9jYBnO9vjXmefhdI4MM9lmjCXZpJAq0rU 1l2ES1uttiTxa88I+sB4gJA+Do+vXok+zqvVW/jlv1HnurzTAFa1kr5Y+zhpGzfTcJJqKg WXmIChfbWhg7wMOT5oHhtH0RpOm0iFU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-79hVDwSjOKuz7zXcPIfeJw-1; Mon, 20 Apr 2020 10:10:40 -0400 X-MC-Unique: 79hVDwSjOKuz7zXcPIfeJw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E7E21034B40; Mon, 20 Apr 2020 14:10:38 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-228.ams2.redhat.com [10.36.114.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 069065DA7C; Mon, 20 Apr 2020 14:10:36 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 10/13] OvmfPkg/MptScsiDxe: Initialize hardware To: devel@edk2.groups.io, nikita.leshchenko@oracle.com Cc: liran.alon@oracle.com, aaron.young@oracle.com, Jordan Justen , Ard Biesheuvel References: <20200414173813.7715-1-nikita.leshchenko@oracle.com> <20200414173813.7715-11-nikita.leshchenko@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 20 Apr 2020 16:10:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200414173813.7715-11-nikita.leshchenko@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/14/20 19:38, Nikita Leshenko wrote: > diff --git a/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h b/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h Some notes related to edk2's CamelCase style: > +#pragma pack (1) > +typedef struct { > + UINT8 WhoInit; > + UINT8 Reserved1; > + UINT8 MessageLength; > + UINT8 Function; > + UINT8 Flags; > + UINT8 MaxDevices; > + UINT8 MaxBuses; > + UINT8 MessageFlags; > + UINT32 MessageContext; > + UINT16 Reserved2; > + UINT16 IOCStatus; > + UINT32 IOCLogInfo; (13) In both above fields, please spell "IOC" as "Ioc". > +} MPT_IO_CONTROLLER_INIT_REPLY; > + > +typedef struct { > + UINT8 TargetID; (14) TargetId > + UINT8 Bus; > + UINT8 ChainOffset; > + UINT8 Function; > + UINT8 CDBLength; (15) CdbLength > + UINT8 SenseBufferLength; > + UINT8 Reserved; > + UINT8 MessageFlags; > + UINT32 MessageContext; > + UINT8 LUN[8]; (16) Lun > + UINT32 Control; > + UINT8 CDB[16]; (17) Cdb > + UINT32 DataLength; > + UINT32 SenseBufferLowAddress; > +} MPT_SCSI_IO_REQUEST; > + > +typedef struct { > + UINT32 Length: 24; > + UINT32 EndOfList: 1; > + UINT32 Is64BitAddress: 1; > + // > + // True when the buffer contains data to be transfered. Otherwise it's the > + // destination buffer > + // > + UINT32 BufferContainsData: 1; > + UINT32 LocalAddress: 1; > + UINT32 ElementType: 2; > + UINT32 EndOfBuffer: 1; > + UINT32 LastElement: 1; > + UINT64 DataBufferAddress; > +} MPT_SG_ENTRY_SIMPLE; > +#pragma pack () > + > +typedef union { > +#pragma pack (1) > + struct { > + UINT8 TargetID; (18) TargetId > + UINT8 Bus; > + UINT8 MessageLength; > + UINT8 Function; > + UINT8 CDBLength; (19) CdbLength > + UINT8 SenseBufferLength; > + UINT8 Reserved; > + UINT8 MessageFlags; > + UINT32 MessageContext; > + UINT8 SCSIStatus; > + UINT8 SCSIState; (20) In both fields, s/SCSI/Scsi/ please > + UINT16 IOCStatus; > + UINT32 IOCLogInfo; (21) Same as (13) > + UINT32 TransferCount; > + UINT32 SenseCount; > + UINT32 ResponseInfo; > + } Data; > +#pragma pack () > + UINT64 Uint64; // 8 byte alignment required by HW > +} MPT_SCSI_IO_ERROR_REPLY; > + > #endif // __FUSION_MPT_SCSI_H__ Thanks! Laszlo