xref: /openbmc/linux/drivers/infiniband/core/iwcm.h (revision 60dff56d)
1922a8e9fSTom Tucker /*
2922a8e9fSTom Tucker  * Copyright (c) 2005 Network Appliance, Inc. All rights reserved.
3922a8e9fSTom Tucker  * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
4922a8e9fSTom Tucker  *
5922a8e9fSTom Tucker  * This software is available to you under a choice of one of two
6922a8e9fSTom Tucker  * licenses.  You may choose to be licensed under the terms of the GNU
7922a8e9fSTom Tucker  * General Public License (GPL) Version 2, available from the file
8922a8e9fSTom Tucker  * COPYING in the main directory of this source tree, or the
9922a8e9fSTom Tucker  * OpenIB.org BSD license below:
10922a8e9fSTom Tucker  *
11922a8e9fSTom Tucker  *     Redistribution and use in source and binary forms, with or
12922a8e9fSTom Tucker  *     without modification, are permitted provided that the following
13922a8e9fSTom Tucker  *     conditions are met:
14922a8e9fSTom Tucker  *
15922a8e9fSTom Tucker  *      - Redistributions of source code must retain the above
16922a8e9fSTom Tucker  *        copyright notice, this list of conditions and the following
17922a8e9fSTom Tucker  *        disclaimer.
18922a8e9fSTom Tucker  *
19922a8e9fSTom Tucker  *      - Redistributions in binary form must reproduce the above
20922a8e9fSTom Tucker  *        copyright notice, this list of conditions and the following
21922a8e9fSTom Tucker  *        disclaimer in the documentation and/or other materials
22922a8e9fSTom Tucker  *        provided with the distribution.
23922a8e9fSTom Tucker  *
24922a8e9fSTom Tucker  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25922a8e9fSTom Tucker  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26922a8e9fSTom Tucker  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27922a8e9fSTom Tucker  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28922a8e9fSTom Tucker  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29922a8e9fSTom Tucker  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30922a8e9fSTom Tucker  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31922a8e9fSTom Tucker  * SOFTWARE.
32922a8e9fSTom Tucker  */
33922a8e9fSTom Tucker #ifndef IWCM_H
34922a8e9fSTom Tucker #define IWCM_H
35922a8e9fSTom Tucker 
36922a8e9fSTom Tucker enum iw_cm_state {
37922a8e9fSTom Tucker 	IW_CM_STATE_IDLE,             /* unbound, inactive */
38922a8e9fSTom Tucker 	IW_CM_STATE_LISTEN,           /* listen waiting for connect */
39922a8e9fSTom Tucker 	IW_CM_STATE_CONN_RECV,        /* inbound waiting for user accept */
40922a8e9fSTom Tucker 	IW_CM_STATE_CONN_SENT,        /* outbound waiting for peer accept */
41922a8e9fSTom Tucker 	IW_CM_STATE_ESTABLISHED,      /* established */
42922a8e9fSTom Tucker 	IW_CM_STATE_CLOSING,	      /* disconnect */
43922a8e9fSTom Tucker 	IW_CM_STATE_DESTROYING        /* object being deleted */
44922a8e9fSTom Tucker };
45922a8e9fSTom Tucker 
46922a8e9fSTom Tucker struct iwcm_id_private {
47922a8e9fSTom Tucker 	struct iw_cm_id	id;
48922a8e9fSTom Tucker 	enum iw_cm_state state;
49922a8e9fSTom Tucker 	unsigned long flags;
50922a8e9fSTom Tucker 	struct ib_qp *qp;
51922a8e9fSTom Tucker 	struct completion destroy_comp;
52922a8e9fSTom Tucker 	wait_queue_head_t connect_wait;
53922a8e9fSTom Tucker 	struct list_head work_list;
54922a8e9fSTom Tucker 	spinlock_t lock;
55*60dff56dSWeihang Li 	refcount_t refcount;
56922a8e9fSTom Tucker 	struct list_head work_free_list;
57922a8e9fSTom Tucker };
58922a8e9fSTom Tucker 
5959c68ac3SSteve Wise #define IWCM_F_DROP_EVENTS	  1
60922a8e9fSTom Tucker #define IWCM_F_CONNECT_WAIT       2
61922a8e9fSTom Tucker 
62922a8e9fSTom Tucker #endif /* IWCM_H */
63