VirtualBox

Changeset 57901 in vbox


Ignore:
Timestamp:
Sep 25, 2015 3:29:51 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102873
Message:

Devices/Virtio: semantic fixes.

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

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

    r57809 r57901  
    4848#ifdef IN_RING3
    4949
    50 #define VNET_PCI_SUBSYSTEM_ID        1 + VIRTIO_NET_ID
    5150#define VNET_PCI_CLASS               0x0200
    5251#define VNET_N_QUEUES                3
     
    5554#if 0
    5655/* Virtio Block Device */
    57 #define VNET_PCI_SUBSYSTEM_ID        1 + VIRTIO_BLK_ID
    5856#define VNET_PCI_CLASS               0x0180
    5957#define VNET_N_QUEUES                2
     
    19511949    pThis->VPCI.IBase.pfnQueryInterface    = vnetQueryInterface;
    19521950    rc = vpciConstruct(pDevIns, &pThis->VPCI, iInstance,
    1953                        VNET_NAME_FMT, VNET_PCI_SUBSYSTEM_ID,
     1951                       VNET_NAME_FMT, VIRTIO_NET_ID,
    19541952                       VNET_PCI_CLASS, VNET_N_QUEUES);
    19551953    pThis->pRxQueue  = vpciAddQueue(&pThis->VPCI, 256, vnetQueueReceive,  "RX ");
  • trunk/src/VBox/Devices/VirtIO/Virtio.cpp

    r57809 r57901  
    769769 *
    770770 * @param   pci          Reference to PCI device structure.
    771  * @param   uSubsystemId PCI Subsystem Id
     771 * @param   uDeviceId    VirtiO Device Id
    772772 * @param   uClass       Class of PCI device (network, etc)
    773773 * @thread  EMT
    774774 */
    775775static DECLCALLBACK(void) vpciConfigure(PCIDEVICE& pci,
    776                                         uint16_t uSubsystemId,
     776                                        uint16_t uDeviceId,
    777777                                        uint16_t uClass)
    778778{
    779779    /* Configure PCI Device, assume 32-bit mode ******************************/
    780780    PCIDevSetVendorId(&pci, DEVICE_PCI_VENDOR_ID);
    781     PCIDevSetDeviceId(&pci, DEVICE_PCI_DEVICE_ID);
     781    PCIDevSetDeviceId(&pci, DEVICE_PCI_BASE_ID + uDeviceId);
    782782    vpciCfgSetU16(pci, VBOX_PCI_SUBSYSTEM_VENDOR_ID, DEVICE_PCI_SUBSYSTEM_VENDOR_ID);
    783     vpciCfgSetU16(pci, VBOX_PCI_SUBSYSTEM_ID, uSubsystemId);
     783    vpciCfgSetU16(pci, VBOX_PCI_SUBSYSTEM_ID, DEVICE_PCI_SUBSYSTEM_BASE_ID + uDeviceId);
    784784
    785785    /* ABI version, must be equal 0 as of 2.6.30 kernel. */
     
    812812int vpciConstruct(PPDMDEVINS pDevIns, VPCISTATE *pState,
    813813                  int iInstance, const char *pcszNameFmt,
    814                   uint16_t uSubsystemId, uint16_t uClass,
     814                  uint16_t uDeviceId, uint16_t uClass,
    815815                  uint32_t nQueues)
    816816{
     
    832832
    833833    /* Set PCI config registers */
    834     vpciConfigure(pState->pciDevice, uSubsystemId, uClass);
     834    vpciConfigure(pState->pciDevice, uDeviceId, uClass);
    835835    /* Register PCI device */
    836836    rc = PDMDevHlpPCIRegister(pDevIns, &pState->pciDevice);
  • trunk/src/VBox/Devices/VirtIO/Virtio.h

    r57809 r57901  
    3333
    3434#define DEVICE_PCI_VENDOR_ID                0x1AF4
    35 #define DEVICE_PCI_DEVICE_ID                0x1000
     35#define DEVICE_PCI_BASE_ID                  0x1000
    3636#define DEVICE_PCI_SUBSYSTEM_VENDOR_ID      0x1AF4
     37#define DEVICE_PCI_SUBSYSTEM_BASE_ID       1
    3738
    3839#define VIRTIO_MAX_NQUEUES                  3
     
    260261int   vpciLoadExec(PVPCISTATE pState, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass, uint32_t nQueues);
    261262int   vpciConstruct(PPDMDEVINS pDevIns, VPCISTATE *pState, int iInstance, const char *pcszNameFmt,
    262                     uint16_t uSubsystemId, uint16_t uClass, uint32_t nQueues);
     263                    uint16_t uDeviceId, uint16_t uClass, uint32_t nQueues);
    263264int   vpciDestruct(VPCISTATE* pState);
    264265void  vpciRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
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