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

Subversion Repositories or1k

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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*+M*************************************************************************
2
 * Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux.
3
 *
4
 * Copyright (c) 1997 Perceptive Solutions, Inc.
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2, or (at your option)
9
 * any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; see the file COPYING.  If not, write to
18
 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
 *
20
 *
21
 *      File Name:              pci2000.h
22
 *
23
 *      Description:    Header file for the SCSI driver for the PCI-2000
24
 *                                      interface card.
25
 *
26
 *-M*************************************************************************/
27
#ifndef _PCI2000_H
28
#define _PCI2000_H
29
 
30
#include <linux/types.h>
31
#include <linux/kdev_t.h>
32
 
33
#ifndef PSI_EIDE_SCSIOP
34
#define PSI_EIDE_SCSIOP 1
35
 
36
/************************************************/
37
/*              definition of standard data types               */
38
/************************************************/
39
#define CHAR    char
40
#define UCHAR   unsigned char
41
#define SHORT   short
42
#define USHORT  unsigned short
43
#define BOOL    long
44
#define LONG    long
45
#define ULONG   unsigned long
46
#define VOID    void
47
 
48
typedef CHAR    *PCHAR;
49
typedef UCHAR   *PUCHAR;
50
typedef SHORT   *PSHORT;
51
typedef USHORT  *PUSHORT;
52
typedef BOOL    *PBOOL;
53
typedef LONG    *PLONG;
54
typedef ULONG   *PULONG;
55
typedef VOID    *PVOID;
56
 
57
 
58
/************************************************/
59
/*              Misc. macros                                                    */
60
/************************************************/
61
#define ANY2SCSI(up, p)                                 \
62
((UCHAR *)up)[0] = (((ULONG)(p)) >> 8);  \
63
((UCHAR *)up)[1] = ((ULONG)(p));
64
 
65
#define SCSI2LONG(up)                                   \
66
( (((long)*(((UCHAR *)up))) << 16)              \
67
+ (((long)(((UCHAR *)up)[1])) << 8)             \
68
+ ((long)(((UCHAR *)up)[2])) )
69
 
70
#define XANY2SCSI(up, p)                                \
71
((UCHAR *)up)[0] = ((long)(p)) >> 24;    \
72
((UCHAR *)up)[1] = ((long)(p)) >> 16;   \
73
((UCHAR *)up)[2] = ((long)(p)) >> 8;    \
74
((UCHAR *)up)[3] = ((long)(p));
75
 
76
#define XSCSI2LONG(up)                                  \
77
( (((long)(((UCHAR *)up)[0])) << 24)     \
78
+ (((long)(((UCHAR *)up)[1])) << 16)    \
79
+ (((long)(((UCHAR *)up)[2])) <<  8)    \
80
+ ((long)(((UCHAR *)up)[3])) )
81
 
82
/************************************************/
83
/*              SCSI CDB operation codes                                */
84
/************************************************/
85
#define SCSIOP_TEST_UNIT_READY          0x00
86
#define SCSIOP_REZERO_UNIT                      0x01
87
#define SCSIOP_REWIND                           0x01
88
#define SCSIOP_REQUEST_BLOCK_ADDR       0x02
89
#define SCSIOP_REQUEST_SENSE            0x03
90
#define SCSIOP_FORMAT_UNIT                      0x04
91
#define SCSIOP_READ_BLOCK_LIMITS        0x05
92
#define SCSIOP_REASSIGN_BLOCKS          0x07
93
#define SCSIOP_READ6                            0x08
94
#define SCSIOP_RECEIVE                          0x08
95
#define SCSIOP_WRITE6                           0x0A
96
#define SCSIOP_PRINT                            0x0A
97
#define SCSIOP_SEND                                     0x0A
98
#define SCSIOP_SEEK6                            0x0B
99
#define SCSIOP_TRACK_SELECT                     0x0B
100
#define SCSIOP_SLEW_PRINT                       0x0B
101
#define SCSIOP_SEEK_BLOCK                       0x0C
102
#define SCSIOP_PARTITION                        0x0D
103
#define SCSIOP_READ_REVERSE                     0x0F
104
#define SCSIOP_WRITE_FILEMARKS          0x10
105
#define SCSIOP_FLUSH_BUFFER                     0x10
106
#define SCSIOP_SPACE                            0x11
107
#define SCSIOP_INQUIRY                          0x12
108
#define SCSIOP_VERIFY6                          0x13
109
#define SCSIOP_RECOVER_BUF_DATA         0x14
110
#define SCSIOP_MODE_SELECT                      0x15
111
#define SCSIOP_RESERVE_UNIT                     0x16
112
#define SCSIOP_RELEASE_UNIT                     0x17
113
#define SCSIOP_COPY                                     0x18
114
#define SCSIOP_ERASE                            0x19
115
#define SCSIOP_MODE_SENSE                       0x1A
116
#define SCSIOP_START_STOP_UNIT          0x1B
117
#define SCSIOP_STOP_PRINT                       0x1B
118
#define SCSIOP_LOAD_UNLOAD                      0x1B
119
#define SCSIOP_RECEIVE_DIAGNOSTIC       0x1C
120
#define SCSIOP_SEND_DIAGNOSTIC          0x1D
121
#define SCSIOP_MEDIUM_REMOVAL           0x1E
122
#define SCSIOP_READ_CAPACITY            0x25
123
#define SCSIOP_READ                                     0x28
124
#define SCSIOP_WRITE                            0x2A
125
#define SCSIOP_SEEK                                     0x2B
126
#define SCSIOP_LOCATE                           0x2B
127
#define SCSIOP_WRITE_VERIFY                     0x2E
128
#define SCSIOP_VERIFY                           0x2F
129
#define SCSIOP_SEARCH_DATA_HIGH         0x30
130
#define SCSIOP_SEARCH_DATA_EQUAL        0x31
131
#define SCSIOP_SEARCH_DATA_LOW          0x32
132
#define SCSIOP_SET_LIMITS                       0x33
133
#define SCSIOP_READ_POSITION            0x34
134
#define SCSIOP_SYNCHRONIZE_CACHE        0x35
135
#define SCSIOP_COMPARE                          0x39
136
#define SCSIOP_COPY_COMPARE                     0x3A
137
#define SCSIOP_WRITE_DATA_BUFF          0x3B
138
#define SCSIOP_READ_DATA_BUFF           0x3C
139
#define SCSIOP_CHANGE_DEFINITION        0x40
140
#define SCSIOP_READ_SUB_CHANNEL         0x42
141
#define SCSIOP_READ_TOC                         0x43
142
#define SCSIOP_READ_HEADER                      0x44
143
#define SCSIOP_PLAY_AUDIO                       0x45
144
#define SCSIOP_PLAY_AUDIO_MSF           0x47
145
#define SCSIOP_PLAY_TRACK_INDEX         0x48
146
#define SCSIOP_PLAY_TRACK_RELATIVE      0x49
147
#define SCSIOP_PAUSE_RESUME                     0x4B
148
#define SCSIOP_LOG_SELECT                       0x4C
149
#define SCSIOP_LOG_SENSE                        0x4D
150
#define SCSIOP_MODE_SELECT10            0x55
151
#define SCSIOP_MODE_SENSE10                     0x5A
152
#define SCSIOP_LOAD_UNLOAD_SLOT         0xA6
153
#define SCSIOP_MECHANISM_STATUS         0xBD
154
#define SCSIOP_READ_CD                          0xBE
155
 
