diff options
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/bus/pcibackup.c | 10 | ||||
-rw-r--r-- | src/drivers/infiniband/arbel.c | 4 | ||||
-rw-r--r-- | src/drivers/infiniband/hermon.c | 5 | ||||
-rw-r--r-- | src/drivers/infiniband/qib7322.c | 4 |
4 files changed, 13 insertions, 10 deletions
diff --git a/src/drivers/bus/pcibackup.c b/src/drivers/bus/pcibackup.c index fecad8192..4cf126f83 100644 --- a/src/drivers/bus/pcibackup.c +++ b/src/drivers/bus/pcibackup.c @@ -61,14 +61,15 @@ pci_backup_excluded ( struct pci_device *pci, unsigned int offset, * * @v pci PCI device * @v backup PCI configuration space backup + * @v limit Maximum offset in PCI configuration space * @v exclude PCI configuration space backup exclusion list, or NULL */ void pci_backup ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ) { + unsigned int limit, const uint8_t *exclude ) { unsigned int offset; uint32_t *dword; - for ( offset = 0, dword = backup->dwords ; offset < 0x100 ; + for ( offset = 0, dword = backup->dwords ; offset < limit ; offset += sizeof ( *dword ) , dword++ ) { if ( ! pci_backup_excluded ( pci, offset, exclude ) ) pci_read_config_dword ( pci, offset, dword ); @@ -80,14 +81,15 @@ void pci_backup ( struct pci_device *pci, struct pci_config_backup *backup, * * @v pci PCI device * @v backup PCI configuration space backup + * @v limit Maximum offset in PCI configuration space * @v exclude PCI configuration space backup exclusion list, or NULL */ void pci_restore ( struct pci_device *pci, struct pci_config_backup *backup, - const uint8_t *exclude ) { + unsigned int limit, const uint8_t *exclude ) { unsigned int offset; uint32_t *dword; - for ( offset = 0, dword = backup->dwords ; offset < 0x100 ; + for ( offset = 0, dword = backup->dwords ; offset < limit ; offset += sizeof ( *dword ) , dword++ ) { if ( ! pci_backup_excluded ( pci, offset, exclude ) ) pci_write_config_dword ( pci, offset, *dword ); diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c index fbef3f8a6..293c1b647 100644 --- a/src/drivers/infiniband/arbel.c +++ b/src/drivers/infiniband/arbel.c @@ -2561,7 +2561,7 @@ static void arbel_reset ( struct arbel *arbel ) { unsigned int i; /* Perform device reset and preserve PCI configuration */ - pci_backup ( pci, &backup, backup_exclude ); + pci_backup ( pci, &backup, PCI_CONFIG_BACKUP_ALL, backup_exclude ); writel ( ARBEL_RESET_MAGIC, ( arbel->config + ARBEL_RESET_OFFSET ) ); for ( i = 0 ; i < ARBEL_RESET_WAIT_TIME_MS ; i++ ) { @@ -2570,7 +2570,7 @@ static void arbel_reset ( struct arbel *arbel ) { if ( vendor != 0xffff ) break; } - pci_restore ( pci, &backup, backup_exclude ); + pci_restore ( pci, &backup, PCI_CONFIG_BACKUP_ALL, backup_exclude ); } /** diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c index 2afaaf991..c09baf7ae 100644 --- a/src/drivers/infiniband/hermon.c +++ b/src/drivers/infiniband/hermon.c @@ -2840,7 +2840,7 @@ static int hermon_reset ( struct hermon *hermon ) { hermon->toggle = 0; /* Perform device reset and preserve PCI configuration */ - pci_backup ( pci, &backup, backup_exclude ); + pci_backup ( pci, &backup, PCI_CONFIG_BACKUP_ALL, backup_exclude ); writel ( HERMON_RESET_MAGIC, ( hermon->config + HERMON_RESET_OFFSET ) ); @@ -2852,7 +2852,8 @@ static int hermon_reset ( struct hermon *hermon ) { if ( vendor == pci->vendor ) { /* Restore PCI configuration */ - pci_restore ( pci, &backup, backup_exclude ); + pci_restore ( pci, &backup, PCI_CONFIG_BACKUP_ALL, + backup_exclude ); DBGC ( hermon, "Hermon %p reset after %dms\n", hermon, i ); diff --git a/src/drivers/infiniband/qib7322.c b/src/drivers/infiniband/qib7322.c index a4b51db05..da055b744 100644 --- a/src/drivers/infiniband/qib7322.c +++ b/src/drivers/infiniband/qib7322.c @@ -2256,7 +2256,7 @@ static void qib7322_reset ( struct qib7322 *qib7322, struct pci_device *pci ) { struct pci_config_backup backup; /* Back up PCI configuration space */ - pci_backup ( pci, &backup, NULL ); + pci_backup ( pci, &backup, PCI_CONFIG_BACKUP_ALL, NULL ); /* Assert reset */ memset ( &control, 0, sizeof ( control ) ); @@ -2267,7 +2267,7 @@ static void qib7322_reset ( struct qib7322 *qib7322, struct pci_device *pci ) { mdelay ( 1000 ); /* Restore PCI configuration space */ - pci_restore ( pci, &backup, NULL ); + pci_restore ( pci, &backup, PCI_CONFIG_BACKUP_ALL, NULL ); } /** |