[Stgt-devel] [PATCH] Move device type to LUN

FUJITA Tomonori fujita.tomonori
Fri Jun 15 06:36:06 CEST 2007


From: Hannes Reinecke <hare at suse.de>
Subject: [Stgt-devel] [PATCH] Move device type to LUN
Date: Tue, 5 Jun 2007 15:38:26 +0200

> diff --git a/usr/spc.c b/usr/spc.c
> index 6aecdeb..006d3bc 100644
> --- a/usr/spc.c
> +++ b/usr/spc.c
> @@ -43,7 +43,7 @@ int spc_inquiry(int host_no, struct scsi
>  	int len, ret = SAM_STAT_CHECK_CONDITION;
>  	uint8_t *data;
>  	uint8_t *scb = cmd->scb;
> -	unsigned char device_type = cmd->c_target->dev_type_template.type;
> +	uint8_t devtype;
>  	struct lu_phy_attr *attributes = cmd->dev->attributes;
>  	unsigned char key = ILLEGAL_REQUEST, asc = 0x24;
>  
> @@ -60,9 +60,12 @@ int spc_inquiry(int host_no, struct scsi
>  
>  	dprintf("%x %x\n", scb[1], scb[2]);
>  
> +	devtype = (attributes->qualifier & 0x7 ) << 5;
> +	devtype &= (attributes->device_type & 0x1f);

?

> +	devtype |= (attributes->device_type & 0x1f);


The rest looks ok for iSCSI, however this breaks ibmvio code badly.

I updated the patch against the latest tree
(c90113a76a377ea3c7d5345c0f185b4d9a9c8f1a).

---



More information about the stgt mailing list