1922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/*
2922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * Copyright (c) 2005 Network Appliance, Inc. All rights reserved.
3922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
4922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
5922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * This software is available to you under a choice of one of two
6922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * licenses.  You may choose to be licensed under the terms of the GNU
7922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * General Public License (GPL) Version 2, available from the file
8922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * COPYING in the main directory of this source tree, or the
9922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * OpenIB.org BSD license below:
10922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
11922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *     Redistribution and use in source and binary forms, with or
12922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *     without modification, are permitted provided that the following
13922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *     conditions are met:
14922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
15922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *      - Redistributions of source code must retain the above
16922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *        copyright notice, this list of conditions and the following
17922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *        disclaimer.
18922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
19922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *      - Redistributions in binary form must reproduce the above
20922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *        copyright notice, this list of conditions and the following
21922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *        disclaimer in the documentation and/or other materials
22922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *        provided with the distribution.
23922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
24922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * SOFTWARE.
32922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
33922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker#ifndef IW_CM_H
34922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker#define IW_CM_H
35922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
36922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker#include <linux/in.h>
37922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker#include <rdma/ib_cm.h>
38922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
39922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_id;
40922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
41922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerenum iw_cm_event_type {
42922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	IW_CM_EVENT_CONNECT_REQUEST = 1, /* connect request received */
43922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	IW_CM_EVENT_CONNECT_REPLY,	 /* reply from active connect request */
44922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	IW_CM_EVENT_ESTABLISHED,	 /* passive side accept successful */
45922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	IW_CM_EVENT_DISCONNECT,		 /* orderly shutdown */
46922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	IW_CM_EVENT_CLOSE		 /* close complete */
47922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker};
48922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
49922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_event {
50922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	enum iw_cm_event_type event;
51d0c49bf391b2e230a8f3ae4486da7df440f1216dRoland Dreier	int			 status;
52922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct sockaddr_in local_addr;
53922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct sockaddr_in remote_addr;
54922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void *private_data;
554deccd6d95f1f1536dad3c842e39c1ace577329dDotan Barak	void *provider_data;
563ebeebc38b4b13384aba97f2e4acd6b48d47a65cKumar Sanghvi	u8 private_data_len;
573ebeebc38b4b13384aba97f2e4acd6b48d47a65cKumar Sanghvi	u8 ord;
583ebeebc38b4b13384aba97f2e4acd6b48d47a65cKumar Sanghvi	u8 ird;
59922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker};
60922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
61922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
62922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_handler - Function to be called by the IW CM when delivering events
63922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * to the client.
64922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
65922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier associated with the event.
66922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @event: Pointer to the event structure.
67922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
68922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckertypedef int (*iw_cm_handler)(struct iw_cm_id *cm_id,
69922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker			     struct iw_cm_event *event);
70922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
71922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
72922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_event_handler - Function called by the provider when delivering provider
73922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * events to the IW CM.  Returns either 0 indicating the event was processed
74922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * or -errno if the event could not be processed.
75922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
76922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier associated with the event.
77922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @event: Pointer to the event structure.
78922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
79922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckertypedef int (*iw_event_handler)(struct iw_cm_id *cm_id,
80922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				 struct iw_cm_event *event);
81922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
82922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_id {
83922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	iw_cm_handler		cm_handler;      /* client callback function */
84922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void		        *context;	 /* client cb context */
85922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct ib_device	*device;
86922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct sockaddr_in      local_addr;
87922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct sockaddr_in	remote_addr;
88922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void			*provider_data;	 /* provider private data */
89922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	iw_event_handler        event_handler;   /* cb for provider
90922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker						    events */
91922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	/* Used by provider to add and remove refs on IW cm_id */
92922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void (*add_ref)(struct iw_cm_id *);
93922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void (*rem_ref)(struct iw_cm_id *);
94922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker};
95922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
96922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_conn_param {
97922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	const void *private_data;
98922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	u16 private_data_len;
99922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	u32 ord;
100922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	u32 ird;
101922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	u32 qpn;
102922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker};
103922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
104922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_verbs {
105922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void		(*add_ref)(struct ib_qp *qp);
106922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
107922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	void		(*rem_ref)(struct ib_qp *qp);
108922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
109922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	struct ib_qp *	(*get_qp)(struct ib_device *device,
110922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				  int qpn);
111922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
112922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	int		(*connect)(struct iw_cm_id *cm_id,
113922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				   struct iw_cm_conn_param *conn_param);
114922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
115922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	int		(*accept)(struct iw_cm_id *cm_id,
116922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				  struct iw_cm_conn_param *conn_param);
117922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
118922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	int		(*reject)(struct iw_cm_id *cm_id,
119922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				  const void *pdata, u8 pdata_len);
120922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
121922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	int		(*create_listen)(struct iw_cm_id *cm_id,
122922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker					 int backlog);
123922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
124922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker	int		(*destroy_listen)(struct iw_cm_id *cm_id);
125922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker};
126922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
127922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
128922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_create_cm_id - Create an IW CM identifier.
129922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
130922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @device: The IB device on which to create the IW CM identier.
131922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @event_handler: User callback invoked to report events associated with the
132922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   returned IW CM identifier.
133922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @context: User specified context associated with the id.
134922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
135922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct iw_cm_id *iw_create_cm_id(struct ib_device *device,
136922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker				 iw_cm_handler cm_handler, void *context);
137922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
138922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
139922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_destroy_cm_id - Destroy an IW CM identifier.
140922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
141922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The previously created IW CM identifier to destroy.
142922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
143922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * The client can assume that no events will be delivered for the CM ID after
144922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * this function returns.
145922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
146922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckervoid iw_destroy_cm_id(struct iw_cm_id *cm_id);
147922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
148922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
149922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_bind_qp - Unbind the specified IW CM identifier and QP
150922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
151922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM idenfier to unbind from the QP.
152922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @qp: The QP
153922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
154922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * This is called by the provider when destroying the QP to ensure
155922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * that any references held by the IWCM are released. It may also
156922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * be called by the IWCM when destroying a CM_ID to that any
157922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * references held by the provider are released.
158922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
159922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckervoid iw_cm_unbind_qp(struct iw_cm_id *cm_id, struct ib_qp *qp);
160922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
161922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
162922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_get_qp - Return the ib_qp associated with a QPN
163922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
164922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @ib_device: The IB device
165922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @qpn: The queue pair number
166922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
167922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerstruct ib_qp *iw_cm_get_qp(struct ib_device *device, int qpn);
168922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
169922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
170922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_listen - Listen for incoming connection requests on the
171922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * specified IW CM id.
172922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
173922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier.
174922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @backlog: The maximum number of outstanding un-accepted inbound listen
175922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   requests to queue.
176922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
177922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * The source address and port number are specified in the IW CM identifier
178922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * structure.
179922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
180922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_listen(struct iw_cm_id *cm_id, int backlog);
181922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
182922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
183922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_accept - Called to accept an incoming connect request.
184922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
185922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier associated with the connection request.
186922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @iw_param: Pointer to a structure containing connection establishment
187922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   parameters.
188922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
189922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * The specified cm_id will have been provided in the event data for a
190922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * CONNECT_REQUEST event. Subsequent events related to this connection will be
191922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * delivered to the specified IW CM identifier prior and may occur prior to
192922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * the return of this function. If this function returns a non-zero value, the
193922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * client can assume that no events will be delivered to the specified IW CM
194922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * identifier.
195922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
196922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *iw_param);
197922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
198922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
199922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_reject - Reject an incoming connection request.
200922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
201922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: Connection identifier associated with the request.
202922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @private_daa: Pointer to data to deliver to the remote peer as part of the
203922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   reject message.
204922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @private_data_len: The number of bytes in the private_data parameter.
205922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
206922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * The client can assume that no events will be delivered to the specified IW
207922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * CM identifier following the return of this function. The private_data
208922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * buffer is available for reuse when this function returns.
209922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
210922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_reject(struct iw_cm_id *cm_id, const void *private_data,
211922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker		 u8 private_data_len);
212922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
213922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
214922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_connect - Called to request a connection to a remote peer.
215922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
216922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier for the connection.
217922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @iw_param: Pointer to a structure containing connection  establishment
218922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   parameters.
219922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
220922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * Events may be delivered to the specified IW CM identifier prior to the
221922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * return of this function. If this function returns a non-zero value, the
222922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * client can assume that no events will be delivered to the specified IW CM
223922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * identifier.
224922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
225922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *iw_param);
226922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
227922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
228922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_disconnect - Close the specified connection.
229922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
230922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier to close.
231922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @abrupt: If 0, the connection will be closed gracefully, otherwise, the
232922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   connection will be reset.
233922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
234922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * The IW CM identifier is still active until the IW_CM_EVENT_CLOSE event is
235922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * delivered.
236922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
237922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_disconnect(struct iw_cm_id *cm_id, int abrupt);
238922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
239922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker/**
240922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * iw_cm_init_qp_attr - Called to initialize the attributes of the QP
241922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * associated with a IW CM identifier.
242922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *
243922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @cm_id: The IW CM identifier associated with the QP
244922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @qp_attr: Pointer to the QP attributes structure.
245922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker * @qp_attr_mask: Pointer to a bit vector specifying which QP attributes are
246922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker *   valid.
247922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker */
248922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tuckerint iw_cm_init_qp_attr(struct iw_cm_id *cm_id, struct ib_qp_attr *qp_attr,
249922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker		       int *qp_attr_mask);
250922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker
251922a8e9fb2e0711212badce47a41137e2ca04cb3Tom Tucker#endif /* IW_CM_H */
252