FreeBSD/sys/ofed/drivers/infiniband/core/iwcm.c
/*
 * Active Side: CM_ID <-- ESTABLISHED
 *
 * The app has called connect and is waiting for the established event to
 * post it's requests to the server. This event will wake up anyone
 * blocked in iw_cm_disconnect or iw_destroy_id.
 */
Active Side: CM_ID <-- ESTABLISHED
The app has called connect and is waiting for the established event to
post it's requests to the server. This event will wake up anyone
blocked in iw_cm_disconnect or iw_destroy_id.
Active Side : CM_ID < -- ESTABLISHED The app has called connect and is waiting for the established event to post it ' s requests to the server . This event will wake up anyone blocked in iw_cm_disconnect or iw_destroy_id .
static int cm_conn_rep_handler(struct iwcm_id_private *cm_id_priv,
			       struct iw_cm_event *iw_event)
{
	unsigned long flags;
	int ret;
	spin_lock_irqsave(&cm_id_priv->lock, flags);
	clear_bit(IWCM_F_CONNECT_WAIT, &cm_id_priv->flags);
	BUG_ON(cm_id_priv->state != IW_CM_STATE_CONN_SENT);
	if (iw_event->status == 0) {
		cm_id_priv->id.local_addr = iw_event->local_addr;
		cm_id_priv->id.remote_addr = iw_event->remote_addr;
		cm_id_priv->state = IW_CM_STATE_ESTABLISHED;
	} else {
		cm_id_priv->id.device->iwcm->rem_ref(cm_id_priv->qp);
		cm_id_priv->qp = NULL;
		cm_id_priv->state = IW_CM_STATE_IDLE;
	}
	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
	ret = cm_id_priv->id.cm_handler(&cm_id_priv->id, iw_event);
	if (iw_event->private_data_len)
		kfree(iw_event->private_data);
	wake_up_all(&cm_id_priv->connect_wait);
	return ret;
}
static int cm_conn_rep_handler ( struct iwcm_id_private * cm_id_priv , struct iw_cm_event * iw_event ) { unsigned long flags ; int ret ; spin_lock_irqsave ( & cm_id_priv -> lock , flags ) ; clear_bit ( IWCM_F_CONNECT_WAIT , & cm_id_priv -> flags ) ; BUG_ON ( cm_id_priv -> state != IW_CM_STATE_CONN_SENT ) ; if ( iw_event -> status == 0 ) { cm_id_priv -> id . local_addr = iw_event -> local_addr ; cm_id_priv -> id . remote_addr = iw_event -> remote_addr ; cm_id_priv -> state = IW_CM_STATE_ESTABLISHED ; } else { cm_id_priv -> id . device -> iwcm -> rem_ref ( cm_id_priv -> qp ) ; cm_id_priv -> qp = NULL ; cm_id_priv -> state = IW_CM_STATE_IDLE ; } spin_unlock_irqrestore ( & cm_id_priv -> lock , flags ) ; ret = cm_id_priv -> id . cm_handler ( & cm_id_priv -> id , iw_event ) ; if ( iw_event -> private_data_len ) kfree ( iw_event -> private_data ) ; wake_up_all ( & cm_id_priv -> connect_wait ) ; return ret ; }
Active Side: CM_ID <-- ESTABLISHED
 The app has called connect and is waiting for the established event to
 post it's requests to the server.
Active Side : CM_ID < -- ESTABLISHED The app has called connect and is waiting for the established event to post it ' s requests to the server .
/*
	 * Clear the connect wait bit so a callback function calling
	 * iw_cm_disconnect will not wait and deadlock this thread
	 */ /* REJECTED or RESET */ /* Wake up waiters on connect complete */