From f8f92e9180b21f817a1738bdcdd9c5fd3abd5601 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sat, 4 Jun 2016 03:54:30 +0000 Subject: [PATCH] ioat(4): Export the number of available channels Sponsored by: EMC / Isilon Storage Division --- sys/dev/ioat/ioat.c | 7 +++++++ sys/dev/ioat/ioat.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c index 3724fbe2f64..cd9e894a9dc 100644 --- a/sys/dev/ioat/ioat.c +++ b/sys/dev/ioat/ioat.c @@ -742,6 +742,13 @@ ioat_reset_hw_task(void *ctx, int pending __unused) /* * User API functions */ +unsigned +ioat_get_nchannels(void) +{ + + return (ioat_channel_index); +} + bus_dmaengine_t ioat_get_dmaengine(uint32_t index, int flags) { diff --git a/sys/dev/ioat/ioat.h b/sys/dev/ioat/ioat.h index 2e1012453bf..9a0c3e3bfb6 100644 --- a/sys/dev/ioat/ioat.h +++ b/sys/dev/ioat/ioat.h @@ -85,6 +85,8 @@ typedef void *bus_dmaengine_t; struct bus_dmadesc; typedef void (*bus_dmaengine_callback_t)(void *arg, int error); +unsigned ioat_get_nchannels(void); + /* * Called first to acquire a reference to the DMA channel *