2 * Copyright (C) 2005 - 2015 Emulex
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation. The full GNU General
8 * Public License is included in this distribution in the file called COPYING.
10 * Written by: Jayamohan Kallickal (jayamohan.kallickal@avagotech.com)
12 * Contact Information:
13 * linux-drivers@avagotech.com
17 * Costa Mesa, CA 92626
20 #include <scsi/libiscsi.h>
21 #include <scsi/scsi_transport_iscsi.h>
22 #include <scsi/scsi_transport.h>
23 #include <scsi/scsi_cmnd.h>
24 #include <scsi/scsi_device.h>
25 #include <scsi/scsi_host.h>
26 #include <scsi/scsi_netlink.h>
27 #include <net/netlink.h>
28 #include <scsi/scsi.h>
32 extern struct iscsi_transport beiscsi_iscsi_transport;
35 * beiscsi_session_create - creates a new iscsi session
36 * @cmds_max: max commands supported
37 * @qdepth: max queue depth supported
38 * @initial_cmdsn: initial iscsi CMDSN
40 struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
45 struct Scsi_Host *shost;
46 struct beiscsi_endpoint *beiscsi_ep;
47 struct iscsi_cls_session *cls_session;
48 struct beiscsi_hba *phba;
49 struct iscsi_session *sess;
50 struct beiscsi_session *beiscsi_sess;
51 struct beiscsi_io_task *io_task;
56 "beiscsi_session_create: invalid ep\n");
59 beiscsi_ep = ep->dd_data;
60 phba = beiscsi_ep->phba;
62 if (phba->state & BE_ADAPTER_PCI_ERR) {
63 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
64 "BS_%d : PCI_ERROR Recovery\n");
67 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
68 "BS_%d : In beiscsi_session_create\n");
71 if (cmds_max > beiscsi_ep->phba->params.wrbs_per_cxn) {
72 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
73 "BS_%d : Cannot handle %d cmds."
74 "Max cmds per session supported is %d. Using %d."
76 beiscsi_ep->phba->params.wrbs_per_cxn,
77 beiscsi_ep->phba->params.wrbs_per_cxn);
79 cmds_max = beiscsi_ep->phba->params.wrbs_per_cxn;
83 cls_session = iscsi_session_setup(&beiscsi_iscsi_transport,
85 sizeof(*beiscsi_sess),
87 initial_cmdsn, ISCSI_MAX_TARGET);
90 sess = cls_session->dd_data;
91 beiscsi_sess = sess->dd_data;
92 beiscsi_sess->bhs_pool = pci_pool_create("beiscsi_bhs_pool",
94 sizeof(struct be_cmd_bhs),
96 if (!beiscsi_sess->bhs_pool)
101 iscsi_session_teardown(cls_session);
106 * beiscsi_session_destroy - destroys iscsi session
107 * @cls_session: pointer to iscsi cls session
109 * Destroys iSCSI session instance and releases
110 * resources allocated for it.
112 void beiscsi_session_destroy(struct iscsi_cls_session *cls_session)
114 struct iscsi_session *sess = cls_session->dd_data;
115 struct beiscsi_session *beiscsi_sess = sess->dd_data;
117 printk(KERN_INFO "In beiscsi_session_destroy\n");
118 pci_pool_destroy(beiscsi_sess->bhs_pool);
119 iscsi_session_teardown(cls_session);
123 * beiscsi_conn_create - create an instance of iscsi connection
124 * @cls_session: ptr to iscsi_cls_session
127 struct iscsi_cls_conn *
128 beiscsi_conn_create(struct iscsi_cls_session *cls_session, u32 cid)
130 struct beiscsi_hba *phba;
131 struct Scsi_Host *shost;
132 struct iscsi_cls_conn *cls_conn;
133 struct beiscsi_conn *beiscsi_conn;
134 struct iscsi_conn *conn;
135 struct iscsi_session *sess;
136 struct beiscsi_session *beiscsi_sess;
138 shost = iscsi_session_to_shost(cls_session);
139 phba = iscsi_host_priv(shost);
141 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
142 "BS_%d : In beiscsi_conn_create ,cid"
143 "from iscsi layer=%d\n", cid);
145 cls_conn = iscsi_conn_setup(cls_session, sizeof(*beiscsi_conn), cid);
149 conn = cls_conn->dd_data;
150 beiscsi_conn = conn->dd_data;
151 beiscsi_conn->ep = NULL;
152 beiscsi_conn->phba = phba;
153 beiscsi_conn->conn = conn;
154 sess = cls_session->dd_data;
155 beiscsi_sess = sess->dd_data;
156 beiscsi_conn->beiscsi_sess = beiscsi_sess;
161 * beiscsi_bindconn_cid - Bind the beiscsi_conn with phba connection table
162 * @beiscsi_conn: The pointer to beiscsi_conn structure
163 * @phba: The phba instance
164 * @cid: The cid to free
166 static int beiscsi_bindconn_cid(struct beiscsi_hba *phba,
167 struct beiscsi_conn *beiscsi_conn,
170 uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
172 if (phba->conn_table[cri_index]) {
173 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
174 "BS_%d : Connection table already occupied. Detected clash\n");
178 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
179 "BS_%d : phba->conn_table[%d]=%p(beiscsi_conn)\n",
180 cri_index, beiscsi_conn);
182 phba->conn_table[cri_index] = beiscsi_conn;
188 * beiscsi_conn_bind - Binds iscsi session/connection with TCP connection
189 * @cls_session: pointer to iscsi cls session
190 * @cls_conn: pointer to iscsi cls conn
191 * @transport_fd: EP handle(64 bit)
193 * This function binds the TCP Conn with iSCSI Connection and Session.
195 int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
196 struct iscsi_cls_conn *cls_conn,
197 u64 transport_fd, int is_leading)
199 struct iscsi_conn *conn = cls_conn->dd_data;
200 struct beiscsi_conn *beiscsi_conn = conn->dd_data;
201 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
202 struct beiscsi_hba *phba = iscsi_host_priv(shost);
203 struct hwi_controller *phwi_ctrlr = phba->phwi_ctrlr;
204 struct hwi_wrb_context *pwrb_context;
205 struct beiscsi_endpoint *beiscsi_ep;
206 struct iscsi_endpoint *ep;
208 ep = iscsi_lookup_endpoint(transport_fd);
212 beiscsi_ep = ep->dd_data;
214 if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
217 if (beiscsi_ep->phba != phba) {
218 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
219 "BS_%d : beiscsi_ep->hba=%p not equal to phba=%p\n",
220 beiscsi_ep->phba, phba);
225 pwrb_context = &phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID(
226 beiscsi_ep->ep_cid)];
228 beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid;
229 beiscsi_conn->ep = beiscsi_ep;
230 beiscsi_ep->conn = beiscsi_conn;
231 beiscsi_conn->doorbell_offset = pwrb_context->doorbell_offset;
233 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
234 "BS_%d : beiscsi_conn=%p conn=%p ep_cid=%d\n",
235 beiscsi_conn, conn, beiscsi_ep->ep_cid);
237 return beiscsi_bindconn_cid(phba, beiscsi_conn, beiscsi_ep->ep_cid);
240 static int beiscsi_iface_create_ipv4(struct beiscsi_hba *phba)
242 if (phba->ipv4_iface)
245 phba->ipv4_iface = iscsi_create_iface(phba->shost,
246 &beiscsi_iscsi_transport,
247 ISCSI_IFACE_TYPE_IPV4,
249 if (!phba->ipv4_iface) {
250 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
252 "create default IPv4 address.\n");
259 static int beiscsi_iface_create_ipv6(struct beiscsi_hba *phba)
261 if (phba->ipv6_iface)
264 phba->ipv6_iface = iscsi_create_iface(phba->shost,
265 &beiscsi_iscsi_transport,
266 ISCSI_IFACE_TYPE_IPV6,
268 if (!phba->ipv6_iface) {
269 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
271 "create default IPv6 address.\n");
278 void beiscsi_iface_create_default(struct beiscsi_hba *phba)
280 struct be_cmd_get_if_info_resp *if_info;
282 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V4, &if_info)) {
283 beiscsi_iface_create_ipv4(phba);
287 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V6, &if_info)) {
288 beiscsi_iface_create_ipv6(phba);
293 void beiscsi_iface_destroy_default(struct beiscsi_hba *phba)
295 if (phba->ipv6_iface) {
296 iscsi_destroy_iface(phba->ipv6_iface);
297 phba->ipv6_iface = NULL;
299 if (phba->ipv4_iface) {
300 iscsi_destroy_iface(phba->ipv4_iface);
301 phba->ipv4_iface = NULL;
306 * beiscsi_set_vlan_tag()- Set the VLAN TAG
307 * @shost: Scsi Host for the driver instance
308 * @iface_param: Interface paramters
310 * Set the VLAN TAG for the adapter or disable
315 * Failure: Non-Zero Value
318 beiscsi_iface_config_vlan(struct Scsi_Host *shost,
319 struct iscsi_iface_param_info *iface_param)
321 struct beiscsi_hba *phba = iscsi_host_priv(shost);
324 switch (iface_param->param) {
325 case ISCSI_NET_PARAM_VLAN_ENABLED:
327 if (iface_param->value[0] != ISCSI_VLAN_ENABLE)
328 ret = beiscsi_if_set_vlan(phba, BEISCSI_VLAN_DISABLE);
330 case ISCSI_NET_PARAM_VLAN_TAG:
331 ret = beiscsi_if_set_vlan(phba,
332 *((uint16_t *)iface_param->value));
340 beiscsi_iface_config_ipv4(struct Scsi_Host *shost,
341 struct iscsi_iface_param_info *info,
342 void *data, uint32_t dt_len)
344 struct beiscsi_hba *phba = iscsi_host_priv(shost);
345 u8 *ip = NULL, *subnet = NULL, *gw;
349 /* Check the param */
350 switch (info->param) {
351 case ISCSI_NET_PARAM_IFACE_ENABLE:
352 if (info->value[0] == ISCSI_IFACE_ENABLE)
353 ret = beiscsi_iface_create_ipv4(phba);
355 iscsi_destroy_iface(phba->ipv4_iface);
356 phba->ipv4_iface = NULL;
359 case ISCSI_NET_PARAM_IPV4_GW:
361 ret = beiscsi_if_set_gw(phba, BEISCSI_IP_TYPE_V4, gw);
363 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
364 if (info->value[0] == ISCSI_BOOTPROTO_DHCP)
365 ret = beiscsi_if_en_dhcp(phba, BEISCSI_IP_TYPE_V4);
366 else if (info->value[0] == ISCSI_BOOTPROTO_STATIC)
367 /* release DHCP IP address */
368 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
371 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
372 "BS_%d : Invalid BOOTPROTO: %d\n",
375 case ISCSI_NET_PARAM_IPV4_ADDR:
377 nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_SUBNET);
379 info = nla_data(nla);
380 subnet = info->value;
382 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
385 case ISCSI_NET_PARAM_IPV4_SUBNET:
387 * OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR ioctl needs IP
388 * and subnet both. Find IP to be applied for this subnet.
390 subnet = info->value;
391 nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
393 info = nla_data(nla);
396 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
405 beiscsi_iface_config_ipv6(struct Scsi_Host *shost,
406 struct iscsi_iface_param_info *iface_param,
407 void *data, uint32_t dt_len)
409 struct beiscsi_hba *phba = iscsi_host_priv(shost);
412 switch (iface_param->param) {
413 case ISCSI_NET_PARAM_IFACE_ENABLE:
414 if (iface_param->value[0] == ISCSI_IFACE_ENABLE)
415 ret = beiscsi_iface_create_ipv6(phba);
417 iscsi_destroy_iface(phba->ipv6_iface);
418 phba->ipv6_iface = NULL;
421 case ISCSI_NET_PARAM_IPV6_ADDR:
422 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V6,
423 iface_param->value, NULL);
430 int beiscsi_iface_set_param(struct Scsi_Host *shost,
431 void *data, uint32_t dt_len)
433 struct iscsi_iface_param_info *iface_param = NULL;
434 struct beiscsi_hba *phba = iscsi_host_priv(shost);
435 struct nlattr *attrib;
436 uint32_t rm_len = dt_len;
439 if (phba->state & BE_ADAPTER_PCI_ERR) {
440 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
441 "BS_%d : In PCI_ERROR Recovery\n");
445 /* update interface_handle */
446 ret = beiscsi_if_get_handle(phba);
448 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
449 "BS_%d : Getting Interface Handle Failed\n");
453 nla_for_each_attr(attrib, data, dt_len, rm_len) {
454 iface_param = nla_data(attrib);
456 if (iface_param->param_type != ISCSI_NET_PARAM)
460 * BE2ISCSI only supports 1 interface
462 if (iface_param->iface_num) {
463 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
464 "BS_%d : Invalid iface_num %d."
465 "Only iface_num 0 is supported.\n",
466 iface_param->iface_num);
471 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
472 "BS_%d : %s.0 set param %d",
473 (iface_param->iface_type == ISCSI_IFACE_TYPE_IPV4) ?
474 "ipv4" : "ipv6", iface_param->param);
477 switch (iface_param->param) {
478 case ISCSI_NET_PARAM_VLAN_ENABLED:
479 case ISCSI_NET_PARAM_VLAN_TAG:
480 ret = beiscsi_iface_config_vlan(shost, iface_param);
483 switch (iface_param->iface_type) {
484 case ISCSI_IFACE_TYPE_IPV4:
485 ret = beiscsi_iface_config_ipv4(shost,
489 case ISCSI_IFACE_TYPE_IPV6:
490 ret = beiscsi_iface_config_ipv6(shost,
498 __beiscsi_log(phba, KERN_ERR,
499 "BS_%d : %s.0 set param %d not permitted",
500 (iface_param->iface_type ==
501 ISCSI_IFACE_TYPE_IPV4) ? "ipv4" : "ipv6",
512 static int __beiscsi_iface_get_param(struct beiscsi_hba *phba,
513 struct iscsi_iface *iface,
514 int param, char *buf)
516 struct be_cmd_get_if_info_resp *if_info;
517 int len, ip_type = BEISCSI_IP_TYPE_V4;
519 if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6)
520 ip_type = BEISCSI_IP_TYPE_V6;
522 len = beiscsi_if_get_info(phba, ip_type, &if_info);
527 case ISCSI_NET_PARAM_IPV4_ADDR:
528 len = sprintf(buf, "%pI4\n", if_info->ip_addr.addr);
530 case ISCSI_NET_PARAM_IPV6_ADDR:
531 len = sprintf(buf, "%pI6\n", if_info->ip_addr.addr);
533 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
534 if (!if_info->dhcp_state)
535 len = sprintf(buf, "static\n");
537 len = sprintf(buf, "dhcp\n");
539 case ISCSI_NET_PARAM_IPV4_SUBNET:
540 len = sprintf(buf, "%pI4\n", if_info->ip_addr.subnet_mask);
542 case ISCSI_NET_PARAM_VLAN_ENABLED:
543 len = sprintf(buf, "%s\n",
544 (if_info->vlan_priority == BEISCSI_VLAN_DISABLE) ?
545 "disable" : "enable");
547 case ISCSI_NET_PARAM_VLAN_ID:
548 if (if_info->vlan_priority == BEISCSI_VLAN_DISABLE)
551 len = sprintf(buf, "%d\n",
552 (if_info->vlan_priority &
555 case ISCSI_NET_PARAM_VLAN_PRIORITY:
556 if (if_info->vlan_priority == BEISCSI_VLAN_DISABLE)
559 len = sprintf(buf, "%d\n",
560 ((if_info->vlan_priority >> 13) &
561 ISCSI_MAX_VLAN_PRIORITY));
571 int beiscsi_iface_get_param(struct iscsi_iface *iface,
572 enum iscsi_param_type param_type,
573 int param, char *buf)
575 struct Scsi_Host *shost = iscsi_iface_to_shost(iface);
576 struct beiscsi_hba *phba = iscsi_host_priv(shost);
577 struct be_cmd_get_def_gateway_resp gateway;
580 if (param_type != ISCSI_NET_PARAM)
582 if (phba->state & BE_ADAPTER_PCI_ERR) {
583 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
584 "BS_%d : In PCI_ERROR Recovery\n");
589 case ISCSI_NET_PARAM_IPV4_ADDR:
590 case ISCSI_NET_PARAM_IPV4_SUBNET:
591 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
592 case ISCSI_NET_PARAM_IPV6_ADDR:
593 case ISCSI_NET_PARAM_VLAN_ENABLED:
594 case ISCSI_NET_PARAM_VLAN_ID:
595 case ISCSI_NET_PARAM_VLAN_PRIORITY:
596 len = __beiscsi_iface_get_param(phba, iface, param, buf);
598 case ISCSI_NET_PARAM_IFACE_ENABLE:
599 if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4)
600 len = sprintf(buf, "%s\n",
601 phba->ipv4_iface ? "enable" : "disable");
602 else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6)
603 len = sprintf(buf, "%s\n",
604 phba->ipv6_iface ? "enable" : "disable");
606 case ISCSI_NET_PARAM_IPV4_GW:
607 memset(&gateway, 0, sizeof(gateway));
608 len = beiscsi_if_get_gw(phba, BEISCSI_IP_TYPE_V4, &gateway);
610 len = sprintf(buf, "%pI4\n", &gateway.ip_addr.addr);
618 * beiscsi_ep_get_param - get the iscsi parameter
619 * @ep: pointer to iscsi ep
620 * @param: parameter type identifier
621 * @buf: buffer pointer
623 * returns iscsi parameter
625 int beiscsi_ep_get_param(struct iscsi_endpoint *ep,
626 enum iscsi_param param, char *buf)
628 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
631 beiscsi_log(beiscsi_ep->phba, KERN_INFO,
633 "BS_%d : In beiscsi_ep_get_param,"
634 " param= %d\n", param);
637 case ISCSI_PARAM_CONN_PORT:
638 len = sprintf(buf, "%hu\n", beiscsi_ep->dst_tcpport);
640 case ISCSI_PARAM_CONN_ADDRESS:
641 if (beiscsi_ep->ip_type == BEISCSI_IP_TYPE_V4)
642 len = sprintf(buf, "%pI4\n", &beiscsi_ep->dst_addr);
644 len = sprintf(buf, "%pI6\n", &beiscsi_ep->dst6_addr);
652 int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
653 enum iscsi_param param, char *buf, int buflen)
655 struct iscsi_conn *conn = cls_conn->dd_data;
656 struct iscsi_session *session = conn->session;
657 struct beiscsi_hba *phba = NULL;
660 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
661 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
662 "BS_%d : In beiscsi_conn_set_param,"
663 " param= %d\n", param);
665 ret = iscsi_set_param(cls_conn, param, buf, buflen);
669 * If userspace tried to set the value to higher than we can
670 * support override here.
673 case ISCSI_PARAM_FIRST_BURST:
674 if (session->first_burst > 8192)
675 session->first_burst = 8192;
677 case ISCSI_PARAM_MAX_RECV_DLENGTH:
678 if (conn->max_recv_dlength > 65536)
679 conn->max_recv_dlength = 65536;
681 case ISCSI_PARAM_MAX_BURST:
682 if (session->max_burst > 262144)
683 session->max_burst = 262144;
685 case ISCSI_PARAM_MAX_XMIT_DLENGTH:
686 if (conn->max_xmit_dlength > 65536)
687 conn->max_xmit_dlength = 65536;
696 * beiscsi_get_initname - Read Initiator Name from flash
697 * @buf: buffer bointer
698 * @phba: The device priv structure instance
700 * returns number of bytes
702 static int beiscsi_get_initname(char *buf, struct beiscsi_hba *phba)
706 struct be_mcc_wrb *wrb;
707 struct be_cmd_hba_name *resp;
709 tag = be_cmd_get_initname(phba);
711 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
712 "BS_%d : Getting Initiator Name Failed\n");
717 rc = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL);
719 beiscsi_log(phba, KERN_ERR,
720 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
721 "BS_%d : Initiator Name MBX Failed\n");
725 resp = embedded_payload(wrb);
726 rc = sprintf(buf, "%s\n", resp->initiator_name);
731 * beiscsi_get_port_state - Get the Port State
732 * @shost : pointer to scsi_host structure
735 static void beiscsi_get_port_state(struct Scsi_Host *shost)
737 struct beiscsi_hba *phba = iscsi_host_priv(shost);
738 struct iscsi_cls_host *ihost = shost->shost_data;
740 ihost->port_state = (phba->state & BE_ADAPTER_LINK_UP) ?
741 ISCSI_PORT_STATE_UP : ISCSI_PORT_STATE_DOWN;
745 * beiscsi_get_port_speed - Get the Port Speed from Adapter
746 * @shost : pointer to scsi_host structure
749 static void beiscsi_get_port_speed(struct Scsi_Host *shost)
751 struct beiscsi_hba *phba = iscsi_host_priv(shost);
752 struct iscsi_cls_host *ihost = shost->shost_data;
754 switch (phba->port_speed) {
755 case BE2ISCSI_LINK_SPEED_10MBPS:
756 ihost->port_speed = ISCSI_PORT_SPEED_10MBPS;
758 case BE2ISCSI_LINK_SPEED_100MBPS:
759 ihost->port_speed = ISCSI_PORT_SPEED_100MBPS;
761 case BE2ISCSI_LINK_SPEED_1GBPS:
762 ihost->port_speed = ISCSI_PORT_SPEED_1GBPS;
764 case BE2ISCSI_LINK_SPEED_10GBPS:
765 ihost->port_speed = ISCSI_PORT_SPEED_10GBPS;
767 case BE2ISCSI_LINK_SPEED_25GBPS:
768 ihost->port_speed = ISCSI_PORT_SPEED_25GBPS;
770 case BE2ISCSI_LINK_SPEED_40GBPS:
771 ihost->port_speed = ISCSI_PORT_SPEED_40GBPS;
774 ihost->port_speed = ISCSI_PORT_SPEED_UNKNOWN;
779 * beiscsi_get_host_param - get the iscsi parameter
780 * @shost: pointer to scsi_host structure
781 * @param: parameter type identifier
782 * @buf: buffer pointer
784 * returns host parameter
786 int beiscsi_get_host_param(struct Scsi_Host *shost,
787 enum iscsi_host_param param, char *buf)
789 struct beiscsi_hba *phba = iscsi_host_priv(shost);
793 if (phba->state & BE_ADAPTER_PCI_ERR) {
794 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
795 "BS_%d : In PCI_ERROR Recovery\n");
798 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
799 "BS_%d : In beiscsi_get_host_param,"
800 " param = %d\n", param);
804 case ISCSI_HOST_PARAM_HWADDRESS:
805 status = beiscsi_get_macaddr(buf, phba);
807 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
808 "BS_%d : beiscsi_get_macaddr Failed\n");
812 case ISCSI_HOST_PARAM_INITIATOR_NAME:
813 status = beiscsi_get_initname(buf, phba);
815 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
816 "BS_%d : Retreiving Initiator Name Failed\n");
820 case ISCSI_HOST_PARAM_PORT_STATE:
821 beiscsi_get_port_state(shost);
822 status = sprintf(buf, "%s\n", iscsi_get_port_state_name(shost));
824 case ISCSI_HOST_PARAM_PORT_SPEED:
825 beiscsi_get_port_speed(shost);
826 status = sprintf(buf, "%s\n", iscsi_get_port_speed_name(shost));
829 return iscsi_host_get_param(shost, param, buf);
834 int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
836 struct be_cmd_get_nic_conf_resp resp;
839 if (phba->mac_addr_set)
840 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
842 memset(&resp, 0, sizeof(resp));
843 rc = mgmt_get_nic_conf(phba, &resp);
847 phba->mac_addr_set = true;
848 memcpy(phba->mac_address, resp.mac_address, ETH_ALEN);
849 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
853 * beiscsi_conn_get_stats - get the iscsi stats
854 * @cls_conn: pointer to iscsi cls conn
855 * @stats: pointer to iscsi_stats structure
857 * returns iscsi stats
859 void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
860 struct iscsi_stats *stats)
862 struct iscsi_conn *conn = cls_conn->dd_data;
863 struct beiscsi_hba *phba = NULL;
865 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
866 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
867 "BS_%d : In beiscsi_conn_get_stats\n");
869 stats->txdata_octets = conn->txdata_octets;
870 stats->rxdata_octets = conn->rxdata_octets;
871 stats->dataout_pdus = conn->dataout_pdus_cnt;
872 stats->scsirsp_pdus = conn->scsirsp_pdus_cnt;
873 stats->scsicmd_pdus = conn->scsicmd_pdus_cnt;
874 stats->datain_pdus = conn->datain_pdus_cnt;
875 stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
876 stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
877 stats->r2t_pdus = conn->r2t_pdus_cnt;
878 stats->digest_err = 0;
879 stats->timeout_err = 0;
880 stats->custom_length = 1;
881 strcpy(stats->custom[0].desc, "eh_abort_cnt");
882 stats->custom[0].value = conn->eh_abort_cnt;
886 * beiscsi_set_params_for_offld - get the parameters for offload
887 * @beiscsi_conn: pointer to beiscsi_conn
888 * @params: pointer to offload_params structure
890 static void beiscsi_set_params_for_offld(struct beiscsi_conn *beiscsi_conn,
891 struct beiscsi_offload_params *params)
893 struct iscsi_conn *conn = beiscsi_conn->conn;
894 struct iscsi_session *session = conn->session;
896 AMAP_SET_BITS(struct amap_beiscsi_offload_params, max_burst_length,
897 params, session->max_burst);
898 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
899 max_send_data_segment_length, params,
900 conn->max_xmit_dlength);
901 AMAP_SET_BITS(struct amap_beiscsi_offload_params, first_burst_length,
902 params, session->first_burst);
903 AMAP_SET_BITS(struct amap_beiscsi_offload_params, erl, params,
905 AMAP_SET_BITS(struct amap_beiscsi_offload_params, dde, params,
907 AMAP_SET_BITS(struct amap_beiscsi_offload_params, hde, params,
909 AMAP_SET_BITS(struct amap_beiscsi_offload_params, ir2t, params,
910 session->initial_r2t_en);
911 AMAP_SET_BITS(struct amap_beiscsi_offload_params, imd, params,
912 session->imm_data_en);
913 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
914 data_seq_inorder, params,
915 session->dataseq_inorder_en);
916 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
917 pdu_seq_inorder, params,
918 session->pdu_inorder_en);
919 AMAP_SET_BITS(struct amap_beiscsi_offload_params, max_r2t, params,
921 AMAP_SET_BITS(struct amap_beiscsi_offload_params, exp_statsn, params,
922 (conn->exp_statsn - 1));
923 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
924 max_recv_data_segment_length, params,
925 conn->max_recv_dlength);
930 * beiscsi_conn_start - offload of session to chip
931 * @cls_conn: pointer to beiscsi_conn
933 int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn)
935 struct iscsi_conn *conn = cls_conn->dd_data;
936 struct beiscsi_conn *beiscsi_conn = conn->dd_data;
937 struct beiscsi_endpoint *beiscsi_ep;
938 struct beiscsi_offload_params params;
939 struct beiscsi_hba *phba;
941 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
943 if (phba->state & BE_ADAPTER_PCI_ERR) {
944 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
945 "BS_%d : In PCI_ERROR Recovery\n");
948 beiscsi_log(beiscsi_conn->phba, KERN_INFO,
950 "BS_%d : In beiscsi_conn_start\n");
953 memset(¶ms, 0, sizeof(struct beiscsi_offload_params));
954 beiscsi_ep = beiscsi_conn->ep;
956 beiscsi_log(beiscsi_conn->phba, KERN_ERR,
958 "BS_%d : In beiscsi_conn_start , no beiscsi_ep\n");
960 beiscsi_conn->login_in_progress = 0;
961 beiscsi_set_params_for_offld(beiscsi_conn, ¶ms);
962 beiscsi_offload_connection(beiscsi_conn, ¶ms);
963 iscsi_conn_start(cls_conn);
968 * beiscsi_get_cid - Allocate a cid
969 * @phba: The phba instance
971 static int beiscsi_get_cid(struct beiscsi_hba *phba)
973 unsigned short cid = 0xFFFF, cid_from_ulp;
974 struct ulp_cid_info *cid_info = NULL;
975 uint16_t cid_avlbl_ulp0, cid_avlbl_ulp1;
977 /* Find the ULP which has more CID available */
978 cid_avlbl_ulp0 = (phba->cid_array_info[BEISCSI_ULP0]) ?
979 BEISCSI_ULP0_AVLBL_CID(phba) : 0;
980 cid_avlbl_ulp1 = (phba->cid_array_info[BEISCSI_ULP1]) ?
981 BEISCSI_ULP1_AVLBL_CID(phba) : 0;
982 cid_from_ulp = (cid_avlbl_ulp0 > cid_avlbl_ulp1) ?
983 BEISCSI_ULP0 : BEISCSI_ULP1;
985 if (test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported)) {
986 cid_info = phba->cid_array_info[cid_from_ulp];
987 if (!cid_info->avlbl_cids)
990 cid = cid_info->cid_array[cid_info->cid_alloc++];
992 if (cid_info->cid_alloc == BEISCSI_GET_CID_COUNT(
994 cid_info->cid_alloc = 0;
996 cid_info->avlbl_cids--;
1002 * beiscsi_put_cid - Free the cid
1003 * @phba: The phba for which the cid is being freed
1004 * @cid: The cid to free
1006 static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid)
1008 uint16_t cid_post_ulp;
1009 struct hwi_controller *phwi_ctrlr;
1010 struct hwi_wrb_context *pwrb_context;
1011 struct ulp_cid_info *cid_info = NULL;
1012 uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
1014 phwi_ctrlr = phba->phwi_ctrlr;
1015 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
1016 cid_post_ulp = pwrb_context->ulp_num;
1018 cid_info = phba->cid_array_info[cid_post_ulp];
1019 cid_info->avlbl_cids++;
1021 cid_info->cid_array[cid_info->cid_free++] = cid;
1022 if (cid_info->cid_free == BEISCSI_GET_CID_COUNT(phba, cid_post_ulp))
1023 cid_info->cid_free = 0;
1027 * beiscsi_free_ep - free endpoint
1028 * @ep: pointer to iscsi endpoint structure
1030 static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
1032 struct beiscsi_hba *phba = beiscsi_ep->phba;
1033 struct beiscsi_conn *beiscsi_conn;
1035 beiscsi_put_cid(phba, beiscsi_ep->ep_cid);
1036 beiscsi_ep->phba = NULL;
1037 phba->ep_array[BE_GET_CRI_FROM_CID
1038 (beiscsi_ep->ep_cid)] = NULL;
1041 * Check if any connection resource allocated by driver
1042 * is to be freed.This case occurs when target redirection
1043 * or connection retry is done.
1045 if (!beiscsi_ep->conn)
1048 beiscsi_conn = beiscsi_ep->conn;
1049 if (beiscsi_conn->login_in_progress) {
1050 beiscsi_free_mgmt_task_handles(beiscsi_conn,
1051 beiscsi_conn->task);
1052 beiscsi_conn->login_in_progress = 0;
1057 * beiscsi_open_conn - Ask FW to open a TCP connection
1058 * @ep: endpoint to be used
1059 * @src_addr: The source IP address
1060 * @dst_addr: The Destination IP address
1062 * Asks the FW to open a TCP connection
1064 static int beiscsi_open_conn(struct iscsi_endpoint *ep,
1065 struct sockaddr *src_addr,
1066 struct sockaddr *dst_addr, int non_blocking)
1068 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
1069 struct beiscsi_hba *phba = beiscsi_ep->phba;
1070 struct tcp_connect_and_offload_out *ptcpcnct_out;
1071 struct be_dma_mem nonemb_cmd;
1072 unsigned int tag, req_memsize;
1075 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1076 "BS_%d : In beiscsi_open_conn\n");
1078 beiscsi_ep->ep_cid = beiscsi_get_cid(phba);
1079 if (beiscsi_ep->ep_cid == 0xFFFF) {
1080 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1081 "BS_%d : No free cid available\n");
1085 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1086 "BS_%d : In beiscsi_open_conn, ep_cid=%d\n",
1087 beiscsi_ep->ep_cid);
1089 phba->ep_array[BE_GET_CRI_FROM_CID
1090 (beiscsi_ep->ep_cid)] = ep;
1092 beiscsi_ep->cid_vld = 0;
1094 if (is_chip_be2_be3r(phba))
1095 req_memsize = sizeof(struct tcp_connect_and_offload_in);
1097 req_memsize = sizeof(struct tcp_connect_and_offload_in_v1);
1099 nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev,
1102 if (nonemb_cmd.va == NULL) {
1104 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1105 "BS_%d : Failed to allocate memory for"
1106 " mgmt_open_connection\n");
1108 beiscsi_free_ep(beiscsi_ep);
1111 nonemb_cmd.size = req_memsize;
1112 memset(nonemb_cmd.va, 0, nonemb_cmd.size);
1113 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
1115 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1116 "BS_%d : mgmt_open_connection Failed for cid=%d\n",
1117 beiscsi_ep->ep_cid);
1119 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
1120 nonemb_cmd.va, nonemb_cmd.dma);
1121 beiscsi_free_ep(beiscsi_ep);
1125 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
1127 beiscsi_log(phba, KERN_ERR,
1128 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
1129 "BS_%d : mgmt_open_connection Failed");
1132 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
1133 nonemb_cmd.va, nonemb_cmd.dma);
1135 beiscsi_free_ep(beiscsi_ep);
1139 ptcpcnct_out = (struct tcp_connect_and_offload_out *)nonemb_cmd.va;
1140 beiscsi_ep = ep->dd_data;
1141 beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
1142 beiscsi_ep->cid_vld = 1;
1143 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1144 "BS_%d : mgmt_open_connection Success\n");
1146 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size,
1147 nonemb_cmd.va, nonemb_cmd.dma);
1152 * beiscsi_ep_connect - Ask chip to create TCP Conn
1153 * @scsi_host: Pointer to scsi_host structure
1154 * @dst_addr: The IP address of Target
1155 * @non_blocking: blocking or non-blocking call
1157 * This routines first asks chip to create a connection and then allocates an EP
1159 struct iscsi_endpoint *
1160 beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
1163 struct beiscsi_hba *phba;
1164 struct beiscsi_endpoint *beiscsi_ep;
1165 struct iscsi_endpoint *ep;
1169 phba = iscsi_host_priv(shost);
1173 "beiscsi_ep_connect shost is NULL\n");
1174 return ERR_PTR(ret);
1177 if (beiscsi_error(phba)) {
1179 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
1180 "BS_%d : The FW state Not Stable!!!\n");
1181 return ERR_PTR(ret);
1184 if (phba->state & BE_ADAPTER_PCI_ERR) {
1186 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1187 "BS_%d : In PCI_ERROR Recovery\n");
1188 return ERR_PTR(ret);
1189 } else if (phba->state & BE_ADAPTER_LINK_DOWN) {
1191 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
1192 "BS_%d : The Adapter Port state is Down!!!\n");
1193 return ERR_PTR(ret);
1196 ep = iscsi_create_endpoint(sizeof(struct beiscsi_endpoint));
1199 return ERR_PTR(ret);
1202 beiscsi_ep = ep->dd_data;
1203 beiscsi_ep->phba = phba;
1204 beiscsi_ep->openiscsi_ep = ep;
1205 ret = beiscsi_open_conn(ep, NULL, dst_addr, non_blocking);
1207 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1208 "BS_%d : Failed in beiscsi_open_conn\n");
1215 iscsi_destroy_endpoint(ep);
1216 return ERR_PTR(ret);
1220 * beiscsi_ep_poll - Poll to see if connection is established
1221 * @ep: endpoint to be used
1222 * @timeout_ms: timeout specified in millisecs
1224 * Poll to see if TCP connection established
1226 int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
1228 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
1230 beiscsi_log(beiscsi_ep->phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1231 "BS_%d : In beiscsi_ep_poll\n");
1233 if (beiscsi_ep->cid_vld == 1)
1240 * beiscsi_flush_cq()- Flush the CQ created.
1241 * @phba: ptr device priv structure.
1243 * Before the connection resource are freed flush
1244 * all the CQ enteries
1246 static void beiscsi_flush_cq(struct beiscsi_hba *phba)
1249 struct be_eq_obj *pbe_eq;
1250 struct hwi_controller *phwi_ctrlr;
1251 struct hwi_context_memory *phwi_context;
1253 phwi_ctrlr = phba->phwi_ctrlr;
1254 phwi_context = phwi_ctrlr->phwi_ctxt;
1256 for (i = 0; i < phba->num_cpus; i++) {
1257 pbe_eq = &phwi_context->be_eq[i];
1258 irq_poll_disable(&pbe_eq->iopoll);
1259 beiscsi_process_cq(pbe_eq, BE2_MAX_NUM_CQ_PROC);
1260 irq_poll_enable(&pbe_eq->iopoll);
1265 * beiscsi_close_conn - Upload the connection
1266 * @ep: The iscsi endpoint
1267 * @flag: The type of connection closure
1269 static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
1273 struct beiscsi_hba *phba = beiscsi_ep->phba;
1275 tag = mgmt_upload_connection(phba, beiscsi_ep->ep_cid, flag);
1277 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1278 "BS_%d : upload failed for cid 0x%x\n",
1279 beiscsi_ep->ep_cid);
1284 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1286 /* Flush the CQ entries */
1287 beiscsi_flush_cq(phba);
1293 * beiscsi_unbind_conn_to_cid - Unbind the beiscsi_conn from phba conn table
1294 * @phba: The phba instance
1295 * @cid: The cid to free
1297 static int beiscsi_unbind_conn_to_cid(struct beiscsi_hba *phba,
1300 uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
1302 if (phba->conn_table[cri_index])
1303 phba->conn_table[cri_index] = NULL;
1305 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1306 "BS_%d : Connection table Not occupied.\n");
1313 * beiscsi_ep_disconnect - Tears down the TCP connection
1314 * @ep: endpoint to be used
1316 * Tears down the TCP connection
1318 void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
1320 struct beiscsi_conn *beiscsi_conn;
1321 struct beiscsi_endpoint *beiscsi_ep;
1322 struct beiscsi_hba *phba;
1324 uint8_t mgmt_invalidate_flag, tcp_upload_flag;
1325 unsigned short savecfg_flag = CMD_ISCSI_SESSION_SAVE_CFG_ON_FLASH;
1327 beiscsi_ep = ep->dd_data;
1328 phba = beiscsi_ep->phba;
1329 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1330 "BS_%d : In beiscsi_ep_disconnect for ep_cid = %d\n",
1331 beiscsi_ep->ep_cid);
1333 if (beiscsi_ep->conn) {
1334 beiscsi_conn = beiscsi_ep->conn;
1335 iscsi_suspend_queue(beiscsi_conn->conn);
1336 mgmt_invalidate_flag = ~BEISCSI_NO_RST_ISSUE;
1337 tcp_upload_flag = CONNECTION_UPLOAD_GRACEFUL;
1339 mgmt_invalidate_flag = BEISCSI_NO_RST_ISSUE;
1340 tcp_upload_flag = CONNECTION_UPLOAD_ABORT;
1343 if (phba->state & BE_ADAPTER_PCI_ERR) {
1344 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1345 "BS_%d : PCI_ERROR Recovery\n");
1349 tag = mgmt_invalidate_connection(phba, beiscsi_ep,
1351 mgmt_invalidate_flag,
1354 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1355 "BS_%d : mgmt_invalidate_connection Failed for cid=%d\n",
1356 beiscsi_ep->ep_cid);
1359 beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1360 beiscsi_close_conn(beiscsi_ep, tcp_upload_flag);
1362 msleep(BEISCSI_LOGOUT_SYNC_DELAY);
1363 beiscsi_free_ep(beiscsi_ep);
1364 beiscsi_unbind_conn_to_cid(phba, beiscsi_ep->ep_cid);
1365 iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep);
1368 umode_t beiscsi_attr_is_visible(int param_type, int param)
1370 switch (param_type) {
1371 case ISCSI_NET_PARAM:
1373 case ISCSI_NET_PARAM_IFACE_ENABLE:
1374 case ISCSI_NET_PARAM_IPV4_ADDR:
1375 case ISCSI_NET_PARAM_IPV4_SUBNET:
1376 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
1377 case ISCSI_NET_PARAM_IPV4_GW:
1378 case ISCSI_NET_PARAM_IPV6_ADDR:
1379 case ISCSI_NET_PARAM_VLAN_ID:
1380 case ISCSI_NET_PARAM_VLAN_PRIORITY:
1381 case ISCSI_NET_PARAM_VLAN_ENABLED:
1386 case ISCSI_HOST_PARAM:
1388 case ISCSI_HOST_PARAM_HWADDRESS:
1389 case ISCSI_HOST_PARAM_INITIATOR_NAME:
1390 case ISCSI_HOST_PARAM_PORT_STATE:
1391 case ISCSI_HOST_PARAM_PORT_SPEED:
1398 case ISCSI_PARAM_MAX_RECV_DLENGTH:
1399 case ISCSI_PARAM_MAX_XMIT_DLENGTH:
1400 case ISCSI_PARAM_HDRDGST_EN:
1401 case ISCSI_PARAM_DATADGST_EN:
1402 case ISCSI_PARAM_CONN_ADDRESS:
1403 case ISCSI_PARAM_CONN_PORT:
1404 case ISCSI_PARAM_EXP_STATSN:
1405 case ISCSI_PARAM_PERSISTENT_ADDRESS:
1406 case ISCSI_PARAM_PERSISTENT_PORT:
1407 case ISCSI_PARAM_PING_TMO:
1408 case ISCSI_PARAM_RECV_TMO:
1409 case ISCSI_PARAM_INITIAL_R2T_EN:
1410 case ISCSI_PARAM_MAX_R2T:
1411 case ISCSI_PARAM_IMM_DATA_EN:
1412 case ISCSI_PARAM_FIRST_BURST:
1413 case ISCSI_PARAM_MAX_BURST:
1414 case ISCSI_PARAM_PDU_INORDER_EN:
1415 case ISCSI_PARAM_DATASEQ_INORDER_EN:
1416 case ISCSI_PARAM_ERL:
1417 case ISCSI_PARAM_TARGET_NAME:
1418 case ISCSI_PARAM_TPGT:
1419 case ISCSI_PARAM_USERNAME:
1420 case ISCSI_PARAM_PASSWORD:
1421 case ISCSI_PARAM_USERNAME_IN:
1422 case ISCSI_PARAM_PASSWORD_IN:
1423 case ISCSI_PARAM_FAST_ABORT:
1424 case ISCSI_PARAM_ABORT_TMO:
1425 case ISCSI_PARAM_LU_RESET_TMO:
1426 case ISCSI_PARAM_IFACE_NAME:
1427 case ISCSI_PARAM_INITIATOR_NAME: