162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright (c) 2005 Network Appliance, Inc. All rights reserved.
362306a36Sopenharmony_ci * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * This software is available to you under a choice of one of two
662306a36Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
762306a36Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
862306a36Sopenharmony_ci * COPYING in the main directory of this source tree, or the
962306a36Sopenharmony_ci * OpenIB.org BSD license below:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
1262306a36Sopenharmony_ci *     without modification, are permitted provided that the following
1362306a36Sopenharmony_ci *     conditions are met:
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci *      - Redistributions of source code must retain the above
1662306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
1762306a36Sopenharmony_ci *        disclaimer.
1862306a36Sopenharmony_ci *
1962306a36Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
2062306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
2162306a36Sopenharmony_ci *        disclaimer in the documentation and/or other materials
2262306a36Sopenharmony_ci *        provided with the distribution.
2362306a36Sopenharmony_ci *
2462306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2562306a36Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2662306a36Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2762306a36Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2862306a36Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2962306a36Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3062306a36Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3162306a36Sopenharmony_ci * SOFTWARE.
3262306a36Sopenharmony_ci */
3362306a36Sopenharmony_ci#ifndef IWCM_H
3462306a36Sopenharmony_ci#define IWCM_H
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_cienum iw_cm_state {
3762306a36Sopenharmony_ci	IW_CM_STATE_IDLE,             /* unbound, inactive */
3862306a36Sopenharmony_ci	IW_CM_STATE_LISTEN,           /* listen waiting for connect */
3962306a36Sopenharmony_ci	IW_CM_STATE_CONN_RECV,        /* inbound waiting for user accept */
4062306a36Sopenharmony_ci	IW_CM_STATE_CONN_SENT,        /* outbound waiting for peer accept */
4162306a36Sopenharmony_ci	IW_CM_STATE_ESTABLISHED,      /* established */
4262306a36Sopenharmony_ci	IW_CM_STATE_CLOSING,	      /* disconnect */
4362306a36Sopenharmony_ci	IW_CM_STATE_DESTROYING        /* object being deleted */
4462306a36Sopenharmony_ci};
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_cistruct iwcm_id_private {
4762306a36Sopenharmony_ci	struct iw_cm_id	id;
4862306a36Sopenharmony_ci	enum iw_cm_state state;
4962306a36Sopenharmony_ci	unsigned long flags;
5062306a36Sopenharmony_ci	struct ib_qp *qp;
5162306a36Sopenharmony_ci	struct completion destroy_comp;
5262306a36Sopenharmony_ci	wait_queue_head_t connect_wait;
5362306a36Sopenharmony_ci	struct list_head work_list;
5462306a36Sopenharmony_ci	spinlock_t lock;
5562306a36Sopenharmony_ci	refcount_t refcount;
5662306a36Sopenharmony_ci	struct list_head work_free_list;
5762306a36Sopenharmony_ci};
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define IWCM_F_DROP_EVENTS	  1
6062306a36Sopenharmony_ci#define IWCM_F_CONNECT_WAIT       2
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci#endif /* IWCM_H */
63