OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [scsi/] [st.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
 
2
#ifndef _ST_H
3
        #define _ST_H
4
/*
5
        $Header: /home/marcus/revision_ctrl_test/oc_cvs/cvs/or1k/rc203soc/sw/uClinux/drivers/scsi/st.h,v 1.1 2005-12-20 10:17:45 jcastillo Exp $
6
*/
7
 
8
#ifndef _SCSI_H
9
#include "scsi.h"
10
#endif
11
 
12
/* The tape buffer descriptor. */
13
typedef struct {
14
  unsigned char in_use;
15
  unsigned char dma;    /* DMA-able buffer */
16
  int buffer_size;
17
  int buffer_blocks;
18
  int buffer_bytes;
19
  int read_pointer;
20
  int writing;
21
  int last_result;
22
  int last_result_fatal;
23
  unsigned char *b_data;
24
  int orig_size;
25
  unsigned char *orig_b_data;
26
} ST_buffer;
27
 
28
 
29
/* The tape mode definition */
30
typedef struct {
31
  unsigned char defined;
32
  unsigned char do_async_writes;
33
  unsigned char do_buffer_writes;
34
  unsigned char do_read_ahead;
35
  unsigned char defaults_for_writes;
36
  unsigned char default_compression; /* 0 = don't touch, etc */
37
  short default_density; /* Forced density, -1 = no value */
38
  int default_blksize;  /* Forced blocksize, -1 = no value */
39
} ST_mode;
40
 
41
#define ST_NBR_MODE_BITS 2
42
#define ST_NBR_MODES (1 << ST_NBR_MODE_BITS)
43
#define ST_MODE_SHIFT (7 - ST_NBR_MODE_BITS)
44
#define ST_MODE_MASK ((ST_NBR_MODES - 1) << ST_MODE_SHIFT)
45
 
46
/* The status related to each partition */
47
typedef struct {
48
  unsigned char rw;
49
  unsigned char moves_after_eof;
50
  unsigned char at_sm;
51
  unsigned char last_block_valid;
52
  u32 last_block_visited;
53
} ST_partstat;
54
 
55
#define ST_NBR_PARTITIONS 4
56
 
57
/* The tape drive descriptor */
58
typedef struct {
59
  kdev_t devt;
60
  unsigned capacity;
61
  struct wait_queue * waiting;
62
  Scsi_Device* device;
63
  Scsi_Cmnd SCpnt;
64
  struct semaphore sem;
65
  ST_buffer * buffer;
66
 
67
  /* Drive characteristics */
68
  unsigned char omit_blklims;
69
  unsigned char do_auto_lock;
70
  unsigned char can_bsr;
71
  unsigned char can_partitions;
72
  unsigned char two_fm;
73
  unsigned char fast_mteom;
74
  unsigned char restr_dma;
75
  unsigned char scsi2_logical;
76
  unsigned char default_drvbuffer;  /* 0xff = don't touch, value 3 bits */
77
  int write_threshold;
78
 
79
  /* Mode characteristics */
80
  ST_mode modes[ST_NBR_MODES];
81
  int current_mode;
82
 
83
  /* Status variables */
84
  int partition;
85
  int new_partition;
86
  int nbr_partitions;    /* zero until partition support enabled */
87
  ST_partstat ps[ST_NBR_PARTITIONS];
88
  unsigned char dirty;
89
  unsigned char ready;
90
  unsigned char eof;
91
  unsigned char write_prot;
92
  unsigned char drv_write_prot;
93
  unsigned char in_use;
94
  unsigned char eof_hit;
95
  unsigned char blksize_changed;
96
  unsigned char density_changed;
97
  unsigned char compression_changed;
98
  unsigned char drv_buffer;
99
  unsigned char density;
100
  unsigned char door_locked;
101
  unsigned char rew_at_close;
102
  int block_size;
103
  int min_block;
104
  int max_block;
105
  int recover_count;
106
  int drv_block;        /* The block where the drive head is */
107
  struct mtget * mt_status;
108
 
109
#if DEBUG
110
  unsigned char write_pending;
111
  int nbr_finished;
112
  int nbr_waits;
113
#endif
114
} Scsi_Tape;
115
 
116
extern Scsi_Tape * scsi_tapes;
117
 
118
/* Values of eof */
119
#define ST_NOEOF        0
120
#define ST_FM           1
121
#define ST_EOM_OK       2
122
#define ST_EOM_ERROR    3
123
#define ST_EOD          4
124
 
125
/* Values of rw */
126
#define ST_IDLE         0
127
#define ST_READING      1
128
#define ST_WRITING      2
129
 
130
/* Values of ready state */
131
#define ST_READY        0
132
#define ST_NOT_READY    1
133
#define ST_NO_TAPE      2
134
 
135
/* Values for door lock state */
136
#define ST_UNLOCKED     0
137
#define ST_LOCKED_EXPLICIT 1
138
#define ST_LOCKED_AUTO  2
139
#define ST_LOCK_FAILS   3
140
 
141
/* Positioning SCSI-commands for Tandberg, etc. drives */
142
#define QFA_REQUEST_BLOCK       0x02
143
#define QFA_SEEK_BLOCK          0x0c
144
 
145
/* Setting the binary options */
146
#define ST_DONT_TOUCH  0
147
#define ST_NO          1
148
#define ST_YES         2
149
 
150
#endif
151
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.