@@ -1903,7 +1903,8 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1903
1903
u32 len ;
1904
1904
char lu_id_str [6 ];
1905
1905
int host_no = devip -> sdbg_host -> shost -> host_no ;
1906
-
1906
+
1907
+ arr [1 ] = cmd [2 ];
1907
1908
port_group_id = (((host_no + 1 ) & 0x7f ) << 8 ) +
1908
1909
(devip -> channel & 0x7f );
1909
1910
if (sdebug_vpd_use_hostno == 0 )
@@ -1914,7 +1915,6 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1914
1915
(devip -> target * 1000 ) - 3 ;
1915
1916
len = scnprintf (lu_id_str , 6 , "%d" , lu_id_num );
1916
1917
if (0 == cmd [2 ]) { /* supported vital product data pages */
1917
- arr [1 ] = cmd [2 ]; /*sanity */
1918
1918
n = 4 ;
1919
1919
arr [n ++ ] = 0x0 ; /* this page */
1920
1920
arr [n ++ ] = 0x80 ; /* unit serial number */
@@ -1935,23 +1935,18 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1935
1935
}
1936
1936
arr [3 ] = n - 4 ; /* number of supported VPD pages */
1937
1937
} else if (0x80 == cmd [2 ]) { /* unit serial number */
1938
- arr [1 ] = cmd [2 ]; /*sanity */
1939
1938
arr [3 ] = len ;
1940
1939
memcpy (& arr [4 ], lu_id_str , len );
1941
1940
} else if (0x83 == cmd [2 ]) { /* device identification */
1942
- arr [1 ] = cmd [2 ]; /*sanity */
1943
1941
arr [3 ] = inquiry_vpd_83 (& arr [4 ], port_group_id ,
1944
1942
target_dev_id , lu_id_num ,
1945
1943
lu_id_str , len ,
1946
1944
& devip -> lu_name );
1947
1945
} else if (0x84 == cmd [2 ]) { /* Software interface ident. */
1948
- arr [1 ] = cmd [2 ]; /*sanity */
1949
1946
arr [3 ] = inquiry_vpd_84 (& arr [4 ]);
1950
1947
} else if (0x85 == cmd [2 ]) { /* Management network addresses */
1951
- arr [1 ] = cmd [2 ]; /*sanity */
1952
1948
arr [3 ] = inquiry_vpd_85 (& arr [4 ]);
1953
1949
} else if (0x86 == cmd [2 ]) { /* extended inquiry */
1954
- arr [1 ] = cmd [2 ]; /*sanity */
1955
1950
arr [3 ] = 0x3c ; /* number of following entries */
1956
1951
if (sdebug_dif == T10_PI_TYPE3_PROTECTION )
1957
1952
arr [4 ] = 0x4 ; /* SPT: GRD_CHK:1 */
@@ -1961,30 +1956,23 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1961
1956
arr [4 ] = 0x0 ; /* no protection stuff */
1962
1957
arr [5 ] = 0x7 ; /* head of q, ordered + simple q's */
1963
1958
} else if (0x87 == cmd [2 ]) { /* mode page policy */
1964
- arr [1 ] = cmd [2 ]; /*sanity */
1965
1959
arr [3 ] = 0x8 ; /* number of following entries */
1966
1960
arr [4 ] = 0x2 ; /* disconnect-reconnect mp */
1967
1961
arr [6 ] = 0x80 ; /* mlus, shared */
1968
1962
arr [8 ] = 0x18 ; /* protocol specific lu */
1969
1963
arr [10 ] = 0x82 ; /* mlus, per initiator port */
1970
1964
} else if (0x88 == cmd [2 ]) { /* SCSI Ports */
1971
- arr [1 ] = cmd [2 ]; /*sanity */
1972
1965
arr [3 ] = inquiry_vpd_88 (& arr [4 ], target_dev_id );
1973
1966
} else if (is_disk_zbc && 0x89 == cmd [2 ]) { /* ATA info */
1974
- arr [1 ] = cmd [2 ]; /*sanity */
1975
1967
n = inquiry_vpd_89 (& arr [4 ]);
1976
1968
put_unaligned_be16 (n , arr + 2 );
1977
1969
} else if (is_disk_zbc && 0xb0 == cmd [2 ]) { /* Block limits */
1978
- arr [1 ] = cmd [2 ]; /*sanity */
1979
1970
arr [3 ] = inquiry_vpd_b0 (& arr [4 ]);
1980
1971
} else if (is_disk_zbc && 0xb1 == cmd [2 ]) { /* Block char. */
1981
- arr [1 ] = cmd [2 ]; /*sanity */
1982
1972
arr [3 ] = inquiry_vpd_b1 (devip , & arr [4 ]);
1983
1973
} else if (is_disk && 0xb2 == cmd [2 ]) { /* LB Prov. */
1984
- arr [1 ] = cmd [2 ]; /*sanity */
1985
1974
arr [3 ] = inquiry_vpd_b2 (& arr [4 ]);
1986
1975
} else if (is_zbc && cmd [2 ] == 0xb6 ) { /* ZB dev. charact. */
1987
- arr [1 ] = cmd [2 ]; /*sanity */
1988
1976
arr [3 ] = inquiry_vpd_b6 (devip , & arr [4 ]);
1989
1977
} else {
1990
1978
mk_sense_invalid_fld (scp , SDEB_IN_CDB , 2 , -1 );
0 commit comments