Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ibmvscsi.h
Go to the documentation of this file.
1 /* ------------------------------------------------------------
2  * ibmvscsi.h
3  * (C) Copyright IBM Corporation 1994, 2003
4  * Authors: Colin DeVilbiss ([email protected])
5  * Santiago Leon ([email protected])
6  * Dave Boutcher ([email protected])
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21  * USA
22  *
23  * ------------------------------------------------------------
24  * Emulation of a SCSI host adapter for Virtual I/O devices
25  *
26  * This driver allows the Linux SCSI peripheral drivers to directly
27  * access devices in the hosting partition, either on an iSeries
28  * hypervisor system or a converged hypervisor system.
29  */
30 #ifndef IBMVSCSI_H
31 #define IBMVSCSI_H
32 #include <linux/types.h>
33 #include <linux/list.h>
34 #include <linux/completion.h>
35 #include <linux/interrupt.h>
36 #include "viosrp.h"
37 
38 struct scsi_cmnd;
39 struct Scsi_Host;
40 
41 /* Number of indirect bufs...the list of these has to fit in the
42  * additional data of the srp_cmd struct along with the indirect
43  * descriptor
44  */
45 #define MAX_INDIRECT_BUFS 10
46 
47 #define IBMVSCSI_MAX_REQUESTS_DEFAULT 100
48 #define IBMVSCSI_CMDS_PER_LUN_DEFAULT 16
49 #define IBMVSCSI_MAX_SECTORS_DEFAULT 256 /* 32 * 8 = default max I/O 32 pages */
50 #define IBMVSCSI_MAX_CMDS_PER_LUN 64
51 
52 /* ------------------------------------------------------------
53  * Data Structures
54  */
55 /* an RPA command/response transport queue */
56 struct crq_queue {
57  struct viosrp_crq *msgs;
58  int size, cur;
61 };
62 
63 /* a unit of work for the hosting partition */
66  struct scsi_cmnd *cmnd;
67  struct list_head list;
68  void (*done) (struct srp_event_struct *);
69  struct viosrp_crq crq;
72  union viosrp_iu iu;
73  void (*cmnd_done) (struct scsi_cmnd *);
74  struct completion comp;
75  struct timer_list timer;
79 };
80 
81 /* a pool of event structs for use */
82 struct event_pool {
85  int next;
88 };
89 
90 /* all driver data associated with a host adapter */
94  int reset_crq;
96  struct device *dev;
97  struct event_pool pool;
98  struct crq_queue queue;
100  struct list_head sent;
101  struct Scsi_Host *host;
108 };
109 
110 #endif /* IBMVSCSI_H */