blob: e0b3b2d1f27a64e9b5ee1eba4b558046847c0375 [file] [log] [blame]
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05301/**
Jayamohan Kallickal65c5efa2014-08-08 00:59:59 -04002 * Copyright (C) 2005 - 2014 Emulex
Jayamohan Kallickal6733b392009-09-05 07:36:35 +05303 * All rights reserved.
4 *
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.
9 *
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -070010 * Written by: Jayamohan Kallickal (jayamohan.kallickal@emulex.com)
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053011 *
12 * Contact Information:
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -070013 * linux-drivers@emulex.com
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053014 *
Jayamohan Kallickal255fa9a2011-03-25 14:23:57 -070015 * Emulex
16 * 3333 Susan Street
17 * Costa Mesa, CA 92626
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053018 */
19
20#ifndef _BE_ISCSI_
21#define _BE_ISCSI_
22
23#include "be_main.h"
24#include "be_mgmt.h"
25
26#define BE2_IPV4 0x1
27#define BE2_IPV6 0x10
Mike Christie0e438952012-04-03 23:41:51 -050028#define BE2_DHCP_V4 0x05
29
30#define NON_BLOCKING 0x0
31#define BLOCKING 0x1
32
33void beiscsi_create_def_ifaces(struct beiscsi_hba *phba);
34
35void beiscsi_destroy_def_ifaces(struct beiscsi_hba *phba);
36
37int be2iscsi_iface_get_param(struct iscsi_iface *iface,
38 enum iscsi_param_type param_type,
39 int param, char *buf);
40
41int be2iscsi_iface_set_param(struct Scsi_Host *shost,
42 void *data, uint32_t count);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053043
Al Viro587a1f12011-07-23 23:11:19 -040044umode_t be2iscsi_attr_is_visible(int param_type, int param);
Mike Christie3128c6c2011-07-25 13:48:42 -050045
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053046void beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn,
47 struct beiscsi_offload_params *params);
48
49void beiscsi_offload_iscsi(struct beiscsi_hba *phba, struct iscsi_conn *conn,
50 struct beiscsi_conn *beiscsi_conn,
51 unsigned int fw_handle);
52
53struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
54 uint16_t cmds_max,
55 uint16_t qdepth,
56 uint32_t initial_cmdsn);
57
58void beiscsi_session_destroy(struct iscsi_cls_session *cls_session);
59
60struct iscsi_cls_conn *beiscsi_conn_create(struct iscsi_cls_session
61 *cls_session, uint32_t cid);
62
63int beiscsi_conn_bind(struct iscsi_cls_session *cls_session,
64 struct iscsi_cls_conn *cls_conn,
65 uint64_t transport_fd, int is_leading);
66
Mike Christiec7f7fd52011-02-16 15:04:41 -060067int beiscsi_ep_get_param(struct iscsi_endpoint *ep, enum iscsi_param param,
68 char *buf);
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053069
70int beiscsi_get_host_param(struct Scsi_Host *shost,
71 enum iscsi_host_param param, char *buf);
72
Jayamohan Kallickalc7acc5b2010-07-22 04:29:18 +053073int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba);
74
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053075int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
76 enum iscsi_param param, char *buf, int buflen);
77
78int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn);
79
Jayamohan Kallickal6733b392009-09-05 07:36:35 +053080struct iscsi_endpoint *beiscsi_ep_connect(struct Scsi_Host *shost,
81 struct sockaddr *dst_addr,
82 int non_blocking);
83
84int beiscsi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms);
85
86void beiscsi_ep_disconnect(struct iscsi_endpoint *ep);
87
88void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
89 struct iscsi_stats *stats);
90
91#endif