aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-04 00:27:18 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-04 00:27:18 -0400
commitf7d57e42e7ebd085133506ef6325e70e822196dc (patch)
tree1851633f96b1eeaac58edcff94669bed3921dec7 /include
parent51bece910d2b0aca64cd3dee9fa2a8aa7feeadd9 (diff)
parentc4e00fac42f268ed0a547cdd1d12bb8399864040 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (57 commits) [SCSI] fix error handling in scsi_io_completion [SCSI] qla1280: fix section mismatch warnings [SCSI] mptsas: eliminate ghost devices [SCSI] qla2xxx: make some more functions static [SCSI] small whitespace cleanup for qlogic driver [SCSI] mptbase: mpt_interrupt should return IRQ_NONE [SCSI] mptsas: make two functions static [SCSI] sg.c: Fix bad error handling in [SCSI] 53c700: fix breakage caused by the autosense update [SCSI] iscsi: add async notification of session events [SCSI] iscsi: pass target nr to session creation [SCSI] iscsi: break up session creation into two stages [SCSI] iscsi: rm channel usage from iscsi [SCSI] iscsi: fix session refcouting [SCSI] iscsi: convert iscsi_tcp to new set/get param fns [SCSI] iscsi: convert iser to new set/get param fns [SCSI] iscsi: fixup set/get param functions [SCSI] iscsi: add target discvery event to transport class [SCSI] st: remove unused st_buffer.in_use [SCSI] atp870u: reduce huge stack usage ...
Diffstat (limited to 'include')
-rw-r--r--include/scsi/iscsi_if.h24
-rw-r--r--include/scsi/libiscsi.h15
-rw-r--r--include/scsi/scsi_cmnd.h2
-rw-r--r--include/scsi/scsi_host.h6
-rw-r--r--include/scsi/scsi_transport_iscsi.h48
-rw-r--r--include/scsi/scsi_transport_sas.h37
6 files changed, 101 insertions, 31 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 253797c60095..55ebf035e620 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -47,10 +47,19 @@ enum iscsi_uevent_e {
47 ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13, 47 ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13,
48 ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, 48 ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14,
49 49
50 ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15,
51
50 /* up events */ 52 /* up events */
51 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 53 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
52 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, 54 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2,
53 ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3, 55 ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3,
56 ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4,
57};
58
59enum iscsi_tgt_dscvr {
60 ISCSI_TGT_DSCVR_SEND_TARGETS = 1,
61 ISCSI_TGT_DSCVR_ISNS = 2,
62 ISCSI_TGT_DSCVR_SLP = 3,
54}; 63};
55 64
56struct iscsi_uevent { 65struct iscsi_uevent {
@@ -116,6 +125,17 @@ struct iscsi_uevent {
116 struct msg_transport_disconnect { 125 struct msg_transport_disconnect {
117 uint64_t ep_handle; 126 uint64_t ep_handle;
118 } ep_disconnect; 127 } ep_disconnect;
128 struct msg_tgt_dscvr {
129 enum iscsi_tgt_dscvr type;
130 uint32_t host_no;
131 /*
132 * enable = 1 to establish a new connection
133 * with the server. enable = 0 to disconnect
134 * from the server. Used primarily to switch
135 * from one iSNS server to another.
136 */
137 uint32_t enable;
138 } tgt_dscvr;
119 } u; 139 } u;
120 union { 140 union {
121 /* messages k -> u */ 141 /* messages k -> u */
@@ -138,6 +158,10 @@ struct iscsi_uevent {
138 uint32_t cid; 158 uint32_t cid;
139 uint32_t error; /* enum iscsi_err */ 159 uint32_t error; /* enum iscsi_err */
140 } connerror; 160 } connerror;
161 struct msg_session_destroyed {
162 uint32_t host_no;
163 uint32_t sid;
164 } d_session;
141 struct msg_transport_connect_ret { 165 struct msg_transport_connect_ret {
142 uint64_t handle; 166 uint64_t handle;
143 } ep_connect_ret; 167 } ep_connect_ret;
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index cbf7e58bd6f9..ba2760802ded 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -157,6 +157,11 @@ struct iscsi_conn {
157 int max_xmit_dlength; /* target_max_recv_dsl */ 157 int max_xmit_dlength; /* target_max_recv_dsl */
158 int hdrdgst_en; 158 int hdrdgst_en;
159 int datadgst_en; 159 int datadgst_en;
160 int ifmarker_en;
161 int ofmarker_en;
162 /* values userspace uses to id a conn */
163 int persistent_port;
164 char *persistent_address;
160 165
161 /* MIB-statistics */ 166 /* MIB-statistics */
162 uint64_t txdata_octets; 167 uint64_t txdata_octets;
@@ -196,8 +201,8 @@ struct iscsi_session {
196 int pdu_inorder_en; 201 int pdu_inorder_en;
197 int dataseq_inorder_en; 202 int dataseq_inorder_en;
198 int erl; 203 int erl;
199 int ifmarker_en; 204 int tpgt;
200 int ofmarker_en; 205 char *targetname;
201 206
202 /* control data */ 207 /* control data */
203 struct iscsi_transport *tt; 208 struct iscsi_transport *tt;
@@ -240,6 +245,10 @@ iscsi_session_setup(struct iscsi_transport *, struct scsi_transport_template *,
240extern void iscsi_session_teardown(struct iscsi_cls_session *); 245extern void iscsi_session_teardown(struct iscsi_cls_session *);
241extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *); 246extern struct iscsi_session *class_to_transport_session(struct iscsi_cls_session *);
242extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); 247extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *);
248extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
249 enum iscsi_param param, char *buf, int buflen);
250extern int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
251 enum iscsi_param param, char *buf);
243 252
244#define session_to_cls(_sess) \ 253#define session_to_cls(_sess) \
245 hostdata_session(_sess->host->hostdata) 254 hostdata_session(_sess->host->hostdata)
@@ -255,6 +264,8 @@ extern void iscsi_conn_stop(struct iscsi_cls_conn *, int);
255extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *, 264extern int iscsi_conn_bind(struct iscsi_cls_session *, struct iscsi_cls_conn *,
256 int); 265 int);
257extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err); 266extern void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err);
267extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
268 enum iscsi_param param, char *buf);
258 269
259/* 270/*
260 * pdu and task processing 271 * pdu and task processing
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index e46cd404bd7d..371f70d9aa92 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -143,7 +143,7 @@ struct scsi_cmnd {
143 143
144extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); 144extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
145extern void scsi_put_command(struct scsi_cmnd *); 145extern void scsi_put_command(struct scsi_cmnd *);
146extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 146extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
147extern void scsi_finish_command(struct scsi_cmnd *cmd); 147extern void scsi_finish_command(struct scsi_cmnd *cmd);
148extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd); 148extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
149 149
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index a42efd6e4be8..b3dd90f3e858 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -542,6 +542,9 @@ struct Scsi_Host {
542 */ 542 */
543 unsigned ordered_tag:1; 543 unsigned ordered_tag:1;
544 544
545 /* task mgmt function in progress */
546 unsigned tmf_in_progress:1;
547
545 /* 548 /*
546 * Optional work queue to be utilized by the transport 549 * Optional work queue to be utilized by the transport
547 */ 550 */
@@ -619,7 +622,8 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
619{ 622{
620 return shost->shost_state == SHOST_RECOVERY || 623 return shost->shost_state == SHOST_RECOVERY ||
621 shost->shost_state == SHOST_CANCEL_RECOVERY || 624 shost->shost_state == SHOST_CANCEL_RECOVERY ||
622 shost->shost_state == SHOST_DEL_RECOVERY; 625 shost->shost_state == SHOST_DEL_RECOVERY ||
626 shost->tmf_in_progress;
623} 627}
624 628
625extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); 629extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index b684426a5900..5a3df1d7085f 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -34,6 +34,7 @@ struct iscsi_cls_conn;
34struct iscsi_conn; 34struct iscsi_conn;
35struct iscsi_cmd_task; 35struct iscsi_cmd_task;
36struct iscsi_mgmt_task; 36struct iscsi_mgmt_task;
37struct sockaddr;
37 38
38/** 39/**
39 * struct iscsi_transport - iSCSI Transport template 40 * struct iscsi_transport - iSCSI Transport template
@@ -46,7 +47,12 @@ struct iscsi_mgmt_task;
46 * @bind_conn: associate this connection with existing iSCSI session 47 * @bind_conn: associate this connection with existing iSCSI session
47 * and specified transport descriptor 48 * and specified transport descriptor
48 * @destroy_conn: destroy inactive iSCSI connection 49 * @destroy_conn: destroy inactive iSCSI connection
49 * @set_param: set iSCSI Data-Path operational parameter 50 * @set_param: set iSCSI parameter. Return 0 on success, -ENODATA
51 * when param is not supported, and a -Exx value on other
52 * error.
53 * @get_param get iSCSI parameter. Must return number of bytes
54 * copied to buffer on success, -ENODATA when param
55 * is not supported, and a -Exx value on other error
50 * @start_conn: set connection to be operational 56 * @start_conn: set connection to be operational
51 * @stop_conn: suspend/recover/terminate connection 57 * @stop_conn: suspend/recover/terminate connection
52 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. 58 * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
@@ -97,15 +103,11 @@ struct iscsi_transport {
97 void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); 103 void (*stop_conn) (struct iscsi_cls_conn *conn, int flag);
98 void (*destroy_conn) (struct iscsi_cls_conn *conn); 104 void (*destroy_conn) (struct iscsi_cls_conn *conn);
99 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param, 105 int (*set_param) (struct iscsi_cls_conn *conn, enum iscsi_param param,
100 uint32_t value); 106 char *buf, int buflen);
101 int (*get_conn_param) (struct iscsi_cls_conn *conn, 107 int (*get_conn_param) (struct iscsi_cls_conn *conn,
102 enum iscsi_param param, uint32_t *value); 108 enum iscsi_param param, char *buf);
103 int (*get_session_param) (struct iscsi_cls_session *session, 109 int (*get_session_param) (struct iscsi_cls_session *session,
104 enum iscsi_param param, uint32_t *value); 110 enum iscsi_param param, char *buf);
105 int (*get_conn_str_param) (struct iscsi_cls_conn *conn,
106 enum iscsi_param param, char *buf);
107 int (*get_session_str_param) (struct iscsi_cls_session *session,
108 enum iscsi_param param, char *buf);
109 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 111 int (*send_pdu) (struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
110 char *data, uint32_t data_size); 112 char *data, uint32_t data_size);
111 void (*get_stats) (struct iscsi_cls_conn *conn, 113 void (*get_stats) (struct iscsi_cls_conn *conn,
@@ -127,6 +129,8 @@ struct iscsi_transport {
127 uint64_t *ep_handle); 129 uint64_t *ep_handle);
128 int (*ep_poll) (uint64_t ep_handle, int timeout_ms); 130 int (*ep_poll) (uint64_t ep_handle, int timeout_ms);
129 void (*ep_disconnect) (uint64_t ep_handle); 131 void (*ep_disconnect) (uint64_t ep_handle);
132 int (*tgt_dscvr) (enum iscsi_tgt_dscvr type, uint32_t host_no,
133 uint32_t enable, struct sockaddr *dst_addr);
130}; 134};
131 135
132/* 136/*
@@ -155,13 +159,6 @@ struct iscsi_cls_conn {
155 struct iscsi_transport *transport; 159 struct iscsi_transport *transport;
156 uint32_t cid; /* connection id */ 160 uint32_t cid; /* connection id */
157 161
158 /* portal/group values we got during discovery */
159 char *persistent_address;
160 int persistent_port;
161 /* portal/group values we are currently using */
162 char *address;
163 int port;
164
165 int active; /* must be accessed with the connlock */ 162 int active; /* must be accessed with the connlock */
166 struct device dev; /* sysfs transport/container device */ 163 struct device dev; /* sysfs transport/container device */
167 struct mempool_zone *z_error; 164 struct mempool_zone *z_error;
@@ -185,16 +182,11 @@ struct iscsi_cls_session {
185 struct list_head host_list; 182 struct list_head host_list;
186 struct iscsi_transport *transport; 183 struct iscsi_transport *transport;
187 184
188 /* iSCSI values used as unique id by userspace. */
189 char *targetname;
190 int tpgt;
191
192 /* recovery fields */ 185 /* recovery fields */
193 int recovery_tmo; 186 int recovery_tmo;
194 struct work_struct recovery_work; 187 struct work_struct recovery_work;
195 188
196 int target_id; 189 int target_id;
197 int channel;
198 190
199 int sid; /* session id */ 191 int sid; /* session id */
200 void *dd_data; /* LLD private data */ 192 void *dd_data; /* LLD private data */
@@ -207,8 +199,10 @@ struct iscsi_cls_session {
207#define iscsi_session_to_shost(_session) \ 199#define iscsi_session_to_shost(_session) \
208 dev_to_shost(_session->dev.parent) 200 dev_to_shost(_session->dev.parent)
209 201
202#define starget_to_session(_stgt) \
203 iscsi_dev_to_session(_stgt->dev.parent)
204
210struct iscsi_host { 205struct iscsi_host {
211 int next_target_id;
212 struct list_head sessions; 206 struct list_head sessions;
213 struct mutex mutex; 207 struct mutex mutex;
214}; 208};
@@ -216,8 +210,17 @@ struct iscsi_host {
216/* 210/*
217 * session and connection functions that can be used by HW iSCSI LLDs 211 * session and connection functions that can be used by HW iSCSI LLDs
218 */ 212 */
213extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
214 struct iscsi_transport *transport);
215extern int iscsi_add_session(struct iscsi_cls_session *session,
216 unsigned int target_id);
217extern int iscsi_if_create_session_done(struct iscsi_cls_conn *conn);
218extern int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn);
219extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, 219extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
220 struct iscsi_transport *t, int channel); 220 struct iscsi_transport *t,
221 unsigned int target_id);
222extern void iscsi_remove_session(struct iscsi_cls_session *session);
223extern void iscsi_free_session(struct iscsi_cls_session *session);
221extern int iscsi_destroy_session(struct iscsi_cls_session *session); 224extern int iscsi_destroy_session(struct iscsi_cls_session *session);
222extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess, 225extern struct iscsi_cls_conn *iscsi_create_conn(struct iscsi_cls_session *sess,
223 uint32_t cid); 226 uint32_t cid);
@@ -225,4 +228,5 @@ extern int iscsi_destroy_conn(struct iscsi_cls_conn *conn);
225extern void iscsi_unblock_session(struct iscsi_cls_session *session); 228extern void iscsi_unblock_session(struct iscsi_cls_session *session);
226extern void iscsi_block_session(struct iscsi_cls_session *session); 229extern void iscsi_block_session(struct iscsi_cls_session *session);
227 230
231
228#endif 232#endif
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 93cfb4bf4211..e3c503cd175e 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/transport_class.h> 4#include <linux/transport_class.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/mutex.h>
6 7
7struct scsi_transport_template; 8struct scsi_transport_template;
8struct sas_rphy; 9struct sas_rphy;
@@ -55,7 +56,6 @@ struct sas_phy {
55 enum sas_linkrate minimum_linkrate; 56 enum sas_linkrate minimum_linkrate;
56 enum sas_linkrate maximum_linkrate_hw; 57 enum sas_linkrate maximum_linkrate_hw;
57 enum sas_linkrate maximum_linkrate; 58 enum sas_linkrate maximum_linkrate;
58 u8 port_identifier;
59 59
60 /* internal state */ 60 /* internal state */
61 unsigned int local_attached : 1; 61 unsigned int local_attached : 1;
@@ -66,8 +66,8 @@ struct sas_phy {
66 u32 loss_of_dword_sync_count; 66 u32 loss_of_dword_sync_count;
67 u32 phy_reset_problem_count; 67 u32 phy_reset_problem_count;
68 68
69 /* the other end of the link */ 69 /* for the list of phys belonging to a port */
70 struct sas_rphy *rphy; 70 struct list_head port_siblings;
71}; 71};
72 72
73#define dev_to_phy(d) \ 73#define dev_to_phy(d) \
@@ -124,6 +124,24 @@ struct sas_expander_device {
124#define rphy_to_expander_device(r) \ 124#define rphy_to_expander_device(r) \
125 container_of((r), struct sas_expander_device, rphy) 125 container_of((r), struct sas_expander_device, rphy)
126 126
127struct sas_port {
128 struct device dev;
129
130 u8 port_identifier;
131 int num_phys;
132
133 /* the other end of the link */
134 struct sas_rphy *rphy;
135
136 struct mutex phy_list_mutex;
137 struct list_head phy_list;
138};
139
140#define dev_to_sas_port(d) \
141 container_of((d), struct sas_port, dev)
142#define transport_class_to_sas_port(cdev) \
143 dev_to_sas_port((cdev)->dev)
144
127/* The functions by which the transport class and the driver communicate */ 145/* The functions by which the transport class and the driver communicate */
128struct sas_function_template { 146struct sas_function_template {
129 int (*get_linkerrors)(struct sas_phy *); 147 int (*get_linkerrors)(struct sas_phy *);
@@ -133,6 +151,7 @@ struct sas_function_template {
133}; 151};
134 152
135 153
154void sas_remove_children(struct device *);
136extern void sas_remove_host(struct Scsi_Host *); 155extern void sas_remove_host(struct Scsi_Host *);
137 156
138extern struct sas_phy *sas_phy_alloc(struct device *, int); 157extern struct sas_phy *sas_phy_alloc(struct device *, int);
@@ -141,13 +160,21 @@ extern int sas_phy_add(struct sas_phy *);
141extern void sas_phy_delete(struct sas_phy *); 160extern void sas_phy_delete(struct sas_phy *);
142extern int scsi_is_sas_phy(const struct device *); 161extern int scsi_is_sas_phy(const struct device *);
143 162
144extern struct sas_rphy *sas_end_device_alloc(struct sas_phy *); 163extern struct sas_rphy *sas_end_device_alloc(struct sas_port *);
145extern struct sas_rphy *sas_expander_alloc(struct sas_phy *, enum sas_device_type); 164extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type);
146void sas_rphy_free(struct sas_rphy *); 165void sas_rphy_free(struct sas_rphy *);
147extern int sas_rphy_add(struct sas_rphy *); 166extern int sas_rphy_add(struct sas_rphy *);
148extern void sas_rphy_delete(struct sas_rphy *); 167extern void sas_rphy_delete(struct sas_rphy *);
149extern int scsi_is_sas_rphy(const struct device *); 168extern int scsi_is_sas_rphy(const struct device *);
150 169
170struct sas_port *sas_port_alloc(struct device *, int);
171int sas_port_add(struct sas_port *);
172void sas_port_free(struct sas_port *);
173void sas_port_delete(struct sas_port *);
174void sas_port_add_phy(struct sas_port *, struct sas_phy *);
175void sas_port_delete_phy(struct sas_port *, struct sas_phy *);
176int scsi_is_sas_port(const struct device *);
177
151extern struct scsi_transport_template * 178extern struct scsi_transport_template *
152sas_attach_transport(struct sas_function_template *); 179sas_attach_transport(struct sas_function_template *);
153extern void sas_release_transport(struct scsi_transport_template *); 180extern void sas_release_transport(struct scsi_transport_template *);