156
// SCSI read capacity structure
157
typedef struct _READ_CAPACITY_DATA
158
        {
159
        ULONG blks;                             /* total blocks (converted to little endian) */
160
        ULONG blksiz;                   /* size of each (converted to little endian) */
161
        }       READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA;
162
 
163
// SCSI inquiry data
164
typedef struct _INQUIRYDATA
165
        {
166
        UCHAR DeviceType                        :5;
167
        UCHAR DeviceTypeQualifier       :3;
168
        UCHAR DeviceTypeModifier        :7;
169
        UCHAR RemovableMedia            :1;
170
    UCHAR Versions;
171
    UCHAR ResponseDataFormat;
172
    UCHAR AdditionalLength;
173
    UCHAR Reserved[2];
174
        UCHAR SoftReset                         :1;
175
        UCHAR CommandQueue                      :1;
176
        UCHAR Reserved2                         :1;
177
        UCHAR LinkedCommands            :1;
178
        UCHAR Synchronous                       :1;
179
        UCHAR Wide16Bit                         :1;
180
        UCHAR Wide32Bit                         :1;
181
        UCHAR RelativeAddressing        :1;
182
    UCHAR VendorId[8];
183
    UCHAR ProductId[16];
184
    UCHAR ProductRevisionLevel[4];
185
    UCHAR VendorSpecific[20];
186
    UCHAR Reserved3[40];
187
        }       INQUIRYDATA, *PINQUIRYDATA;
188
 
189
#endif
190
 
191
// function prototypes
192
int Pci2000_Detect                      (Scsi_Host_Template *tpnt);
193
int Pci2000_Command                     (Scsi_Cmnd *SCpnt);
194
int Pci2000_QueueCommand        (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *));
195
int Pci2000_Abort                       (Scsi_Cmnd *SCpnt);
196
int Pci2000_Reset                       (Scsi_Cmnd *SCpnt, unsigned int flags);
197
int Pci2000_BiosParam           (Disk *disk, kdev_t dev, int geom[]);
198
 
199
#ifndef NULL
200
        #define NULL 0
201
#endif
202
 
203
extern struct proc_dir_entry Proc_Scsi_Pci2000;
204
 
205
#define PCI2000 { NULL, NULL,                                                   \
206
                        &Proc_Scsi_Pci2000,/* proc_dir_entry */         \
207
                        NULL,                                                           \
208
                        "PCI-2000 SCSI Intelligent Disk Controller",\
209
                        Pci2000_Detect,                                                         \
210
                        NULL,                                                                           \
211
                        NULL,                                                                           \
212
                        Pci2000_Command,                                                        \
213
                        Pci2000_QueueCommand,                                           \
214
                        Pci2000_Abort,                                                          \
215
                        Pci2000_Reset,                                                          \
216
                        NULL,                                                                           \
217
                        Pci2000_BiosParam,                                      \
218
                        16,                                                                             \
219
                        -1,                                                                             \
220
                        16,                                                                                     \
221
                        1,                                                                                      \
222
                        0,                                                                                       \
223
                        0,                                                                                       \
224
                        DISABLE_CLUSTERING }
225
 
226
#endif

powered by: WebSVN 2.1.0

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