Browse Source

[pci] Replace pci_max_bus() with pci_num_bus()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
abb5590b29

+ 5
- 5
src/arch/i386/interface/pcbios/pcibios.c View File

29
  */
29
  */
30
 
30
 
31
 /**
31
 /**
32
- * Determine maximum PCI bus number within system
32
+ * Determine number of PCI buses within system
33
  *
33
  *
34
- * @ret max_bus		Maximum bus number
34
+ * @ret num_bus		Number of buses
35
  */
35
  */
36
-static int pcibios_max_bus ( void ) {
36
+static int pcibios_num_bus ( void ) {
37
 	int discard_a, discard_D;
37
 	int discard_a, discard_D;
38
 	uint8_t max_bus;
38
 	uint8_t max_bus;
39
 
39
 
48
 				 "D" ( 0 )
48
 				 "D" ( 0 )
49
 			       : "ebx", "edx" );
49
 			       : "ebx", "edx" );
50
 
50
 
51
-	return max_bus;
51
+	return ( max_bus + 1 );
52
 }
52
 }
53
 
53
 
54
 /**
54
 /**
105
 	return ( ( status >> 8 ) & 0xff );
105
 	return ( ( status >> 8 ) & 0xff );
106
 }
106
 }
107
 
107
 
108
-PROVIDE_PCIAPI ( pcbios, pci_max_bus, pcibios_max_bus );
108
+PROVIDE_PCIAPI ( pcbios, pci_num_bus, pcibios_num_bus );
109
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_byte );
109
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_byte );
110
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_word );
110
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_word );
111
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_dword );
111
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_dword );

+ 1
- 1
src/arch/x86/core/pcidirect.c View File

38
 	       PCIDIRECT_CONFIG_ADDRESS );
38
 	       PCIDIRECT_CONFIG_ADDRESS );
39
 }
39
 }
40
 
40
 
41
-PROVIDE_PCIAPI_INLINE ( direct, pci_max_bus );
41
+PROVIDE_PCIAPI_INLINE ( direct, pci_num_bus );
42
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_byte );
42
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_byte );
43
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_word );
43
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_word );
44
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_dword );
44
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_dword );

+ 4
- 4
src/arch/x86/include/ipxe/pcidirect.h View File

26
 extern void pcidirect_prepare ( struct pci_device *pci, int where );
26
 extern void pcidirect_prepare ( struct pci_device *pci, int where );
27
 
27
 
28
 /**
28
 /**
29
- * Determine maximum PCI bus number within system
29
+ * Determine number of PCI buses within system
30
  *
30
  *
31
- * @ret max_bus		Maximum bus number
31
+ * @ret num_bus		Number of buses
32
  */
32
  */
33
 static inline __always_inline int
33
 static inline __always_inline int
34
-PCIAPI_INLINE ( direct, pci_max_bus ) ( void ) {
34
+PCIAPI_INLINE ( direct, pci_num_bus ) ( void ) {
35
 	/* No way to work this out via Type 1 accesses */
35
 	/* No way to work this out via Type 1 accesses */
36
-	return 0xff;
36
+	return 0x100;
37
 }
37
 }
38
 
38
 
39
 /**
39
 /**

+ 1
- 1
src/drivers/bus/pci.c View File

234
 	uint32_t tmp;
234
 	uint32_t tmp;
235
 	int rc;
235
 	int rc;
236
 
236
 
237
-	num_bus = ( pci_max_bus() + 1 );
237
+	num_bus = pci_num_bus();
238
 	for ( busdevfn = 0 ; busdevfn < PCI_BUSDEVFN ( num_bus, 0, 0 ) ;
238
 	for ( busdevfn = 0 ; busdevfn < PCI_BUSDEVFN ( num_bus, 0, 0 ) ;
239
 	      busdevfn++ ) {
239
 	      busdevfn++ ) {
240
 
240
 

+ 4
- 4
src/include/ipxe/efi/efi_pci.h View File

33
 			  unsigned long value );
33
 			  unsigned long value );
34
 
34
 
35
 /**
35
 /**
36
- * Determine maximum PCI bus number within system
36
+ * Determine number of PCI buses within system
37
  *
37
  *
38
- * @ret max_bus		Maximum bus number
38
+ * @ret num_bus		Number of buses
39
  */
39
  */
40
 static inline __always_inline int
40
 static inline __always_inline int
41
-PCIAPI_INLINE ( efi, pci_max_bus ) ( void ) {
41
+PCIAPI_INLINE ( efi, pci_num_bus ) ( void ) {
42
 	/* No way to work this out via EFI */
42
 	/* No way to work this out via EFI */
43
-	return 0xff;
43
+	return 0x100;
44
 }
44
 }
45
 
45
 
46
 /**
46
 /**

+ 3
- 3
src/include/ipxe/pci_io.h View File

49
 #include <bits/pci_io.h>
49
 #include <bits/pci_io.h>
50
 
50
 
51
 /**
51
 /**
52
- * Determine maximum PCI bus number within system
52
+ * Determine number of PCI buses within system
53
  *
53
  *
54
- * @ret max_bus		Maximum bus number
54
+ * @ret num_bus		Number of buses
55
  */
55
  */
56
-int pci_max_bus ( void );
56
+int pci_num_bus ( void );
57
 
57
 
58
 /**
58
 /**
59
  * Read byte from PCI configuration space
59
  * Read byte from PCI configuration space

+ 1
- 1
src/interface/efi/efi_pci.c View File

73
 	return 0;
73
 	return 0;
74
 }
74
 }
75
 
75
 
76
-PROVIDE_PCIAPI_INLINE ( efi, pci_max_bus );
76
+PROVIDE_PCIAPI_INLINE ( efi, pci_num_bus );
77
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_byte );
77
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_byte );
78
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_word );
78
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_word );
79
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_dword );
79
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_dword );

Loading…
Cancel
Save