2 * This file is part of the Emulex Linux Device Driver for Enterprise iSCSI
3 * Host Bus Adapters. Refer to the README file included with this package
4 * for driver version and adapter compatibility.
6 * Copyright (c) 2018 Broadcom. All Rights Reserved.
7 * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of version 2 of the GNU General Public License as published
11 * by the Free Software Foundation.
13 * Contact Information:
14 * linux-drivers@broadcom.com
18 #include <scsi/libiscsi.h>
19 #include <scsi/scsi_transport_iscsi.h>
20 #include <scsi/scsi_transport.h>
21 #include <scsi/scsi_cmnd.h>
22 #include <scsi/scsi_device.h>
23 #include <scsi/scsi_host.h>
24 #include <scsi/scsi_netlink.h>
25 #include <net/netlink.h>
26 #include <scsi/scsi.h>
30 extern struct iscsi_transport beiscsi_iscsi_transport;
33 * beiscsi_session_create - creates a new iscsi session
34 * @cmds_max: max commands supported
35 * @qdepth: max queue depth supported
36 * @initial_cmdsn: initial iscsi CMDSN
38 struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
43 struct Scsi_Host *shost;
44 struct beiscsi_endpoint *beiscsi_ep;
45 struct iscsi_cls_session *cls_session;
46 struct beiscsi_hba *phba;
47 struct iscsi_session *sess;
48 struct beiscsi_session *beiscsi_sess;
49 struct beiscsi_io_task *io_task;
53 pr_err("beiscsi_session_create: invalid ep\n");
56 beiscsi_ep = ep->dd_data;
57 phba = beiscsi_ep->phba;
59 if (!beiscsi_hba_is_online(phba)) {
60 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
61 "BS_%d : HBA in error 0x%lx\n", phba->state);
65 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
66 "BS_%d : In beiscsi_session_create\n");
67 if (cmds_max > beiscsi_ep->phba->params.wrbs_per_cxn) {
68 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
69 "BS_%d : Cannot handle %d cmds."
70 "Max cmds per session supported is %d. Using %d."
72 beiscsi_ep->phba->params.wrbs_per_cxn,
73 beiscsi_ep->phba->params.wrbs_per_cxn);
75 cmds_max = beiscsi_ep->phba->params.wrbs_per_cxn;
79 cls_session = iscsi_session_setup(&beiscsi_iscsi_transport,
81 sizeof(*beiscsi_sess),
83 initial_cmdsn, ISCSI_MAX_TARGET);
86 sess = cls_session->dd_data;
87 beiscsi_sess = sess->dd_data;
88 beiscsi_sess->bhs_pool = dma_pool_create("beiscsi_bhs_pool",
90 sizeof(struct be_cmd_bhs),
92 if (!beiscsi_sess->bhs_pool)
97 iscsi_session_teardown(cls_session);
102 * beiscsi_session_destroy - destroys iscsi session
103 * @cls_session: pointer to iscsi cls session
105 * Destroys iSCSI session instance and releases
106 * resources allocated for it.
108 void beiscsi_session_destroy(struct iscsi_cls_session *cls_session)
110 struct iscsi_session *sess = cls_session->dd_data;
111 struct beiscsi_session *beiscsi_sess = sess->dd_data;
113 printk(KERN_INFO "In beiscsi_session_destroy\n");
114 dma_pool_destroy(beiscsi_sess->bhs_pool);
115 iscsi_session_teardown(cls_session);
119 * beiscsi_session_fail(): Closing session with appropriate error
120 * @cls_session: ptr to session
122 void beiscsi_session_fail(struct iscsi_cls_session *cls_session)
124 iscsi_session_failure(cls_session->dd_data, ISCSI_ERR_CONN_FAILED);
129 * beiscsi_conn_create - create an instance of iscsi connection
130 * @cls_session: ptr to iscsi_cls_session
133 struct iscsi_cls_conn *
134 beiscsi_conn_create(struct iscsi_cls_session *cls_session, u32 cid)
136 struct beiscsi_hba *phba;
137 struct Scsi_Host *shost;
138 struct iscsi_cls_conn *cls_conn;
139 struct beiscsi_conn *beiscsi_conn;
140 struct iscsi_conn *conn;
141 struct iscsi_session *sess;
142 struct beiscsi_session *beiscsi_sess;
144 shost = iscsi_session_to_shost(cls_session);
145 phba = iscsi_host_priv(shost);
147 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
148 "BS_%d : In beiscsi_conn_create ,cid"
149 "from iscsi layer=%d\n", cid);
151 cls_conn = iscsi_conn_setup(cls_session, sizeof(*beiscsi_conn), cid);
155 conn = cls_conn->dd_data;
156 beiscsi_conn = conn->dd_data;
157 beiscsi_conn->ep = NULL;
158 beiscsi_conn->phba = phba;
159 beiscsi_conn->conn = conn;
160 sess = cls_session->dd_data;
161 beiscsi_sess = sess->dd_data;
162 beiscsi_conn->beiscsi_sess = beiscsi_sess;
167 * beiscsi_conn_bind - Binds iscsi session/connection with TCP connection
168 * @cls_session: pointer to iscsi cls session
169 * @cls_conn: pointer to iscsi cls conn
170 * @transport_fd: EP handle(64 bit)
172 * This function binds the TCP Conn with iSCSI Connection and Session.
174 int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
175 struct iscsi_cls_conn *cls_conn,
176 u64 transport_fd, int is_leading)
178 struct iscsi_conn *conn = cls_conn->dd_data;
179 struct beiscsi_conn *beiscsi_conn = conn->dd_data;
180 struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
181 struct beiscsi_hba *phba = iscsi_host_priv(shost);
182 struct hwi_controller *phwi_ctrlr = phba->phwi_ctrlr;
183 struct hwi_wrb_context *pwrb_context;
184 struct beiscsi_endpoint *beiscsi_ep;
185 struct iscsi_endpoint *ep;
188 ep = iscsi_lookup_endpoint(transport_fd);
192 beiscsi_ep = ep->dd_data;
194 if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
197 if (beiscsi_ep->phba != phba) {
198 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
199 "BS_%d : beiscsi_ep->hba=%p not equal to phba=%p\n",
200 beiscsi_ep->phba, phba);
204 cri_index = BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid);
205 if (phba->conn_table[cri_index]) {
206 if (beiscsi_conn != phba->conn_table[cri_index] ||
207 beiscsi_ep != phba->conn_table[cri_index]->ep) {
208 __beiscsi_log(phba, KERN_ERR,
209 "BS_%d : conn_table not empty at %u: cid %u conn %p:%p\n",
213 phba->conn_table[cri_index]);
218 beiscsi_conn->beiscsi_conn_cid = beiscsi_ep->ep_cid;
219 beiscsi_conn->ep = beiscsi_ep;
220 beiscsi_ep->conn = beiscsi_conn;
222 * Each connection is associated with a WRBQ kept in wrb_context.
223 * Store doorbell offset for transmit path.
225 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
226 beiscsi_conn->doorbell_offset = pwrb_context->doorbell_offset;
227 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
228 "BS_%d : cid %d phba->conn_table[%u]=%p\n",
229 beiscsi_ep->ep_cid, cri_index, beiscsi_conn);
230 phba->conn_table[cri_index] = beiscsi_conn;
234 static int beiscsi_iface_create_ipv4(struct beiscsi_hba *phba)
236 if (phba->ipv4_iface)
239 phba->ipv4_iface = iscsi_create_iface(phba->shost,
240 &beiscsi_iscsi_transport,
241 ISCSI_IFACE_TYPE_IPV4,
243 if (!phba->ipv4_iface) {
244 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
246 "create default IPv4 address.\n");
253 static int beiscsi_iface_create_ipv6(struct beiscsi_hba *phba)
255 if (phba->ipv6_iface)
258 phba->ipv6_iface = iscsi_create_iface(phba->shost,
259 &beiscsi_iscsi_transport,
260 ISCSI_IFACE_TYPE_IPV6,
262 if (!phba->ipv6_iface) {
263 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
265 "create default IPv6 address.\n");
272 void beiscsi_iface_create_default(struct beiscsi_hba *phba)
274 struct be_cmd_get_if_info_resp *if_info;
276 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V4, &if_info)) {
277 beiscsi_iface_create_ipv4(phba);
281 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V6, &if_info)) {
282 beiscsi_iface_create_ipv6(phba);
287 void beiscsi_iface_destroy_default(struct beiscsi_hba *phba)
289 if (phba->ipv6_iface) {
290 iscsi_destroy_iface(phba->ipv6_iface);
291 phba->ipv6_iface = NULL;
293 if (phba->ipv4_iface) {
294 iscsi_destroy_iface(phba->ipv4_iface);
295 phba->ipv4_iface = NULL;
300 * beiscsi_set_vlan_tag()- Set the VLAN TAG
301 * @shost: Scsi Host for the driver instance
302 * @iface_param: Interface paramters
304 * Set the VLAN TAG for the adapter or disable
309 * Failure: Non-Zero Value
312 beiscsi_iface_config_vlan(struct Scsi_Host *shost,
313 struct iscsi_iface_param_info *iface_param)
315 struct beiscsi_hba *phba = iscsi_host_priv(shost);
318 switch (iface_param->param) {
319 case ISCSI_NET_PARAM_VLAN_ENABLED:
321 if (iface_param->value[0] != ISCSI_VLAN_ENABLE)
322 ret = beiscsi_if_set_vlan(phba, BEISCSI_VLAN_DISABLE);
324 case ISCSI_NET_PARAM_VLAN_TAG:
325 ret = beiscsi_if_set_vlan(phba,
326 *((uint16_t *)iface_param->value));
334 beiscsi_iface_config_ipv4(struct Scsi_Host *shost,
335 struct iscsi_iface_param_info *info,
336 void *data, uint32_t dt_len)
338 struct beiscsi_hba *phba = iscsi_host_priv(shost);
339 u8 *ip = NULL, *subnet = NULL, *gw;
343 /* Check the param */
344 switch (info->param) {
345 case ISCSI_NET_PARAM_IFACE_ENABLE:
346 if (info->value[0] == ISCSI_IFACE_ENABLE)
347 ret = beiscsi_iface_create_ipv4(phba);
349 iscsi_destroy_iface(phba->ipv4_iface);
350 phba->ipv4_iface = NULL;
353 case ISCSI_NET_PARAM_IPV4_GW:
355 ret = beiscsi_if_set_gw(phba, BEISCSI_IP_TYPE_V4, gw);
357 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
358 if (info->value[0] == ISCSI_BOOTPROTO_DHCP)
359 ret = beiscsi_if_en_dhcp(phba, BEISCSI_IP_TYPE_V4);
360 else if (info->value[0] == ISCSI_BOOTPROTO_STATIC)
361 /* release DHCP IP address */
362 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
365 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
366 "BS_%d : Invalid BOOTPROTO: %d\n",
369 case ISCSI_NET_PARAM_IPV4_ADDR:
371 nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_SUBNET);
373 info = nla_data(nla);
374 subnet = info->value;
376 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
379 case ISCSI_NET_PARAM_IPV4_SUBNET:
381 * OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR ioctl needs IP
382 * and subnet both. Find IP to be applied for this subnet.
384 subnet = info->value;
385 nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
387 info = nla_data(nla);
390 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4,
399 beiscsi_iface_config_ipv6(struct Scsi_Host *shost,
400 struct iscsi_iface_param_info *iface_param,
401 void *data, uint32_t dt_len)
403 struct beiscsi_hba *phba = iscsi_host_priv(shost);
406 switch (iface_param->param) {
407 case ISCSI_NET_PARAM_IFACE_ENABLE:
408 if (iface_param->value[0] == ISCSI_IFACE_ENABLE)
409 ret = beiscsi_iface_create_ipv6(phba);
411 iscsi_destroy_iface(phba->ipv6_iface);
412 phba->ipv6_iface = NULL;
415 case ISCSI_NET_PARAM_IPV6_ADDR:
416 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V6,
417 iface_param->value, NULL);
424 int beiscsi_iface_set_param(struct Scsi_Host *shost,
425 void *data, uint32_t dt_len)
427 struct iscsi_iface_param_info *iface_param = NULL;
428 struct beiscsi_hba *phba = iscsi_host_priv(shost);
429 struct nlattr *attrib;
430 uint32_t rm_len = dt_len;
433 if (!beiscsi_hba_is_online(phba)) {
434 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
435 "BS_%d : HBA in error 0x%lx\n", phba->state);
439 /* update interface_handle */
440 ret = beiscsi_if_get_handle(phba);
442 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
443 "BS_%d : Getting Interface Handle Failed\n");
447 nla_for_each_attr(attrib, data, dt_len, rm_len) {
448 iface_param = nla_data(attrib);
450 if (iface_param->param_type != ISCSI_NET_PARAM)
454 * BE2ISCSI only supports 1 interface
456 if (iface_param->iface_num) {
457 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
458 "BS_%d : Invalid iface_num %d."
459 "Only iface_num 0 is supported.\n",
460 iface_param->iface_num);
465 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
466 "BS_%d : %s.0 set param %d",
467 (iface_param->iface_type == ISCSI_IFACE_TYPE_IPV4) ?
468 "ipv4" : "ipv6", iface_param->param);
471 switch (iface_param->param) {
472 case ISCSI_NET_PARAM_VLAN_ENABLED:
473 case ISCSI_NET_PARAM_VLAN_TAG:
474 ret = beiscsi_iface_config_vlan(shost, iface_param);
477 switch (iface_param->iface_type) {
478 case ISCSI_IFACE_TYPE_IPV4:
479 ret = beiscsi_iface_config_ipv4(shost,
483 case ISCSI_IFACE_TYPE_IPV6:
484 ret = beiscsi_iface_config_ipv6(shost,
492 __beiscsi_log(phba, KERN_ERR,
493 "BS_%d : %s.0 set param %d not permitted",
494 (iface_param->iface_type ==
495 ISCSI_IFACE_TYPE_IPV4) ? "ipv4" : "ipv6",
506 static int __beiscsi_iface_get_param(struct beiscsi_hba *phba,
507 struct iscsi_iface *iface,
508 int param, char *buf)
510 struct be_cmd_get_if_info_resp *if_info;
511 int len, ip_type = BEISCSI_IP_TYPE_V4;
513 if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6)
514 ip_type = BEISCSI_IP_TYPE_V6;
516 len = beiscsi_if_get_info(phba, ip_type, &if_info);
521 case ISCSI_NET_PARAM_IPV4_ADDR:
522 len = sprintf(buf, "%pI4\n", if_info->ip_addr.addr);
524 case ISCSI_NET_PARAM_IPV6_ADDR:
525 len = sprintf(buf, "%pI6\n", if_info->ip_addr.addr);
527 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
528 if (!if_info->dhcp_state)
529 len = sprintf(buf, "static\n");
531 len = sprintf(buf, "dhcp\n");
533 case ISCSI_NET_PARAM_IPV4_SUBNET:
534 len = sprintf(buf, "%pI4\n", if_info->ip_addr.subnet_mask);
536 case ISCSI_NET_PARAM_VLAN_ENABLED:
537 len = sprintf(buf, "%s\n",
538 (if_info->vlan_priority == BEISCSI_VLAN_DISABLE) ?
539 "disable" : "enable");
541 case ISCSI_NET_PARAM_VLAN_ID:
542 if (if_info->vlan_priority == BEISCSI_VLAN_DISABLE)
545 len = sprintf(buf, "%d\n",
546 (if_info->vlan_priority &
549 case ISCSI_NET_PARAM_VLAN_PRIORITY:
550 if (if_info->vlan_priority == BEISCSI_VLAN_DISABLE)
553 len = sprintf(buf, "%d\n",
554 ((if_info->vlan_priority >> 13) &
555 ISCSI_MAX_VLAN_PRIORITY));
565 int beiscsi_iface_get_param(struct iscsi_iface *iface,
566 enum iscsi_param_type param_type,
567 int param, char *buf)
569 struct Scsi_Host *shost = iscsi_iface_to_shost(iface);
570 struct beiscsi_hba *phba = iscsi_host_priv(shost);
571 struct be_cmd_get_def_gateway_resp gateway;
574 if (param_type != ISCSI_NET_PARAM)
576 if (!beiscsi_hba_is_online(phba)) {
577 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
578 "BS_%d : HBA in error 0x%lx\n", phba->state);
583 case ISCSI_NET_PARAM_IPV4_ADDR:
584 case ISCSI_NET_PARAM_IPV4_SUBNET:
585 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
586 case ISCSI_NET_PARAM_IPV6_ADDR:
587 case ISCSI_NET_PARAM_VLAN_ENABLED:
588 case ISCSI_NET_PARAM_VLAN_ID:
589 case ISCSI_NET_PARAM_VLAN_PRIORITY:
590 len = __beiscsi_iface_get_param(phba, iface, param, buf);
592 case ISCSI_NET_PARAM_IFACE_ENABLE:
593 if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4)
594 len = sprintf(buf, "%s\n",
595 phba->ipv4_iface ? "enable" : "disable");
596 else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV6)
597 len = sprintf(buf, "%s\n",
598 phba->ipv6_iface ? "enable" : "disable");
600 case ISCSI_NET_PARAM_IPV4_GW:
601 memset(&gateway, 0, sizeof(gateway));
602 len = beiscsi_if_get_gw(phba, BEISCSI_IP_TYPE_V4, &gateway);
604 len = sprintf(buf, "%pI4\n", &gateway.ip_addr.addr);
612 * beiscsi_ep_get_param - get the iscsi parameter
613 * @ep: pointer to iscsi ep
614 * @param: parameter type identifier
615 * @buf: buffer pointer
617 * returns iscsi parameter
619 int beiscsi_ep_get_param(struct iscsi_endpoint *ep,
620 enum iscsi_param param, char *buf)
622 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
625 beiscsi_log(beiscsi_ep->phba, KERN_INFO,
627 "BS_%d : In beiscsi_ep_get_param,"
628 " param= %d\n", param);
631 case ISCSI_PARAM_CONN_PORT:
632 len = sprintf(buf, "%hu\n", beiscsi_ep->dst_tcpport);
634 case ISCSI_PARAM_CONN_ADDRESS:
635 if (beiscsi_ep->ip_type == BEISCSI_IP_TYPE_V4)
636 len = sprintf(buf, "%pI4\n", &beiscsi_ep->dst_addr);
638 len = sprintf(buf, "%pI6\n", &beiscsi_ep->dst6_addr);
646 int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
647 enum iscsi_param param, char *buf, int buflen)
649 struct iscsi_conn *conn = cls_conn->dd_data;
650 struct iscsi_session *session = conn->session;
651 struct beiscsi_hba *phba = NULL;
654 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
655 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
656 "BS_%d : In beiscsi_conn_set_param,"
657 " param= %d\n", param);
659 ret = iscsi_set_param(cls_conn, param, buf, buflen);
663 * If userspace tried to set the value to higher than we can
664 * support override here.
667 case ISCSI_PARAM_FIRST_BURST:
668 if (session->first_burst > 8192)
669 session->first_burst = 8192;
671 case ISCSI_PARAM_MAX_RECV_DLENGTH:
672 if (conn->max_recv_dlength > 65536)
673 conn->max_recv_dlength = 65536;
675 case ISCSI_PARAM_MAX_BURST:
676 if (session->max_burst > 262144)
677 session->max_burst = 262144;
679 case ISCSI_PARAM_MAX_XMIT_DLENGTH:
680 if (conn->max_xmit_dlength > 65536)
681 conn->max_xmit_dlength = 65536;
691 * beiscsi_get_port_state - Get the Port State
692 * @shost : pointer to scsi_host structure
695 static void beiscsi_get_port_state(struct Scsi_Host *shost)
697 struct beiscsi_hba *phba = iscsi_host_priv(shost);
698 struct iscsi_cls_host *ihost = shost->shost_data;
700 ihost->port_state = test_bit(BEISCSI_HBA_LINK_UP, &phba->state) ?
701 ISCSI_PORT_STATE_UP : ISCSI_PORT_STATE_DOWN;
705 * beiscsi_get_port_speed - Get the Port Speed from Adapter
706 * @shost : pointer to scsi_host structure
709 static void beiscsi_get_port_speed(struct Scsi_Host *shost)
711 struct beiscsi_hba *phba = iscsi_host_priv(shost);
712 struct iscsi_cls_host *ihost = shost->shost_data;
714 switch (phba->port_speed) {
715 case BE2ISCSI_LINK_SPEED_10MBPS:
716 ihost->port_speed = ISCSI_PORT_SPEED_10MBPS;
718 case BE2ISCSI_LINK_SPEED_100MBPS:
719 ihost->port_speed = ISCSI_PORT_SPEED_100MBPS;
721 case BE2ISCSI_LINK_SPEED_1GBPS:
722 ihost->port_speed = ISCSI_PORT_SPEED_1GBPS;
724 case BE2ISCSI_LINK_SPEED_10GBPS:
725 ihost->port_speed = ISCSI_PORT_SPEED_10GBPS;
727 case BE2ISCSI_LINK_SPEED_25GBPS:
728 ihost->port_speed = ISCSI_PORT_SPEED_25GBPS;
730 case BE2ISCSI_LINK_SPEED_40GBPS:
731 ihost->port_speed = ISCSI_PORT_SPEED_40GBPS;
734 ihost->port_speed = ISCSI_PORT_SPEED_UNKNOWN;
739 * beiscsi_get_host_param - get the iscsi parameter
740 * @shost: pointer to scsi_host structure
741 * @param: parameter type identifier
742 * @buf: buffer pointer
745 int beiscsi_get_host_param(struct Scsi_Host *shost,
746 enum iscsi_host_param param, char *buf)
748 struct beiscsi_hba *phba = iscsi_host_priv(shost);
751 if (!beiscsi_hba_is_online(phba)) {
752 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
753 "BS_%d : HBA in error 0x%lx\n", phba->state);
756 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
757 "BS_%d : In beiscsi_get_host_param, param = %d\n", param);
760 case ISCSI_HOST_PARAM_HWADDRESS:
761 status = beiscsi_get_macaddr(buf, phba);
763 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
764 "BS_%d : beiscsi_get_macaddr Failed\n");
768 case ISCSI_HOST_PARAM_INITIATOR_NAME:
769 /* try fetching user configured name first */
770 status = beiscsi_get_initiator_name(phba, buf, true);
772 status = beiscsi_get_initiator_name(phba, buf, false);
774 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
775 "BS_%d : Retrieving Initiator Name Failed\n");
780 case ISCSI_HOST_PARAM_PORT_STATE:
781 beiscsi_get_port_state(shost);
782 status = sprintf(buf, "%s\n", iscsi_get_port_state_name(shost));
784 case ISCSI_HOST_PARAM_PORT_SPEED:
785 beiscsi_get_port_speed(shost);
786 status = sprintf(buf, "%s\n", iscsi_get_port_speed_name(shost));
789 return iscsi_host_get_param(shost, param, buf);
794 int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba)
796 struct be_cmd_get_nic_conf_resp resp;
799 if (phba->mac_addr_set)
800 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
802 memset(&resp, 0, sizeof(resp));
803 rc = mgmt_get_nic_conf(phba, &resp);
807 phba->mac_addr_set = true;
808 memcpy(phba->mac_address, resp.mac_address, ETH_ALEN);
809 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
813 * beiscsi_conn_get_stats - get the iscsi stats
814 * @cls_conn: pointer to iscsi cls conn
815 * @stats: pointer to iscsi_stats structure
817 * returns iscsi stats
819 void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
820 struct iscsi_stats *stats)
822 struct iscsi_conn *conn = cls_conn->dd_data;
823 struct beiscsi_hba *phba = NULL;
825 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
826 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
827 "BS_%d : In beiscsi_conn_get_stats\n");
829 stats->txdata_octets = conn->txdata_octets;
830 stats->rxdata_octets = conn->rxdata_octets;
831 stats->dataout_pdus = conn->dataout_pdus_cnt;
832 stats->scsirsp_pdus = conn->scsirsp_pdus_cnt;
833 stats->scsicmd_pdus = conn->scsicmd_pdus_cnt;
834 stats->datain_pdus = conn->datain_pdus_cnt;
835 stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
836 stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
837 stats->r2t_pdus = conn->r2t_pdus_cnt;
838 stats->digest_err = 0;
839 stats->timeout_err = 0;
840 stats->custom_length = 1;
841 strcpy(stats->custom[0].desc, "eh_abort_cnt");
842 stats->custom[0].value = conn->eh_abort_cnt;
846 * beiscsi_set_params_for_offld - get the parameters for offload
847 * @beiscsi_conn: pointer to beiscsi_conn
848 * @params: pointer to offload_params structure
850 static void beiscsi_set_params_for_offld(struct beiscsi_conn *beiscsi_conn,
851 struct beiscsi_offload_params *params)
853 struct iscsi_conn *conn = beiscsi_conn->conn;
854 struct iscsi_session *session = conn->session;
856 AMAP_SET_BITS(struct amap_beiscsi_offload_params, max_burst_length,
857 params, session->max_burst);
858 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
859 max_send_data_segment_length, params,
860 conn->max_xmit_dlength);
861 AMAP_SET_BITS(struct amap_beiscsi_offload_params, first_burst_length,
862 params, session->first_burst);
863 AMAP_SET_BITS(struct amap_beiscsi_offload_params, erl, params,
865 AMAP_SET_BITS(struct amap_beiscsi_offload_params, dde, params,
867 AMAP_SET_BITS(struct amap_beiscsi_offload_params, hde, params,
869 AMAP_SET_BITS(struct amap_beiscsi_offload_params, ir2t, params,
870 session->initial_r2t_en);
871 AMAP_SET_BITS(struct amap_beiscsi_offload_params, imd, params,
872 session->imm_data_en);
873 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
874 data_seq_inorder, params,
875 session->dataseq_inorder_en);
876 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
877 pdu_seq_inorder, params,
878 session->pdu_inorder_en);
879 AMAP_SET_BITS(struct amap_beiscsi_offload_params, max_r2t, params,
881 AMAP_SET_BITS(struct amap_beiscsi_offload_params, exp_statsn, params,
882 (conn->exp_statsn - 1));
883 AMAP_SET_BITS(struct amap_beiscsi_offload_params,
884 max_recv_data_segment_length, params,
885 conn->max_recv_dlength);
890 * beiscsi_conn_start - offload of session to chip
891 * @cls_conn: pointer to beiscsi_conn
893 int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn)
895 struct iscsi_conn *conn = cls_conn->dd_data;
896 struct beiscsi_conn *beiscsi_conn = conn->dd_data;
897 struct beiscsi_endpoint *beiscsi_ep;
898 struct beiscsi_offload_params params;
899 struct beiscsi_hba *phba;
901 phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
903 if (!beiscsi_hba_is_online(phba)) {
904 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
905 "BS_%d : HBA in error 0x%lx\n", phba->state);
908 beiscsi_log(beiscsi_conn->phba, KERN_INFO, BEISCSI_LOG_CONFIG,
909 "BS_%d : In beiscsi_conn_start\n");
911 memset(¶ms, 0, sizeof(struct beiscsi_offload_params));
912 beiscsi_ep = beiscsi_conn->ep;
914 beiscsi_log(beiscsi_conn->phba, KERN_ERR,
916 "BS_%d : In beiscsi_conn_start , no beiscsi_ep\n");
918 beiscsi_conn->login_in_progress = 0;
919 beiscsi_set_params_for_offld(beiscsi_conn, ¶ms);
920 beiscsi_offload_connection(beiscsi_conn, ¶ms);
921 iscsi_conn_start(cls_conn);
926 * beiscsi_get_cid - Allocate a cid
927 * @phba: The phba instance
929 static int beiscsi_get_cid(struct beiscsi_hba *phba)
931 uint16_t cid_avlbl_ulp0, cid_avlbl_ulp1;
932 unsigned short cid, cid_from_ulp;
933 struct ulp_cid_info *cid_info;
935 /* Find the ULP which has more CID available */
936 cid_avlbl_ulp0 = (phba->cid_array_info[BEISCSI_ULP0]) ?
937 BEISCSI_ULP0_AVLBL_CID(phba) : 0;
938 cid_avlbl_ulp1 = (phba->cid_array_info[BEISCSI_ULP1]) ?
939 BEISCSI_ULP1_AVLBL_CID(phba) : 0;
940 cid_from_ulp = (cid_avlbl_ulp0 > cid_avlbl_ulp1) ?
941 BEISCSI_ULP0 : BEISCSI_ULP1;
943 * If iSCSI protocol is loaded only on ULP 0, and when cid_avlbl_ulp
944 * is ZERO for both, ULP 1 is returned.
945 * Check if ULP is loaded before getting new CID.
947 if (!test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported))
948 return BE_INVALID_CID;
950 cid_info = phba->cid_array_info[cid_from_ulp];
951 cid = cid_info->cid_array[cid_info->cid_alloc];
952 if (!cid_info->avlbl_cids || cid == BE_INVALID_CID) {
953 __beiscsi_log(phba, KERN_ERR,
954 "BS_%d : failed to get cid: available %u:%u\n",
955 cid_info->avlbl_cids, cid_info->cid_free);
956 return BE_INVALID_CID;
959 cid_info->cid_array[cid_info->cid_alloc++] = BE_INVALID_CID;
960 if (cid_info->cid_alloc == BEISCSI_GET_CID_COUNT(phba, cid_from_ulp))
961 cid_info->cid_alloc = 0;
962 cid_info->avlbl_cids--;
967 * beiscsi_put_cid - Free the cid
968 * @phba: The phba for which the cid is being freed
969 * @cid: The cid to free
971 static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid)
973 uint16_t cri_index = BE_GET_CRI_FROM_CID(cid);
974 struct hwi_wrb_context *pwrb_context;
975 struct hwi_controller *phwi_ctrlr;
976 struct ulp_cid_info *cid_info;
977 uint16_t cid_post_ulp;
979 phwi_ctrlr = phba->phwi_ctrlr;
980 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
981 cid_post_ulp = pwrb_context->ulp_num;
983 cid_info = phba->cid_array_info[cid_post_ulp];
984 /* fill only in empty slot */
985 if (cid_info->cid_array[cid_info->cid_free] != BE_INVALID_CID) {
986 __beiscsi_log(phba, KERN_ERR,
987 "BS_%d : failed to put cid %u: available %u:%u\n",
988 cid, cid_info->avlbl_cids, cid_info->cid_free);
991 cid_info->cid_array[cid_info->cid_free++] = cid;
992 if (cid_info->cid_free == BEISCSI_GET_CID_COUNT(phba, cid_post_ulp))
993 cid_info->cid_free = 0;
994 cid_info->avlbl_cids++;
998 * beiscsi_free_ep - free endpoint
999 * @ep: pointer to iscsi endpoint structure
1001 static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
1003 struct beiscsi_hba *phba = beiscsi_ep->phba;
1004 struct beiscsi_conn *beiscsi_conn;
1006 beiscsi_put_cid(phba, beiscsi_ep->ep_cid);
1007 beiscsi_ep->phba = NULL;
1008 /* clear this to track freeing in beiscsi_ep_disconnect */
1009 phba->ep_array[BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid)] = NULL;
1012 * Check if any connection resource allocated by driver
1013 * is to be freed.This case occurs when target redirection
1014 * or connection retry is done.
1016 if (!beiscsi_ep->conn)
1019 beiscsi_conn = beiscsi_ep->conn;
1021 * Break ep->conn link here so that completions after
1024 beiscsi_ep->conn = NULL;
1025 if (beiscsi_conn->login_in_progress) {
1026 beiscsi_free_mgmt_task_handles(beiscsi_conn,
1027 beiscsi_conn->task);
1028 beiscsi_conn->login_in_progress = 0;
1033 * beiscsi_open_conn - Ask FW to open a TCP connection
1034 * @ep: endpoint to be used
1035 * @src_addr: The source IP address
1036 * @dst_addr: The Destination IP address
1038 * Asks the FW to open a TCP connection
1040 static int beiscsi_open_conn(struct iscsi_endpoint *ep,
1041 struct sockaddr *src_addr,
1042 struct sockaddr *dst_addr, int non_blocking)
1044 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
1045 struct beiscsi_hba *phba = beiscsi_ep->phba;
1046 struct tcp_connect_and_offload_out *ptcpcnct_out;
1047 struct be_dma_mem nonemb_cmd;
1048 unsigned int tag, req_memsize;
1051 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1052 "BS_%d : In beiscsi_open_conn\n");
1054 beiscsi_ep->ep_cid = beiscsi_get_cid(phba);
1055 if (beiscsi_ep->ep_cid == BE_INVALID_CID) {
1056 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1057 "BS_%d : No free cid available\n");
1061 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1062 "BS_%d : In beiscsi_open_conn, ep_cid=%d\n",
1063 beiscsi_ep->ep_cid);
1065 phba->ep_array[BE_GET_CRI_FROM_CID
1066 (beiscsi_ep->ep_cid)] = ep;
1068 beiscsi_ep->cid_vld = 0;
1070 if (is_chip_be2_be3r(phba))
1071 req_memsize = sizeof(struct tcp_connect_and_offload_in);
1073 req_memsize = sizeof(struct tcp_connect_and_offload_in_v1);
1075 nonemb_cmd.va = dma_alloc_coherent(&phba->ctrl.pdev->dev,
1077 &nonemb_cmd.dma, GFP_KERNEL);
1078 if (nonemb_cmd.va == NULL) {
1080 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1081 "BS_%d : Failed to allocate memory for"
1082 " mgmt_open_connection\n");
1084 beiscsi_free_ep(beiscsi_ep);
1087 nonemb_cmd.size = req_memsize;
1088 memset(nonemb_cmd.va, 0, nonemb_cmd.size);
1089 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd);
1091 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1092 "BS_%d : mgmt_open_connection Failed for cid=%d\n",
1093 beiscsi_ep->ep_cid);
1095 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size,
1096 nonemb_cmd.va, nonemb_cmd.dma);
1097 beiscsi_free_ep(beiscsi_ep);
1101 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd);
1103 beiscsi_log(phba, KERN_ERR,
1104 BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
1105 "BS_%d : mgmt_open_connection Failed");
1108 dma_free_coherent(&phba->ctrl.pdev->dev,
1109 nonemb_cmd.size, nonemb_cmd.va,
1112 beiscsi_free_ep(beiscsi_ep);
1116 ptcpcnct_out = (struct tcp_connect_and_offload_out *)nonemb_cmd.va;
1117 beiscsi_ep = ep->dd_data;
1118 beiscsi_ep->fw_handle = ptcpcnct_out->connection_handle;
1119 beiscsi_ep->cid_vld = 1;
1120 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1121 "BS_%d : mgmt_open_connection Success\n");
1123 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size,
1124 nonemb_cmd.va, nonemb_cmd.dma);
1129 * beiscsi_ep_connect - Ask chip to create TCP Conn
1130 * @scsi_host: Pointer to scsi_host structure
1131 * @dst_addr: The IP address of Target
1132 * @non_blocking: blocking or non-blocking call
1134 * This routines first asks chip to create a connection and then allocates an EP
1136 struct iscsi_endpoint *
1137 beiscsi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
1140 struct beiscsi_hba *phba;
1141 struct beiscsi_endpoint *beiscsi_ep;
1142 struct iscsi_endpoint *ep;
1147 pr_err("beiscsi_ep_connect shost is NULL\n");
1148 return ERR_PTR(ret);
1151 phba = iscsi_host_priv(shost);
1152 if (!beiscsi_hba_is_online(phba)) {
1154 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1155 "BS_%d : HBA in error 0x%lx\n", phba->state);
1156 return ERR_PTR(ret);
1158 if (!test_bit(BEISCSI_HBA_LINK_UP, &phba->state)) {
1160 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
1161 "BS_%d : The Adapter Port state is Down!!!\n");
1162 return ERR_PTR(ret);
1165 ep = iscsi_create_endpoint(sizeof(struct beiscsi_endpoint));
1168 return ERR_PTR(ret);
1171 beiscsi_ep = ep->dd_data;
1172 beiscsi_ep->phba = phba;
1173 beiscsi_ep->openiscsi_ep = ep;
1174 ret = beiscsi_open_conn(ep, NULL, dst_addr, non_blocking);
1176 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
1177 "BS_%d : Failed in beiscsi_open_conn\n");
1184 iscsi_destroy_endpoint(ep);
1185 return ERR_PTR(ret);
1189 * beiscsi_ep_poll - Poll to see if connection is established
1190 * @ep: endpoint to be used
1191 * @timeout_ms: timeout specified in millisecs
1193 * Poll to see if TCP connection established
1195 int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
1197 struct beiscsi_endpoint *beiscsi_ep = ep->dd_data;
1199 beiscsi_log(beiscsi_ep->phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1200 "BS_%d : In beiscsi_ep_poll\n");
1202 if (beiscsi_ep->cid_vld == 1)
1209 * beiscsi_flush_cq()- Flush the CQ created.
1210 * @phba: ptr device priv structure.
1212 * Before the connection resource are freed flush
1213 * all the CQ enteries
1215 static void beiscsi_flush_cq(struct beiscsi_hba *phba)
1218 struct be_eq_obj *pbe_eq;
1219 struct hwi_controller *phwi_ctrlr;
1220 struct hwi_context_memory *phwi_context;
1222 phwi_ctrlr = phba->phwi_ctrlr;
1223 phwi_context = phwi_ctrlr->phwi_ctxt;
1225 for (i = 0; i < phba->num_cpus; i++) {
1226 pbe_eq = &phwi_context->be_eq[i];
1227 irq_poll_disable(&pbe_eq->iopoll);
1228 beiscsi_process_cq(pbe_eq, BE2_MAX_NUM_CQ_PROC);
1229 irq_poll_enable(&pbe_eq->iopoll);
1234 * beiscsi_conn_close - Invalidate and upload connection
1235 * @ep: The iscsi endpoint
1237 * Returns 0 on success, -1 on failure.
1239 static int beiscsi_conn_close(struct beiscsi_endpoint *beiscsi_ep)
1241 struct beiscsi_hba *phba = beiscsi_ep->phba;
1242 unsigned int tag, attempts;
1246 * Without successfully invalidating and uploading connection
1247 * driver can't reuse the CID so attempt more than once.
1250 while (attempts++ < 3) {
1251 tag = beiscsi_invalidate_cxn(phba, beiscsi_ep);
1253 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1256 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1257 "BS_%d : invalidate conn failed cid %d\n",
1258 beiscsi_ep->ep_cid);
1262 /* wait for all completions to arrive, then process them */
1264 /* flush CQ entries */
1265 beiscsi_flush_cq(phba);
1271 while (attempts++ < 3) {
1272 tag = beiscsi_upload_cxn(phba, beiscsi_ep);
1274 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL);
1277 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1278 "BS_%d : upload conn failed cid %d\n",
1279 beiscsi_ep->ep_cid);
1289 * beiscsi_ep_disconnect - Tears down the TCP connection
1290 * @ep: endpoint to be used
1292 * Tears down the TCP connection
1294 void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
1296 struct beiscsi_endpoint *beiscsi_ep;
1297 struct beiscsi_conn *beiscsi_conn;
1298 struct beiscsi_hba *phba;
1301 beiscsi_ep = ep->dd_data;
1302 phba = beiscsi_ep->phba;
1303 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1304 "BS_%d : In beiscsi_ep_disconnect for ep_cid = %u\n",
1305 beiscsi_ep->ep_cid);
1307 cri_index = BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid);
1308 if (!phba->ep_array[cri_index]) {
1309 __beiscsi_log(phba, KERN_ERR,
1310 "BS_%d : ep_array at %u cid %u empty\n",
1312 beiscsi_ep->ep_cid);
1316 if (beiscsi_ep->conn) {
1317 beiscsi_conn = beiscsi_ep->conn;
1318 iscsi_suspend_queue(beiscsi_conn->conn);
1321 if (!beiscsi_hba_is_online(phba)) {
1322 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
1323 "BS_%d : HBA in error 0x%lx\n", phba->state);
1326 * Make CID available even if close fails.
1327 * If not freed, FW might fail open using the CID.
1329 if (beiscsi_conn_close(beiscsi_ep) < 0)
1330 __beiscsi_log(phba, KERN_ERR,
1331 "BS_%d : close conn failed cid %d\n",
1332 beiscsi_ep->ep_cid);
1335 beiscsi_free_ep(beiscsi_ep);
1336 if (!phba->conn_table[cri_index])
1337 __beiscsi_log(phba, KERN_ERR,
1338 "BS_%d : conn_table empty at %u: cid %u\n",
1339 cri_index, beiscsi_ep->ep_cid);
1340 phba->conn_table[cri_index] = NULL;
1341 iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep);
1344 umode_t beiscsi_attr_is_visible(int param_type, int param)
1346 switch (param_type) {
1347 case ISCSI_NET_PARAM:
1349 case ISCSI_NET_PARAM_IFACE_ENABLE:
1350 case ISCSI_NET_PARAM_IPV4_ADDR:
1351 case ISCSI_NET_PARAM_IPV4_SUBNET:
1352 case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
1353 case ISCSI_NET_PARAM_IPV4_GW:
1354 case ISCSI_NET_PARAM_IPV6_ADDR:
1355 case ISCSI_NET_PARAM_VLAN_ID:
1356 case ISCSI_NET_PARAM_VLAN_PRIORITY:
1357 case ISCSI_NET_PARAM_VLAN_ENABLED:
1362 case ISCSI_HOST_PARAM:
1364 case ISCSI_HOST_PARAM_HWADDRESS:
1365 case ISCSI_HOST_PARAM_INITIATOR_NAME:
1366 case ISCSI_HOST_PARAM_PORT_STATE:
1367 case ISCSI_HOST_PARAM_PORT_SPEED:
1374 case ISCSI_PARAM_MAX_RECV_DLENGTH:
1375 case ISCSI_PARAM_MAX_XMIT_DLENGTH:
1376 case ISCSI_PARAM_HDRDGST_EN:
1377 case ISCSI_PARAM_DATADGST_EN:
1378 case ISCSI_PARAM_CONN_ADDRESS:
1379 case ISCSI_PARAM_CONN_PORT:
1380 case ISCSI_PARAM_EXP_STATSN:
1381 case ISCSI_PARAM_PERSISTENT_ADDRESS:
1382 case ISCSI_PARAM_PERSISTENT_PORT:
1383 case ISCSI_PARAM_PING_TMO:
1384 case ISCSI_PARAM_RECV_TMO:
1385 case ISCSI_PARAM_INITIAL_R2T_EN:
1386 case ISCSI_PARAM_MAX_R2T:
1387 case ISCSI_PARAM_IMM_DATA_EN:
1388 case ISCSI_PARAM_FIRST_BURST:
1389 case ISCSI_PARAM_MAX_BURST:
1390 case ISCSI_PARAM_PDU_INORDER_EN:
1391 case ISCSI_PARAM_DATASEQ_INORDER_EN:
1392 case ISCSI_PARAM_ERL:
1393 case ISCSI_PARAM_TARGET_NAME:
1394 case ISCSI_PARAM_TPGT:
1395 case ISCSI_PARAM_USERNAME:
1396 case ISCSI_PARAM_PASSWORD:
1397 case ISCSI_PARAM_USERNAME_IN:
1398 case ISCSI_PARAM_PASSWORD_IN:
1399 case ISCSI_PARAM_FAST_ABORT:
1400 case ISCSI_PARAM_ABORT_TMO:
1401 case ISCSI_PARAM_LU_RESET_TMO:
1402 case ISCSI_PARAM_IFACE_NAME:
1403 case ISCSI_PARAM_INITIATOR_NAME: