VirtualBox

Changeset 32863 in vbox for trunk


Ignore:
Timestamp:
Oct 1, 2010 12:28:58 PM (14 years ago)
Author:
vboxsync
Message:

e1k: temporary code for MSI testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r32724 r32863  
    4343//#define E1K_REL_STATS
    4444//#define E1K_USE_SUPLIB_SEMEVENT
     45//#define E1K_WITH_MSI
    4546
    4647#include <iprt/crc.h>
     
    145146{
    146147    /* Vendor Device SSVendor SubSys  Name */
    147     { 0x8086, 0x100E, 0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */
     148    { 0x8086,
     149      /* Temporary code, as MSI-aware driver dislike 0x100E. How to do that right? */
     150#ifdef E1K_WITH_MSI
     151      0x105E,
     152#else
     153      0x100E,
     154#endif
     155                      0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */
    148156    { 0x8086, 0x1004, 0x8086, 0x1004, "82543GC" }, /* Intel 82543GC   in Intel PRO/1000 T  Server */
    149157    { 0x8086, 0x100F, 0x15AD, 0x0750, "82545EM" }  /* Intel 82545EM-A in VMWare Network Adapter */
     
    55895597    /* Capability ID: PCI-X Configuration Registers */
    55905598    e1kPCICfgSetU8( pci, 0xE4,                           VBOX_PCI_CAP_ID_PCIX);
     5599#ifdef E1K_WITH_MSI
     5600    e1kPCICfgSetU8( pci, 0xE4 + 1,                      0x80);
     5601#else
    55915602    /* Next Item Pointer: None (Message Signalled Interrupts are disabled) */
    55925603    e1kPCICfgSetU8( pci, 0xE4 + 1,                      0x00);
     5604#endif
    55935605    /* PCI-X Command: Enable Relaxed Ordering */
    55945606    e1kPCICfgSetU16(pci, 0xE4 + 2,                    VBOX_PCI_X_CMD_ERO);
    55955607    /* PCI-X Status: 32-bit, 66MHz*/
    5596     /// @todo: is this value really correct? fff8 doesn't look like actual PCI address 
     5608    /// @todo: is this value really correct? fff8 doesn't look like actual PCI address
    55975609    e1kPCICfgSetU32(pci, 0xE4 + 4,                0x0040FFF8);
    55985610}
     
    57305742    if (RT_FAILURE(rc))
    57315743        return rc;
     5744
     5745#ifdef E1K_WITH_MSI
     5746    PDMMSIREG aMsiReg;
     5747    aMsiReg.cVectors = 1;
     5748    aMsiReg.iCapOffset = 0x80;
     5749    aMsiReg.iNextOffset = 0x0;
     5750    aMsiReg.iMsiFlags = 0;
     5751    rc = PDMDevHlpPCIRegisterMsi(pDevIns, &aMsiReg);
     5752    AssertRC(rc);
     5753    if (RT_FAILURE (rc))
     5754        return rc;
     5755#endif
     5756
    57325757
    57335758    /* Map our registers to memory space (region 0, see e1kConfigurePCI)*/
Note: See TracChangeset for help on using the changeset viewer.

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