1 /* 2 * Disk Array driver for HP SA 5xxx and 6xxx Controllers, SCSI Tape module 3 * Copyright 2001, 2002 Hewlett-Packard Development Company, L.P. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 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 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or 13 * NON INFRINGEMENT. See the GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * 19 * Questions/Comments/Bugfixes to Cciss-discuss@lists.sourceforge.net 20 * 21 */ 22 #ifdef CONFIG_CISS_SCSI_TAPE 23 #ifndef _CCISS_SCSI_H_ 24 #define _CCISS_SCSI_H_ 25 26 #include <scsi/scsicam.h> /* possibly irrelevant, since we don't show disks */ 27 28 // the scsi id of the adapter... 29 #define SELF_SCSI_ID -1 30 // In case we ever want to present controller so sg will 31 // bind to it. The scsi bus that's presented by the 32 // driver to the OS is fabricated. The "real" scsi-3 33 // bus the hardware presents is fabricated too. 34 // The actual, honest-to-goodness physical 35 // bus that the devices are attached to is not 36 // addressible natively, and may in fact turn 37 // out to be not scsi at all. 38 39 #define SCSI_CCISS_CAN_QUEUE 2 40 41 /* this notation works fine for static initializations (as is the usual 42 case for linux scsi drivers), but not so well for dynamic settings, 43 so, if you change this, you also have to change cciss_unregister_scsi() 44 in cciss_scsi.c */ 45 #define CCISS_SCSI { \ 46 name: "", \ 47 detect: cciss_scsi_detect, \ 48 release: cciss_scsi_release, \ 49 proc_info: cciss_scsi_proc_info, \ 50 queuecommand: cciss_scsi_queue_command, \ 51 bios_param: scsicam_bios_param, \ 52 can_queue: SCSI_CCISS_CAN_QUEUE, \ 53 this_id: SELF_SCSI_ID, \ 54 sg_tablesize: MAXSGENTRIES, \ 55 cmd_per_lun: 1, \ 56 use_new_eh_code: 1, \ 57 use_clustering: DISABLE_CLUSTERING,\ 58 } 59 60 /* 61 info: cciss_scsi_info, \ 62 63 Note, cmd_per_lun could give us some trouble, so I'm setting it very low. 64 Likewise, SCSI_CCISS_CAN_QUEUE is set very conservatively. 65 66 If the upper scsi layer tries to track how many commands we have 67 outstanding, it will be operating under the misapprehension that it is 68 the only one sending us requests. We also have the block interface, 69 which is where most requests must surely come from, so the upper layer's 70 notion of how many requests we have outstanding will be wrong most or 71 all of the time. 72 73 Note, the normal SCSI mid-layer error handling doesn't work well 74 for this driver because 1) it takes the io_request_lock before 75 calling error handlers and uses a local variable to store flags, 76 so the io_request_lock cannot be released and interrupts enabled 77 inside the error handlers, and, the error handlers cannot poll 78 for command completion because they might get commands from the 79 block half of the driver completing, and not know what to do 80 with them. That's what we get for making a hybrid scsi/block 81 driver, I suppose. 82 83 */ 84 85 struct cciss_scsi_dev_t { 86 int devtype; 87 int bus, target, lun; /* as presented to the OS */ 88 unsigned char scsi3addr[8]; /* as presented to the HW */ 89 }; 90 91 struct cciss_scsi_hba_t { 92 char name[32]; 93 int ndevices; 94 #define CCISS_MAX_SCSI_DEVS_PER_HBA 16 95 struct cciss_scsi_dev_t dev[CCISS_MAX_SCSI_DEVS_PER_HBA]; 96 }; 97 98 #endif /* _CCISS_SCSI_H_ */ 99 #endif /* CONFIG_CISS_SCSI_TAPE */ 100