3
3
* Copyright (C) 2003 Anton Blanchard <[email protected] >, IBM
4
4
*
5
5
* pSeries specific routines for PCI.
6
- *
6
+ *
7
7
* This program is free software; you can redistribute it and/or modify
8
8
* it under the terms of the GNU General Public License as published by
9
9
* the Free Software Foundation; either version 2 of the License, or
10
10
* (at your option) any later version.
11
- *
11
+ *
12
12
* This program is distributed in the hope that it will be useful,
13
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
15
* GNU General Public License for more details.
16
- *
16
+ *
17
17
* You should have received a copy of the GNU General Public License
18
18
* along with this program; if not, write to the Free Software
19
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -54,10 +54,26 @@ void pcibios_name_device(struct pci_dev *dev)
54
54
}
55
55
}
56
56
}
57
- }
57
+ }
58
58
DECLARE_PCI_FIXUP_HEADER (PCI_ANY_ID , PCI_ANY_ID , pcibios_name_device );
59
59
#endif
60
60
61
+ #ifdef CONFIG_PCI_IOV
62
+ int pseries_pcibios_sriov_enable (struct pci_dev * pdev , u16 num_vfs )
63
+ {
64
+ /* Allocate PCI data */
65
+ add_dev_pci_data (pdev );
66
+ return 0 ;
67
+ }
68
+
69
+ int pseries_pcibios_sriov_disable (struct pci_dev * pdev )
70
+ {
71
+ /* Release PCI data */
72
+ remove_dev_pci_data (pdev );
73
+ return 0 ;
74
+ }
75
+ #endif
76
+
61
77
static void __init pSeries_request_regions (void )
62
78
{
63
79
if (!isa_io_base )
@@ -76,6 +92,11 @@ void __init pSeries_final_fixup(void)
76
92
pSeries_request_regions ();
77
93
78
94
eeh_addr_cache_build ();
95
+
96
+ #ifdef CONFIG_PCI_IOV
97
+ ppc_md .pcibios_sriov_enable = pseries_pcibios_sriov_enable ;
98
+ ppc_md .pcibios_sriov_disable = pseries_pcibios_sriov_disable ;
99
+ #endif
79
100
}
80
101
81
102
/*
0 commit comments