1/**
2 *
3 * TODO: description
4 *
5 * This file is a part of USB SCSI CAM for Haiku.
6 * May be used under terms of the MIT License
7 *
8 * Author(s):
9 * 	Siarzhuk Zharski <imker@gmx.li>
10 *
11 *
12 */
13#ifndef _DEVICE_INFO_H_
14	#define _DEVICE_INFO_H_
15
16#ifndef _SCSI_COMMANDS_H_
17	#include "scsi_commands.h"
18#endif /*_SCSI_COMMANDS_H_*/
19
20#ifndef _PROTO_MODULE_H_
21	#include "proto_module.h"
22#endif /* _PROTO_MODULE_H_ */
23
24typedef struct _usb_device_info{
25	uint8 dev_num;				/**/
26	const usb_device device;	/**/
27	uint16 interface;			/**/
28	uint8	max_lun;			/**/
29
30	uint32 properties;
31
32	usb_pipe pipe_in;			/**/
33	usb_pipe pipe_out;			/**/
34	usb_pipe pipe_intr;			/**/
35
36	sem_id lock_sem;			/**/
37	sem_id trans_sem;			/**/
38	uint32 tag;					/**/
39	status_t status;			/**/
40
41	bigtime_t trans_timeout;
42	usb_module_info *usb_m;
43
44	void *data;					/**/
45	int actual_len;				/**/
46
47	protocol_module_info *protocol_m;
48	char *protocol_m_path;
49
50	transform_module_info *transform_m;
51	char *transform_m_path;
52
53	bool b_trace;
54	void (*trace)(bool b_force, const char *fmt, ...);
55	void (*trace_bytes)(const char *prefix, const uint8 *bytes, size_t bytes_len);
56
57	uint8 scsi_command_buf[IOCDBLEN];
58	/* auto sense buffer. Some commands doesn't have it. emulate */
59	scsi_sense_data autosense_data;
60	/* iovec					 autosense_sg; DO NOT RESTORE IT !!!*/
61	uint8 not_ready_luns;
62} usb_device_info;
63
64#endif /* _DEVICE_INFO_H_ */
65
66