aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/Kbuild1
-rw-r--r--include/scsi/iscsi_if.h117
-rw-r--r--include/scsi/libfc.h3
-rw-r--r--include/scsi/libiscsi.h1
-rw-r--r--include/scsi/libsas.h4
-rw-r--r--include/scsi/osd_protocol.h2
-rw-r--r--include/scsi/sas.h22
-rw-r--r--include/scsi/sas_ata.h4
-rw-r--r--include/scsi/scsi_device.h16
-rw-r--r--include/scsi/scsi_host.h6
-rw-r--r--include/scsi/scsi_transport_iscsi.h147
-rw-r--r--include/scsi/scsi_transport_sas.h7
12 files changed, 300 insertions, 30 deletions
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild
deleted file mode 100644
index 562ff9d591b8..000000000000
--- a/include/scsi/Kbuild
+++ /dev/null
@@ -1 +0,0 @@
1header-y += fc/
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 917741bb8e11..fe7f06c86f68 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -63,6 +63,12 @@ enum iscsi_uevent_e {
63 ISCSI_UEVENT_PING = UEVENT_BASE + 22, 63 ISCSI_UEVENT_PING = UEVENT_BASE + 22,
64 ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23, 64 ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23,
65 ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24, 65 ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24,
66 ISCSI_UEVENT_SET_FLASHNODE_PARAMS = UEVENT_BASE + 25,
67 ISCSI_UEVENT_NEW_FLASHNODE = UEVENT_BASE + 26,
68 ISCSI_UEVENT_DEL_FLASHNODE = UEVENT_BASE + 27,
69 ISCSI_UEVENT_LOGIN_FLASHNODE = UEVENT_BASE + 28,
70 ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29,
71 ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30,
66 72
67 /* up events */ 73 /* up events */
68 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 74 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -210,6 +216,31 @@ struct iscsi_uevent {
210 uint32_t host_no; 216 uint32_t host_no;
211 uint16_t chap_tbl_idx; 217 uint16_t chap_tbl_idx;
212 } delete_chap; 218 } delete_chap;
219 struct msg_set_flashnode_param {
220 uint32_t host_no;
221 uint32_t flashnode_idx;
222 uint32_t count;
223 } set_flashnode;
224 struct msg_new_flashnode {
225 uint32_t host_no;
226 uint32_t len;
227 } new_flashnode;
228 struct msg_del_flashnode {
229 uint32_t host_no;
230 uint32_t flashnode_idx;
231 } del_flashnode;
232 struct msg_login_flashnode {
233 uint32_t host_no;
234 uint32_t flashnode_idx;
235 } login_flashnode;
236 struct msg_logout_flashnode {
237 uint32_t host_no;
238 uint32_t flashnode_idx;
239 } logout_flashnode;
240 struct msg_logout_flashnode_sid {
241 uint32_t host_no;
242 uint32_t sid;
243 } logout_flashnode_sid;
213 } u; 244 } u;
214 union { 245 union {
215 /* messages k -> u */ 246 /* messages k -> u */
@@ -267,6 +298,9 @@ struct iscsi_uevent {
267 with each ping request */ 298 with each ping request */
268 uint32_t data_size; 299 uint32_t data_size;
269 } ping_comp; 300 } ping_comp;
301 struct msg_new_flashnode_ret {
302 uint32_t flashnode_idx;
303 } new_flashnode_ret;
270 } r; 304 } r;
271} __attribute__ ((aligned (sizeof(uint64_t)))); 305} __attribute__ ((aligned (sizeof(uint64_t))));
272 306
@@ -274,6 +308,7 @@ enum iscsi_param_type {
274 ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ 308 ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */
275 ISCSI_HOST_PARAM, /* iscsi_host_param */ 309 ISCSI_HOST_PARAM, /* iscsi_host_param */
276 ISCSI_NET_PARAM, /* iscsi_net_param */ 310 ISCSI_NET_PARAM, /* iscsi_net_param */
311 ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */
277}; 312};
278 313
279struct iscsi_iface_param_info { 314struct iscsi_iface_param_info {
@@ -469,6 +504,88 @@ enum iscsi_host_param {
469 ISCSI_HOST_PARAM_MAX, 504 ISCSI_HOST_PARAM_MAX,
470}; 505};
471 506
507/* portal type */
508#define PORTAL_TYPE_IPV4 "ipv4"
509#define PORTAL_TYPE_IPV6 "ipv6"
510
511/* iSCSI Flash Target params */
512enum iscsi_flashnode_param {
513 ISCSI_FLASHNODE_IS_FW_ASSIGNED_IPV6,
514 ISCSI_FLASHNODE_PORTAL_TYPE,
515 ISCSI_FLASHNODE_AUTO_SND_TGT_DISABLE,
516 ISCSI_FLASHNODE_DISCOVERY_SESS,
517 ISCSI_FLASHNODE_ENTRY_EN,
518 ISCSI_FLASHNODE_HDR_DGST_EN,
519 ISCSI_FLASHNODE_DATA_DGST_EN,
520 ISCSI_FLASHNODE_IMM_DATA_EN,
521 ISCSI_FLASHNODE_INITIAL_R2T_EN,
522 ISCSI_FLASHNODE_DATASEQ_INORDER,
523 ISCSI_FLASHNODE_PDU_INORDER,
524 ISCSI_FLASHNODE_CHAP_AUTH_EN,
525 ISCSI_FLASHNODE_SNACK_REQ_EN,
526 ISCSI_FLASHNODE_DISCOVERY_LOGOUT_EN,
527 ISCSI_FLASHNODE_BIDI_CHAP_EN,
528 /* make authentication for discovery sessions optional */
529 ISCSI_FLASHNODE_DISCOVERY_AUTH_OPTIONAL,
530 ISCSI_FLASHNODE_ERL,
531 ISCSI_FLASHNODE_TCP_TIMESTAMP_STAT,
532 ISCSI_FLASHNODE_TCP_NAGLE_DISABLE,
533 ISCSI_FLASHNODE_TCP_WSF_DISABLE,
534 ISCSI_FLASHNODE_TCP_TIMER_SCALE,
535 ISCSI_FLASHNODE_TCP_TIMESTAMP_EN,
536 ISCSI_FLASHNODE_IP_FRAG_DISABLE,
537 ISCSI_FLASHNODE_MAX_RECV_DLENGTH,
538 ISCSI_FLASHNODE_MAX_XMIT_DLENGTH,
539 ISCSI_FLASHNODE_FIRST_BURST,
540 ISCSI_FLASHNODE_DEF_TIME2WAIT,
541 ISCSI_FLASHNODE_DEF_TIME2RETAIN,
542 ISCSI_FLASHNODE_MAX_R2T,
543 ISCSI_FLASHNODE_KEEPALIVE_TMO,
544 ISCSI_FLASHNODE_ISID,
545 ISCSI_FLASHNODE_TSID,
546 ISCSI_FLASHNODE_PORT,
547 ISCSI_FLASHNODE_MAX_BURST,
548 ISCSI_FLASHNODE_DEF_TASKMGMT_TMO,
549 ISCSI_FLASHNODE_IPADDR,
550 ISCSI_FLASHNODE_ALIAS,
551 ISCSI_FLASHNODE_REDIRECT_IPADDR,
552 ISCSI_FLASHNODE_MAX_SEGMENT_SIZE,
553 ISCSI_FLASHNODE_LOCAL_PORT,
554 ISCSI_FLASHNODE_IPV4_TOS,
555 ISCSI_FLASHNODE_IPV6_TC,
556 ISCSI_FLASHNODE_IPV6_FLOW_LABEL,
557 ISCSI_FLASHNODE_NAME,
558 ISCSI_FLASHNODE_TPGT,
559 ISCSI_FLASHNODE_LINK_LOCAL_IPV6,
560 ISCSI_FLASHNODE_DISCOVERY_PARENT_IDX,
561 ISCSI_FLASHNODE_DISCOVERY_PARENT_TYPE,
562 ISCSI_FLASHNODE_TCP_XMIT_WSF,
563 ISCSI_FLASHNODE_TCP_RECV_WSF,
564 ISCSI_FLASHNODE_CHAP_IN_IDX,
565 ISCSI_FLASHNODE_CHAP_OUT_IDX,
566 ISCSI_FLASHNODE_USERNAME,
567 ISCSI_FLASHNODE_USERNAME_IN,
568 ISCSI_FLASHNODE_PASSWORD,
569 ISCSI_FLASHNODE_PASSWORD_IN,
570 ISCSI_FLASHNODE_STATSN,
571 ISCSI_FLASHNODE_EXP_STATSN,
572 ISCSI_FLASHNODE_IS_BOOT_TGT,
573
574 ISCSI_FLASHNODE_MAX,
575};
576
577struct iscsi_flashnode_param_info {
578 uint32_t len; /* Actual length of the param */
579 uint16_t param; /* iscsi param value */
580 uint8_t value[0]; /* length sized value follows */
581} __packed;
582
583enum iscsi_discovery_parent_type {
584 ISCSI_DISC_PARENT_UNKNOWN = 0x1,
585 ISCSI_DISC_PARENT_SENDTGT = 0x2,
586 ISCSI_DISC_PARENT_ISNS = 0x3,
587};
588
472/* iSCSI port Speed */ 589/* iSCSI port Speed */
473enum iscsi_port_speed { 590enum iscsi_port_speed {
474 ISCSI_PORT_SPEED_UNKNOWN = 0x1, 591 ISCSI_PORT_SPEED_UNKNOWN = 0x1,
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 399162b50a8d..e1379b4e8faf 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -1074,7 +1074,8 @@ void fc_rport_terminate_io(struct fc_rport *);
1074/* 1074/*
1075 * DISCOVERY LAYER 1075 * DISCOVERY LAYER
1076 *****************************/ 1076 *****************************/
1077int fc_disc_init(struct fc_lport *); 1077void fc_disc_init(struct fc_lport *);
1078void fc_disc_config(struct fc_lport *, void *);
1078 1079
1079static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc) 1080static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc)
1080{ 1081{
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 6e33386a3898..09c041e6c35f 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -427,6 +427,7 @@ extern void iscsi_complete_scsi_task(struct iscsi_task *task,
427 */ 427 */
428extern void iscsi_pool_free(struct iscsi_pool *); 428extern void iscsi_pool_free(struct iscsi_pool *);
429extern int iscsi_pool_init(struct iscsi_pool *, int, void ***, int); 429extern int iscsi_pool_init(struct iscsi_pool *, int, void ***, int);
430extern int iscsi_switch_str_param(char **, char *);
430 431
431/* 432/*
432 * inline functions to deal with padding. 433 * inline functions to deal with padding.
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index ef937b56f9b5..e2c1e66d58ae 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -118,7 +118,7 @@ struct ex_phy {
118 118
119 enum ex_phy_state phy_state; 119 enum ex_phy_state phy_state;
120 120
121 enum sas_dev_type attached_dev_type; 121 enum sas_device_type attached_dev_type;
122 enum sas_linkrate linkrate; 122 enum sas_linkrate linkrate;
123 123
124 u8 attached_sata_host:1; 124 u8 attached_sata_host:1;
@@ -195,7 +195,7 @@ enum {
195 195
196struct domain_device { 196struct domain_device {
197 spinlock_t done_lock; 197 spinlock_t done_lock;
198 enum sas_dev_type dev_type; 198 enum sas_device_type dev_type;
199 199
200 enum sas_linkrate linkrate; 200 enum sas_linkrate linkrate;
201 enum sas_linkrate min_linkrate; 201 enum sas_linkrate min_linkrate;
diff --git a/include/scsi/osd_protocol.h b/include/scsi/osd_protocol.h
index a6026da25f3e..25ac6283b9c7 100644
--- a/include/scsi/osd_protocol.h
+++ b/include/scsi/osd_protocol.h
@@ -107,7 +107,7 @@ enum osd_attributes_mode {
107 * int exponent: 04; 107 * int exponent: 04;
108 * } 108 * }
109 */ 109 */
110typedef __be32 __bitwise osd_cdb_offset; 110typedef __be32 osd_cdb_offset;
111 111
112enum { 112enum {
113 OSD_OFFSET_UNUSED = 0xFFFFFFFF, 113 OSD_OFFSET_UNUSED = 0xFFFFFFFF,
diff --git a/include/scsi/sas.h b/include/scsi/sas.h
index be3eb0bf1ac0..0d2607d12387 100644
--- a/include/scsi/sas.h
+++ b/include/scsi/sas.h
@@ -90,16 +90,18 @@ enum sas_oob_mode {
90}; 90};
91 91
92/* See sas_discover.c if you plan on changing these */ 92/* See sas_discover.c if you plan on changing these */
93enum sas_dev_type { 93enum sas_device_type {
94 NO_DEVICE = 0, /* protocol */ 94 /* these are SAS protocol defined (attached device type field) */
95 SAS_END_DEV = 1, /* protocol */ 95 SAS_PHY_UNUSED = 0,
96 EDGE_DEV = 2, /* protocol */ 96 SAS_END_DEVICE = 1,
97 FANOUT_DEV = 3, /* protocol */ 97 SAS_EDGE_EXPANDER_DEVICE = 2,
98 SAS_HA = 4, 98 SAS_FANOUT_EXPANDER_DEVICE = 3,
99 SATA_DEV = 5, 99 /* these are internal to libsas */
100 SATA_PM = 7, 100 SAS_HA = 4,
101 SATA_PM_PORT= 8, 101 SAS_SATA_DEV = 5,
102 SATA_PENDING = 9, 102 SAS_SATA_PM = 7,
103 SAS_SATA_PM_PORT = 8,
104 SAS_SATA_PENDING = 9,
103}; 105};
104 106
105enum sas_protocol { 107enum sas_protocol {
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index ff71a5654684..00f41aeeecf5 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -32,8 +32,8 @@
32 32
33static inline int dev_is_sata(struct domain_device *dev) 33static inline int dev_is_sata(struct domain_device *dev)
34{ 34{
35 return dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM || 35 return dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM ||
36 dev->dev_type == SATA_PM_PORT || dev->dev_type == SATA_PENDING; 36 dev->dev_type == SAS_SATA_PM_PORT || dev->dev_type == SAS_SATA_PENDING;
37} 37}
38 38
39int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); 39int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index a7f9cba275e9..cc645876d147 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -394,10 +394,18 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
394 int data_direction, void *buffer, unsigned bufflen, 394 int data_direction, void *buffer, unsigned bufflen,
395 unsigned char *sense, int timeout, int retries, 395 unsigned char *sense, int timeout, int retries,
396 int flag, int *resid); 396 int flag, int *resid);
397extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, 397extern int scsi_execute_req_flags(struct scsi_device *sdev,
398 int data_direction, void *buffer, unsigned bufflen, 398 const unsigned char *cmd, int data_direction, void *buffer,
399 struct scsi_sense_hdr *, int timeout, int retries, 399 unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
400 int *resid); 400 int retries, int *resid, int flags);
401static inline int scsi_execute_req(struct scsi_device *sdev,
402 const unsigned char *cmd, int data_direction, void *buffer,
403 unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
404 int retries, int *resid)
405{
406 return scsi_execute_req_flags(sdev, cmd, data_direction, buffer,
407 bufflen, sshdr, timeout, retries, resid, 0);
408}
401extern void sdev_disable_disk_events(struct scsi_device *sdev); 409extern void sdev_disable_disk_events(struct scsi_device *sdev);
402extern void sdev_enable_disk_events(struct scsi_device *sdev); 410extern void sdev_enable_disk_events(struct scsi_device *sdev);
403 411
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 2b6956e9853d..755243572219 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -6,6 +6,7 @@
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#include <linux/mutex.h>
9#include <linux/seq_file.h>
9#include <scsi/scsi.h> 10#include <scsi/scsi.h>
10 11
11struct request_queue; 12struct request_queue;
@@ -340,7 +341,8 @@ struct scsi_host_template {
340 * 341 *
341 * Status: OBSOLETE 342 * Status: OBSOLETE
342 */ 343 */
343 int (*proc_info)(struct Scsi_Host *, char *, char **, off_t, int, int); 344 int (*show_info)(struct seq_file *, struct Scsi_Host *);
345 int (*write_info)(struct Scsi_Host *, char *, int);
344 346
345 /* 347 /*
346 * This is an optional routine that allows the transport to become 348 * This is an optional routine that allows the transport to become
@@ -375,7 +377,7 @@ struct scsi_host_template {
375 377
376 /* 378 /*
377 * Used to store the procfs directory if a driver implements the 379 * Used to store the procfs directory if a driver implements the
378 * proc_info method. 380 * show_info method.
379 */ 381 */
380 struct proc_dir_entry *proc_dir; 382 struct proc_dir_entry *proc_dir;
381 383
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 53f0b361d668..d0f1602985e7 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -39,6 +39,8 @@ struct iscsi_task;
39struct sockaddr; 39struct sockaddr;
40struct iscsi_iface; 40struct iscsi_iface;
41struct bsg_job; 41struct bsg_job;
42struct iscsi_bus_flash_session;
43struct iscsi_bus_flash_conn;
42 44
43/** 45/**
44 * struct iscsi_transport - iSCSI Transport template 46 * struct iscsi_transport - iSCSI Transport template
@@ -150,6 +152,19 @@ struct iscsi_transport {
150 int (*get_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx, 152 int (*get_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx,
151 uint32_t *num_entries, char *buf); 153 uint32_t *num_entries, char *buf);
152 int (*delete_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx); 154 int (*delete_chap) (struct Scsi_Host *shost, uint16_t chap_tbl_idx);
155 int (*get_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess,
156 int param, char *buf);
157 int (*set_flashnode_param) (struct iscsi_bus_flash_session *fnode_sess,
158 struct iscsi_bus_flash_conn *fnode_conn,
159 void *data, int len);
160 int (*new_flashnode) (struct Scsi_Host *shost, const char *buf,
161 int len);
162 int (*del_flashnode) (struct iscsi_bus_flash_session *fnode_sess);
163 int (*login_flashnode) (struct iscsi_bus_flash_session *fnode_sess,
164 struct iscsi_bus_flash_conn *fnode_conn);
165 int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess,
166 struct iscsi_bus_flash_conn *fnode_conn);
167 int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess);
153}; 168};
154 169
155/* 170/*
@@ -286,6 +301,112 @@ struct iscsi_iface {
286#define iscsi_iface_to_shost(_iface) \ 301#define iscsi_iface_to_shost(_iface) \
287 dev_to_shost(_iface->dev.parent) 302 dev_to_shost(_iface->dev.parent)
288 303
304
305struct iscsi_bus_flash_conn {
306 struct list_head conn_list; /* item in connlist */
307 void *dd_data; /* LLD private data */
308 struct iscsi_transport *transport;
309 struct device dev; /* sysfs transport/container device */
310 /* iscsi connection parameters */
311 uint32_t exp_statsn;
312 uint32_t statsn;
313 unsigned max_recv_dlength; /* initiator_max_recv_dsl*/
314 unsigned max_xmit_dlength; /* target_max_recv_dsl */
315 unsigned max_segment_size;
316 unsigned tcp_xmit_wsf;
317 unsigned tcp_recv_wsf;
318 int hdrdgst_en;
319 int datadgst_en;
320 int port;
321 char *ipaddress;
322 char *link_local_ipv6_addr;
323 char *redirect_ipaddr;
324 uint16_t keepalive_timeout;
325 uint16_t local_port;
326 uint8_t snack_req_en;
327 /* tcp timestamp negotiation status */
328 uint8_t tcp_timestamp_stat;
329 uint8_t tcp_nagle_disable;
330 /* tcp window scale factor */
331 uint8_t tcp_wsf_disable;
332 uint8_t tcp_timer_scale;
333 uint8_t tcp_timestamp_en;
334 uint8_t ipv4_tos;
335 uint8_t ipv6_traffic_class;
336 uint8_t ipv6_flow_label;
337 uint8_t fragment_disable;
338 /* Link local IPv6 address is assigned by firmware or driver */
339 uint8_t is_fw_assigned_ipv6;
340};
341
342#define iscsi_dev_to_flash_conn(_dev) \
343 container_of(_dev, struct iscsi_bus_flash_conn, dev)
344
345#define iscsi_flash_conn_to_flash_session(_conn) \
346 iscsi_dev_to_flash_session(_conn->dev.parent)
347
348#define ISID_SIZE 6
349
350struct iscsi_bus_flash_session {
351 struct list_head sess_list; /* item in session_list */
352 struct iscsi_transport *transport;
353 unsigned int target_id;
354 int flash_state; /* persistent or non-persistent */
355 void *dd_data; /* LLD private data */
356 struct device dev; /* sysfs transport/container device */
357 /* iscsi session parameters */
358 unsigned first_burst;
359 unsigned max_burst;
360 unsigned short max_r2t;
361 int default_taskmgmt_timeout;
362 int initial_r2t_en;
363 int imm_data_en;
364 int time2wait;
365 int time2retain;
366 int pdu_inorder_en;
367 int dataseq_inorder_en;
368 int erl;
369 int tpgt;
370 char *username;
371 char *username_in;
372 char *password;
373 char *password_in;
374 char *targetname;
375 char *targetalias;
376 char *portal_type;
377 uint16_t tsid;
378 uint16_t chap_in_idx;
379 uint16_t chap_out_idx;
380 /* index of iSCSI discovery session if the entry is
381 * discovered by iSCSI discovery session
382 */
383 uint16_t discovery_parent_idx;
384 /* indicates if discovery was done through iSNS discovery service
385 * or through sendTarget */
386 uint16_t discovery_parent_type;
387 /* Firmware auto sendtarget discovery disable */
388 uint8_t auto_snd_tgt_disable;
389 uint8_t discovery_sess;
390 /* indicates if this flashnode entry is enabled or disabled */
391 uint8_t entry_state;
392 uint8_t chap_auth_en;
393 /* enables firmware to auto logout the discovery session on discovery
394 * completion
395 */
396 uint8_t discovery_logout_en;
397 uint8_t bidi_chap_en;
398 /* makes authentication for discovery session optional */
399 uint8_t discovery_auth_optional;
400 uint8_t isid[ISID_SIZE];
401 uint8_t is_boot_target;
402};
403
404#define iscsi_dev_to_flash_session(_dev) \
405 container_of(_dev, struct iscsi_bus_flash_session, dev)
406
407#define iscsi_flash_session_to_shost(_session) \
408 dev_to_shost(_session->dev.parent)
409
289/* 410/*
290 * session and connection functions that can be used by HW iSCSI LLDs 411 * session and connection functions that can be used by HW iSCSI LLDs
291 */ 412 */
@@ -330,4 +451,30 @@ extern char *iscsi_get_port_speed_name(struct Scsi_Host *shost);
330extern char *iscsi_get_port_state_name(struct Scsi_Host *shost); 451extern char *iscsi_get_port_state_name(struct Scsi_Host *shost);
331extern int iscsi_is_session_dev(const struct device *dev); 452extern int iscsi_is_session_dev(const struct device *dev);
332 453
454extern char *iscsi_get_discovery_parent_name(int parent_type);
455extern struct device *
456iscsi_find_flashnode(struct Scsi_Host *shost, void *data,
457 int (*fn)(struct device *dev, void *data));
458
459extern struct iscsi_bus_flash_session *
460iscsi_create_flashnode_sess(struct Scsi_Host *shost, int index,
461 struct iscsi_transport *transport, int dd_size);
462
463extern struct iscsi_bus_flash_conn *
464iscsi_create_flashnode_conn(struct Scsi_Host *shost,
465 struct iscsi_bus_flash_session *fnode_sess,
466 struct iscsi_transport *transport, int dd_size);
467
468extern void
469iscsi_destroy_flashnode_sess(struct iscsi_bus_flash_session *fnode_sess);
470
471extern void iscsi_destroy_all_flashnode(struct Scsi_Host *shost);
472extern int iscsi_flashnode_bus_match(struct device *dev,
473 struct device_driver *drv);
474extern struct device *
475iscsi_find_flashnode_sess(struct Scsi_Host *shost, void *data,
476 int (*fn)(struct device *dev, void *data));
477extern struct device *
478iscsi_find_flashnode_conn(struct iscsi_bus_flash_session *fnode_sess);
479
333#endif 480#endif
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 9b8e08879cfc..0bd71e2702e3 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -10,13 +10,6 @@ struct scsi_transport_template;
10struct sas_rphy; 10struct sas_rphy;
11struct request; 11struct request;
12 12
13enum sas_device_type {
14 SAS_PHY_UNUSED = 0,
15 SAS_END_DEVICE = 1,
16 SAS_EDGE_EXPANDER_DEVICE = 2,
17 SAS_FANOUT_EXPANDER_DEVICE = 3,
18};
19
20static inline int sas_protocol_ata(enum sas_protocol proto) 13static inline int sas_protocol_ata(enum sas_protocol proto)
21{ 14{
22 return ((proto & SAS_PROTOCOL_SATA) || 15 return ((proto & SAS_PROTOCOL_SATA) ||