summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/SnpDxe
Commit message (Collapse)AuthorAgeFilesLines
* NetworkPkg/SnpDxe: Prevent invalid PCI BAR accessMichael Kubacki2020-04-172-34/+47
| | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1563 SnpDxe initializes values for MemoryBarIndex and IoBarIndex to 0 and 1 respectively even if calls to PciIo->GetBarAttributes never return success. Later, if the BAR is used to perform IO/Mem reads/writes, a potentially non-existent BAR index may be accessed. This change initializes the values to an invalid BAR index (PCI_MAX_BAR) so the condition can be explicitly checked to avoid an invalid BAR access. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
* NetworkPkg/SnpDxe: Register SnpNotifyExitBootServices at TPL_CALLBACKMichael Kubacki2020-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1562 The current SnpDxe implementation registers its ExitBootServices event notification function (SnpNotifyExitBootServices ()) at TPL_NOTIFY. This function calls PxeShutdown() which issues an UNDI shutdown operation. Ultimately, this may invoke Shutdown() in EFI_SIMPLE_NETWORK_PROTOCOL. The UEFI specification 2.8A Table 27 "TPL Restrictions" restricts the TPL for Simple Network Protocol to <= TPL_CALLBACK. In addition, it has been observed in some 3rd party UNDI drivers to cause an issue further down the call stack if the TPL is higher than TPL_CALLBACK on invocation. Therefore, this commit changes the TPL of SnpNotifyExitBootServices() to TPL_CALLBACK. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
* NetworkPkg/SnpDxe: Fix few typosAntoine Coeur2020-02-105-10/+10
| | | | | | | | | | | | | Fix few typos in comments and documentation. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Maciej Rabeda <maciej.rabeda@intel.com> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-47-philmd@redhat.com>
* NetworkPkg/SnpDxe: Use PcdGetBool() instead of FixedPcdGetBool in Snp.cSiyuan, Fu2019-10-291-2/+2
| | | | | | | | | | | | This patch fixes a problem introduced by commit 61bb6eeb4d93c0a34c1995d87914ab41398f9550. The PcdSnpCreateExitBootServicesEvent is not guaranteed to be FixedAtBuild, so use PcdGetBool() to supports both fixed and patchable PCD. Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg/SnpDxe: Add PCD to remove ExitBootServices event from SNP driver.Rabeda, Maciej2019-10-213-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | Patch addresses Bugzilla #1974. During ExitBootServices stage, drivers should not call any functions known to use Memory Allocation Services. One of such functions (as per UEFI spec) is UNDI->Shutdown(). Since UNDI drivers during ExitBootServices phase are expected to put the adapter to such a state that it will not perform any DMA operations, there is no need to interface UNDI by SNP driver during that phase. Finally, since ExitBootServices event notification function in SNP only calls UNDI->Shutdown() and Stop() functions, there is no need to create this event at all. Adding PCD to control creation of event reacting to ExitBootServices() call so that systems with UNDIs relying on SNP to call their Shutdown() and Stop() can still work. Change-Id: Idd76f26d2e8ff7cf88b2d75e2d524c74211f2e89 Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
* NetworkPkg: Remove unnecessary MdeModulePkg/MdeModulePkg.dec dependency in INFLiming Gao2019-10-081-1/+0
| | | | | | | Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* NetworkPkg: Move Network library header file from MdeModulePkg to NetworkPkgLiming Gao2019-05-271-0/+1
| | | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* NetworkPkg: Move Network library and drivers from MdeModulePkg to NetworkPkgLiming Gao2019-05-2721-0/+5904
Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>