Fix inquiry length detection for the ses(4) driver. It was using the

inq_len member of the ccb_getdev structure, but we've never filled that
value in..

So we now get the length from the inquiry data returned by the drive.
(Since we will fetch as much inquiry data as the drive claims to support.)

Reviewed by:	mjacob
Reported by:	Andrzej Tobola <san@iem.pw.edu.pl>
This commit is contained in:
Kenneth D. Merry 2001-03-16 22:16:54 +00:00
parent 9c83e8862e
commit e35550e2bc

View File

@ -286,14 +286,17 @@ sesasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
{
cam_status status;
struct ccb_getdev *cgd;
int inq_len;
cgd = (struct ccb_getdev *)arg;
inq_len = cgd->inq_data.additional_length + 4;
/*
* PROBLEM: WE NEED TO LOOK AT BYTES 48-53 TO SEE IF THIS IS
* PROBLEM: IS A SAF-TE DEVICE.
*/
switch (ses_type(&cgd->inq_data, cgd->inq_len)) {
switch (ses_type(&cgd->inq_data, inq_len)) {
case SES_SES:
case SES_SES_SCSI2:
case SES_SES_PASSTHROUGH:
@ -746,9 +749,6 @@ ses_type(void *buf, int buflen)
{
unsigned char *iqd = buf;
if (buflen == 0)
buflen = 256; /* per SPC-2 */
if (buflen < 8+SEN_ID_LEN)
return (SES_NONE);