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

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [linux/] [blkcdb.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * 2.5 Command Descriptor Block (CDB) Block Pre-Handler.
3
 *
4
 * Copyright (C) 2001 Andre Hedrick <andre@linux-ide.org>
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 version 2 as
8
 * published by the Free Software Foundation.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
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 Licens
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-
19
 */
20
 
21
#ifndef _LINUX_BLKCDB_H
22
#define _LINUX_BLKCDB_H
23
 
24
typedef struct cdb_list {
25
#if 0
26
        unsigned char cdb_0;
27
        unsigned char cdb_1;
28
        unsigned char cdb_2;
29
        unsigned char cdb_3;
30
        unsigned char cdb_4;
31
        unsigned char cdb_5;
32
        unsigned char cdb_6;
33
        unsigned char cdb_7;
34
        unsigned char cdb_8;
35
        unsigned char cdb_9;
36
        unsigned char cdb_10;
37
        unsigned char cdb_11;
38
        unsigned char cdb_12;
39
        unsigned char cdb_13;
40
        unsigned char cdb_14;
41
        unsigned char cdb_15;
42
#else
43
        unsigned char cdb_regs[16];
44
#endif
45
} cdb_list_t;
46
 
47
#if 0
48
 
49
typedef cdb_list_t * (queue_proc) (kdev_t dev);
50
 
51
request_queue_t *ide_get_queue (kdev_t dev)
52
{
53
        ide_hwif_t *hwif = (ide_hwif_t *)blk_dev[MAJOR(dev)].data;
54
 
55
        return &hwif->drives[DEVICE_NR(dev) & 1].queue;
56
}
57
 
58
static request_queue_t *sd_find_queue(kdev_t dev)
59
{
60
        Scsi_Disk *dpnt;
61
        int target;
62
        target = DEVICE_NR(dev);
63
 
64
        dpnt = &rscsi_disks[target];
65
        if (!dpnt)
66
                return NULL;    /* No such device */
67
        return &dpnt->device->request_queue;
68
}
69
 
70
prebuilder:             NULL,
71
block_device_operations
72
struct block_device {
73
 
74
void do_ide_request(request_queue_t *q)
75
 
76
ide_do_request
77
 
78
typedef cdb_list_t (request_cdb_proc) (request_queue_t *q);
79
 
80
typedef cdb_list_t (request_cdb_proc) (request_queue_t *q);
81
typedef void (request_fn_proc) (request_queue_t *q);
82
 
83
srb
84
 
85
switch (SCpnt->request.cmd)
86
SCpnt->cmnd[0] = WRITE_6/READ_6;
87
SCpnt->cmnd[1] = (SCpnt->device->scsi_level <= SCSI_2) ?
88
                        ((SCpnt->lun << 5) & 0xe0) : 0;
89
SCpnt->cmnd[2] = (unsigned char) (block >> 24) & 0xff;
90
SCpnt->cmnd[3] = (unsigned char) (block >> 16) & 0xff;
91
SCpnt->cmnd[4] = (unsigned char) (block >> 8) & 0xff;
92
SCpnt->cmnd[5] = (unsigned char) block & 0xff;
93
SCpnt->cmnd[6] = 0;
94
SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff;
95
SCpnt->cmnd[8] = (unsigned char) this_count & 0xff;
96
SCpnt->cmnd[9] = 0;
97
 
98
#endif
99
 
100
#endif /* _LINUX_BLKCDB_H */
101
 

powered by: WebSVN 2.1.0

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