/* Returns maximum memory read request in bytes or appropriate error value.  */
int pcie_get_readrq(struct pci_dev *dev)
/* Returns maximum memory read request in bytes or appropriate error value.  */
int pcie_get_readrq(struct pci_dev *dev)
{
	int ret, cap;
	u16 ctl;
	cap = pci_pcie_cap(dev);
	if (!cap)
		return -EINVAL;
	ret = pci_read_config_word(dev, cap + PCI_EXP_DEVCTL, &ctl);
	if (!ret)
	ret = 128 << ((ctl & PCI_EXP_DEVCTL_READRQ) >> 12);
	return ret;
}