diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 19:44:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 19:44:18 -0400 |
commit | ec7ae517537ae5c7b0b2cd7f562dfa3e7a05b954 (patch) | |
tree | e6b0c64a51a7c0aa0efd09d4f7a80872e3b1657a /include/scsi | |
parent | 97d2eb13a019ec09cc1a7ea2d3705c0b117b3c0d (diff) | |
parent | 590134fa78fbdbe5fea78c7ae0b2c3364bc9572f (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (204 commits)
[SCSI] qla4xxx: export address/port of connection (fix udev disk names)
[SCSI] ipr: Fix BUG on adapter dump timeout
[SCSI] megaraid_sas: Fix instance access in megasas_reset_timer
[SCSI] hpsa: change confusing message to be more clear
[SCSI] iscsi class: fix vlan configuration
[SCSI] qla4xxx: fix data alignment and use nl helpers
[SCSI] iscsi class: fix link local mispelling
[SCSI] iscsi class: Replace iscsi_get_next_target_id with IDA
[SCSI] aacraid: use lower snprintf() limit
[SCSI] lpfc 8.3.27: Change driver version to 8.3.27
[SCSI] lpfc 8.3.27: T10 additions for SLI4
[SCSI] lpfc 8.3.27: Fix queue allocation failure recovery
[SCSI] lpfc 8.3.27: Change algorithm for getting physical port name
[SCSI] lpfc 8.3.27: Changed worst case mailbox timeout
[SCSI] lpfc 8.3.27: Miscellanous logic and interface fixes
[SCSI] megaraid_sas: Changelog and version update
[SCSI] megaraid_sas: Add driver workaround for PERC5/1068 kdump kernel panic
[SCSI] megaraid_sas: Add multiple MSI-X vector/multiple reply queue support
[SCSI] megaraid_sas: Add support for MegaRAID 9360/9380 12GB/s controllers
[SCSI] megaraid_sas: Clear FUSION_IN_RESET before enabling interrupts
...
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 135 | ||||
-rw-r--r-- | include/scsi/libfc.h | 76 | ||||
-rw-r--r-- | include/scsi/libfcoe.h | 5 | ||||
-rw-r--r-- | include/scsi/libsas.h | 54 | ||||
-rw-r--r-- | include/scsi/sas.h | 24 | ||||
-rw-r--r-- | include/scsi/scsi_bsg_iscsi.h | 110 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 6 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 16 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 47 |
9 files changed, 356 insertions, 117 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index ddb04568a509..2703e3bedbf5 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -59,6 +59,7 @@ enum iscsi_uevent_e { | |||
59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, | 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, |
60 | 60 | ||
61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, |
62 | ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, | ||
62 | 63 | ||
63 | /* up events */ | 64 | /* up events */ |
64 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 65 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
@@ -70,6 +71,7 @@ enum iscsi_uevent_e { | |||
70 | 71 | ||
71 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, | 72 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, |
72 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, | 73 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, |
74 | ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, | ||
73 | }; | 75 | }; |
74 | 76 | ||
75 | enum iscsi_tgt_dscvr { | 77 | enum iscsi_tgt_dscvr { |
@@ -172,6 +174,10 @@ struct iscsi_uevent { | |||
172 | struct msg_set_path { | 174 | struct msg_set_path { |
173 | uint32_t host_no; | 175 | uint32_t host_no; |
174 | } set_path; | 176 | } set_path; |
177 | struct msg_set_iface_params { | ||
178 | uint32_t host_no; | ||
179 | uint32_t count; | ||
180 | } set_iface_params; | ||
175 | } u; | 181 | } u; |
176 | union { | 182 | union { |
177 | /* messages k -> u */ | 183 | /* messages k -> u */ |
@@ -193,6 +199,11 @@ struct iscsi_uevent { | |||
193 | uint32_t cid; | 199 | uint32_t cid; |
194 | uint64_t recv_handle; | 200 | uint64_t recv_handle; |
195 | } recv_req; | 201 | } recv_req; |
202 | struct msg_conn_login { | ||
203 | uint32_t sid; | ||
204 | uint32_t cid; | ||
205 | uint32_t state; /* enum iscsi_conn_state */ | ||
206 | } conn_login; | ||
196 | struct msg_conn_error { | 207 | struct msg_conn_error { |
197 | uint32_t sid; | 208 | uint32_t sid; |
198 | uint32_t cid; | 209 | uint32_t cid; |
@@ -214,6 +225,21 @@ struct iscsi_uevent { | |||
214 | } r; | 225 | } r; |
215 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 226 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
216 | 227 | ||
228 | enum iscsi_param_type { | ||
229 | ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ | ||
230 | ISCSI_HOST_PARAM, /* iscsi_host_param */ | ||
231 | ISCSI_NET_PARAM, /* iscsi_net_param */ | ||
232 | }; | ||
233 | |||
234 | struct iscsi_iface_param_info { | ||
235 | uint32_t iface_num; /* iface number, 0 - n */ | ||
236 | uint32_t len; /* Actual length of the param */ | ||
237 | uint16_t param; /* iscsi param value */ | ||
238 | uint8_t iface_type; /* IPv4 or IPv6 */ | ||
239 | uint8_t param_type; /* iscsi_param_type */ | ||
240 | uint8_t value[0]; /* length sized value follows */ | ||
241 | } __packed; | ||
242 | |||
217 | /* | 243 | /* |
218 | * To keep the struct iscsi_uevent size the same for userspace code | 244 | * To keep the struct iscsi_uevent size the same for userspace code |
219 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and | 245 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and |
@@ -237,6 +263,71 @@ struct iscsi_path { | |||
237 | uint16_t pmtu; | 263 | uint16_t pmtu; |
238 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 264 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
239 | 265 | ||
266 | /* iscsi iface enabled/disabled setting */ | ||
267 | #define ISCSI_IFACE_DISABLE 0x01 | ||
268 | #define ISCSI_IFACE_ENABLE 0x02 | ||
269 | |||
270 | /* ipv4 bootproto */ | ||
271 | #define ISCSI_BOOTPROTO_STATIC 0x01 | ||
272 | #define ISCSI_BOOTPROTO_DHCP 0x02 | ||
273 | |||
274 | /* ipv6 addr autoconfig type */ | ||
275 | #define ISCSI_IPV6_AUTOCFG_DISABLE 0x01 | ||
276 | #define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02 | ||
277 | #define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03 | ||
278 | |||
279 | /* ipv6 link local addr type */ | ||
280 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01 | ||
281 | #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02 | ||
282 | |||
283 | /* ipv6 router addr type */ | ||
284 | #define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01 | ||
285 | #define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02 | ||
286 | |||
287 | #define ISCSI_IFACE_TYPE_IPV4 0x01 | ||
288 | #define ISCSI_IFACE_TYPE_IPV6 0x02 | ||
289 | |||
290 | #define ISCSI_MAX_VLAN_ID 4095 | ||
291 | #define ISCSI_MAX_VLAN_PRIORITY 7 | ||
292 | |||
293 | /* iscsi vlan enable/disabled setting */ | ||
294 | #define ISCSI_VLAN_DISABLE 0x01 | ||
295 | #define ISCSI_VLAN_ENABLE 0x02 | ||
296 | |||
297 | /* iSCSI network params */ | ||
298 | enum iscsi_net_param { | ||
299 | ISCSI_NET_PARAM_IPV4_ADDR = 1, | ||
300 | ISCSI_NET_PARAM_IPV4_SUBNET = 2, | ||
301 | ISCSI_NET_PARAM_IPV4_GW = 3, | ||
302 | ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, | ||
303 | ISCSI_NET_PARAM_MAC = 5, | ||
304 | ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, | ||
305 | ISCSI_NET_PARAM_IPV6_ADDR = 7, | ||
306 | ISCSI_NET_PARAM_IPV6_ROUTER = 8, | ||
307 | ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, | ||
308 | ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, | ||
309 | ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, | ||
310 | ISCSI_NET_PARAM_IFACE_ENABLE = 12, | ||
311 | ISCSI_NET_PARAM_VLAN_ID = 13, | ||
312 | ISCSI_NET_PARAM_VLAN_PRIORITY = 14, | ||
313 | ISCSI_NET_PARAM_VLAN_ENABLED = 15, | ||
314 | ISCSI_NET_PARAM_VLAN_TAG = 16, | ||
315 | ISCSI_NET_PARAM_IFACE_TYPE = 17, | ||
316 | ISCSI_NET_PARAM_IFACE_NAME = 18, | ||
317 | ISCSI_NET_PARAM_MTU = 19, | ||
318 | ISCSI_NET_PARAM_PORT = 20, | ||
319 | }; | ||
320 | |||
321 | enum iscsi_conn_state { | ||
322 | ISCSI_CONN_STATE_FREE, | ||
323 | ISCSI_CONN_STATE_XPT_WAIT, | ||
324 | ISCSI_CONN_STATE_IN_LOGIN, | ||
325 | ISCSI_CONN_STATE_LOGGED_IN, | ||
326 | ISCSI_CONN_STATE_IN_LOGOUT, | ||
327 | ISCSI_CONN_STATE_LOGOUT_REQUESTED, | ||
328 | ISCSI_CONN_STATE_CLEANUP_WAIT, | ||
329 | }; | ||
330 | |||
240 | /* | 331 | /* |
241 | * Common error codes | 332 | * Common error codes |
242 | */ | 333 | */ |
@@ -319,44 +410,6 @@ enum iscsi_param { | |||
319 | ISCSI_PARAM_MAX, | 410 | ISCSI_PARAM_MAX, |
320 | }; | 411 | }; |
321 | 412 | ||
322 | #define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH) | ||
323 | #define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH) | ||
324 | #define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN) | ||
325 | #define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN) | ||
326 | #define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN) | ||
327 | #define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T) | ||
328 | #define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN) | ||
329 | #define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST) | ||
330 | #define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST) | ||
331 | #define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN) | ||
332 | #define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN) | ||
333 | #define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL) | ||
334 | #define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN) | ||
335 | #define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN) | ||
336 | #define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN) | ||
337 | #define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME) | ||
338 | #define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT) | ||
339 | #define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS) | ||
340 | #define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT) | ||
341 | #define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO) | ||
342 | #define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT) | ||
343 | #define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS) | ||
344 | #define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME) | ||
345 | #define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN) | ||
346 | #define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD) | ||
347 | #define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN) | ||
348 | #define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT) | ||
349 | #define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO) | ||
350 | #define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO) | ||
351 | #define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO) | ||
352 | #define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO) | ||
353 | #define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO) | ||
354 | #define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) | ||
355 | #define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) | ||
356 | #define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) | ||
357 | #define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO) | ||
358 | #define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS) | ||
359 | |||
360 | /* iSCSI HBA params */ | 413 | /* iSCSI HBA params */ |
361 | enum iscsi_host_param { | 414 | enum iscsi_host_param { |
362 | ISCSI_HOST_PARAM_HWADDRESS, | 415 | ISCSI_HOST_PARAM_HWADDRESS, |
@@ -366,11 +419,6 @@ enum iscsi_host_param { | |||
366 | ISCSI_HOST_PARAM_MAX, | 419 | ISCSI_HOST_PARAM_MAX, |
367 | }; | 420 | }; |
368 | 421 | ||
369 | #define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS) | ||
370 | #define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME) | ||
371 | #define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME) | ||
372 | #define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS) | ||
373 | |||
374 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) | 422 | #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) |
375 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) | 423 | #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) |
376 | 424 | ||
@@ -392,6 +440,7 @@ enum iscsi_host_param { | |||
392 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ | 440 | #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ |
393 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, | 441 | #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, |
394 | and verification */ | 442 | and verification */ |
443 | #define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */ | ||
395 | 444 | ||
396 | /* | 445 | /* |
397 | * These flags describes reason of stop_conn() call | 446 | * These flags describes reason of stop_conn() call |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 7d96829b0c00..5d1a758e0595 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -281,9 +281,6 @@ struct fc_seq_els_data { | |||
281 | * @timer: The command timer | 281 | * @timer: The command timer |
282 | * @tm_done: Completion indicator | 282 | * @tm_done: Completion indicator |
283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) | 283 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) |
284 | * @start_time: Timestamp indicating the start of the I/O (in jiffies) | ||
285 | * @end_time: Timestamp indicating the end of the I/O (in jiffies) | ||
286 | * @last_pkt_time: Timestamp of the last frame received (in jiffies) | ||
287 | * @data_len: The length of the data | 284 | * @data_len: The length of the data |
288 | * @cdb_cmd: The CDB command | 285 | * @cdb_cmd: The CDB command |
289 | * @xfer_len: The transfer length | 286 | * @xfer_len: The transfer length |
@@ -304,50 +301,46 @@ struct fc_seq_els_data { | |||
304 | * @recov_seq: The sequence for REC or SRR | 301 | * @recov_seq: The sequence for REC or SRR |
305 | */ | 302 | */ |
306 | struct fc_fcp_pkt { | 303 | struct fc_fcp_pkt { |
307 | /* Housekeeping information */ | ||
308 | struct fc_lport *lp; | ||
309 | u16 state; | ||
310 | atomic_t ref_cnt; | ||
311 | spinlock_t scsi_pkt_lock; | 304 | spinlock_t scsi_pkt_lock; |
305 | atomic_t ref_cnt; | ||
306 | |||
307 | /* SCSI command and data transfer information */ | ||
308 | u32 data_len; | ||
312 | 309 | ||
313 | /* SCSI I/O related information */ | 310 | /* SCSI I/O related information */ |
314 | struct scsi_cmnd *cmd; | 311 | struct scsi_cmnd *cmd; |
315 | struct list_head list; | 312 | struct list_head list; |
316 | 313 | ||
317 | /* Timeout related information */ | 314 | /* Housekeeping information */ |
318 | struct timer_list timer; | 315 | struct fc_lport *lp; |
319 | struct completion tm_done; | 316 | u8 state; |
320 | int wait_for_comp; | ||
321 | unsigned long start_time; | ||
322 | unsigned long end_time; | ||
323 | unsigned long last_pkt_time; | ||
324 | |||
325 | /* SCSI command and data transfer information */ | ||
326 | u32 data_len; | ||
327 | |||
328 | /* Transport related veriables */ | ||
329 | struct fcp_cmnd cdb_cmd; | ||
330 | size_t xfer_len; | ||
331 | u16 xfer_ddp; | ||
332 | u32 xfer_contig_end; | ||
333 | u16 max_payload; | ||
334 | 317 | ||
335 | /* SCSI/FCP return status */ | 318 | /* SCSI/FCP return status */ |
336 | u32 io_status; | ||
337 | u8 cdb_status; | 319 | u8 cdb_status; |
338 | u8 status_code; | 320 | u8 status_code; |
339 | u8 scsi_comp_flags; | 321 | u8 scsi_comp_flags; |
322 | u32 io_status; | ||
340 | u32 req_flags; | 323 | u32 req_flags; |
341 | u32 scsi_resid; | 324 | u32 scsi_resid; |
342 | 325 | ||
326 | /* Transport related veriables */ | ||
327 | size_t xfer_len; | ||
328 | struct fcp_cmnd cdb_cmd; | ||
329 | u32 xfer_contig_end; | ||
330 | u16 max_payload; | ||
331 | u16 xfer_ddp; | ||
332 | |||
343 | /* Associated structures */ | 333 | /* Associated structures */ |
344 | struct fc_rport *rport; | 334 | struct fc_rport *rport; |
345 | struct fc_seq *seq_ptr; | 335 | struct fc_seq *seq_ptr; |
346 | 336 | ||
347 | /* Error Processing information */ | 337 | /* Timeout/error related information */ |
348 | u8 recov_retry; | 338 | struct timer_list timer; |
339 | int wait_for_comp; | ||
340 | u32 recov_retry; | ||
349 | struct fc_seq *recov_seq; | 341 | struct fc_seq *recov_seq; |
350 | }; | 342 | struct completion tm_done; |
343 | } ____cacheline_aligned_in_smp; | ||
351 | 344 | ||
352 | /* | 345 | /* |
353 | * Structure and function definitions for managing Fibre Channel Exchanges | 346 | * Structure and function definitions for managing Fibre Channel Exchanges |
@@ -413,35 +406,32 @@ struct fc_seq { | |||
413 | * sequence allocation | 406 | * sequence allocation |
414 | */ | 407 | */ |
415 | struct fc_exch { | 408 | struct fc_exch { |
409 | spinlock_t ex_lock; | ||
410 | atomic_t ex_refcnt; | ||
411 | enum fc_class class; | ||
416 | struct fc_exch_mgr *em; | 412 | struct fc_exch_mgr *em; |
417 | struct fc_exch_pool *pool; | 413 | struct fc_exch_pool *pool; |
418 | u32 state; | ||
419 | u16 xid; | ||
420 | struct list_head ex_list; | 414 | struct list_head ex_list; |
421 | spinlock_t ex_lock; | ||
422 | atomic_t ex_refcnt; | ||
423 | struct delayed_work timeout_work; | ||
424 | struct fc_lport *lp; | 415 | struct fc_lport *lp; |
416 | u32 esb_stat; | ||
417 | u8 state; | ||
418 | u8 fh_type; | ||
419 | u8 seq_id; | ||
420 | u8 encaps; | ||
421 | u16 xid; | ||
425 | u16 oxid; | 422 | u16 oxid; |
426 | u16 rxid; | 423 | u16 rxid; |
427 | u32 oid; | 424 | u32 oid; |
428 | u32 sid; | 425 | u32 sid; |
429 | u32 did; | 426 | u32 did; |
430 | u32 esb_stat; | ||
431 | u32 r_a_tov; | 427 | u32 r_a_tov; |
432 | u8 seq_id; | ||
433 | u8 encaps; | ||
434 | u32 f_ctl; | 428 | u32 f_ctl; |
435 | u8 fh_type; | 429 | struct fc_seq seq; |
436 | enum fc_class class; | ||
437 | struct fc_seq seq; | ||
438 | |||
439 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); | 430 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); |
440 | void *arg; | 431 | void *arg; |
441 | |||
442 | void (*destructor)(struct fc_seq *, void *); | 432 | void (*destructor)(struct fc_seq *, void *); |
443 | 433 | struct delayed_work timeout_work; | |
444 | }; | 434 | } ____cacheline_aligned_in_smp; |
445 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) | 435 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) |
446 | 436 | ||
447 | 437 | ||
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index 8c1638b8c28e..d1e95c6ac776 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -229,6 +229,11 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *, | |||
229 | const struct libfc_function_template *, int init_fcp); | 229 | const struct libfc_function_template *, int init_fcp); |
230 | u32 fcoe_fc_crc(struct fc_frame *fp); | 230 | u32 fcoe_fc_crc(struct fc_frame *fp); |
231 | int fcoe_start_io(struct sk_buff *skb); | 231 | int fcoe_start_io(struct sk_buff *skb); |
232 | int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type); | ||
233 | void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb, | ||
234 | struct net_device *netdev); | ||
235 | void fcoe_wwn_to_str(u64 wwn, char *buf, int len); | ||
236 | int fcoe_validate_vport_create(struct fc_vport *vport); | ||
232 | 237 | ||
233 | /** | 238 | /** |
234 | * is_fip_mode() - returns true if FIP mode selected. | 239 | * is_fip_mode() - returns true if FIP mode selected. |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index ee866060f8a4..6a308d42d98f 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -142,8 +142,11 @@ struct expander_device { | |||
142 | u16 ex_change_count; | 142 | u16 ex_change_count; |
143 | u16 max_route_indexes; | 143 | u16 max_route_indexes; |
144 | u8 num_phys; | 144 | u8 num_phys; |
145 | |||
146 | u8 t2t_supp:1; | ||
145 | u8 configuring:1; | 147 | u8 configuring:1; |
146 | u8 conf_route_table:1; | 148 | u8 conf_route_table:1; |
149 | |||
147 | u8 enclosure_logical_id[8]; | 150 | u8 enclosure_logical_id[8]; |
148 | 151 | ||
149 | struct ex_phy *ex_phy; | 152 | struct ex_phy *ex_phy; |
@@ -386,6 +389,11 @@ sdev_to_domain_dev(struct scsi_device *sdev) { | |||
386 | return starget_to_domain_dev(sdev->sdev_target); | 389 | return starget_to_domain_dev(sdev->sdev_target); |
387 | } | 390 | } |
388 | 391 | ||
392 | static inline struct ata_device *sas_to_ata_dev(struct domain_device *dev) | ||
393 | { | ||
394 | return &dev->sata_dev.ap->link.device[0]; | ||
395 | } | ||
396 | |||
389 | static inline struct domain_device * | 397 | static inline struct domain_device * |
390 | cmd_to_domain_dev(struct scsi_cmnd *cmd) | 398 | cmd_to_domain_dev(struct scsi_cmnd *cmd) |
391 | { | 399 | { |
@@ -405,6 +413,20 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy) | |||
405 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; | 413 | phy->linkrate = SAS_LINK_RATE_UNKNOWN; |
406 | } | 414 | } |
407 | 415 | ||
416 | static inline unsigned int to_sas_gpio_od(int device, int bit) | ||
417 | { | ||
418 | return 3 * device + bit; | ||
419 | } | ||
420 | |||
421 | #ifdef CONFIG_SCSI_SAS_HOST_SMP | ||
422 | int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count); | ||
423 | #else | ||
424 | static inline int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count) | ||
425 | { | ||
426 | return -1; | ||
427 | } | ||
428 | #endif | ||
429 | |||
408 | /* ---------- Tasks ---------- */ | 430 | /* ---------- Tasks ---------- */ |
409 | /* | 431 | /* |
410 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | | 432 | service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | |
@@ -555,36 +577,14 @@ struct sas_task { | |||
555 | struct work_struct abort_work; | 577 | struct work_struct abort_work; |
556 | }; | 578 | }; |
557 | 579 | ||
558 | extern struct kmem_cache *sas_task_cache; | ||
559 | |||
560 | #define SAS_TASK_STATE_PENDING 1 | 580 | #define SAS_TASK_STATE_PENDING 1 |
561 | #define SAS_TASK_STATE_DONE 2 | 581 | #define SAS_TASK_STATE_DONE 2 |
562 | #define SAS_TASK_STATE_ABORTED 4 | 582 | #define SAS_TASK_STATE_ABORTED 4 |
563 | #define SAS_TASK_NEED_DEV_RESET 8 | 583 | #define SAS_TASK_NEED_DEV_RESET 8 |
564 | #define SAS_TASK_AT_INITIATOR 16 | 584 | #define SAS_TASK_AT_INITIATOR 16 |
565 | 585 | ||
566 | static inline struct sas_task *sas_alloc_task(gfp_t flags) | 586 | extern struct sas_task *sas_alloc_task(gfp_t flags); |
567 | { | 587 | extern void sas_free_task(struct sas_task *task); |
568 | struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); | ||
569 | |||
570 | if (task) { | ||
571 | INIT_LIST_HEAD(&task->list); | ||
572 | spin_lock_init(&task->task_state_lock); | ||
573 | task->task_state_flags = SAS_TASK_STATE_PENDING; | ||
574 | init_timer(&task->timer); | ||
575 | init_completion(&task->completion); | ||
576 | } | ||
577 | |||
578 | return task; | ||
579 | } | ||
580 | |||
581 | static inline void sas_free_task(struct sas_task *task) | ||
582 | { | ||
583 | if (task) { | ||
584 | BUG_ON(!list_empty(&task->list)); | ||
585 | kmem_cache_free(sas_task_cache, task); | ||
586 | } | ||
587 | } | ||
588 | 588 | ||
589 | struct sas_domain_function_template { | 589 | struct sas_domain_function_template { |
590 | /* The class calls these to notify the LLDD of an event. */ | 590 | /* The class calls these to notify the LLDD of an event. */ |
@@ -614,6 +614,10 @@ struct sas_domain_function_template { | |||
614 | 614 | ||
615 | /* Phy management */ | 615 | /* Phy management */ |
616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); | 616 | int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); |
617 | |||
618 | /* GPIO support */ | ||
619 | int (*lldd_write_gpio)(struct sas_ha_struct *, u8 reg_type, | ||
620 | u8 reg_index, u8 reg_count, u8 *write_data); | ||
617 | }; | 621 | }; |
618 | 622 | ||
619 | extern int sas_register_ha(struct sas_ha_struct *); | 623 | extern int sas_register_ha(struct sas_ha_struct *); |
@@ -652,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev); | |||
652 | int sas_discover_sata(struct domain_device *); | 656 | int sas_discover_sata(struct domain_device *); |
653 | int sas_discover_end_dev(struct domain_device *); | 657 | int sas_discover_end_dev(struct domain_device *); |
654 | 658 | ||
655 | void sas_unregister_dev(struct domain_device *); | 659 | void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *); |
656 | 660 | ||
657 | void sas_init_dev(struct domain_device *); | 661 | void sas_init_dev(struct domain_device *); |
658 | 662 | ||
diff --git a/include/scsi/sas.h b/include/scsi/sas.h index e9fd02281381..3673d685e6ad 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h | |||
@@ -108,6 +108,7 @@ enum sas_protocol { | |||
108 | SAS_PROTOCOL_STP = 0x04, | 108 | SAS_PROTOCOL_STP = 0x04, |
109 | SAS_PROTOCOL_SSP = 0x08, | 109 | SAS_PROTOCOL_SSP = 0x08, |
110 | SAS_PROTOCOL_ALL = 0x0E, | 110 | SAS_PROTOCOL_ALL = 0x0E, |
111 | SAS_PROTOCOL_STP_ALL = SAS_PROTOCOL_STP|SAS_PROTOCOL_SATA, | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | /* From the spec; local phys only */ | 114 | /* From the spec; local phys only */ |
@@ -121,6 +122,7 @@ enum phy_func { | |||
121 | PHY_FUNC_TX_SATA_PS_SIGNAL, | 122 | PHY_FUNC_TX_SATA_PS_SIGNAL, |
122 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ | 123 | PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ |
123 | PHY_FUNC_SET_LINK_RATE, | 124 | PHY_FUNC_SET_LINK_RATE, |
125 | PHY_FUNC_GET_EVENTS, | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. | 128 | /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. |
@@ -195,6 +197,14 @@ enum sas_open_rej_reason { | |||
195 | SAS_OREJ_RSVD_RETRY = 18, | 197 | SAS_OREJ_RSVD_RETRY = 18, |
196 | }; | 198 | }; |
197 | 199 | ||
200 | enum sas_gpio_reg_type { | ||
201 | SAS_GPIO_REG_CFG = 0, | ||
202 | SAS_GPIO_REG_RX = 1, | ||
203 | SAS_GPIO_REG_RX_GP = 2, | ||
204 | SAS_GPIO_REG_TX = 3, | ||
205 | SAS_GPIO_REG_TX_GP = 4, | ||
206 | }; | ||
207 | |||
198 | struct dev_to_host_fis { | 208 | struct dev_to_host_fis { |
199 | u8 fis_type; /* 0x34 */ | 209 | u8 fis_type; /* 0x34 */ |
200 | u8 flags; | 210 | u8 flags; |
@@ -341,7 +351,12 @@ struct report_general_resp { | |||
341 | 351 | ||
342 | u8 conf_route_table:1; | 352 | u8 conf_route_table:1; |
343 | u8 configuring:1; | 353 | u8 configuring:1; |
344 | u8 _r_b:6; | 354 | u8 config_others:1; |
355 | u8 orej_retry_supp:1; | ||
356 | u8 stp_cont_awt:1; | ||
357 | u8 self_config:1; | ||
358 | u8 zone_config:1; | ||
359 | u8 t2t_supp:1; | ||
345 | 360 | ||
346 | u8 _r_c; | 361 | u8 _r_c; |
347 | 362 | ||
@@ -528,7 +543,12 @@ struct report_general_resp { | |||
528 | u8 _r_a; | 543 | u8 _r_a; |
529 | u8 num_phys; | 544 | u8 num_phys; |
530 | 545 | ||
531 | u8 _r_b:6; | 546 | u8 t2t_supp:1; |
547 | u8 zone_config:1; | ||
548 | u8 self_config:1; | ||
549 | u8 stp_cont_awt:1; | ||
550 | u8 orej_retry_supp:1; | ||
551 | u8 config_others:1; | ||
532 | u8 configuring:1; | 552 | u8 configuring:1; |
533 | u8 conf_route_table:1; | 553 | u8 conf_route_table:1; |
534 | 554 | ||
diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h new file mode 100644 index 000000000000..fd5689d4c052 --- /dev/null +++ b/include/scsi/scsi_bsg_iscsi.h | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * iSCSI Transport BSG Interface | ||
3 | * | ||
4 | * Copyright (C) 2009 James Smart, Emulex Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef SCSI_BSG_ISCSI_H | ||
23 | #define SCSI_BSG_ISCSI_H | ||
24 | |||
25 | /* | ||
26 | * This file intended to be included by both kernel and user space | ||
27 | */ | ||
28 | |||
29 | #include <scsi/scsi.h> | ||
30 | |||
31 | /* | ||
32 | * iSCSI Transport SGIO v4 BSG Message Support | ||
33 | */ | ||
34 | |||
35 | /* Default BSG request timeout (in seconds) */ | ||
36 | #define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ) | ||
37 | |||
38 | |||
39 | /* | ||
40 | * Request Message Codes supported by the iSCSI Transport | ||
41 | */ | ||
42 | |||
43 | /* define the class masks for the message codes */ | ||
44 | #define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */ | ||
45 | #define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */ | ||
46 | |||
47 | /* iscsi host Message Codes */ | ||
48 | #define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF) | ||
49 | |||
50 | |||
51 | /* | ||
52 | * iSCSI Host Messages | ||
53 | */ | ||
54 | |||
55 | /* ISCSI_BSG_HST_VENDOR : */ | ||
56 | |||
57 | /* Request: | ||
58 | * Note: When specifying vendor_id, be sure to read the Vendor Type and ID | ||
59 | * formatting requirements specified in scsi_netlink.h | ||
60 | */ | ||
61 | struct iscsi_bsg_host_vendor { | ||
62 | /* | ||
63 | * Identifies the vendor that the message is formatted for. This | ||
64 | * should be the recipient of the message. | ||
65 | */ | ||
66 | uint64_t vendor_id; | ||
67 | |||
68 | /* start of vendor command area */ | ||
69 | uint32_t vendor_cmd[0]; | ||
70 | }; | ||
71 | |||
72 | /* Response: | ||
73 | */ | ||
74 | struct iscsi_bsg_host_vendor_reply { | ||
75 | /* start of vendor response area */ | ||
76 | uint32_t vendor_rsp[0]; | ||
77 | }; | ||
78 | |||
79 | |||
80 | /* request (CDB) structure of the sg_io_v4 */ | ||
81 | struct iscsi_bsg_request { | ||
82 | uint32_t msgcode; | ||
83 | union { | ||
84 | struct iscsi_bsg_host_vendor h_vendor; | ||
85 | } rqst_data; | ||
86 | } __attribute__((packed)); | ||
87 | |||
88 | |||
89 | /* response (request sense data) structure of the sg_io_v4 */ | ||
90 | struct iscsi_bsg_reply { | ||
91 | /* | ||
92 | * The completion result. Result exists in two forms: | ||
93 | * if negative, it is an -Exxx system errno value. There will | ||
94 | * be no further reply information supplied. | ||
95 | * else, it's the 4-byte scsi error result, with driver, host, | ||
96 | * msg and status fields. The per-msgcode reply structure | ||
97 | * will contain valid data. | ||
98 | */ | ||
99 | uint32_t result; | ||
100 | |||
101 | /* If there was reply_payload, how much was recevied ? */ | ||
102 | uint32_t reply_payload_rcv_len; | ||
103 | |||
104 | union { | ||
105 | struct iscsi_bsg_host_vendor_reply vendor_reply; | ||
106 | } reply_data; | ||
107 | }; | ||
108 | |||
109 | |||
110 | #endif /* SCSI_BSG_ISCSI_H */ | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3ca90c3..5591ed54dc93 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -197,6 +197,7 @@ struct scsi_device_handler { | |||
197 | int (*activate)(struct scsi_device *, activate_complete, void *); | 197 | int (*activate)(struct scsi_device *, activate_complete, void *); |
198 | int (*prep_fn)(struct scsi_device *, struct request *); | 198 | int (*prep_fn)(struct scsi_device *, struct request *); |
199 | int (*set_params)(struct scsi_device *, const char *); | 199 | int (*set_params)(struct scsi_device *, const char *); |
200 | bool (*match)(struct scsi_device *); | ||
200 | }; | 201 | }; |
201 | 202 | ||
202 | struct scsi_dh_data { | 203 | struct scsi_dh_data { |
@@ -471,6 +472,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev) | |||
471 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); | 472 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
472 | } | 473 | } |
473 | 474 | ||
475 | static inline int scsi_device_tpgs(struct scsi_device *sdev) | ||
476 | { | ||
477 | return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; | ||
478 | } | ||
479 | |||
474 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ | 480 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ |
475 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") | 481 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") |
476 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" | 482 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index f1f2644137b8..50266c9405fc 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -355,6 +355,19 @@ struct scsi_host_template { | |||
355 | */ | 355 | */ |
356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); | 356 | enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); |
357 | 357 | ||
358 | /* This is an optional routine that allows transport to initiate | ||
359 | * LLD adapter or firmware reset using sysfs attribute. | ||
360 | * | ||
361 | * Return values: 0 on success, -ve value on failure. | ||
362 | * | ||
363 | * Status: OPTIONAL | ||
364 | */ | ||
365 | |||
366 | int (*host_reset)(struct Scsi_Host *shost, int reset_type); | ||
367 | #define SCSI_ADAPTER_RESET 1 | ||
368 | #define SCSI_FIRMWARE_RESET 2 | ||
369 | |||
370 | |||
358 | /* | 371 | /* |
359 | * Name of proc directory | 372 | * Name of proc directory |
360 | */ | 373 | */ |
@@ -791,7 +804,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) | |||
791 | **/ | 804 | **/ |
792 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) | 805 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) |
793 | { | 806 | { |
794 | return shost->shost_state == SHOST_RUNNING; | 807 | return shost->shost_state == SHOST_RUNNING || |
808 | shost->shost_state == SHOST_RECOVERY; | ||
795 | } | 809 | } |
796 | 810 | ||
797 | extern void scsi_unblock_requests(struct Scsi_Host *); | 811 | extern void scsi_unblock_requests(struct Scsi_Host *); |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index bf8f52965675..5994bcc1b017 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -37,6 +37,8 @@ struct iscsi_cls_conn; | |||
37 | struct iscsi_conn; | 37 | struct iscsi_conn; |
38 | struct iscsi_task; | 38 | struct iscsi_task; |
39 | struct sockaddr; | 39 | struct sockaddr; |
40 | struct iscsi_iface; | ||
41 | struct bsg_job; | ||
40 | 42 | ||
41 | /** | 43 | /** |
42 | * struct iscsi_transport - iSCSI Transport template | 44 | * struct iscsi_transport - iSCSI Transport template |
@@ -84,9 +86,7 @@ struct iscsi_transport { | |||
84 | struct module *owner; | 86 | struct module *owner; |
85 | char *name; | 87 | char *name; |
86 | unsigned int caps; | 88 | unsigned int caps; |
87 | /* LLD sets this to indicate what values it can export to sysfs */ | 89 | |
88 | uint64_t param_mask; | ||
89 | uint64_t host_param_mask; | ||
90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, | 90 | struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, |
91 | uint16_t cmds_max, uint16_t qdepth, | 91 | uint16_t cmds_max, uint16_t qdepth, |
92 | uint32_t sn); | 92 | uint32_t sn); |
@@ -137,6 +137,13 @@ struct iscsi_transport { | |||
137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, | 137 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, |
138 | uint32_t enable, struct sockaddr *dst_addr); | 138 | uint32_t enable, struct sockaddr *dst_addr); |
139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); | 139 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); |
140 | int (*set_iface_param) (struct Scsi_Host *shost, void *data, | ||
141 | uint32_t len); | ||
142 | int (*get_iface_param) (struct iscsi_iface *iface, | ||
143 | enum iscsi_param_type param_type, | ||
144 | int param, char *buf); | ||
145 | mode_t (*attr_is_visible)(int param_type, int param); | ||
146 | int (*bsg_request)(struct bsg_job *job); | ||
140 | }; | 147 | }; |
141 | 148 | ||
142 | /* | 149 | /* |
@@ -150,6 +157,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt); | |||
150 | */ | 157 | */ |
151 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, | 158 | extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, |
152 | enum iscsi_err error); | 159 | enum iscsi_err error); |
160 | extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn, | ||
161 | enum iscsi_conn_state state); | ||
153 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 162 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
154 | char *data, uint32_t data_size); | 163 | char *data, uint32_t data_size); |
155 | 164 | ||
@@ -171,6 +180,9 @@ struct iscsi_cls_conn { | |||
171 | #define iscsi_dev_to_conn(_dev) \ | 180 | #define iscsi_dev_to_conn(_dev) \ |
172 | container_of(_dev, struct iscsi_cls_conn, dev) | 181 | container_of(_dev, struct iscsi_cls_conn, dev) |
173 | 182 | ||
183 | #define transport_class_to_conn(_cdev) \ | ||
184 | iscsi_dev_to_conn(_cdev->parent) | ||
185 | |||
174 | #define iscsi_conn_to_session(_conn) \ | 186 | #define iscsi_conn_to_session(_conn) \ |
175 | iscsi_dev_to_session(_conn->dev.parent) | 187 | iscsi_dev_to_session(_conn->dev.parent) |
176 | 188 | ||
@@ -197,6 +209,7 @@ struct iscsi_cls_session { | |||
197 | struct delayed_work recovery_work; | 209 | struct delayed_work recovery_work; |
198 | 210 | ||
199 | unsigned int target_id; | 211 | unsigned int target_id; |
212 | bool ida_used; | ||
200 | 213 | ||
201 | int state; | 214 | int state; |
202 | int sid; /* session id */ | 215 | int sid; /* session id */ |
@@ -207,6 +220,9 @@ struct iscsi_cls_session { | |||
207 | #define iscsi_dev_to_session(_dev) \ | 220 | #define iscsi_dev_to_session(_dev) \ |
208 | container_of(_dev, struct iscsi_cls_session, dev) | 221 | container_of(_dev, struct iscsi_cls_session, dev) |
209 | 222 | ||
223 | #define transport_class_to_session(_cdev) \ | ||
224 | iscsi_dev_to_session(_cdev->parent) | ||
225 | |||
210 | #define iscsi_session_to_shost(_session) \ | 226 | #define iscsi_session_to_shost(_session) \ |
211 | dev_to_shost(_session->dev.parent) | 227 | dev_to_shost(_session->dev.parent) |
212 | 228 | ||
@@ -216,8 +232,12 @@ struct iscsi_cls_session { | |||
216 | struct iscsi_cls_host { | 232 | struct iscsi_cls_host { |
217 | atomic_t nr_scans; | 233 | atomic_t nr_scans; |
218 | struct mutex mutex; | 234 | struct mutex mutex; |
235 | struct request_queue *bsg_q; | ||
219 | }; | 236 | }; |
220 | 237 | ||
238 | #define iscsi_job_to_shost(_job) \ | ||
239 | dev_to_shost(_job->dev) | ||
240 | |||
221 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, | 241 | extern void iscsi_host_for_each_session(struct Scsi_Host *shost, |
222 | void (*fn)(struct iscsi_cls_session *)); | 242 | void (*fn)(struct iscsi_cls_session *)); |
223 | 243 | ||
@@ -228,6 +248,20 @@ struct iscsi_endpoint { | |||
228 | struct iscsi_cls_conn *conn; | 248 | struct iscsi_cls_conn *conn; |
229 | }; | 249 | }; |
230 | 250 | ||
251 | struct iscsi_iface { | ||
252 | struct device dev; | ||
253 | struct iscsi_transport *transport; | ||
254 | uint32_t iface_type; /* IPv4 or IPv6 */ | ||
255 | uint32_t iface_num; /* iface number, 0 - n */ | ||
256 | void *dd_data; /* LLD private data */ | ||
257 | }; | ||
258 | |||
259 | #define iscsi_dev_to_iface(_dev) \ | ||
260 | container_of(_dev, struct iscsi_iface, dev) | ||
261 | |||
262 | #define iscsi_iface_to_shost(_iface) \ | ||
263 | dev_to_shost(_iface->dev.parent) | ||
264 | |||
231 | /* | 265 | /* |
232 | * session and connection functions that can be used by HW iSCSI LLDs | 266 | * session and connection functions that can be used by HW iSCSI LLDs |
233 | */ | 267 | */ |
@@ -238,6 +272,7 @@ struct iscsi_endpoint { | |||
238 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) | 272 | dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) |
239 | 273 | ||
240 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); | 274 | extern int iscsi_session_chkready(struct iscsi_cls_session *session); |
275 | extern int iscsi_is_session_online(struct iscsi_cls_session *session); | ||
241 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, | 276 | extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, |
242 | struct iscsi_transport *transport, int dd_size); | 277 | struct iscsi_transport *transport, int dd_size); |
243 | extern int iscsi_add_session(struct iscsi_cls_session *session, | 278 | extern int iscsi_add_session(struct iscsi_cls_session *session, |
@@ -261,5 +296,11 @@ extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size); | |||
261 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); | 296 | extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); |
262 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); | 297 | extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); |
263 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); | 298 | extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); |
299 | extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost, | ||
300 | struct iscsi_transport *t, | ||
301 | uint32_t iface_type, | ||
302 | uint32_t iface_num, int dd_size); | ||
303 | extern void iscsi_destroy_iface(struct iscsi_iface *iface); | ||
304 | extern struct iscsi_iface *iscsi_lookup_iface(int handle); | ||
264 | 305 | ||
265 | #endif | 306 | #endif |