aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-08-11 12:12:36 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-09-02 15:27:39 +1000
commitb9801047a12c27d1d205ba5c250a9c399a9f8fd1 (patch)
treed932946f2daaba8a0f4b3f893206146f1e828f60 /hw
parentac83440c8241902d2c32410050a2fd1e96b20fcf (diff)
downloadskiboot-b9801047a12c27d1d205ba5c250a9c399a9f8fd1.zip
skiboot-b9801047a12c27d1d205ba5c250a9c399a9f8fd1.tar.gz
skiboot-b9801047a12c27d1d205ba5c250a9c399a9f8fd1.tar.bz2
core/pci: Improve PCI config register filter
This improves PCI config register filter so that it can be reused by PCI virtual device in subsequent patch: * First argument to pci_cfg_reg_func() is changed to "void *". It allows to accept variable data types including PCI virtual device in future. * Return value from pci_cfg_reg_func() to be used by PCI virtual device in future. * Shortened name of function phb3_pcicfg_filter_rc_pref_window(). Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/phb3.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index 649c833..d0b5010 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -72,10 +72,10 @@ static bool phb3_fenced(struct phb3 *p)
return false;
}
-static void phb3_pcicfg_filter_rc_pref_window(struct pci_device *pd __unused,
- struct pci_cfg_reg_filter *pcrf,
- uint32_t offset, uint32_t len,
- uint32_t *data, bool write)
+static int64_t phb3_pcicfg_rc_pref_window(void *dev __unused,
+ struct pci_cfg_reg_filter *pcrf,
+ uint32_t offset, uint32_t len,
+ uint32_t *data, bool write)
{
uint8_t *pdata;
uint32_t i;
@@ -85,7 +85,7 @@ static void phb3_pcicfg_filter_rc_pref_window(struct pci_device *pd __unused,
pdata = &pcrf->data[offset - pcrf->start];
for (i = 0; i < len; i++, pdata++)
*pdata = (uint8_t)(*data >> (8 * i));
- return;
+ return OPAL_SUCCESS;
}
/* Return whatever we cached */
@@ -100,6 +100,8 @@ static void phb3_pcicfg_filter_rc_pref_window(struct pci_device *pd __unused,
*data |= *pdata;
}
+
+ return OPAL_SUCCESS;
}
/*
@@ -495,7 +497,7 @@ static void phb3_check_device_quirks(struct phb *phb, struct pci_device *dev)
pci_add_cfg_reg_filter(dev,
PCI_CFG_PREF_MEM_BASE_U32, 12,
PCI_REG_FLAG_READ | PCI_REG_FLAG_WRITE,
- phb3_pcicfg_filter_rc_pref_window);
+ phb3_pcicfg_rc_pref_window);
}
}
}