/* Returns < 0 if off is not valid, 1 if window access is needed. 'off' is set to offset from CRB space in 128M pci map 0 if no window access is needed. 'off' is set to 2M addr In: 'off' is offset from base in 128M pci map  */
static int netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong off, void __iomem **addr)
/* Returns < 0 if off is not valid, 1 if window access is needed. 'off' is set to offset from CRB space in 128M pci map 0 if no window access is needed. 'off' is set to 2M addr In: 'off' is offset from base in 128M pci map  */
static int netxen_nic_pci_get_crb_addr_2M(struct netxen_adapter *adapter, ulong off, void __iomem **addr)
{
	crb_128M_2M_sub_block_map_t *m;
	if ((off >= NETXEN_CRB_MAX) || (off < NETXEN_PCI_CRBSPACE))
		return -EINVAL;
	off -= NETXEN_PCI_CRBSPACE;
	m = &crb_128M_2M_map[CRB_BLK(off)].sub_block[CRB_SUBBLK(off)];
	if (m->valid && (m->start_128M <= off) && (m->end_128M > off)) {
		*addr = adapter->ahw.pci_base0 + m->start_2M +
			(off - m->start_128M);
		return 0;
	}
	*addr = adapter->ahw.pci_base0 + CRB_INDIRECT_2M +
		(off & MASK(16));
	return 1;
}