2 * 2.5 Command Descriptor Block (CDB) Block Pre-Handler.
4 * Copyright (C) 2001 Andre Hedrick <andre@linux-ide.org>
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.
10 * This program is distributed in the hope that it will be useful,
11 * 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.
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-
21 #ifndef _LINUX_BLKCDB_H
22 #define _LINUX_BLKCDB_H
24 typedef struct cdb_list {
43 unsigned char cdb_regs[16];
49 typedef cdb_list_t * (queue_proc) (kdev_t dev);
51 request_queue_t *ide_get_queue (kdev_t dev)
53 ide_hwif_t *hwif = (ide_hwif_t *)blk_dev[MAJOR(dev)].data;
55 return &hwif->drives[DEVICE_NR(dev) & 1].queue;
58 static request_queue_t *sd_find_queue(kdev_t dev)
62 target = DEVICE_NR(dev);
64 dpnt = &rscsi_disks[target];
66 return NULL; /* No such device */
67 return &dpnt->device->request_queue;
71 block_device_operations
74 void do_ide_request(request_queue_t *q)
78 typedef cdb_list_t (request_cdb_proc) (request_queue_t *q);
80 typedef cdb_list_t (request_cdb_proc) (request_queue_t *q);
81 typedef void (request_fn_proc) (request_queue_t *q);
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;
94 SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff;
95 SCpnt->cmnd[8] = (unsigned char) this_count & 0xff;
100 #endif /* _LINUX_BLKCDB_H */