summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Delete UefiPxeBcDxe in MdeModulePkg.Siyuan Fu2018-12-241-2989/+0
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1278 This patch is to delete the UefiPxeBcDxe driver in MdeModulePkg. The driver will not be maintained and can't co-work with the dual-stack UefiPxeBcDxe in NetworkPkg. People should use below NetworkPkg drivers instead: NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf Which is actively maintained with more bug fixes and new feature support. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Clean up source filesLiming Gao2018-06-281-34/+34
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout.fanwang22017-12-181-4/+4
| | | | | | | | | | | | | | | | Since new Api NetLibDetectMediaWaitTimeout was involved to support connecting state handling, and it is forward compatible. So apply this Api in MdeModulePkg. V2: *Define time period in a macro instead of hard code. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan <fan.wang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Signed-off-by: fanwang2 <fan.wang@intel.com>
* MdeModulePkg/UefiPxeBcDxe: Discard the normal ICMP packets and recycle the ↵Jiaxin Wu2017-12-131-7/+7
| | | | | | | | | | | | | | | received ICMP data. This patch is to discard the normal ICMP packets and recycle the received ICMP data to avoid the memory leak. Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Heyi Guo <heyi.guo@linaro.org> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Tested-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed informationJiaxin Wu2017-06-051-0/+18
| | | | | | | | | | | | This path is to refine the PXE boot displayed information so as to in line with NetworkPkg/UefiPxeBcDxe driver. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg/Network: Fix potential ASSERT if NetIp4IsUnicast is calledJiaxin Wu2017-03-231-1/+1
| | | | | | | | | | | | | Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
* MdeModulePkg: Refine casting expression result to bigger sizeHao Wu2017-03-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Check for NULL pointer before dereference it.Fu Siyuan2016-10-311-4/+8
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg: Update IP4 stack drivers for classless address unicast check.Fu Siyuan2016-10-281-9/+15
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg: Do not use hard coded TTL/ToS in PXE driver.Fu Siyuan2016-05-051-2/+4
| | | | | | | | | | | | | EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but not used by the UdpWrite() interface. The code always use a hard coded 16 for the TTL and 0 for ToS. This patch update the UpdWrite() to use the TTL and ToS which have been set by the SetParameters(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* MdeModulePkg: reset DHCP child when leaving PXE LoadFile.Fu Siyuan2015-10-161-0/+5
| | | | | | | | | | | | | The DHCP4 can have only one configured child instance so we need to reset the DHCP4 child when leaving PXE driver's LoadFile() function, otherwise the other programs which also need to use DHCP4 (like HTTP boot) will be impacted. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18615 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: PXE Driver's LoadFile protocol should check FilePathZhang Lubo2015-09-101-0/+4
| | | | | | | | | | | | | PXE driver's LoadFile protocol should check the input parameter FilePath to see whether it's a supported device path.If not, it should return invalid parameter, do not continue PXE boot. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18435 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix the issue cannot boot to UEFI Network after resetZhang Lubo2015-07-291-1/+13
| | | | | | | | | | | | | | | DHCP4 service allows only one of its children to be configured in the active state,If the DHCP4 D.O.R.A started by IP4 auto configuration and has not been completed, the Dhcp4 state machine will not be in the right state for the PXE to start a new round D.O.R.A., so we need to switch it's policy to static. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18107 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix the issue EfiPxeBcDhcp() may return wrong status.Zhang Lubo2015-07-261-2/+2
| | | | | | | | | | | | | | | | if the instance of the DHCP4 protocol driver is in the Dhcp4Bound status that is DHCP configuration has completed, so the Dhcp4->Start FUNC in the EfiPxcBcDhcp() will return EFI_ALREADY_STARTED status which lead to EfiPxeBcDhcp FUNC not in correspondence with UEFI spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> [lersek@redhat.com: updated copyright year as Siyuan asked] Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18050 6f19259b-4bc3-4df7-8a09-765794883524
* Initialize DefaultInfo before using it.sfu52013-03-111-0/+1
| | | | | | | | Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Ouyang Qian <qian.ouyang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14168 6f19259b-4bc3-4df7-8a09-765794883524
* Removes a useless condition in PxeBcImpl.c.sfu52013-02-011-4/+1
| | | | | | | | | Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14117 6f19259b-4bc3-4df7-8a09-765794883524
* Reconfigure the UdpRead instance if an error occurred in Dhcp, Discover and ↵sfu52011-12-161-5/+6
| | | | | | | | | | Mtftp process. Signed-off-by: sfu5 Reviewed-by: qianouyang Reviewed-by: tye git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12884 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Fix bug in PXE driver UdpRead function to handle the IP fragmentation.sfu52011-09-091-15/+46
| | | | | | | | Signed-off-by: sfu5 Reviewed-by: xdu2 Reviewed-by: hhuan13 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12309 6f19259b-4bc3-4df7-8a09-765794883524
* Fix bug for UefiPxeBcDxe driver to catch the return status.sfu52011-09-011-0/+5
| | | | | | | | Signed-off-by: sfu5 Reviewed-by: hhuan13 Reviewed-by: xdu2 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12252 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Fix PXE performance issue : enhance EfiPxeBcSetIpFilter() to eliminate ↵hhuan132011-06-091-27/+58
| | | | | | | | | | unnecessary re-configure Udp4Read operation. Reviewed-by: xdu2 Signed-off-by: hhuan13 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11779 6f19259b-4bc3-4df7-8a09-765794883524
* Refine soma code to make code run safely.ydong102010-09-151-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10877 6f19259b-4bc3-4df7-8a09-765794883524
* Improve PXE Over IPv4 performance:hhuan132010-09-091-12/+16
| | | | | | | 1. Stop UdpWrite instance upon return from EfiPxeBcUdpWrite() to avoid mass pkgs enqueue to this useless instance in Udp layer. 2. Enhance Udp timeout logic to prevent the worst case happen, and set PxeUdp instance to 50ms to avoid enqueue mass pkgs in background. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10861 6f19259b-4bc3-4df7-8a09-765794883524
* To comply w/ UEFI spec , In Dhcp(), Discover(), and Mtftp() interfaces, set ↵hhuan132010-08-271-20/+94
| | | | | | the IP filter to use StationIp. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10829 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Introduce PcdTftpBlockSize to let platform DSC customize block size.hhuan132010-08-181-1/+13
| | | | | | 2. Roll back the default block size to handle all link layers. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10803 6f19259b-4bc3-4df7-8a09-765794883524
* Roll back BlockSize to 0x8000 for PXE performance concern.hhuan132010-08-151-5/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10798 6f19259b-4bc3-4df7-8a09-765794883524
* Fix 3 K8 issues for PXE module hhuan132010-05-141-2/+29
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10489 6f19259b-4bc3-4df7-8a09-765794883524
* Update the copyright notice formathhtian2010-04-241-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10418 6f19259b-4bc3-4df7-8a09-765794883524
* remove PxeBc->Stop () when EFI_BUFFER_TOO_SMALL, the calling PxeBc->Stop() ↵vanjeff2010-03-271-1/+3
| | | | | | in Driver Binding Stop() could make sure PXE functionality is stopped when disconnecting UefiPxeBcDxe module. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10318 6f19259b-4bc3-4df7-8a09-765794883524
* Fix an bug for PXE boot asserthhuan132010-03-191-2/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10291 6f19259b-4bc3-4df7-8a09-765794883524
* For network dynamic media support:xdu22010-02-031-0/+10
| | | | | | | | | | 1. add library function NetLibDetectMedia to NetLib for media detection 2. update MnpDxe to periodically poll for media status update and check for media status before packet transmit 3. update Ip4Dxe to return ModeData using Mnp->GetModeData() 4. update IScsiDxe to check for media status before try to do DHCP and session login 5. update UefiPxeBcDxe to check for media status before PXE start git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9919 6f19259b-4bc3-4df7-8a09-765794883524
* Get MaxPacketSize from IP4 mode data and reduce the head size of UDP and ↵ljin62010-02-011-7/+8
| | | | | | MTFTP, and take it as BlockSize to download. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9894 6f19259b-4bc3-4df7-8a09-765794883524
* refine the code and add more security check.vanjeff2010-01-081-179/+179
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9691 6f19259b-4bc3-4df7-8a09-765794883524
* The functionality of PXE Base Code protocol will not be stopped, when ↵vanjeff2009-12-041-1/+4
| | | | | | downloading is successfully. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9512 6f19259b-4bc3-4df7-8a09-765794883524
* Fixed the bug that not to stop PXE functionality when PXE meeting some ↵vanjeff2009-11-251-0/+2
| | | | | | failure. And enhanced DriverBindingStop() to stop PXE functionality if PXE was still alive. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9478 6f19259b-4bc3-4df7-8a09-765794883524
* Update network drivers to use FreePool() instead of gBS->FreePool().xdu22009-11-131-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9424 6f19259b-4bc3-4df7-8a09-765794883524
* [Change summary]:tye2009-11-041-9/+9
| | | | | | | | | | | | | | | | | | | | | | | 1. Update NetLib to a combined NetLib support dual network stack: 1) Add Network Debug facility for IPv4 stack. 2) Extend the library APIs to support IPv6 stack: a. NetIp6IsUnspecifiedAddr b. NetIp6IsLinkLocalAddr c. NetIp6IsNetEqual d. NetLibCreateIPv6DPathNode. e. NetIp6PseudoHeadChecksum f. NetIp6IsValidUnicast 3) Update the structure definitions: a. Update NET_BUF to add EFI_IP6_HEADER and EFI_UDP_HEADER b. Add NET_IP6_PSEUDO_HDR 4) Update Ip4IsUnicast to NetIp4IsUnicast 2. Update the impacted modules to adopt the combined NetLib. 3. Clean up coding style errors in all network drivers and libraries. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9391 6f19259b-4bc3-4df7-8a09-765794883524
* Use siaddr in DHCP packet, if zero, use option 54 instead.vanjeff2009-08-141-2/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9066 6f19259b-4bc3-4df7-8a09-765794883524
* Retire NetLibQueueDpc() and NetLibDispatchDpc() and use QueueDpc() and ↵mdkinney2009-07-111-2/+2
| | | | | | DispatchDpc() from the DpcLib instead. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8897 6f19259b-4bc3-4df7-8a09-765794883524
* add security check.vanjeff2009-07-081-6/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8819 6f19259b-4bc3-4df7-8a09-765794883524
* add security check.vanjeff2009-06-291-5/+8
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8680 6f19259b-4bc3-4df7-8a09-765794883524
* Fix incorrect error handling when PXE boot timeout.gikidy2009-06-291-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8675 6f19259b-4bc3-4df7-8a09-765794883524
* sync tracker:PXE misused the parameter of second since boot in DHCP header.vanjeff2009-06-081-58/+45
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8496 6f19259b-4bc3-4df7-8a09-765794883524
* 1. sync PXE boot trackers for Windows 2008 server.vanjeff2009-03-161-27/+38
| | | | | | 2. fixed one bug for SetIpfilter(). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7886 6f19259b-4bc3-4df7-8a09-765794883524
* code scrub for UefiPxeBcDxe.jgong52009-02-061-431/+675
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7452 6f19259b-4bc3-4df7-8a09-765794883524
* Refine MdeModulePkg to pass GCC build.xli242008-11-181-4/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6575 6f19259b-4bc3-4df7-8a09-765794883524
* Patch to remove STATIC modifier. This is on longer recommended by EFI ↵jji42008-10-301-6/+0
| | | | | | Framework coding style. All duplicated symbols has been renamed accordingly. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6296 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Sync Bug:PXE Boot issue- UefiPxeBc driver currently does not follow PXE Specvanjeff2008-09-191-3/+4
| | | | | | | | | | | [Root Cause Analysis] The PXE offer selection in the PXE driver is splitted into two passes and the two passes are required to follow the same flow. However, in current code, there is some difference between the two. [Solution] make the second offer selection pass exactly match the first one. 2. Fixed one bug when allocating pool for UDP transmit packet. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5932 6f19259b-4bc3-4df7-8a09-765794883524
* clean EBC build.vanjeff2008-06-121-23/+12
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5342 6f19259b-4bc3-4df7-8a09-765794883524
* [Description]:vanjeff2008-05-271-35/+49
| | | | | | | | | | | | | | Problem with PXE boot to Windows Server 2008 install. The reason is that UdpRead and UdpWrite interfaces cannot work well with the same UDP instance. [Solution] Use separate instances for UDP Read and UDP write in UefiPxeBC module. [Impaction]: UefiPxeBcDxe and Udp4Dxe module. [Reference Info]: EDK tracker 1133 - Problem with PXE boot to Windows Server 2008 install. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5303 6f19259b-4bc3-4df7-8a09-765794883524
* remove debug code.vanjeff2008-04-021-2/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4982 6f19259b-4bc3-4df7-8a09-765794883524