Beispiel #1
0
struct bus_dmadesc *
ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst,
    bus_addr_t src, bus_size_t len, bus_dmaengine_callback_t callback_fn,
    void *callback_arg, uint32_t flags)
{
	struct ioat_dma_hw_descriptor *hw_desc;
	struct ioat_descriptor *desc;
	struct ioat_softc *ioat;

	CTR0(KTR_IOAT, __func__);
	ioat = to_ioat_softc(dmaengine);

	if (((src | dst) & (0xffffull << 48)) != 0) {
		ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n",
		    __func__);
		return (NULL);
	}

	desc = ioat_op_generic(ioat, IOAT_OP_COPY, len, src, dst, callback_fn,
	    callback_arg, flags);
	if (desc == NULL)
		return (NULL);

	hw_desc = desc->u.dma;
	if (g_ioat_debug_level >= 3)
		dump_descriptor(hw_desc);

	ioat_submit_single(ioat);
	return (&desc->bus_dmadesc);
}
Beispiel #2
0
static
void dump_descriptors(struct tssp_descriptors *descriptors, int depth)
{
    struct tssp_descriptor *desc;

    STAILQ_FOREACH(desc, descriptors, entry)
        dump_descriptor(desc, depth);
}
Beispiel #3
0
static void
ioat_halted_debug(struct ioat_softc *ioat, uint32_t chanerr)
{
	struct ioat_descriptor *desc;

	ioat_log_message(0, "Channel halted (%b)\n", (int)chanerr,
	    IOAT_CHANERR_STR);
	if (chanerr == 0)
		return;

	mtx_assert(&ioat->cleanup_lock, MA_OWNED);

	desc = ioat_get_ring_entry(ioat, ioat->tail + 0);
	dump_descriptor(desc->u.raw);

	desc = ioat_get_ring_entry(ioat, ioat->tail + 1);
	dump_descriptor(desc->u.raw);
}
Beispiel #4
0
void
dump_cs_device(usb_descriptor_t *desc, int interface)
{
	switch (usbdev.class) {
	case UICLASS_HID:
		hid_device(desc, interface);
		break;
	default:
		dump_descriptor(desc, "\t\t");
	}
}
Beispiel #5
0
void
dump_cs_endpoint(usb_descriptor_t *desc)
{
	if (usbdev.vendor == 0x0582 && usbdev.product == 0x0050) {
		/* Roland EDIROL UA-3FX USB audio I/F (advanced) */
		audio_endpoint(desc, usbdev.subclass);
		return;
	}

	switch (usbdev.class) {
	case UICLASS_AUDIO:
		audio_endpoint(desc, usbdev.subclass);
		break;
	default:
		dump_descriptor(desc, "\t\t");
	}
}
Beispiel #6
0
struct bus_dmadesc *
ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_addr_t dst1,
    bus_addr_t dst2, bus_addr_t src1, bus_addr_t src2,
    bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags)
{
	struct ioat_dma_hw_descriptor *hw_desc;
	struct ioat_descriptor *desc;
	struct ioat_softc *ioat;

	CTR0(KTR_IOAT, __func__);
	ioat = to_ioat_softc(dmaengine);

	if (((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) != 0) {
		ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n",
		    __func__);
		return (NULL);
	}
	if (((src1 | src2 | dst1 | dst2) & PAGE_MASK) != 0) {
		ioat_log_message(0, "%s: Addresses must be page-aligned\n",
		    __func__);
		return (NULL);
	}

	desc = ioat_op_generic(ioat, IOAT_OP_COPY, 2 * PAGE_SIZE, src1, dst1,
	    callback_fn, callback_arg, flags);
	if (desc == NULL)
		return (NULL);

	hw_desc = desc->u.dma;
	if (src2 != src1 + PAGE_SIZE) {
		hw_desc->u.control.src_page_break = 1;
		hw_desc->next_src_addr = src2;
	}
	if (dst2 != dst1 + PAGE_SIZE) {
		hw_desc->u.control.dest_page_break = 1;
		hw_desc->next_dest_addr = dst2;
	}

	if (g_ioat_debug_level >= 3)
		dump_descriptor(hw_desc);

	ioat_submit_single(ioat);
	return (&desc->bus_dmadesc);
}
Beispiel #7
0
void
dump_cs_interface(usb_descriptor_t *desc)
{
	if (usbdev.vendor == 0x0499 && usbdev.product == 0x1000) {
		/* YAMAHA UX256 USB MIDI */
		audio_midi_interface(desc);
		return;
	}
	if (usbdev.vendor == 0x0582 && usbdev.product == 0x0050) {
		/* Roland EDIROL UA-3FX USB audio I/F (advanced) */
		audio_interface(desc, usbdev.subclass);
		return;
	}

	switch (usbdev.class) {
	case UICLASS_AUDIO:
		audio_interface(desc, usbdev.subclass);
		break;
	default:
		dump_descriptor(desc, "\t\t");
	}
}
Beispiel #8
0
struct bus_dmadesc *
ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern,
    bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg,
    uint32_t flags)
{
	struct ioat_fill_hw_descriptor *hw_desc;
	struct ioat_descriptor *desc;
	struct ioat_softc *ioat;

	CTR0(KTR_IOAT, __func__);
	ioat = to_ioat_softc(dmaengine);

	if ((ioat->capabilities & IOAT_DMACAP_BFILL) == 0) {
		ioat_log_message(0, "%s: Device lacks BFILL capability\n",
		    __func__);
		return (NULL);
	}

	if ((dst & (0xffffull << 48)) != 0) {
		ioat_log_message(0, "%s: High 16 bits of dst invalid\n",
		    __func__);
		return (NULL);
	}

	desc = ioat_op_generic(ioat, IOAT_OP_FILL, len, fillpattern, dst,
	    callback_fn, callback_arg, flags);
	if (desc == NULL)
		return (NULL);

	hw_desc = desc->u.fill;
	if (g_ioat_debug_level >= 3)
		dump_descriptor(hw_desc);

	ioat_submit_single(ioat);
	return (&desc->bus_dmadesc);
}