Changeset 80721 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
- Timestamp:
- Sep 11, 2019 8:46:37 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-129237 /vendor/edk2/current 103735-103757,103769-103776,129194-133213
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
r77662 r80721 2 2 Support functions implementation for UefiPxeBc Driver. 3 3 4 Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR> 5 6 This program and the accompanying materials 7 are licensed and made available under the terms and conditions of the BSD License 8 which accompanies this distribution. The full text of the license may be found at 9 http://opensource.org/licenses/bsd-license.php. 10 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> 5 6 SPDX-License-Identifier: BSD-2-Clause-Patent 13 7 14 8 **/ … … 37 31 EFI_PXE_BASE_CODE_MODE *Mode; 38 32 EFI_STATUS Status; 33 EFI_ARP_CONFIG_DATA ArpConfigData; 39 34 40 35 Mode = Private->PxeBc.Mode; 41 36 Status = EFI_SUCCESS; 42 43 if (Mode->UsingIpv6) { 44 45 if (StationIp != NULL) { 46 CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS)); 47 CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS)); 48 } 37 ZeroMem (&ArpConfigData, sizeof (EFI_ARP_CONFIG_DATA)); 38 39 if (Mode->UsingIpv6 && StationIp != NULL) { 40 // 41 // Overwrite Udp6CfgData/Ip6CfgData StationAddress. 42 // 43 CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS)); 44 CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS)); 49 45 50 46 // … … 62 58 } else { 63 59 if (StationIp != NULL) { 60 // 61 // Reconfigure the ARP instance with station Ip address. 62 // 63 ArpConfigData.SwAddressType = 0x0800; 64 ArpConfigData.SwAddressLength = (UINT8) sizeof (EFI_IPv4_ADDRESS); 65 ArpConfigData.StationAddress = StationIp; 66 67 Private->Arp->Configure (Private->Arp, NULL); 68 Private->Arp->Configure (Private->Arp, &ArpConfigData); 69 70 // 71 // Overwrite Udp4CfgData/Ip4CfgData StationAddress. 72 // 64 73 CopyMem (&Private->Udp4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS)); 65 74 CopyMem (&Private->Ip4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS)); … … 67 76 68 77 if (SubnetMask != NULL) { 78 // 79 // Overwrite Udp4CfgData/Ip4CfgData SubnetMask. 80 // 69 81 CopyMem (&Private->Udp4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv4_ADDRESS)); 70 82 CopyMem (&Private->Ip4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv4_ADDRESS)); 71 83 } 72 84 73 // 74 // Reconfigure the Ip4 instance to capture background ICMP packets with new station Ip address. 75 // 76 Private->Ip4->Cancel (Private->Ip4, &Private->IcmpToken); 77 Private->Ip4->Configure (Private->Ip4, NULL); 78 79 Status = Private->Ip4->Configure (Private->Ip4, &Private->Ip4CfgData); 80 if (EFI_ERROR (Status)) { 81 goto ON_EXIT; 82 } 83 84 Status = Private->Ip4->Receive (Private->Ip4, &Private->IcmpToken); 85 if (StationIp != NULL && SubnetMask != NULL) { 86 // 87 // Updated the route table. 88 // 89 Mode->RouteTableEntries = 1; 90 Mode->RouteTable[0].IpAddr.Addr[0] = StationIp->Addr[0] & SubnetMask->Addr[0]; 91 Mode->RouteTable[0].SubnetMask.Addr[0] = SubnetMask->Addr[0]; 92 Mode->RouteTable[0].GwAddr.Addr[0] = 0; 93 } 94 95 if (StationIp != NULL || SubnetMask != NULL) { 96 // 97 // Reconfigure the Ip4 instance to capture background ICMP packets with new station Ip address. 98 // 99 Private->Ip4->Cancel (Private->Ip4, &Private->IcmpToken); 100 Private->Ip4->Configure (Private->Ip4, NULL); 101 102 Status = Private->Ip4->Configure (Private->Ip4, &Private->Ip4CfgData); 103 if (EFI_ERROR (Status)) { 104 goto ON_EXIT; 105 } 106 107 Status = Private->Ip4->Receive (Private->Ip4, &Private->IcmpToken); 108 } 85 109 } 86 110 … … 1481 1505 ZeroMem (&Time, sizeof (EFI_TIME)); 1482 1506 gRT->GetTime (&Time, NULL); 1483 CurrentStamp = (UINT64)1484 (1485 ((((((Time.Year - 1900) * 360 +1486 (Time.Month - 1)) * 30+1487 (Time.Day - 1)) * 24 + Time.Hour) * 60 +1488 Time.Minute) * 60 + Time.Second) * 1001489 + DivU64x32(Time.Nanosecond, 10000000)1490 );1507 CurrentStamp = MultU64x32 ( 1508 ((((UINT32)(Time.Year - 1900) * 360 + (Time.Month - 1) * 30 + (Time.Day - 1)) * 24 + Time.Hour) * 60 + Time.Minute) * 60 + Time.Second, 1509 100 1510 ) + 1511 DivU64x32 ( 1512 Time.Nanosecond, 1513 10000000 1514 ); 1491 1515 1492 1516 //
Note:
See TracChangeset
for help on using the changeset viewer.