2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CDI_SCSI_H_INCLUDED
20 #define CDI_SCSI_H_INCLUDED
28 struct cdi_scsi_packet
{
29 // Buffer zum Senden oder Empfangen von Daten
32 // Groesse des Buffers
35 // Ob gelesen oder geschrieben werden soll
45 // Groesse des SCSI Commands
50 struct cdi_scsi_device
{
51 struct cdi_device dev
;
55 struct cdi_scsi_driver
{
56 struct cdi_driver drv
;
58 int (*request
)(struct cdi_scsi_device
*device
,struct cdi_scsi_packet
*packet
);
62 * Ein SCSI-Paket allozieren
64 * @param size Benoetigte Groesse
66 * @return Pointer auf das Paket oder NULL im Fehlerfall
68 struct cdi_scsi_packet
* cdi_scsi_packet_alloc(size_t size
);
71 * Ein SCSI-Paket freigeben
73 * @param packet Pointer auf das Paket
75 void cdi_scsi_packet_free(struct cdi_scsi_packet
* packet
);
78 * Initialisiert die Datenstrukturen fuer einen SCSI-Treiber
80 void cdi_scsi_driver_init(struct cdi_scsi_driver
* driver
);
83 * Deinitialisiert die Datenstrukturen fuer einen SCSI-Treiber
85 void cdi_scsi_driver_destroy(struct cdi_scsi_driver
* driver
);
88 * Registiert einen SCSI-Treiber
90 void cdi_scsi_driver_register(struct cdi_scsi_driver
* driver
);