1/* 2 * QLogic ISP2x00 SCSI-FCP 3 * 4 * Written by Erik H. Moe, ehm@cris.com 5 * Copyright 1995, Erik H. Moe 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the 9 * Free Software Foundation; either version 2, or (at your option) any 10 * later version. 11 * 12 * This program is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * General Public License for more details. 16 */ 17 18/* Renamed and updated to 1.3.x by Michael Griffith <grif@cs.ucr.edu> */ 19 20/* This is a version of the isp1020 driver which was modified by 21 * Chris Loveland <cwl@iol.unh.edu> to support the isp2x00 22 */ 23 24 25/* 26 * $Date: 2008/10/15 03:26:55 $ 27 * $Revision: 1.1.1.1 $ 28 * 29 * $Log: qlogicfc.h,v $ 30 * Revision 1.1.1.1 2008/10/15 03:26:55 james26_jang 31 * Initial. 32 * 33 * Revision 1.1.1.1 2008/07/21 09:15:23 james26_jang 34 * New UI, New QoS, New wireless driver(4.151.10.29), ipmonitor. 35 * 36 * Revision 1.1.1.1 2008/07/02 14:39:39 james26_jang 37 * 4.100.10.29, New QoS and New UI. 38 * 39 * Revision 1.1.1.1 2003/02/03 22:37:53 mhuang 40 * LINUX_2_4 branch snapshot from linux-mips.org CVS 41 * 42 * Revision 0.5 1995/09/22 02:32:56 root 43 * do auto request sense 44 * 45 * Revision 0.4 1995/08/07 04:48:28 root 46 * supply firmware with driver. 47 * numerous bug fixes/general cleanup of code. 48 * 49 * Revision 0.3 1995/07/16 16:17:16 root 50 * added reset/abort code. 51 * 52 * Revision 0.2 1995/06/29 03:19:43 root 53 * fixed biosparam. 54 * added queue protocol. 55 * 56 * Revision 0.1 1995/06/25 01:56:13 root 57 * Initial release. 58 * 59 */ 60 61#ifndef _QLOGICFC_H 62#define _QLOGICFC_H 63 64/* 65 * With the qlogic interface, every queue slot can hold a SCSI 66 * command with up to 2 scatter/gather entries. If we need more 67 * than 2 entries, continuation entries can be used that hold 68 * another 5 entries each. Unlike for other drivers, this means 69 * that the maximum number of scatter/gather entries we can 70 * support at any given time is a function of the number of queue 71 * slots available. That is, host->can_queue and host->sg_tablesize 72 * are dynamic and _not_ independent. This all works fine because 73 * requests are queued serially and the scatter/gather limit is 74 * determined for each queue request anew. 75 */ 76 77#define DATASEGS_PER_COMMAND 2 78#define DATASEGS_PER_CONT 5 79 80#define QLOGICFC_REQ_QUEUE_LEN 127 /* must be power of two - 1 */ 81#define QLOGICFC_MAX_SG(ql) (DATASEGS_PER_COMMAND + (((ql) > 0) ? DATASEGS_PER_CONT*((ql) - 1) : 0)) 82#define QLOGICFC_CMD_PER_LUN 8 83 84int isp2x00_detect(Scsi_Host_Template *); 85int isp2x00_release(struct Scsi_Host *); 86const char * isp2x00_info(struct Scsi_Host *); 87int isp2x00_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *)); 88int isp2x00_abort(Scsi_Cmnd *); 89int isp2x00_reset(Scsi_Cmnd *, unsigned int); 90int isp2x00_biosparam(Disk *, kdev_t, int[]); 91 92#ifndef NULL 93#define NULL (0) 94#endif 95 96#define QLOGICFC { \ 97 detect: isp2x00_detect, \ 98 release: isp2x00_release, \ 99 info: isp2x00_info, \ 100 queuecommand: isp2x00_queuecommand, \ 101 eh_abort_handler: isp2x00_abort, \ 102 reset: isp2x00_reset, \ 103 bios_param: isp2x00_biosparam, \ 104 can_queue: QLOGICFC_REQ_QUEUE_LEN, \ 105 this_id: -1, \ 106 sg_tablesize: QLOGICFC_MAX_SG(QLOGICFC_REQ_QUEUE_LEN), \ 107 cmd_per_lun: QLOGICFC_CMD_PER_LUN, \ 108 present: 0, \ 109 unchecked_isa_dma: 0, \ 110 use_clustering: ENABLE_CLUSTERING, \ 111 highmem_io: 1 \ 112} 113 114#endif /* _QLOGICFC_H */ 115 116 117 118