add place-holder directory for the a3000 wd533c93 scsi controller implementation.
[AROS.git] / arch / m68k-amiga / hidd / gayle_ata / fastata_busclass.c
blob9ad7d87af120df4d151c2340ea8269d5c93c2c87
1 /*
2 Copyright © 2017-2019, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Elbox FastATA HIDD
6 Lang: English
7 */
9 #include <aros/debug.h>
10 #include <proto/exec.h>
12 #include <hardware/ata.h>
13 #include <hidd/bus.h>
14 #include <hidd/ata.h>
15 #include <hidd/pci.h>
16 #include <oop/oop.h>
17 #include <utility/tagitem.h>
18 #include <proto/kernel.h>
19 #include <proto/oop.h>
20 #include <proto/utility.h>
21 #include <hardware/intbits.h>
23 #include "bus_class.h"
24 #include "interface_pio.h"
26 AROS_INTH1(IDE_Handler_FASTATA, struct ATA_BusData *, bus)
28 AROS_INTFUNC_INIT
30 D(bug("[ATA:FastATA] %s()\n", __func__);)
32 return FALSE;
34 AROS_INTFUNC_EXIT
37 static BOOL ata_CreateFastATAInterrupt(struct ATA_BusData *bus, UBYTE num)
39 D(bug("[ATA:FastATA] %s()\n", __func__);)
40 return FALSE;
42 static void ata_RemoveFastATAInterrupt(struct ATA_BusData *bus)
44 D(bug("[ATA:FastATA] %s()\n", __func__);)
47 OOP_Object *FASTATA__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
49 struct ataBase *base = cl->UserData;
50 struct ata_ProbedBus *bus = (struct ata_ProbedBus *)GetTagData(aHidd_DriverData, 0, msg->attrList);
52 D(bug("[ATA:FastATA] %s()\n", __func__);)
54 if (!bus)
55 return NULL;
57 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
58 if (o)
60 struct ATA_BusData *data = OOP_INST_DATA(cl, o);
62 data->bus = bus;
63 data->gaylebase = data->bus->port;
64 data->gayleirqbase = data->bus->gayleirqbase;
65 ata_CreateFastATAInterrupt(data, 0);
68 D(bug("[ATA:FastATA] %s: Instance @ %p\n", __func__, o);)
69 return o;
72 void FASTATA__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
74 struct ATA_BusData *data = OOP_INST_DATA(cl, o);
76 D(bug("[ATA:FastATA] %s()\n", __func__);)
78 ata_RemoveFastATAInterrupt(data);
79 FreeVec(data->bus);
81 OOP_DoSuperMethod(cl, o, msg);
84 void FASTATA__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg)
86 struct ataBase *base = cl->UserData;
87 ULONG idx;
89 D(bug("[ATA:FastATA] %s()\n", __func__);)
91 Hidd_ATABus_Switch(msg->attrID, idx)
93 case aoHidd_ATABus_Use80Wire:
94 *msg->storage = FALSE;
95 return;
97 case aoHidd_ATABus_UseDMA:
98 *msg->storage = FALSE;
99 return;
101 case aoHidd_ATABus_Use32Bit:
102 *msg->storage = TRUE;
103 return;
106 OOP_DoSuperMethod(cl, o, &msg->mID);
109 void FASTATA__Root__Set(OOP_Class *cl, OOP_Object *o, struct pRoot_Set *msg)
111 struct ataBase *base = cl->UserData;
112 struct ATA_BusData *data = OOP_INST_DATA(cl, o);
113 struct TagItem *tstate = msg->attrList;
114 struct TagItem *tag;
116 D(bug("[ATA:FastATA] %s()\n", __func__);)
118 while ((tag = NextTagItem(&tstate)))
120 ULONG idx;
122 Hidd_Bus_Switch(tag->ti_Tag, idx)
124 case aoHidd_Bus_IRQHandler:
125 data->ata_HandleIRQ = (APTR)tag->ti_Data;
126 break;
128 case aoHidd_Bus_IRQData:
129 data->irqData = (APTR)tag->ti_Data;
130 break;
135 APTR FASTATA__Hidd_ATABus__GetPIOInterface(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
137 struct ATA_BusData *data = OOP_INST_DATA(cl, o);
138 struct pio_data *pio = (struct pio_data *)OOP_DoSuperMethod(cl, o, msg);
140 D(bug("[ATA:FastATA] %s()\n", __func__);)
142 if (pio)
144 pio->port = data->bus->port;
145 pio->altport = data->bus->altport;
146 pio->dataport = (UBYTE*)(((ULONG)pio->port) & ~3);
149 return pio;
152 BOOL FASTATA__Hidd_ATABus__SetXferMode(OOP_Class *cl, OOP_Object *obj, OOP_Msg msg)
154 D(bug("[ATA:FastATA] %s()\n", __func__);)
156 return TRUE;
159 void FASTATA__Hidd_ATABus__Shutdown(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
161 D(bug("[ATA:FastATA] %s()\n", __func__);)
163 OOP_DoSuperMethod(cl, o, msg);