FreeBSD/sys/ofed/drivers/infiniband/core/iwcm.c
/*
 * Passive Side: CM_ID <-- ESTABLISHED
 *
 * The provider generated an ESTABLISHED event which means that
 * the MPA negotion has completed successfully and we are now in MPA
 * FPDU mode.
 *
 * This event can only be received in the CONN_RECV state. If the
 * remote peer closed, the ESTABLISHED event would be received followed
 * by the CLOSE event. If the app closes, it will block until we wake
 * it up after processing this event.
 */
Passive Side: CM_ID <-- ESTABLISHED
The provider generated an ESTABLISHED event which means that
the MPA negotion has completed successfully and we are now in MPA
FPDU mode.

This event can only be received in the CONN_RECV state. If the
remote peer closed, the ESTABLISHED event would be received followed
by the CLOSE event. If the app closes, it will block until we wake
it up after processing this event.
Passive Side : CM_ID < -- ESTABLISHED The provider generated an ESTABLISHED event which means that the MPA negotion has completed successfully and we are now in MPA FPDU mode . This event can only be received in the CONN_RECV state . If the remote peer closed the ESTABLISHED event would be received followed by the CLOSE event . If the app closes it will block until we wake it up after processing this event .
static int cm_conn_est_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_RECV);
	cm_id_priv->state = IW_CM_STATE_ESTABLISHED;
	spin_unlock_irqrestore(&cm_id_priv->lock, flags);
	ret = cm_id_priv->id.cm_handler(&cm_id_priv->id, iw_event);
	wake_up_all(&cm_id_priv->connect_wait);
	return ret;
}
static int cm_conn_est_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_RECV ) ; cm_id_priv -> state = IW_CM_STATE_ESTABLISHED ; spin_unlock_irqrestore ( & cm_id_priv -> lock , flags ) ; ret = cm_id_priv -> id . cm_handler ( & cm_id_priv -> id , iw_event ) ; wake_up_all ( & cm_id_priv -> connect_wait ) ; return ret ; }
Passive Side: CM_ID <-- ESTABLISHED
 The provider generated an ESTABLISHED event which means that
 the MPA negotion has completed successfully and we are now in MPA
 FPDU mode.
Passive Side : CM_ID < -- ESTABLISHED The provider generated an ESTABLISHED event which means that the MPA negotion has completed successfully and we are now in MPA FPDU mode .
/*
	 * We clear the CONNECT_WAIT bit here to allow the callback
	 * function to call iw_cm_disconnect. Calling iw_destroy_cm_id
	 * from a callback handler is not allowed.
	 */