#ifndef _IOKIT_IODMACONTROLLER_H
#define _IOKIT_IODMACONTROLLER_H
#include <IOKit/IODMACommand.h>
#include <IOKit/IODMAEventSource.h>
#include <IOKit/IOService.h>
class IODMAEventSource;
class IODMAController : public IOService
{
OSDeclareAbstractStructors(IODMAController);
friend class IODMAEventSource;
private:
IOService *_provider;
const OSSymbol *_dmaControllerName;
protected:
virtual void registerDMAController(IOOptionBits options = 0);
virtual IOReturn initDMAChannel(IOService *provider, IODMAEventSource *dmaES, UInt32 *dmaIndex, UInt32 reqIndex) = 0;
virtual IOReturn startDMACommand(UInt32 dmaIndex, IODMACommand *dmaCommand, IODirection direction,
IOByteCount byteCount = 0, IOByteCount byteOffset = 0) = 0;
virtual IOReturn stopDMACommand(UInt32 dmaIndex, bool flush = false, uint64_t timeout = UINT64_MAX) = 0;
virtual void completeDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand);
virtual void notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount);
virtual IOReturn queryDMACommand(UInt32 dmaIndex, IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false) = 0;
virtual IOByteCount getFIFODepth(UInt32 dmaIndex) = 0;
public:
static const OSSymbol *createControllerName(UInt32 phandle);
static IODMAController *getController(IOService *provider, UInt32 dmaIndex);
virtual bool start(IOService *provider);
};
#endif