aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libiscsi.c97
-rw-r--r--include/scsi/libiscsi.h31
2 files changed, 128 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index ae69dfcc7834..86153e087e81 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2812,6 +2812,8 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
2812 kfree(session->boot_nic); 2812 kfree(session->boot_nic);
2813 kfree(session->boot_target); 2813 kfree(session->boot_target);
2814 kfree(session->ifacename); 2814 kfree(session->ifacename);
2815 kfree(session->portal_type);
2816 kfree(session->discovery_parent_type);
2815 2817
2816 iscsi_destroy_session(cls_session); 2818 iscsi_destroy_session(cls_session);
2817 iscsi_host_dec_session_cnt(shost); 2819 iscsi_host_dec_session_cnt(shost);
@@ -3257,6 +3259,11 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
3257 return iscsi_switch_str_param(&session->boot_nic, buf); 3259 return iscsi_switch_str_param(&session->boot_nic, buf);
3258 case ISCSI_PARAM_BOOT_TARGET: 3260 case ISCSI_PARAM_BOOT_TARGET:
3259 return iscsi_switch_str_param(&session->boot_target, buf); 3261 return iscsi_switch_str_param(&session->boot_target, buf);
3262 case ISCSI_PARAM_PORTAL_TYPE:
3263 return iscsi_switch_str_param(&session->portal_type, buf);
3264 case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
3265 return iscsi_switch_str_param(&session->discovery_parent_type,
3266 buf);
3260 default: 3267 default:
3261 return -ENOSYS; 3268 return -ENOSYS;
3262 } 3269 }
@@ -3343,6 +3350,51 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session,
3343 break; 3350 break;
3344 case ISCSI_PARAM_BOOT_TARGET: 3351 case ISCSI_PARAM_BOOT_TARGET:
3345 len = sprintf(buf, "%s\n", session->boot_target); 3352 len = sprintf(buf, "%s\n", session->boot_target);
3353 case ISCSI_PARAM_AUTO_SND_TGT_DISABLE:
3354 len = sprintf(buf, "%u\n", session->auto_snd_tgt_disable);
3355 break;
3356 case ISCSI_PARAM_DISCOVERY_SESS:
3357 len = sprintf(buf, "%u\n", session->discovery_sess);
3358 break;
3359 case ISCSI_PARAM_PORTAL_TYPE:
3360 len = sprintf(buf, "%s\n", session->portal_type);
3361 break;
3362 case ISCSI_PARAM_CHAP_AUTH_EN:
3363 len = sprintf(buf, "%u\n", session->chap_auth_en);
3364 break;
3365 case ISCSI_PARAM_DISCOVERY_LOGOUT_EN:
3366 len = sprintf(buf, "%u\n", session->discovery_logout_en);
3367 break;
3368 case ISCSI_PARAM_BIDI_CHAP_EN:
3369 len = sprintf(buf, "%u\n", session->bidi_chap_en);
3370 break;
3371 case ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL:
3372 len = sprintf(buf, "%u\n", session->discovery_auth_optional);
3373 break;
3374 case ISCSI_PARAM_DEF_TIME2WAIT:
3375 len = sprintf(buf, "%d\n", session->time2wait);
3376 break;
3377 case ISCSI_PARAM_DEF_TIME2RETAIN:
3378 len = sprintf(buf, "%d\n", session->time2retain);
3379 break;
3380 case ISCSI_PARAM_TSID:
3381 len = sprintf(buf, "%u\n", session->tsid);
3382 break;
3383 case ISCSI_PARAM_ISID:
3384 len = sprintf(buf, "%02x%02x%02x%02x%02x%02x\n",
3385 session->isid[0], session->isid[1],
3386 session->isid[2], session->isid[3],
3387 session->isid[4], session->isid[5]);
3388 break;
3389 case ISCSI_PARAM_DISCOVERY_PARENT_IDX:
3390 len = sprintf(buf, "%u\n", session->discovery_parent_idx);
3391 break;
3392 case ISCSI_PARAM_DISCOVERY_PARENT_TYPE:
3393 if (session->discovery_parent_type)
3394 len = sprintf(buf, "%s\n",
3395 session->discovery_parent_type);
3396 else
3397 len = sprintf(buf, "\n");
3346 break; 3398 break;
3347 default: 3399 default:
3348 return -ENOSYS; 3400 return -ENOSYS;
@@ -3433,6 +3485,51 @@ int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
3433 case ISCSI_PARAM_PERSISTENT_ADDRESS: 3485 case ISCSI_PARAM_PERSISTENT_ADDRESS:
3434 len = sprintf(buf, "%s\n", conn->persistent_address); 3486 len = sprintf(buf, "%s\n", conn->persistent_address);
3435 break; 3487 break;
3488 case ISCSI_PARAM_STATSN:
3489 len = sprintf(buf, "%u\n", conn->statsn);
3490 break;
3491 case ISCSI_PARAM_MAX_SEGMENT_SIZE:
3492 len = sprintf(buf, "%u\n", conn->max_segment_size);
3493 break;
3494 case ISCSI_PARAM_KEEPALIVE_TMO:
3495 len = sprintf(buf, "%u\n", conn->keepalive_tmo);
3496 break;
3497 case ISCSI_PARAM_LOCAL_PORT:
3498 len = sprintf(buf, "%u\n", conn->local_port);
3499 break;
3500 case ISCSI_PARAM_TCP_TIMESTAMP_STAT:
3501 len = sprintf(buf, "%u\n", conn->tcp_timestamp_stat);
3502 break;
3503 case ISCSI_PARAM_TCP_NAGLE_DISABLE:
3504 len = sprintf(buf, "%u\n", conn->tcp_nagle_disable);
3505 break;
3506 case ISCSI_PARAM_TCP_WSF_DISABLE:
3507 len = sprintf(buf, "%u\n", conn->tcp_wsf_disable);
3508 break;
3509 case ISCSI_PARAM_TCP_TIMER_SCALE:
3510 len = sprintf(buf, "%u\n", conn->tcp_timer_scale);
3511 break;
3512 case ISCSI_PARAM_TCP_TIMESTAMP_EN:
3513 len = sprintf(buf, "%u\n", conn->tcp_timestamp_en);
3514 break;
3515 case ISCSI_PARAM_IP_FRAGMENT_DISABLE:
3516 len = sprintf(buf, "%u\n", conn->fragment_disable);
3517 break;
3518 case ISCSI_PARAM_IPV4_TOS:
3519 len = sprintf(buf, "%u\n", conn->ipv4_tos);
3520 break;
3521 case ISCSI_PARAM_IPV6_TC:
3522 len = sprintf(buf, "%u\n", conn->ipv6_traffic_class);
3523 break;
3524 case ISCSI_PARAM_IS_FW_ASSIGNED_IPV6:
3525 len = sprintf(buf, "%u\n", conn->is_fw_assigned_ipv6);
3526 break;
3527 case ISCSI_PARAM_TCP_XMIT_WSF:
3528 len = sprintf(buf, "%u\n", conn->tcp_xmit_wsf);
3529 break;
3530 case ISCSI_PARAM_TCP_RECV_WSF:
3531 len = sprintf(buf, "%u\n", conn->tcp_recv_wsf);
3532 break;
3436 default: 3533 default:
3437 return -ENOSYS; 3534 return -ENOSYS;
3438 } 3535 }
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 4265a4bb83cd..6ac9e17acdc4 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -62,6 +62,8 @@ enum {
62 TMF_NOT_FOUND, 62 TMF_NOT_FOUND,
63}; 63};
64 64
65#define ISID_SIZE 6
66
65/* Connection suspend "bit" */ 67/* Connection suspend "bit" */
66#define ISCSI_SUSPEND_BIT 1 68#define ISCSI_SUSPEND_BIT 1
67 69
@@ -173,6 +175,7 @@ struct iscsi_conn {
173 175
174 /* iSCSI connection-wide sequencing */ 176 /* iSCSI connection-wide sequencing */
175 uint32_t exp_statsn; 177 uint32_t exp_statsn;
178 uint32_t statsn;
176 179
177 /* control data */ 180 /* control data */
178 int id; /* CID */ 181 int id; /* CID */
@@ -213,6 +216,22 @@ struct iscsi_conn {
213 int persistent_port; 216 int persistent_port;
214 char *persistent_address; 217 char *persistent_address;
215 218
219 unsigned max_segment_size;
220 unsigned tcp_xmit_wsf;
221 unsigned tcp_recv_wsf;
222 uint16_t keepalive_tmo;
223 uint16_t local_port;
224 uint8_t tcp_timestamp_stat;
225 uint8_t tcp_nagle_disable;
226 uint8_t tcp_wsf_disable;
227 uint8_t tcp_timer_scale;
228 uint8_t tcp_timestamp_en;
229 uint8_t fragment_disable;
230 uint8_t ipv4_tos;
231 uint8_t ipv6_traffic_class;
232 uint8_t ipv6_flow_label;
233 uint8_t is_fw_assigned_ipv6;
234
216 /* MIB-statistics */ 235 /* MIB-statistics */
217 uint64_t txdata_octets; 236 uint64_t txdata_octets;
218 uint64_t rxdata_octets; 237 uint64_t rxdata_octets;
@@ -290,6 +309,18 @@ struct iscsi_session {
290 char *boot_root; 309 char *boot_root;
291 char *boot_nic; 310 char *boot_nic;
292 char *boot_target; 311 char *boot_target;
312 char *portal_type;
313 char *discovery_parent_type;
314 uint16_t discovery_parent_idx;
315 uint16_t def_taskmgmt_tmo;
316 uint16_t tsid;
317 uint8_t auto_snd_tgt_disable;
318 uint8_t discovery_sess;
319 uint8_t chap_auth_en;
320 uint8_t discovery_logout_en;
321 uint8_t bidi_chap_en;
322 uint8_t discovery_auth_optional;
323 uint8_t isid[ISID_SIZE];
293 324
294 /* control data */ 325 /* control data */
295 struct iscsi_transport *tt; 326 struct iscsi_transport *tt;