/*---------------------------------------------------------------------------* * AVM write fifo routines *---------------------------------------------------------------------------*/ static void avm_pnp_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size) { bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]); bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]); switch (what) { case ISIC_WHAT_ISAC: bus_space_write_1(btag, bhandle, ADDR_REG_OFFSET, ISAC_FIFO); bus_space_write_multi_1(btag, bhandle, ISAC_REG_OFFSET, (u_int8_t*)buf, size); break; case ISIC_WHAT_HSCXA: hscx_write_fifo(0, buf, size, sc); break; case ISIC_WHAT_HSCXB: hscx_write_fifo(1, buf, size, sc); break; } }
/*---------------------------------------------------------------------------* * AVM write fifo routines *---------------------------------------------------------------------------*/ static void avma1pp2_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size) { bus_space_handle_t bhandle = rman_get_bushandle(sc->sc_resources.io_base[0]); bus_space_tag_t btag = rman_get_bustag(sc->sc_resources.io_base[0]); int i; switch (what) { case ISIC_WHAT_ISAC: bus_space_write_4(btag, bhandle, ISACSX_INDEX, 0); /* evidently each byte must written as a long */ for (i = 0; i < size; i++) bus_space_write_4(btag, bhandle, ISACSX_DATA, ((unsigned char *)buf)[i]); break; case ISIC_WHAT_HSCXA: hscx_write_fifo(0, buf, size, sc); break; case ISIC_WHAT_HSCXB: hscx_write_fifo(1, buf, size, sc); break; } }
/*---------------------------------------------------------------------------* * AVM write fifo routines *---------------------------------------------------------------------------*/ static void avm_pnp_write_fifo(void *base, const void *buf, size_t len) { int unit; struct isic_softc *sc; unit = (int)base & 0xff; sc = &isic_sc[unit]; /* check whether the target is an HSCX */ if (((int)base & IS_HSCX_MASK) == HSCX0FAKE) { hscx_write_fifo(0, buf, len, sc); return; } if (((int)base & IS_HSCX_MASK) == HSCX1FAKE) { hscx_write_fifo(1, buf, len, sc); return; } /* tell the board to use the ISAC fifo */ outb(sc->sc_port + ADDR_REG_OFFSET, ISAC_FIFO); outsb(sc->sc_port + ISAC_REG_OFFSET, (const u_char *)buf, len); }
static void hscx_fill_fifo(struct BCState *bcs) { struct IsdnCardState *cs = bcs->cs; int more, count; int fifo_size = test_bit(HW_IPAC, &cs->HW_Flags)? 64: 32; u8 *p; p = xmit_fill_fifo_b(bcs, fifo_size, &count, &more); if (!p) return; waitforXFW(bcs); hscx_write_fifo(bcs, p, count); WriteHSCXCMDR(bcs, more ? 0x8 : 0xa); }