]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[pci] Replace pci_max_bus() with pci_num_bus()
authorMichael Brown <mcb30@ipxe.org>
Sat, 12 Feb 2011 02:08:28 +0000 (02:08 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 17 Feb 2011 01:25:11 +0000 (01:25 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/interface/pcbios/pcibios.c
src/arch/x86/core/pcidirect.c
src/arch/x86/include/ipxe/pcidirect.h
src/drivers/bus/pci.c
src/include/ipxe/efi/efi_pci.h
src/include/ipxe/pci_io.h
src/interface/efi/efi_pci.c

index 9f69fe6e420f9ccecd9e191387b3867ced9848bf..511ec6232d8a94925ed595f0d6c7d983cc8d28bf 100644 (file)
@@ -29,11 +29,11 @@ FILE_LICENCE ( GPL2_OR_LATER );
  */
 
 /**
- * Determine maximum PCI bus number within system
+ * Determine number of PCI buses within system
  *
- * @ret max_bus                Maximum bus number
+ * @ret num_bus                Number of buses
  */
-static int pcibios_max_bus ( void ) {
+static int pcibios_num_bus ( void ) {
        int discard_a, discard_D;
        uint8_t max_bus;
 
@@ -48,7 +48,7 @@ static int pcibios_max_bus ( void ) {
                                 "D" ( 0 )
                               : "ebx", "edx" );
 
-       return max_bus;
+       return ( max_bus + 1 );
 }
 
 /**
@@ -105,7 +105,7 @@ int pcibios_write ( struct pci_device *pci, uint32_t command, uint32_t value ){
        return ( ( status >> 8 ) & 0xff );
 }
 
-PROVIDE_PCIAPI ( pcbios, pci_max_bus, pcibios_max_bus );
+PROVIDE_PCIAPI ( pcbios, pci_num_bus, pcibios_num_bus );
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_byte );
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_word );
 PROVIDE_PCIAPI_INLINE ( pcbios, pci_read_config_dword );
index ae74b7f15955a0626891f4db874657aa5114cd48..a07f7d4baed0d06371adf5d98589a74cfc6887ed 100644 (file)
@@ -38,7 +38,7 @@ void pcidirect_prepare ( struct pci_device *pci, int where ) {
               PCIDIRECT_CONFIG_ADDRESS );
 }
 
-PROVIDE_PCIAPI_INLINE ( direct, pci_max_bus );
+PROVIDE_PCIAPI_INLINE ( direct, pci_num_bus );
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_byte );
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_word );
 PROVIDE_PCIAPI_INLINE ( direct, pci_read_config_dword );
index 4e933c43a50a3d2b4cceb819b97c0e4e941be4de..7fa7c4fa7eba39eee7cf19cacf703c3e7fb5e23b 100644 (file)
@@ -26,14 +26,14 @@ struct pci_device;
 extern void pcidirect_prepare ( struct pci_device *pci, int where );
 
 /**
- * Determine maximum PCI bus number within system
+ * Determine number of PCI buses within system
  *
- * @ret max_bus                Maximum bus number
+ * @ret num_bus                Number of buses
  */
 static inline __always_inline int
-PCIAPI_INLINE ( direct, pci_max_bus ) ( void ) {
+PCIAPI_INLINE ( direct, pci_num_bus ) ( void ) {
        /* No way to work this out via Type 1 accesses */
-       return 0xff;
+       return 0x100;
 }
 
 /**
index e92f11b2fed38defa181db79ac7a71404d8deb55..a30fcc7233bd734406fd34e740a5fea7d86dfa5b 100644 (file)
@@ -234,7 +234,7 @@ static int pcibus_probe ( struct root_device *rootdev ) {
        uint32_t tmp;
        int rc;
 
-       num_bus = ( pci_max_bus() + 1 );
+       num_bus = pci_num_bus();
        for ( busdevfn = 0 ; busdevfn < PCI_BUSDEVFN ( num_bus, 0, 0 ) ;
              busdevfn++ ) {
 
index b280d801dee3315bdaaad0d345b89cffcf6b913f..e06473d3ec9892e4f0c3da9869f1dd256b696f83 100644 (file)
@@ -33,14 +33,14 @@ extern int efipci_write ( struct pci_device *pci, unsigned long location,
                          unsigned long value );
 
 /**
- * Determine maximum PCI bus number within system
+ * Determine number of PCI buses within system
  *
- * @ret max_bus                Maximum bus number
+ * @ret num_bus                Number of buses
  */
 static inline __always_inline int
-PCIAPI_INLINE ( efi, pci_max_bus ) ( void ) {
+PCIAPI_INLINE ( efi, pci_num_bus ) ( void ) {
        /* No way to work this out via EFI */
-       return 0xff;
+       return 0x100;
 }
 
 /**
index 1188090722a3c61729053ff69a4c0fca25f551c5..dab5b780729858c764cc611b16411d2f632786c2 100644 (file)
@@ -49,11 +49,11 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <bits/pci_io.h>
 
 /**
- * Determine maximum PCI bus number within system
+ * Determine number of PCI buses within system
  *
- * @ret max_bus                Maximum bus number
+ * @ret num_bus                Number of buses
  */
-int pci_max_bus ( void );
+int pci_num_bus ( void );
 
 /**
  * Read byte from PCI configuration space
index c240d4cb75794047976ceee89b128d7e6b2caeb7..eb334b68512c92cd266f3971bea5a2cc37b66f2a 100644 (file)
@@ -73,7 +73,7 @@ int efipci_write ( struct pci_device *pci, unsigned long location,
        return 0;
 }
 
-PROVIDE_PCIAPI_INLINE ( efi, pci_max_bus );
+PROVIDE_PCIAPI_INLINE ( efi, pci_num_bus );
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_byte );
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_word );
 PROVIDE_PCIAPI_INLINE ( efi, pci_read_config_dword );