From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7C5B7820A2 for ; Sun, 5 Feb 2017 22:01:06 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 05 Feb 2017 22:01:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,340,1477983600"; d="scan'208";a="221736505" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 05 Feb 2017 22:01:05 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jeff Fan , Feng Tian Date: Mon, 6 Feb 2017 14:00:57 +0800 Message-Id: <20170206060059.595976-5-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170206060059.595976-1-ruiyu.ni@intel.com> References: <20170206060059.595976-1-ruiyu.ni@intel.com> Subject: [PATCH v2 4/6] MdeModulePkg/IncompatiblePci: Use -1 to match any IDs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2017 06:01:06 -0000 When the VendorId/DeviceId/RevisionId/SubsystemVendorId /SubsystemDeviceId is (UINT64)-1, IncompatiblePciDeviceSupport driver doesn't use it to match any IDs. The patch fixes this bug. Since PciBus driver always calls IncompatiblePciDeviceSupport using IDs read from HW, (UINT64)-1 is never passed to this driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jeff Fan Cc: Feng Tian --- .../IncompatiblePciDeviceSupport.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c index 5a6a052..6a26013 100644 --- a/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.c @@ -283,31 +283,31 @@ PCheckDevice ( // // See if the Header matches the parameters passed in // - if (Header->VendorId != (UINT64)-1) { + if ((Header->VendorId != (UINT64)-1) && (VendorId != (UINT64)-1)) { if (Header->VendorId != VendorId) { continue; } } - if (Header->DeviceId != (UINT64)-1) { + if ((Header->DeviceId != (UINT64)-1) && (DeviceId != (UINT64) -1)) { if (DeviceId != Header->DeviceId) { continue; } } - if (Header->RevisionId != (UINT64)-1) { + if ((Header->RevisionId != (UINT64)-1) && (RevisionId != (UINT64) -1)) { if (RevisionId != Header->RevisionId) { continue; } } - if (Header->SubsystemVendorId != (UINT64)-1) { + if ((Header->SubsystemVendorId != (UINT64)-1) && (SubsystemVendorId != (UINT64) -1)) { if (SubsystemVendorId != Header->SubsystemVendorId) { continue; } } - if (Header->SubsystemDeviceId != (UINT64)-1) { + if ((Header->SubsystemDeviceId != (UINT64)-1) && (SubsystemDeviceId != (UINT64) -1)) { if (SubsystemDeviceId != Header->SubsystemDeviceId) { continue; } -- 2.9.0.windows.1