aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-14 15:16:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-14 15:16:07 -0500
commit12dbf3fc4d06d2c0c4c44dc0612df04248b3cfd3 (patch)
tree158610ef6c7711afb60d78956ab4b131bf6a08ef /include
parent61b7efddc5256225099d13185659e9ad9d8abc8a (diff)
parentfc091e03820bf67e543362bd40959701a71d0c27 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/raid_class.h2
-rw-r--r--include/scsi/iscsi_if.h6
-rw-r--r--include/scsi/scsi.h6
-rw-r--r--include/scsi/scsi_cmnd.h1
-rw-r--r--include/scsi/scsi_host.h3
-rw-r--r--include/scsi/scsi_transport.h7
-rw-r--r--include/scsi/scsi_transport_fc.h4
-rw-r--r--include/scsi/scsi_transport_iscsi.h75
-rw-r--r--include/scsi/scsi_transport_spi.h2
10 files changed, 91 insertions, 16 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7fb397e3f2d3..5403257ae3e7 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -181,6 +181,7 @@
181#define PCI_DEVICE_ID_LSI_FC929X 0x0626 181#define PCI_DEVICE_ID_LSI_FC929X 0x0626
182#define PCI_DEVICE_ID_LSI_FC939X 0x0642 182#define PCI_DEVICE_ID_LSI_FC939X 0x0642
183#define PCI_DEVICE_ID_LSI_FC949X 0x0640 183#define PCI_DEVICE_ID_LSI_FC949X 0x0640
184#define PCI_DEVICE_ID_LSI_FC949ES 0x0646
184#define PCI_DEVICE_ID_LSI_FC919X 0x0628 185#define PCI_DEVICE_ID_LSI_FC919X 0x0628
185#define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701 186#define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701
186#define PCI_DEVICE_ID_LSI_61C102 0x0901 187#define PCI_DEVICE_ID_LSI_61C102 0x0901
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index 48831eac2910..d0dd38b3a2fd 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -31,9 +31,11 @@ enum raid_level {
31 RAID_LEVEL_LINEAR, 31 RAID_LEVEL_LINEAR,
32 RAID_LEVEL_0, 32 RAID_LEVEL_0,
33 RAID_LEVEL_1, 33 RAID_LEVEL_1,
34 RAID_LEVEL_10,
34 RAID_LEVEL_3, 35 RAID_LEVEL_3,
35 RAID_LEVEL_4, 36 RAID_LEVEL_4,
36 RAID_LEVEL_5, 37 RAID_LEVEL_5,
38 RAID_LEVEL_50,
37 RAID_LEVEL_6, 39 RAID_LEVEL_6,
38}; 40};
39 41
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index be1bc792ab18..3e5cb5ab2d34 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -168,6 +168,12 @@ typedef uint64_t iscsi_connh_t; /* iSCSI Data-Path connection handle */
168 168
169#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 169#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
170#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 170#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
171#define hostdata_session(_hostdata) (iscsi_ptr(*(unsigned long *)_hostdata))
172
173/**
174 * iscsi_hostdata - get LLD hostdata from scsi_host
175 * @_hostdata: pointer to scsi host's hostdata
176 **/
171#define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long)) 177#define iscsi_hostdata(_hostdata) ((void*)_hostdata + sizeof(unsigned long))
172 178
173/* 179/*
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 6cb1e2788d8b..c60b8ff2f5e4 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -32,6 +32,12 @@ extern const unsigned char scsi_command_size[8];
32extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 32extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
33 33
34/* 34/*
35 * Special value for scanning to specify scanning or rescanning of all
36 * possible channels, (target) ids, or luns on a given shost.
37 */
38#define SCAN_WILD_CARD ~0
39
40/*
35 * SCSI opcodes 41 * SCSI opcodes
36 */ 42 */
37 43
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 41cfc29be899..7529f4388bb4 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -151,6 +151,5 @@ extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
151extern void scsi_put_command(struct scsi_cmnd *); 151extern void scsi_put_command(struct scsi_cmnd *);
152extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 152extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
153extern void scsi_finish_command(struct scsi_cmnd *cmd); 153extern void scsi_finish_command(struct scsi_cmnd *cmd);
154extern void scsi_setup_blk_pc_cmnd(struct scsi_cmnd *cmd);
155 154
156#endif /* _SCSI_SCSI_CMND_H */ 155#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 230bc55c0bfa..467274a764d1 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -5,6 +5,7 @@
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8#include <linux/mutex.h>
8 9
9struct block_device; 10struct block_device;
10struct completion; 11struct completion;
@@ -469,7 +470,7 @@ struct Scsi_Host {
469 spinlock_t default_lock; 470 spinlock_t default_lock;
470 spinlock_t *host_lock; 471 spinlock_t *host_lock;
471 472
472 struct semaphore scan_mutex;/* serialize scanning activity */ 473 struct mutex scan_mutex;/* serialize scanning activity */
473 474
474 struct list_head eh_cmd_q; 475 struct list_head eh_cmd_q;
475 struct task_struct * ehandler; /* Error recovery thread. */ 476 struct task_struct * ehandler; /* Error recovery thread. */
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index f6e0bb484c63..e7b1054adf86 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -30,12 +30,9 @@ struct scsi_transport_template {
30 struct transport_container device_attrs; 30 struct transport_container device_attrs;
31 31
32 /* 32 /*
33 * If set, call target_parent prior to allocating a scsi_target, 33 * If set, called from sysfs and legacy procfs rescanning code.
34 * so we get the appropriate parent for the target. This function
35 * is required for transports like FC and iSCSI that do not put the
36 * scsi_target under scsi_host.
37 */ 34 */
38 struct device *(*target_parent)(struct Scsi_Host *, int, uint); 35 int (*user_scan)(struct Scsi_Host *, uint, uint, uint);
39 36
40 /* The size of the specific transport attribute structure (a 37 /* The size of the specific transport attribute structure (a
41 * space of this size will be left at the end of the 38 * space of this size will be left at the end of the
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 394f14a5b7cb..cf3fec8be1e3 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -303,6 +303,7 @@ struct fc_host_attrs {
303 /* Fixed Attributes */ 303 /* Fixed Attributes */
304 u64 node_name; 304 u64 node_name;
305 u64 port_name; 305 u64 port_name;
306 u64 permanent_port_name;
306 u32 supported_classes; 307 u32 supported_classes;
307 u8 supported_fc4s[FC_FC4_LIST_SIZE]; 308 u8 supported_fc4s[FC_FC4_LIST_SIZE];
308 char symbolic_name[FC_SYMBOLIC_NAME_SIZE]; 309 char symbolic_name[FC_SYMBOLIC_NAME_SIZE];
@@ -338,6 +339,8 @@ struct fc_host_attrs {
338 (((struct fc_host_attrs *)(x)->shost_data)->node_name) 339 (((struct fc_host_attrs *)(x)->shost_data)->node_name)
339#define fc_host_port_name(x) \ 340#define fc_host_port_name(x) \
340 (((struct fc_host_attrs *)(x)->shost_data)->port_name) 341 (((struct fc_host_attrs *)(x)->shost_data)->port_name)
342#define fc_host_permanent_port_name(x) \
343 (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name)
341#define fc_host_supported_classes(x) \ 344#define fc_host_supported_classes(x) \
342 (((struct fc_host_attrs *)(x)->shost_data)->supported_classes) 345 (((struct fc_host_attrs *)(x)->shost_data)->supported_classes)
343#define fc_host_supported_fc4s(x) \ 346#define fc_host_supported_fc4s(x) \
@@ -426,6 +429,7 @@ struct fc_function_template {
426 /* host fixed attributes */ 429 /* host fixed attributes */
427 unsigned long show_host_node_name:1; 430 unsigned long show_host_node_name:1;
428 unsigned long show_host_port_name:1; 431 unsigned long show_host_port_name:1;
432 unsigned long show_host_permanent_port_name:1;
429 unsigned long show_host_supported_classes:1; 433 unsigned long show_host_supported_classes:1;
430 unsigned long show_host_supported_fc4s:1; 434 unsigned long show_host_supported_fc4s:1;
431 unsigned long show_host_symbolic_name:1; 435 unsigned long show_host_symbolic_name:1;
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index f25041c386ec..16602a547a63 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -23,8 +23,14 @@
23#ifndef SCSI_TRANSPORT_ISCSI_H 23#ifndef SCSI_TRANSPORT_ISCSI_H
24#define SCSI_TRANSPORT_ISCSI_H 24#define SCSI_TRANSPORT_ISCSI_H
25 25
26#include <linux/device.h>
26#include <scsi/iscsi_if.h> 27#include <scsi/iscsi_if.h>
27 28
29struct scsi_transport_template;
30struct Scsi_Host;
31struct mempool_zone;
32struct iscsi_cls_conn;
33
28/** 34/**
29 * struct iscsi_transport - iSCSI Transport template 35 * struct iscsi_transport - iSCSI Transport template
30 * 36 *
@@ -48,23 +54,31 @@ struct iscsi_transport {
48 char *name; 54 char *name;
49 unsigned int caps; 55 unsigned int caps;
50 struct scsi_host_template *host_template; 56 struct scsi_host_template *host_template;
57 /* LLD session/scsi_host data size */
51 int hostdata_size; 58 int hostdata_size;
59 /* LLD iscsi_host data size */
60 int ihostdata_size;
61 /* LLD connection data size */
62 int conndata_size;
52 int max_lun; 63 int max_lun;
53 unsigned int max_conn; 64 unsigned int max_conn;
54 unsigned int max_cmd_len; 65 unsigned int max_cmd_len;
55 iscsi_sessionh_t (*create_session) (uint32_t initial_cmdsn, 66 struct Scsi_Host *(*create_session) (struct scsi_transport_template *t,
56 struct Scsi_Host *shost); 67 uint32_t initial_cmdsn);
57 void (*destroy_session) (iscsi_sessionh_t session); 68 void (*destroy_session) (struct Scsi_Host *shost);
58 iscsi_connh_t (*create_conn) (iscsi_sessionh_t session, uint32_t cid); 69 struct iscsi_cls_conn *(*create_conn) (struct Scsi_Host *shost,
70 uint32_t cid);
59 int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn, 71 int (*bind_conn) (iscsi_sessionh_t session, iscsi_connh_t conn,
60 uint32_t transport_fd, int is_leading); 72 uint32_t transport_fd, int is_leading);
61 int (*start_conn) (iscsi_connh_t conn); 73 int (*start_conn) (iscsi_connh_t conn);
62 void (*stop_conn) (iscsi_connh_t conn, int flag); 74 void (*stop_conn) (iscsi_connh_t conn, int flag);
63 void (*destroy_conn) (iscsi_connh_t conn); 75 void (*destroy_conn) (struct iscsi_cls_conn *conn);
64 int (*set_param) (iscsi_connh_t conn, enum iscsi_param param, 76 int (*set_param) (iscsi_connh_t conn, enum iscsi_param param,
65 uint32_t value); 77 uint32_t value);
66 int (*get_param) (iscsi_connh_t conn, enum iscsi_param param, 78 int (*get_conn_param) (void *conndata, enum iscsi_param param,
67 uint32_t *value); 79 uint32_t *value);
80 int (*get_session_param) (struct Scsi_Host *shost,
81 enum iscsi_param param, uint32_t *value);
68 int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr, 82 int (*send_pdu) (iscsi_connh_t conn, struct iscsi_hdr *hdr,
69 char *data, uint32_t data_size); 83 char *data, uint32_t data_size);
70 void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats); 84 void (*get_stats) (iscsi_connh_t conn, struct iscsi_stats *stats);
@@ -73,7 +87,7 @@ struct iscsi_transport {
73/* 87/*
74 * transport registration upcalls 88 * transport registration upcalls
75 */ 89 */
76extern int iscsi_register_transport(struct iscsi_transport *tt); 90extern struct scsi_transport_template *iscsi_register_transport(struct iscsi_transport *tt);
77extern int iscsi_unregister_transport(struct iscsi_transport *tt); 91extern int iscsi_unregister_transport(struct iscsi_transport *tt);
78 92
79/* 93/*
@@ -83,4 +97,49 @@ extern void iscsi_conn_error(iscsi_connh_t conn, enum iscsi_err error);
83extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr, 97extern int iscsi_recv_pdu(iscsi_connh_t conn, struct iscsi_hdr *hdr,
84 char *data, uint32_t data_size); 98 char *data, uint32_t data_size);
85 99
100struct iscsi_cls_conn {
101 struct list_head conn_list; /* item in connlist */
102 void *dd_data; /* LLD private data */
103 struct iscsi_transport *transport;
104 iscsi_connh_t connh;
105 int active; /* must be accessed with the connlock */
106 struct device dev; /* sysfs transport/container device */
107 struct mempool_zone *z_error;
108 struct mempool_zone *z_pdu;
109 struct list_head freequeue;
110};
111
112#define iscsi_dev_to_conn(_dev) \
113 container_of(_dev, struct iscsi_cls_conn, dev)
114
115struct iscsi_cls_session {
116 struct list_head list; /* item in session_list */
117 struct iscsi_transport *transport;
118 struct device dev; /* sysfs transport/container device */
119};
120
121#define iscsi_dev_to_session(_dev) \
122 container_of(_dev, struct iscsi_cls_session, dev)
123
124#define iscsi_session_to_shost(_session) \
125 dev_to_shost(_session->dev.parent)
126
127/*
128 * session and connection functions that can be used by HW iSCSI LLDs
129 */
130extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
131 struct iscsi_transport *t);
132extern int iscsi_destroy_session(struct iscsi_cls_session *session);
133extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess,
134 uint32_t cid);
135extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
136
137/*
138 * session functions used by software iscsi
139 */
140extern struct Scsi_Host *
141iscsi_transport_create_session(struct scsi_transport_template *scsit,
142 struct iscsi_transport *transport);
143extern int iscsi_transport_destroy_session(struct Scsi_Host *shost);
144
86#endif 145#endif
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index 54a89611e9c5..2b5930ba69ec 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -54,7 +54,7 @@ struct spi_transport_attrs {
54 unsigned int support_qas; /* supports quick arbitration and selection */ 54 unsigned int support_qas; /* supports quick arbitration and selection */
55 /* Private Fields */ 55 /* Private Fields */
56 unsigned int dv_pending:1; /* Internal flag */ 56 unsigned int dv_pending:1; /* Internal flag */
57 struct semaphore dv_sem; /* semaphore to serialise dv */ 57 struct mutex dv_mutex; /* semaphore to serialise dv */
58}; 58};
59 59
60enum spi_signal_type { 60enum spi_signal_type {