pci_emul_add_pciecap(struct pci_vdev *dev, int type)
{
	int err;
	struct pciecap pciecap;

	if (type != PCIEM_TYPE_ROOT_PORT)
		return -1;

	bzero(&pciecap, sizeof(pciecap));

	pciecap.capid = PCIY_EXPRESS;
	pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT;
	pciecap.link_capabilities = 0x411;	/* gen1, x1 */
	pciecap.link_status = 0x11;		/* gen1, x1 */

	err = pci_emul_add_capability(dev, (u_char *)&pciecap, sizeof(pciecap));
	return err;
}
pci_emul_add_pciecap(struct pci_vdev *dev, int type)
{
	int err;
	struct pciecap pciecap;

	if (type != PCIEM_TYPE_ROOT_PORT)
		return -1;

	bzero(&pciecap, sizeof(pciecap));

	pciecap.capid = PCIY_EXPRESS;
	pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT;
	pciecap.link_capabilities = 0x411;	 
	pciecap.link_status = 0x11;		 

	err = pci_emul_add_capability(dev, (u_char *)&pciecap, sizeof(pciecap));
	return err;
}