/* Must be called with target->scsi_host->host_lock held to protect req_lim and tx_head. Lock cannot be dropped between call here and call to __srp_post_send().  */
static struct srp_iu* __srp_get_tx_iu(struct srp_target_port *target, enum srp_request_type req_type)
/* Must be called with target->scsi_host->host_lock held to protect req_lim and tx_head. Lock cannot be dropped between call here and call to __srp_post_send().  */
static struct srp_iu* __srp_get_tx_iu(struct srp_target_port *target, enum srp_request_type req_type)
{
	s32 min = (req_type == SRP_REQ_TASK_MGMT) ? 1 : 2;
	if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
		return NULL;
	if (target->req_lim < min) {
		++target->zero_req_lim;
		return NULL;
	}
	return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
}