--DMA interface--
Notes
DMA interface is optional, and is needed in order to support DMA data
transfers.
Function table for the interface consists of the following functions:
BOOL dma_Setup(void *obj, APTR buffer, IPTR size, BOOL read)
- Prepare the controller to DMA data transfer. The last argument is
TRUE for read operation and FALSE for write. The function should
return TRUE for success or FALSE for failure.
VOID dma_Start(void *obj)
- Start DMA transfer.
VOID dma_End(void *obj, APTR buffer, IPTR size, BOOL read)
- End DMA transfer and perform post-transfer cleanup of the given region.
ULONG dma_Result(void *obj)
- Get resulting status of the operation. The function should return 0
for successful completion or error code to be passed up to ata.device
caller in io_Result field of the IORequest.
--PIO interface--
Notes
PIO interface is responsible for accessing I/O registers on the IDE
bus, as well as performing PIO-mode 16- and 32-bit data transfers.
This interface is mandatory and must be implemented by the driver,
however some functions are optional. They can be either omitted
entirely from the function table, or set to NULL pointers.
Control functions table for the interface consists of the following
functions (listed in their order in the array):
VOID scsi_out(void *obj, UBYTE val, UWORD offset)
- Write byte into primary register bank with the given offset.
UBYTE scsi_in(void *obj, UWORD offset)
- Read byte from primary register bank with the given offset.
VOID scsi_out_alt(void *obj, UBYTE val, UWORD offset)
- Write byte into alternate register bank with the given offset.
This function is optional.
UBYTE scsi_in_alt(void *obj, UWORD offset)
- Read byte from alternate register bank with the given offset.
This function is optional.
Transfer functions table for the interface consists of the following
functions (listed in their order in the array):
VOID scsi_outsw(void *obj, APTR address, ULONG count)
- Perform 16-bit PIO data write operation from the given memory
region of the given size.
VOID scsi_insw(void *obj, APTR address, ULONG count)
- Perform 16-bit PIO data read operation into the given memory
region of the given size.
VOID scsi_outsl(void *obj, APTR address, ULONG count)
- Perform 32-bit PIO data write operation from the given memory
region of the given size. This function is optional.
UBYTE scsi_insl(void *obj, APTR address, ULONG count)
- Perform 32-bit PIO data read operation into the given memory
region of the given size. This function is optional.
aoHidd_SCSIUnit_XferModes
Function
Tells which transfer modes are supported by this device. The returned value
is a bitwise combination of the following flags (see include/hidd/ata.h):
AF_XFER_PIO(x) - PIO mode number x (0 - 4)
AF_XFER_MDMA(x) - multiword DMA mode number x (0 - 2)
AF_XFER_UDMA(x) - Ultra DMA mode number x (0 - 6)
AF_XFER_48BIT - LBA48 block addressing
AF_XFER_RWMILTI - Multisector PIO
AF_XFER_PACKET - ATAPI
AF_XFER_LBA - LBA28 block addressing
AF_XFER_PIO32 - 32-bit PIO
Bugs
32-bit PIO is actually controller's property and not drive's property.
Because of this AF_XFER_PIO32 flag can never be returned by this attribute.
Nevertheless, it can be returned by aoHidd_SCSIUnit_ConfiguredModes
attribute.
GetBlkSize()
Synopsis
ULONG GetBlkSize(
struct IORequest *io)
Function
Return the sector-size exponent stored for the opened unit.
Result
The stored base-two exponent of the sector size in bytes,
returned as ULONG. For example, 9 denotes 512-byte sectors.
This is not a byte count.
Notes
The call reads the cached unit value without issuing device
I/O or checking media presence. It leaves the request and its
error field unchanged.
No error result is provided for an unopened, closed or invalid
request. The pointers are not validated.
GetRdskLba()
Synopsis
ULONG GetRdskLba(
struct IORequest *io)
Function
Return the fixed value zero. This entrypoint does not search
for or read a rigid disk block.
Result
Always zero. The value does not establish that a rigid disk
block exists at logical block zero.
Notes
No device I/O is issued. The request and its error field are
left unchanged. This entrypoint provides no discovery status.
moHidd_SCSIBus_GetDMAInterface
Synopsis
APTR OOP_DoMethod(OOP_Object *obj, struct pHidd_SCSIBus_GetDMAInterface *Msg);
APTR HIDD_SCSIBus_GetDMAInterface(void);
Function
Instantiates encapsulated DMA interface object and returns its
pointer.
Result
A pointer to opaque DMA interface object or NULL upon failure or
if DMA is not supported by this bus.
Notes
This method should be overloaded by driver subclasses in order to
initialize data portion of the interface object.
moHidd_SCSIBus_GetPIOInterface
Synopsis
APTR OOP_DoMethod(OOP_Object *obj, struct pHidd_SCSIBus_GetPIOInterface *Msg);
APTR HIDD_SCSIBus_GetPIOInterface(void);
Function
Instantiates encapsulated PIO interface object and returns its
pointer.
Result
A pointer to opaque PIO interface object or NULL in case of failure.
Notes
This method should be overloaded by driver subclasses in order to
initialize data portion of the interface object.
moHidd_SCSIBus_SetXferMode
Synopsis
APTR OOP_DoMethod(OOP_Object *obj, struct pHidd_SCSIBus_SetXferMode *Msg);
APTR HIDD_SCSIBus_SetXferMode(UBYTE unit, scsi_XferMode mode);
Function
Sets the desired transfer mode for the given drive on the bus controller.
Result
TRUE if successful or FALSE if the desired mode is not supported
by the hardware.
Notes
The default implementation is provided for drivers not supporting
DMA and always returns FALSE if the caller attempts to set any of
DMA modes.
Bugs
Current version of ata.device does not use this method, and it is
considered reserved.