xref: /haiku/src/add-ons/kernel/drivers/disk/scsi/scsi_cd/scsi_cd.h (revision 37c7d5d83a2372a6971e383411d5bacbeef0ebdc)
1 /*
2  * Copyright 2008, Axel Dörfler, axeld@pinc-software.de.
3  * Copyright 2003, Thomas Kurschel. All rights reserved.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef _SCSI_CD_H
7 #define _SCSI_CD_H
8 
9 
10 #include <device_manager.h>
11 #include <scsi_periph.h>
12 #include <scsi.h>
13 
14 #include "dma_resources.h"
15 #include "IOCache.h"
16 #include "IORequest.h"
17 #include "IOScheduler.h"
18 
19 
20 #define SCSI_CD_DRIVER_MODULE_NAME "drivers/disk/scsi/scsi_cd/driver_v1"
21 #define SCSI_CD_DEVICE_MODULE_NAME "drivers/disk/scsi/scsi_cd/device_v1"
22 
23 // enables using the IOCache instead of the IOScheduler
24 #define USE_IO_CACHE	0
25 
26 
27 struct cd_driver_info {
28 	device_node*			node;
29 	::scsi_periph_device	scsi_periph_device;
30 	::scsi_device			scsi_device;
31 	scsi_device_interface*	scsi;
32 #if USE_IO_CACHE
33 	IOCache*				io_scheduler;
34 #else
35 	IOScheduler*			io_scheduler;
36 #endif
37 	DMAResource*			dma_resource;
38 
39 	uint64					capacity;
40 	uint32					block_size;
41 
42 	bool					removable;
43 	uint8					device_type;
44 };
45 
46 struct cd_handle {
47 	::scsi_periph_handle	scsi_periph_handle;
48 	cd_driver_info*			info;
49 };
50 
51 #endif	// _SCSI_CD_H
52