This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / drivers / scsi / lpfc / lpfc_scsi.h
1 /*******************************************************************
2  * This file is part of the Emulex Linux Device Driver for         *
3  * Enterprise Fibre Channel Host Bus Adapters.                     *
4  * Refer to the README file included with this package for         *
5  * driver version and adapter support.                             *
6  * Copyright (C) 2004 Emulex Corporation.                          *
7  * www.emulex.com                                                  *
8  *                                                                 *
9  * This program is free software; you can redistribute it and/or   *
10  * modify it under the terms of the GNU General Public License     *
11  * as published by the Free Software Foundation; either version 2  *
12  * of the License, or (at your option) any later version.          *
13  *                                                                 *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of  *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   *
17  * GNU General Public License for more details, a copy of which    *
18  * can be found in the file COPYING included with this package.    *
19  *******************************************************************/
20
21 /*
22  * $Id: lpfc_scsi.h 1.68 2004/11/10 11:40:43EST sf_support Exp  $
23  */
24
25 #ifndef _H_LPFC_SCSI
26 #define _H_LPFC_SCSI
27
28 #include "lpfc_disc.h"
29 #include "lpfc_mem.h"
30 #include "lpfc_sli.h"
31
32 struct lpfc_hba;
33
34
35 struct lpfc_target {
36         struct lpfc_nodelist *pnode;    /* Pointer to the node structure. */
37         uint16_t  scsi_id;
38         uint32_t  qcmdcnt;
39         uint32_t  iodonecnt;
40         uint32_t  errorcnt;
41         uint32_t  slavecnt;
42 #if defined(FC_TRANS_VER1) || defined(FC_TRANS_265_BLKPATCH)
43         uint16_t  blocked;
44 #endif
45 #ifdef FC_TRANS_VER1
46         struct scsi_target *starget;            /* Pointer to midlayer target
47                                                    structure. */
48 #endif
49 #if defined(FC_TRANS_265_BLKPATCH)
50         struct timer_list dev_loss_timer;
51 #endif
52 };
53
54 struct lpfc_scsi_buf {
55         struct scsi_cmnd *pCmd;
56         struct lpfc_hba *scsi_hba;
57         struct lpfc_target *target;
58
59         uint32_t timeout;
60
61         uint16_t status;        /* From IOCB Word 7- ulpStatus */
62         uint32_t result;        /* From IOCB Word 4. */
63
64         uint32_t   seg_cnt;     /* Number of scatter-gather segments returned by
65                                  * dma_map_sg.  The driver needs this for calls
66                                  * to dma_unmap_sg. */
67         dma_addr_t nonsg_phys;  /* Non scatter-gather physical address. */
68
69         /* dma_ext has both virt, phys to dma-able buffer
70          * which contains fcp_cmd, fcp_rsp and scatter gather list fro upto
71          * 68 (LPFC_SCSI_BPL_SIZE) BDE entries,
72          * xfer length, cdb, data direction....
73          */
74         struct lpfc_dmabuf dma_ext;
75         struct fcp_cmnd *fcp_cmnd;
76         struct fcp_rsp *fcp_rsp;
77         struct ulp_bde64 *fcp_bpl;
78
79         /* cur_iocbq has phys of the dma-able buffer.
80          * Iotag is in here
81          */
82         struct lpfc_iocbq cur_iocbq;
83 };
84
85 #define LPFC_SCSI_INITIAL_BPL_SIZE  4   /* Number of scsi buf BDEs in fcp_bpl */
86
87 #define LPFC_SCSI_DMA_EXT_SIZE 264
88 #define LPFC_BPL_SIZE          1024
89
90 #define MDAC_DIRECT_CMD                  0x22
91
92 #endif                          /* _H_LPFC_SCSI */