Changeset 89503 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 4, 2021 10:38:21 AM (4 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc
r85801 r89503 991 991 !endif 992 992 OvmfPkg/VirtioNetDxe/VirtioNet.inf 993 !ifdef $(VBOX) 994 VBoxPkg/E1kNetDxe/E1kNet.inf 995 !endif 993 996 994 997 # -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.fdf
r85801 r89503 326 326 !include NetworkPkg/Network.fdf.inc 327 327 INF OvmfPkg/VirtioNetDxe/VirtioNet.inf 328 !ifdef $(VBOX) 329 INF VBoxPkg/E1kNetDxe/E1kNet.inf 330 !endif 328 331 329 332 # -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc
r85801 r89503 994 994 !endif 995 995 OvmfPkg/VirtioNetDxe/VirtioNet.inf 996 !ifdef $(VBOX) 997 VBoxPkg/E1kNetDxe/E1kNet.inf 998 !endif 996 999 997 1000 # -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.fdf
r85801 r89503 332 332 !include NetworkPkg/Network.fdf.inc 333 333 INF OvmfPkg/VirtioNetDxe/VirtioNet.inf 334 !ifdef $(VBOX) 335 INF VBoxPkg/E1kNetDxe/E1kNet.inf 336 !endif 334 337 335 338 # -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/Events.c
r89462 r89503 45 45 // 46 46 E1K_NET_DEV *Dev; 47 //UINT16 RxCurUsed;47 UINT32 RdhCur; 48 48 49 49 Dev = Context; … … 52 52 } 53 53 54 #if 0 55 // 56 // virtio-0.9.5, 2.4.2 Receiving Used Buffers From the Device 57 // 58 MemoryFence (); 59 RxCurUsed = *Dev->RxRing.Used.Idx; 60 MemoryFence (); 54 E1kNetRegRead32(Dev, E1K_REG_RDH, &RdhCur); 61 55 62 if (Dev->R xLastUsed != RxCurUsed) {56 if (Dev->RdhLastSeen != RdhCur) { 63 57 gBS->SignalEvent (Dev->Snp.WaitForPacket); 64 58 } 65 #endif66 59 } 67 60 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpInitialize.c
r89462 r89503 4 4 any. 5 5 6 Copyright (c) 2021, Oracle and/or its affiliates. 7 Copyright (c) 2017, AMD Inc, All rights reserved. 6 8 Copyright (C) 2013, Red Hat, Inc. 7 9 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 8 Copyright (c) 2017, AMD Inc, All rights reserved.<BR>9 10 10 11 SPDX-License-Identifier: BSD-2-Clause-Patent … … 146 147 EFI_STATUS Status; 147 148 UINTN RxBufSize; 148 UINT16 RxAlwaysPending;149 149 UINTN PktIdx; 150 150 UINTN NumBytes; … … 161 161 162 162 // 163 // Limit the number of pending RX packets if the queue is big. The division164 // by two is due to the above "two descriptors per packet" trait.165 //166 RxAlwaysPending = E1K_NET_MAX_PENDING;167 168 //169 163 // The RxBuf is shared between guest and hypervisor, use 170 164 // AllocateSharedPages() to allocate this memory region and map it with … … 172 166 // hypervisor. 173 167 // 174 NumBytes = RxAlwaysPending* RxBufSize;168 NumBytes = E1K_NET_MAX_PENDING * RxBufSize; 175 169 Dev->RxBufNrPages = EFI_SIZE_TO_PAGES (NumBytes); 176 170 Status = Dev->PciIo->AllocateBuffer ( … … 201 195 202 196 Dev->RxRing = RxBuffer; 203 Dev->RxBuf = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * RxAlwaysPending;197 Dev->RxBuf = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * E1K_NET_MAX_PENDING; 204 198 Dev->RdhLastSeen = 0; 205 199 206 200 // Set up the RX descriptors. 207 Dev->RxBufDeviceBase = Dev->RxDeviceBase + sizeof(*Dev->RxRing) * RxAlwaysPending;201 Dev->RxBufDeviceBase = Dev->RxDeviceBase + sizeof(*Dev->RxRing) * E1K_NET_MAX_PENDING; 208 202 RxBufDeviceAddress = Dev->RxBufDeviceBase; 209 for (PktIdx = 0; PktIdx < RxAlwaysPending; ++PktIdx) {203 for (PktIdx = 0; PktIdx < E1K_NET_MAX_PENDING; ++PktIdx) { 210 204 Dev->RxRing[PktIdx].AddrBufferLow = (UINT32)RxBufDeviceAddress; 211 205 Dev->RxRing[PktIdx].AddrBufferHigh = (UINT32)RShiftU64(RxBufDeviceAddress, 32); … … 278 272 EFI_STATUS Status; 279 273 274 DEBUG((DEBUG_INFO, "E1kNetInitialize:\n")); 275 280 276 if (This == NULL) { 281 277 return EFI_INVALID_PARAMETER; -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpReceive.c
r89462 r89503 76 76 UINT8 *RxPtr; 77 77 UINTN RxBufOffset; 78 79 DEBUG((DEBUG_INFO, "E1kNetReceive: HeaderSize=%p BufferSize=%u Buffer=%p\n", 80 HeaderSize, *BufferSize, Buffer)); 78 81 79 82 if (This == NULL || BufferSize == NULL || Buffer == NULL) { -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpSharedHelpers.c
r89462 r89503 86 86 Map Caller-supplied TxBuf buffer to the device-mapped address 87 87 88 @param[in] Dev The VNET_DEV driver instance which wants to88 @param[in] Dev The E1K_NET_DEV driver instance which wants to 89 89 map the Tx packet. 90 90 @param[in] Buffer The system physical address of TxBuf … … 177 177 physical address 178 178 179 @param[in] Dev The VNET_DEV driver instance which wants to179 @param[in] Dev The E1K_NET_DEV driver instance which wants to 180 180 reverse- and unmap the Tx packet. 181 181 @param[out] Buffer The system physical address of TxBuf -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpShutdown.c
r89462 r89503 43 43 EFI_STATUS Status; 44 44 45 DEBUG((DEBUG_INFO, "E1kNetShutdown:\n")); 46 45 47 if (This == NULL) { 46 48 return EFI_INVALID_PARAMETER; … … 60 62 } 61 63 62 #if 0 63 Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0); 64 VirtioNetShutdownRx (Dev); 65 VirtioNetShutdownTx (Dev); 66 VirtioNetUninitRing (Dev, &Dev->TxRing, Dev->TxRingMap); 67 VirtioNetUninitRing (Dev, &Dev->RxRing, Dev->RxRingMap); 68 #endif 64 E1kNetDevReset(Dev); 65 E1kNetShutdownRx (Dev); 66 E1kNetShutdownTx (Dev); 69 67 70 68 Dev->Snm.State = EfiSimpleNetworkStarted; -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpTransmit.c
r89462 r89503 73 73 EFI_STATUS Status; 74 74 EFI_PHYSICAL_ADDRESS DeviceAddress; 75 76 DEBUG((DEBUG_INFO, "E1kNetTransmit: HeaderSize=%u BufferSize=%u Buffer=%p\n", 77 HeaderSize, BufferSize, Buffer)); 75 78 76 79 if (This == NULL || BufferSize == 0 || Buffer == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.