blob: 8c88657eed0d8cac02660f67d1f06866b243c2d8 [file] [log] [blame]
Thomas Gleixner6e9ef502019-05-29 16:57:52 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Jitendra Bhivare942b7652017-03-24 14:11:48 +05302/*
Jitendra Bhivare0172dc62017-10-10 16:18:19 +05303 * Copyright 2017 Broadcom. All Rights Reserved.
Jitendra Bhivare942b7652017-03-24 14:11:48 +05304 * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05305 *
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05306 * Contact Information:
Jitendra Bhivare60f36e02016-08-19 15:20:24 +05307 * linux-drivers@broadcom.com
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05308 */
9
10#ifndef _BE_ISCSI_
11#define _BE_ISCSI_
12
13#include "be_main.h"
14#include "be_mgmt.h"
15
Jitendra Bhivare96b48b92016-08-19 15:20:06 +053016void beiscsi_iface_create_default(struct beiscsi_hba *phba);
Mike Christie0e438952012-04-03 23:41:51 -050017
Jitendra Bhivare96b48b92016-08-19 15:20:06 +053018void beiscsi_iface_destroy_default(struct beiscsi_hba *phba);
Mike Christie0e438952012-04-03 23:41:51 -050019
Jitendra Bhivare96b48b92016-08-19 15:20:06 +053020int beiscsi_iface_get_param(struct iscsi_iface *iface,
Mike Christie0e438952012-04-03 23:41:51 -050021 enum iscsi_param_type param_type,
22 int param, char *buf);
23
Jitendra Bhivare96b48b92016-08-19 15:20:06 +053024int beiscsi_iface_set_param(struct Scsi_Host *shost,
Mike Christie0e438952012-04-03 23:41:51 -050025 void *data, uint32_t count);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053026
Jitendra Bhivare96b48b92016-08-19 15:20:06 +053027umode_t beiscsi_attr_is_visible(int param_type, int param);
Mike Christie3128c6c2011-07-25 13:48:42 -050028
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053029void beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn,
30 struct beiscsi_offload_params *params);
31
32void beiscsi_offload_iscsi(struct beiscsi_hba *phba, struct iscsi_conn *conn,
33 struct beiscsi_conn *beiscsi_conn,
34 unsigned int fw_handle);
35
36struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
37 uint16_t cmds_max,
38 uint16_t qdepth,
39 uint32_t initial_cmdsn);
40
41void beiscsi_session_destroy(struct iscsi_cls_session *cls_session);
42
Jitendra Bhivare480195c2016-08-19 15:20:15 +053043void beiscsi_session_fail(struct iscsi_cls_session *cls_session);
44
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053045struct iscsi_cls_conn *beiscsi_conn_create(struct iscsi_cls_session
46 *cls_session, uint32_t cid);
47
48int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
49 struct iscsi_cls_conn *cls_conn,
50 uint64_t transport_fd, int is_leading);
51
Mike Christiec7f7fd52011-02-16 15:04:41 -060052int beiscsi_ep_get_param(struct iscsi_endpoint *ep, enum iscsi_param param,
53 char *buf);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053054
55int beiscsi_get_host_param(struct Scsi_Host *shost,
56 enum iscsi_host_param param, char *buf);
57
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +053058int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba);
59
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053060int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
61 enum iscsi_param param, char *buf, int buflen);
62
63int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn);
64
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053065struct iscsi_endpoint *beiscsi_ep_connect(struct Scsi_Host *shost,
66 struct sockaddr *dst_addr,
67 int non_blocking);
68
69int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms);
70
71void beiscsi_ep_disconnect(struct iscsi_endpoint *ep);
72
73void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
74 struct iscsi_stats *stats);
75
76#endif