From nobody Tue Feb 10 07:22:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55451+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55451+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1583349737; cv=none; d=zohomail.com; s=zohoarc; b=R/yk2Wljpn/UiWlgYcrZdTf3exzKnRLRmjSj9iZBQ1zmzazvwynz5fe9DMAwDuFLvgjxQY6rvXW2N9Z4JIBAr+JA7RWgGCrQ2/yexgYLmfpaKfUzGwUZgs2oIGJwT9JsO94ooXbpa4PPyQkj0QSSIIenH6i/cLHB5KWY39ojvMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583349737; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fsVvEMad1fMy8Wf9M8wtdK1BfWdDpGZlJiuv6IviDB8=; b=TpxrAMljbT3kJQzHQm3eoXpciP5eXm2RKHZdKsgymVSF39pzMm4Faffk8trkpIx6NV7WooxFPXpV51/1IAGWWEF/tsjdURm2dAtrBWz6uvp/eslbQVLgiMuozAdUP0imlJ9gJQ9iturLkuTM7Ab5eRj1XvF3kpz5lENyI82tXo4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55451+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583349737026590.0618934582004; Wed, 4 Mar 2020 11:22:17 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5OL2YY1788612xAvSTzkGrBr; Wed, 04 Mar 2020 11:22:16 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web11.16607.1583349736163500260 for ; Wed, 04 Mar 2020 11:22:16 -0800 X-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 024Ivxvn049091; Wed, 4 Mar 2020 19:22:15 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2yffcurguq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Mar 2020 19:22:15 +0000 X-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 024JEdXr192512; Wed, 4 Mar 2020 19:22:15 GMT X-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2yg1p890q0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Mar 2020 19:22:15 +0000 X-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 024JMEs9006698; Wed, 4 Mar 2020 19:22:14 GMT X-Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 04 Mar 2020 11:22:14 -0800 From: "Nikita Leshenko" To: devel@edk2.groups.io Cc: Nikita Leshenko , liran.alon@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org Subject: [edk2-devel] [PATCH v3 07/13] OvmfPkg/MptScsiDxe: Build DevicePath for discovered devices Date: Wed, 4 Mar 2020 21:22:51 +0200 Message-Id: <20200304192257.96736-8-nikita.leshchenko@oracle.com> In-Reply-To: <20200304192257.96736-1-nikita.leshchenko@oracle.com> References: <20200304192257.96736-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nikita.leshchenko@oracle.com X-Gm-Message-State: eExe47H5rt1Sh43Ry1AAcZ01x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583349736; bh=uxU+wKM1uJYAp+9FIZdr7Cnh8BhMaStT6S8bi3/ykys=; h=Cc:Date:From:Reply-To:Subject:To; b=Qt5nJsfgL/OA7poPDwDtwOhevFwK2qsRpZwq/hfpRMh1EPSVAaD5DsQstgjR8nXfDR0 SiU+iEHtVYOWVm227Uz8qbXGLLaEEA5kKeS50AjVwYI7xXPtNqAsHL575nZ5PvRTU11KJ aR9mnKZwnVadU/o2NyNvAyIKuIgWYTCHKCs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Used to identify the individual disks in the hardware tree Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2390 Signed-off-by: Nikita Leshenko Reviewed-by: Liran Alon --- OvmfPkg/MptScsiDxe/MptScsi.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c index e898a6024f73..cba564b5f648 100644 --- a/OvmfPkg/MptScsiDxe/MptScsi.c +++ b/OvmfPkg/MptScsiDxe/MptScsi.c @@ -129,7 +129,34 @@ MptScsiBuildDevicePath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath ) { - return EFI_UNSUPPORTED; + SCSI_DEVICE_PATH *ScsiDevicePath; + + if (DevicePath =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // This device support 256 targets only, so it's enough to dereference + // the LSB of Target. + // + if (*Target > 0 || Lun > 0) { + return EFI_NOT_FOUND; + } + + ScsiDevicePath =3D AllocateZeroPool (sizeof (*ScsiDevicePath)); + if (ScsiDevicePath =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + + ScsiDevicePath->Header.Type =3D MESSAGING_DEVICE_PATH; + ScsiDevicePath->Header.SubType =3D MSG_SCSI_DP; + ScsiDevicePath->Header.Length[0] =3D (UINT8)sizeof (*ScsiDevicePath); + ScsiDevicePath->Header.Length[1] =3D (UINT8)(sizeof (*ScsiDevicePath) >>= 8); + ScsiDevicePath->Pun =3D *Target; + ScsiDevicePath->Lun =3D (UINT16)Lun; + + *DevicePath =3D &ScsiDevicePath->Header; + return EFI_SUCCESS; } =20 STATIC --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55451): https://edk2.groups.io/g/devel/message/55451 Mute This Topic: https://groups.io/mt/71733500/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-