Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_hostbridge.c
Show All 28 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "pci_emul.h" | #include "pci_emul.h" | ||||
static int | static int | ||||
pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) | pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) | ||||
{ | { | ||||
/* config space */ | /* config space */ | ||||
pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1275); /* NetApp */ | pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1275); /* NetApp */ | ||||
pci_set_cfgdata16(pi, PCIR_DEVICE, 0x1275); /* NetApp */ | pci_set_cfgdata16(pi, PCIR_DEVICE, 0x1275); /* NetApp */ | ||||
pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_NORMAL); | pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_NORMAL); | ||||
pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE); | pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE); | ||||
pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_HOST); | pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_HOST); | ||||
pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_PORT); | pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_PORT); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
pci_amd_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) | pci_amd_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) | ||||
{ | { | ||||
(void) pci_hostbridge_init(ctx, pi, opts); | (void) pci_hostbridge_init(ctx, pi, nvl); | ||||
pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1022); /* AMD */ | pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1022); /* AMD */ | ||||
pci_set_cfgdata16(pi, PCIR_DEVICE, 0x7432); /* made up */ | pci_set_cfgdata16(pi, PCIR_DEVICE, 0x7432); /* made up */ | ||||
return (0); | return (0); | ||||
} | } | ||||
struct pci_devemu pci_de_amd_hostbridge = { | struct pci_devemu pci_de_amd_hostbridge = { | ||||
.pe_emu = "amd_hostbridge", | .pe_emu = "amd_hostbridge", | ||||
Show All 9 Lines |