Merging r33101 from trunk:

Rewrote scsi.h. This should be the last missing header.


git-svn-id: file:///srv/svn/repos/haiku/haiku/branches/releases/r1alpha1@33102 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-09-12 18:09:08 +00:00
parent c64d00de03
commit 51172a03d2

View File

@ -1,24 +1,17 @@
/******************************************************************************
/
/ File: scsi.h
/
/ Description: Data structures and control calls for using the scsi driver.
/
/ Copyright 1992-98, Be Incorporated
/
*******************************************************************************/
/*
* Copyright 2009, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SCSI_H
#define _SCSI_H
#include <SupportDefs.h>
#include <OS.h>
#include <Drivers.h>
#include <OS.h>
#include <SupportDefs.h>
/* scsi device types */
/*------------------------*/
/* SCSI device types */
#define B_SCSI_DISK 0x00
#define B_SCSI_TAPE 0x01
#define B_SCSI_PRINTER 0x02
@ -31,9 +24,8 @@
#define B_SCSI_NETWORK 0x09
/* scsi device masks */
/*----------------------------------*/
#define B_SCSI_ALL_DEVICES_MASK 0xffffffff
/* SCSI device masks */
#define B_SCSI_ALL_DEVICES_MASK 0xffffffff
#define B_SCSI_DISK_MASK (1 << (B_SCSI_DISK))
#define B_SCSI_TAPE_MASK (1 << (B_SCSI_TAPE))
#define B_SCSI_PRINTER_MASK (1 << (B_SCSI_PRINTER))
@ -45,16 +37,13 @@
#define B_SCSI_JUKEBOX_MASK (1 << (B_SCSI_JUKEBOX))
#define B_SCSI_NETWORK_MASK (1 << (B_SCSI_NETWORK))
/* control call codes for rescan scsi driver (/dev/scsi/rescan) */
/*-----------------------------------------------------*/
enum {
B_SCSI_SCAN_FOR_DEVICES = B_DEVICE_OP_CODES_END + 1,
B_SCSI_ENABLE_PROFILING
};
/* control calls for all individual scsi device drivers */
/*------------------------------------------------------*/
enum {
B_SCSI_INQUIRY = B_DEVICE_OP_CODES_END + 100,
B_SCSI_EJECT,
@ -62,13 +51,12 @@ enum {
B_RAW_DEVICE_COMMAND
};
typedef struct {
uchar inquiry_data[36]; /* inquiry data (see SCSI standard) */
uchar inquiry_data[36];
} scsi_inquiry;
/* control calls for scsi cd-rom driver */
/*--------------------------------------*/
enum {
B_SCSI_GET_TOC = B_DEVICE_OP_CODES_END + 200,
B_SCSI_PLAY_TRACK,
@ -84,34 +72,37 @@ enum {
B_SCSI_DATA_MODE
};
typedef struct {
uchar toc_data[804]; /* table of contents data (see SCSI standard) */
uchar toc_data[804];
} scsi_toc;
typedef struct {
uchar start_track; /* starting track */
uchar start_index; /* starting index */
uchar end_track; /* ending track */
uchar end_index; /* ending index */
uchar start_track;
uchar start_index;
uchar end_track;
uchar end_index;
} scsi_play_track;
typedef struct {
uchar start_m; /* starting minute */
uchar start_s; /* starting second */
uchar start_f; /* starting frame */
uchar end_m; /* ending minute */
uchar end_s; /* ending second */
uchar end_f; /* ending frame */
uchar start_m;
uchar start_s;
uchar start_f;
uchar end_m;
uchar end_s;
uchar end_f;
} scsi_play_position;
typedef struct {
uchar position[16]; /* position data (see SCSI standard) */
} scsi_position;
typedef struct {
uchar flags; /* A 1 in any position means change that field */
/* with port0_channel as bit 0 and port3_volume */
/* as bit 7. */
uchar position[16];
} scsi_position;
typedef struct {
uchar flags;
uchar port0_channel;
uchar port0_volume;
uchar port1_channel;
@ -122,6 +113,7 @@ typedef struct {
uchar port3_volume;
} scsi_volume;
#define B_SCSI_PORT0_CHANNEL 0x01
#define B_SCSI_PORT0_VOLUME 0x02
#define B_SCSI_PORT1_CHANNEL 0x04
@ -131,48 +123,50 @@ typedef struct {
#define B_SCSI_PORT3_CHANNEL 0x40
#define B_SCSI_PORT3_VOLUME 0x80
typedef struct {
uchar start_m; /* starting minute */
uchar start_s; /* starting second */
uchar start_f; /* starting frame */
uchar length_m; /* transfer length minute */
uchar length_s; /* transfer length second */
uchar length_f; /* transfer length frame */
long buffer_length; /* size of read buffer */
char* buffer; /* buffer to hold requested data */
bool play; /* FALSE = don't play, TRUE = play */
} scsi_read_cd;
typedef struct {
char speed; /* 0 = slow - 5x, 1 = fast - 12x */
char direction; /* 1 = forward, 0 = stop scan, -1 = backward */
uchar start_m;
uchar start_s;
uchar start_f;
uchar length_m;
uchar length_s;
uchar length_f;
long buffer_length;
char* buffer;
bool play;
} scsi_read_cd;
typedef struct {
char speed;
char direction;
} scsi_scan;
typedef struct {
off_t block;
int32 mode;
} scsi_data_mode;
/* raw device commands */
typedef struct {
uint8 command[16];
uint8 command_length;
uint8 flags;
uint8 scsi_status; /* SCSI Status Byte */
/* (0 = success, 2 = check cond, ... */
uint8 cam_status; /* CAM_* status conditions from CAM.h */
void *data;
uint8 scsi_status;
uint8 cam_status;
void* data;
size_t data_length;
void *sense_data; /* buffer to return mode sense data in */
size_t sense_data_length; /* size of optional buffer for mode sense */
void* sense_data;
size_t sense_data_length;
bigtime_t timeout;
} raw_device_command;
enum {
B_RAW_DEVICE_DATA_IN = 0x01,
B_RAW_DEVICE_REPORT_RESIDUAL = 0x02,
B_RAW_DEVICE_SHORT_READ_VALID = 0x04
B_RAW_DEVICE_DATA_IN = 0x01,
B_RAW_DEVICE_REPORT_RESIDUAL = 0x02,
B_RAW_DEVICE_SHORT_READ_VALID = 0x04
};
#endif
#endif /* _SCSI_H */