goto Failed;\r
}\r
\r
+ Features &= VIRTIO_SCSI_F_INOUT | VIRTIO_F_VERSION_1;\r
+\r
+ //\r
+ // In virtio-1.0, feature negotiation is expected to complete before queue\r
+ // discovery, and the device can also reject the selected set of features.\r
+ //\r
+ if (Dev->VirtIo->Revision >= VIRTIO_SPEC_REVISION (1, 0, 0)) {\r
+ Status = Virtio10WriteFeatures (Dev->VirtIo, Features, &NextDevStat);\r
+ if (EFI_ERROR (Status)) {\r
+ goto Failed;\r
+ }\r
+ }\r
+\r
//\r
// step 4b -- allocate request virtqueue\r
//\r
}\r
\r
//\r
- // step 5 -- Report understood features and guest-tuneables. We want none of\r
- // the known (or unknown) VIRTIO_SCSI_F_* or VIRTIO_F_* capabilities (see\r
- // virtio-0.9.5, Appendices B and I), except bidirectional transfers.\r
+ // step 5 -- Report understood features and guest-tuneables.\r
//\r
- Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo,\r
- Features & VIRTIO_SCSI_F_INOUT);\r
- if (EFI_ERROR (Status)) {\r
- goto ReleaseQueue;\r
+ if (Dev->VirtIo->Revision < VIRTIO_SPEC_REVISION (1, 0, 0)) {\r
+ Features &= ~(UINT64)VIRTIO_F_VERSION_1;\r
+ Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);\r
+ if (EFI_ERROR (Status)) {\r
+ goto ReleaseQueue;\r
+ }\r
}\r
\r
//\r