/* Configures queue depth based on host's cmd_per_len. If not set then we use the libfc default.  */
int fc_slave_alloc(struct scsi_device *sdev)
/* Configures queue depth based on host's cmd_per_len. If not set then we use the libfc default.  */
int fc_slave_alloc(struct scsi_device *sdev)
{
	struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
	if (!rport || fc_remote_port_chkready(rport))
		return -ENXIO;
	if (sdev->tagged_supported)
		scsi_activate_tcq(sdev, FC_FCP_DFLT_QUEUE_DEPTH);
	else
		scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),
					FC_FCP_DFLT_QUEUE_DEPTH);
	return 0;
}