/* ehca2ib_qp_state maps ehca to IB qp_state returns ib qp state corresponding to given ehca qp state  */
static enum ib_qp_state ehca2ib_qp_state(enum ehca_qp_state ehca_qp_state)
/* ehca2ib_qp_state maps ehca to IB qp_state returns ib qp state corresponding to given ehca qp state  */
static enum ib_qp_state ehca2ib_qp_state(enum ehca_qp_state ehca_qp_state)
{
	switch (ehca_qp_state) {
	case EHCA_QPS_RESET:
		return IB_QPS_RESET;
	case EHCA_QPS_INIT:
		return IB_QPS_INIT;
	case EHCA_QPS_RTR:
		return IB_QPS_RTR;
	case EHCA_QPS_RTS:
		return IB_QPS_RTS;
	case EHCA_QPS_SQD:
		return IB_QPS_SQD;
	case EHCA_QPS_SQE:
		return IB_QPS_SQE;
	case EHCA_QPS_ERR:
		return IB_QPS_ERR;
	default:
		ehca_gen_err("invalid ehca_qp_state=%x", ehca_qp_state);
		return -EINVAL;
	}
}