static int ibm_get_config_addr_info2;
 static int ibm_configure_pe;
 
+void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
+{
+       struct pci_dn *pdn = pci_get_pdn(pdev);
+
+       if (!pdev->is_virtfn)
+               return;
+
+       pdn->device_id  =  pdev->device;
+       pdn->vendor_id  =  pdev->vendor;
+       pdn->class_code =  pdev->class;
+
+       /*
+        * The following operations will fail if VF's sysfs files
+        * aren't created or its resources aren't finalized.
+        */
+       eeh_add_device_early(pdn);
+       eeh_add_device_late(pdev);
+       eeh_sysfs_add_device(pdev);
+
+}
+
 /*
  * Buffer for reporting slot-error-detail rtas calls. Its here
  * in BSS, and not dynamically alloced, so that it ends up in
        /* Set EEH probe mode */
        eeh_add_flag(EEH_PROBE_MODE_DEVTREE | EEH_ENABLE_IO_FOR_LOG);
 
+       /* Set EEH machine dependent code */
+       ppc_md.pcibios_bus_add_device = pseries_pcibios_bus_add_device;
+
        return 0;
 }
 
 
  * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
  *
  * pSeries specific routines for PCI.
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *    
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
                        }
                }
        }
-}   
+}
 DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device);
 #endif
 
+#ifdef CONFIG_PCI_IOV
+int pseries_pcibios_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
+{
+       /* Allocate PCI data */
+       add_dev_pci_data(pdev);
+       return 0;
+}
+
+int pseries_pcibios_sriov_disable(struct pci_dev *pdev)
+{
+       /* Release PCI data */
+       remove_dev_pci_data(pdev);
+       return 0;
+}
+#endif
+
 static void __init pSeries_request_regions(void)
 {
        if (!isa_io_base)
        pSeries_request_regions();
 
        eeh_addr_cache_build();
+
+#ifdef CONFIG_PCI_IOV
+       ppc_md.pcibios_sriov_enable = pseries_pcibios_sriov_enable;
+       ppc_md.pcibios_sriov_disable = pseries_pcibios_sriov_disable;
+#endif
 }
 
 /*