Re: [RFC 4/6] target/transport: support transfers with unknown size of data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2011-12-08 at 18:30 +0100, Sebastian Andrzej Siewior wrote:
> The UAS protocol does transfer the information "expected data". The
> device is supposed to look at the cdb information for that. This patch
> introduces a flag where the expected data (according to cdb) is the
> expected data.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/target/target_core_transport.c |    3 +++
>  include/target/target_core_base.h      |    1 +
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index 05bf4fe..e3d2d89 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -3005,6 +3005,9 @@ static int transport_generic_cmd_sequencer(
>  		goto out_unsupported_cdb;
>  	}
>  
> +	if (cmd->unknown_data_length)
> +		cmd->data_length = size;
> +
>  	if (size != cmd->data_length) {
>  		pr_warn("TARGET_CORE[%s]: Expected Transfer Length:"
>  			" %u does not match SCSI CDB Length: %u for SAM Opcode:"
> diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
> index 8b130c4..e353ba9 100644
> --- a/include/target/target_core_base.h
> +++ b/include/target/target_core_base.h
> @@ -515,6 +515,7 @@ struct se_cmd {
>  	/* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
>  	unsigned		check_release:1;
>  	unsigned		cmd_wait_set:1;
> +	unsigned		unknown_data_length:1;
>  	/* See se_cmd_flags_table */
>  	u32			se_cmd_flags;
>  	u32			se_ordered_id;

So I think this looks reasonable.

Note that for new code the setting of se_cmd->unknown_data_length should
also happen via a target_submit_cmd() flag, as we don't pass the new
se_cmd back to the fabric caller for this to be set manually.

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux