/* Returns mmrbc: maximum memory read count in bytes or appropriate error value.  */
int pcix_get_mmrbc(struct pci_dev *dev)
/* Returns mmrbc: maximum memory read count in bytes or appropriate error value.  */
int pcix_get_mmrbc(struct pci_dev *dev)
{
	int ret, cap;
	u32 cmd;
	cap = pci_find_capability(dev, PCI_CAP_ID_PCIX);
	if (!cap)
		return -EINVAL;
	ret = pci_read_config_dword(dev, cap + PCI_X_CMD, &cmd);
	if (!ret)
		ret = 512 << ((cmd & PCI_X_CMD_MAX_READ) >> 2);
	return ret;
}