VirtualBox

Ignore:
Timestamp:
Jun 4, 2021 10:38:21 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144860
Message:

EFI/E1kNetDxe: Updates, the basic receive and transmit operations are functional and PXE booting seems to work with the limited testing done, include the driver in our image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpInitialize.c

    r89462 r89503  
    44  any.
    55
     6  Copyright (c) 2021, Oracle and/or its affiliates.
     7  Copyright (c) 2017, AMD Inc, All rights reserved.
    68  Copyright (C) 2013, Red Hat, Inc.
    79  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
    8   Copyright (c) 2017, AMD Inc, All rights reserved.<BR>
    910
    1011  SPDX-License-Identifier: BSD-2-Clause-Patent
     
    146147  EFI_STATUS            Status;
    147148  UINTN                 RxBufSize;
    148   UINT16                RxAlwaysPending;
    149149  UINTN                 PktIdx;
    150150  UINTN                 NumBytes;
     
    161161
    162162  //
    163   // Limit the number of pending RX packets if the queue is big. The division
    164   // by two is due to the above "two descriptors per packet" trait.
    165   //
    166   RxAlwaysPending = E1K_NET_MAX_PENDING;
    167 
    168   //
    169163  // The RxBuf is shared between guest and hypervisor, use
    170164  // AllocateSharedPages() to allocate this memory region and map it with
     
    172166  // hypervisor.
    173167  //
    174   NumBytes = RxAlwaysPending * RxBufSize;
     168  NumBytes = E1K_NET_MAX_PENDING * RxBufSize;
    175169  Dev->RxBufNrPages = EFI_SIZE_TO_PAGES (NumBytes);
    176170  Status = Dev->PciIo->AllocateBuffer (
     
    201195
    202196  Dev->RxRing = RxBuffer;
    203   Dev->RxBuf  = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * RxAlwaysPending;
     197  Dev->RxBuf  = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * E1K_NET_MAX_PENDING;
    204198  Dev->RdhLastSeen = 0;
    205199
    206200  // 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;
    208202  RxBufDeviceAddress = Dev->RxBufDeviceBase;
    209   for (PktIdx = 0; PktIdx < RxAlwaysPending; ++PktIdx) {
     203  for (PktIdx = 0; PktIdx < E1K_NET_MAX_PENDING; ++PktIdx) {
    210204    Dev->RxRing[PktIdx].AddrBufferLow  = (UINT32)RxBufDeviceAddress;
    211205    Dev->RxRing[PktIdx].AddrBufferHigh = (UINT32)RShiftU64(RxBufDeviceAddress, 32);
     
    278272  EFI_STATUS  Status;
    279273
     274  DEBUG((DEBUG_INFO, "E1kNetInitialize:\n"));
     275
    280276  if (This == NULL) {
    281277    return EFI_INVALID_PARAMETER;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette