src/sys/dev/cxgbe/t4_main.c
/*
 * Positions the memory window at the given address in the card's address space.
 * There are some alignment requirements and the actual position may be at an
 * address prior to the requested address.  mw->mw_curpos always has the actual
 * position of the window.
 */
Positions the memory window at the given address in the card's address space.
There are some alignment requirements and the actual position may be at an
address prior to the requested address.  mw->mw_curpos always has the actual
position of the window.
Positions the memory window at the given address in the card ' s address space . There are some alignment requirements and the actual position may be at an address prior to the requested address . mw - > mw_curpos always has the actual position of the window .
static void
position_memwin(struct adapter *sc, int idx, uint32_t addr)
{
	struct memwin *mw;
	uint32_t pf;
	uint32_t reg;
	MPASS(idx >= 0 && idx < NUM_MEMWIN);
	mw = &sc->memwin[idx];
	rw_assert(&mw->mw_lock, RA_WLOCKED);
	if (is_t4(sc)) {
		pf = 0;
		mw->mw_curpos = addr & ~0xf;	
	} else {
		pf = V_PFNUM(sc->pf);
		mw->mw_curpos = addr & ~0x7f;	
	}
	reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, idx);
	t4_write_reg(sc, reg, mw->mw_curpos | pf);
	t4_read_reg(sc, reg);	
}
static void position_memwin ( struct adapter * sc , int idx , uint32_t addr ) { struct memwin * mw ; uint32_t pf ; uint32_t reg ; MPASS ( idx >= 0 && idx < NUM_MEMWIN ) ; mw = & sc -> memwin [ idx ] ; rw_assert ( & mw -> mw_lock , RA_WLOCKED ) ; if ( is_t4 ( sc ) ) { pf = 0 ; mw -> mw_curpos = addr & ~ 0xf ; } else { pf = V_PFNUM ( sc -> pf ) ; mw -> mw_curpos = addr & ~ 0x7f ; } reg = PCIE_MEM_ACCESS_REG ( A_PCIE_MEM_ACCESS_OFFSET , idx ) ; t4_write_reg ( sc , reg , mw -> mw_curpos | pf ) ; t4_read_reg ( sc , reg ) ; }
Positions the memory window at the given address in the card's address space.
Positions the memory window at the given address in the card ' s address space .
/* start must be 16B aligned */ /* start must be 128B aligned */ /* flush */