revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / USB / classes / MassStorage / storage_stubs.c
blob39c0d3ba79cd1e8914034912023209e6c8ebf33e
1 /*
2 Copyright � 2004-2019, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Stub functions for PCI subsystem
6 Lang: English
7 */
9 #ifndef AROS_USE_OOP
10 # define AROS_USE_OOP
11 #endif
13 #include <stdint.h>
14 #include <exec/libraries.h>
15 #include <exec/interrupts.h>
17 #include <utility/tagitem.h>
18 #include <utility/hooks.h>
20 #include <oop/oop.h>
21 #include <oop/static_mid.h>
23 #include <hidd/hidd.h>
24 #include <usb/usb.h>
25 #include <usb/mstorage.h>
27 #include <proto/oop.h>
29 #undef OOPBase
30 #define OOPBase (OOP_OOPBASE(o))
32 BOOL HIDD_USBStorage_Reset(OOP_Object *o)
34 STATIC_MID;
35 struct pHidd_USBStorage_Reset p;
37 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_Reset);
39 p.mID = static_mid;
41 return OOP_DoMethod(o, &p.mID);
44 uint8_t HIDD_USBStorage_GetMaxLUN(OOP_Object *o)
46 STATIC_MID;
47 struct pHidd_USBStorage_GetMaxLUN p;
49 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_GetMaxLUN);
51 p.mID = static_mid;
53 return OOP_DoMethod(o, &p.mID);
56 BOOL HIDD_USBStorage_TestUnitReady(OOP_Object *o, uint8_t lun)
58 STATIC_MID;
59 struct pHidd_USBStorage_TestUnitReady p;
61 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_TestUnitReady);
63 p.mID = static_mid;
64 p.lun = lun;
66 return OOP_DoMethod(o, &p.mID);
69 uint32_t HIDD_USBStorage_DirectSCSI(OOP_Object *o, uint8_t lun, uint8_t *cmd, uint8_t cmdLen, void *data, uint32_t dataLen, uint8_t read)
71 STATIC_MID;
72 struct pHidd_USBStorage_DirectSCSI p;
74 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_DirectSCSI);
76 p.mID = static_mid;
77 p.lun = lun;
78 p.cmd = cmd;
79 p.cmdLen = cmdLen;
80 p.data = data;
81 p.dataLen = dataLen;
82 p.read = read;
84 return OOP_DoMethod(o, &p.mID);
87 BOOL HIDD_USBStorage_ReadCapacity(OOP_Object *o, uint8_t lun, uint32_t *blockTotal, uint32_t *blockSize)
89 STATIC_MID;
90 struct pHidd_USBStorage_ReadCapacity p;
92 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_ReadCapacity);
94 p.mID = static_mid;
95 p.lun = lun;
96 p.blockTotal = blockTotal;
97 p.blockSize = blockSize;
99 return OOP_DoMethod(o, &p.mID);
102 BOOL HIDD_USBStorage_RequestSense(OOP_Object *o, uint8_t lun, void *buffer, uint32_t bufferLength)
104 STATIC_MID;
105 struct pHidd_USBStorage_RequestSense p;
107 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_RequestSense);
109 p.mID = static_mid;
110 p.lun = lun;
111 p.buffer = buffer;
112 p.bufferLength = bufferLength;
114 return OOP_DoMethod(o, &p.mID);
117 BOOL HIDD_USBStorage_Inquiry(OOP_Object *o, uint8_t lun, void *buffer, uint32_t bufferLength)
119 STATIC_MID;
120 struct pHidd_USBStorage_Inquiry p;
122 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_Inquiry);
124 p.mID = static_mid;
125 p.lun = lun;
126 p.buffer = buffer;
127 p.bufferLength = bufferLength;
129 return OOP_DoMethod(o, &p.mID);
132 BOOL HIDD_USBStorage_Read(OOP_Object *o, uint8_t lun, void *buffer, uint32_t lba, uint16_t count)
134 STATIC_MID;
135 struct pHidd_USBStorage_Read p;
137 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_Read);
139 p.mID = static_mid;
140 p.lun = lun;
141 p.buffer = buffer;
142 p.block= lba;
143 p.count = count;
145 return OOP_DoMethod(o, &p.mID);
148 BOOL HIDD_USBStorage_Write(OOP_Object *o, uint8_t lun, void *buffer, uint32_t lba, uint16_t count)
150 STATIC_MID;
151 struct pHidd_USBStorage_Write p;
153 if (!static_mid) static_mid = OOP_GetMethodID((STRPTR)IID_Hidd_USBStorage, moHidd_USBStorage_Write);
155 p.mID = static_mid;
156 p.lun = lun;
157 p.buffer = buffer;
158 p.block= lba;
159 p.count = count;
161 return OOP_DoMethod(o, &p.mID);