/* Process ABORT_REQ_RSS CPL message: -> host Process abort requests. If we are waiting for an ABORT_RPL we ignore this request except that we need to reply to it.  */
static int abort_status_to_errno(struct s3_conn *c3cn, int abort_reason, int *need_rst)
/* Process ABORT_REQ_RSS CPL message: -> host Process abort requests. If we are waiting for an ABORT_RPL we ignore this request except that we need to reply to it.  */
static int abort_status_to_errno(struct s3_conn *c3cn, int abort_reason, int *need_rst)
{
	switch (abort_reason) {
	case CPL_ERR_BAD_SYN:
	case CPL_ERR_CONN_RESET:
		return c3cn->state > C3CN_STATE_ESTABLISHED ?
			-EPIPE : -ECONNRESET;
	case CPL_ERR_XMIT_TIMEDOUT:
	case CPL_ERR_PERSIST_TIMEDOUT:
	case CPL_ERR_FINWAIT2_TIMEDOUT:
	case CPL_ERR_KEEPALIVE_TIMEDOUT:
		return -ETIMEDOUT;
	default:
		return -EIO;
	}
}