add place-holder directory for the a3000 wd533c93 scsi controller implementation.
[AROS.git] / rom / devs / scsi / scsi_controllerclass.c
blobac439029e9af180e71342edf9573776a044b2788
1 /*
2 Copyright (C) 2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
8 /* We want all other bases obtained from our base */
9 #define __NOLIBBASE__
11 #include <proto/utility.h>
13 #include <hidd/storage.h>
14 #include <hidd/scsi.h>
15 #include <hidd/hidd.h>
16 #include <oop/oop.h>
17 #include <utility/tagitem.h>
19 #include "scsi.h"
21 const char scsi_DevName[] = "SCSI Controller";
23 OOP_Object *SCSI__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
25 struct scsiBase *SCSIBase = cl->UserData;
27 OOP_Object *scsiController = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
28 if (scsiController)
30 struct scsi_Controller *data = OOP_INST_DATA(cl, scsiController);
32 /*register the controller in ata.device */
33 D(bug ("[SCSI:Controller] Root__New: Controller Entry @ 0x%p\n", data);)
35 data->sc_Class = cl;
36 data->sc_Object = scsiController;
38 AddTail(&SCSIBase->scsi_Controllers, &data->sc_Node);
40 return scsiController;
43 VOID SCSI__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
45 struct scsiBase *SCSIBase = cl->UserData;
46 struct scsi_Controller *scsiNode, *tmpNode;
48 D(bug ("[SCSI:Controller] Root__Dispose(0x%p)\n", o);)
50 ForeachNodeSafe (&SCSIBase->scsi_Controllers, scsiNode, tmpNode)
52 if (scsiNode->sc_Object == o)
54 D(bug ("[SCSI:Controller] Root__Dispose: Destroying Controller Entry @ 0x%p\n", scsiNode);)
55 Remove(&scsiNode->sc_Node);
56 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
57 return;
62 void SCSI__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg)
64 #if (0)
65 struct scsi_Controller *data = OOP_INST_DATA(cl, o);
66 IPTR idx;
68 if (IS_SCSI_ATTR(msg->attrID, idx))
70 switch (idx)
72 case aoHidd_SCSI_xxx:
73 *msg->storage = (IPTR)data->yyyy;
74 return;
77 #endif
78 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
81 BOOL SCSI__Hidd_StorageController__RemoveBus(OOP_Class *cl, OOP_Object *o, struct pHidd_StorageController_RemoveBus *msg)
83 D(bug ("[SCSI:Controller] Hidd_StorageController__RemoveBus(0x%p)\n", msg->busObject);)
85 * Currently we don't support unloading SCSI bus drivers.
86 * This is a very-very big TODO.
88 return FALSE;
91 BOOL SCSI__Hidd_StorageController__SetUpBus(OOP_Class *cl, OOP_Object *o, struct pHidd_StorageController_SetUpBus *msg)
93 struct scsiBase *SCSIBase = cl->UserData;
95 D(bug ("[SCSI:Controller] Hidd_StorageController__SetUpBus(0x%p)\n", msg->busObject);)
97 #if (0)
99 * Instantiate interfaces. PIO is mandatory, DMA is not.
100 * We don't keep interface pointers here because our bus class
101 * stores them itself.
102 * We do this in SetUpBus because the object must be fully
103 * created in order for this stuff to work.
105 if (!HIDD_SCSIBus_GetPIOInterface(msg->busObject))
106 return FALSE;
108 D(bug ("[SCSI:Controller] Hidd_StorageController__SetUpBus: PIO Interfaces obtained\n");)
110 if (!SCSIBase->scsi_NoDMA)
111 HIDD_SCSIBus_GetDMAInterface(msg->busObject);
113 D(bug ("[SCSI:Controller] Hidd_StorageController__SetUpBus: Starting Bus...\n");)
114 #endif
116 /* Add the bus to the device and start service */
117 return Hidd_SCSIBus_Start(msg->busObject, SCSIBase);
120 void SCSI__Hidd_StorageController__CleanUpBus(OOP_Class *cl, OOP_Object *o, struct pHidd_StorageController_CleanUpBus *msg)
122 D(bug ("[SCSI:Controller] Hidd_StorageController__CleanUpBus(0x%p)\n", msg->busObject);)
123 /* By default we have nothing to do here */