/* Changes the CRB window to the specified window.  */
static void netxen_nic_pci_set_crbwindow_128M(struct netxen_adapter *adapter, u32 window)
/* Changes the CRB window to the specified window.  */
static void netxen_nic_pci_set_crbwindow_128M(struct netxen_adapter *adapter, u32 window)
{
	void __iomem *offset;
	int count = 10;
	u8 func = adapter->ahw.pci_func;
	if (adapter->ahw.crb_win == window)
		return;
	offset = PCI_OFFSET_SECOND_RANGE(adapter,
			NETXEN_PCIX_PH_REG(PCIE_CRB_WINDOW_REG(func)));
	writel(window, offset);
	do {
		if (window == readl(offset))
			break;
		if (printk_ratelimit())
			dev_warn(&adapter->pdev->dev,
					"failed to set CRB window to %d\n",
					(window == NETXEN_WINDOW_ONE));
		udelay(1);
	} while (--count > 0);
	if (count > 0)
		adapter->ahw.crb_win = window;
}