Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Dec 2010 18:40:09 GMT
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/152768: [mfi] Weird check in mfi(4)
Message-ID:  <201012021840.oB2Ie9Qu031581@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/152768; it has been noted by GNATS.

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org,
 saw@online.de
Cc: scottl@freebsd.org
Subject: Re: kern/152768: [mfi] Weird check in mfi(4)
Date: Thu, 2 Dec 2010 13:30:51 -0500

 I think it should be 'ccb->csio.data_ptr[0] & 0xe0 | T_NODEVICE', or even 
 shorter would be to do this:
 
 Index: mfi_cam.c
 ===================================================================
 --- mfi_cam.c	(revision 216122)
 +++ mfi_cam.c	(working copy)
 @@ -340,14 +340,14 @@
  		ccbh->status = CAM_REQ_CMP;
  		csio->scsi_status = pt->header.scsi_status;
  		if (ccbh->flags & CAM_CDB_POINTER)
 -			command = ccb->csio.cdb_io.cdb_ptr[0];
 +			command = csio->cdb_io.cdb_ptr[0];
  		else
 -			command = ccb->csio.cdb_io.cdb_bytes[0];
 +			command = csio->cdb_io.cdb_bytes[0];
  		if (command == INQUIRY) {
 -			device = ccb->csio.data_ptr[0] & 0x1f;
 +			device = csio->data_ptr[0] & 0x1f;
  			if ((device == T_DIRECT) || (device == T_PROCESSOR))
  				csio->data_ptr[0] =
 -				     (device & 0xe0) | T_NODEVICE;
 +				     (csio->data_ptr[0] & 0xe0) | T_NODEVICE;
  		}
  		break;
  	}
 
 The intention from the code seems to be to mask T_DIRECT and T_PROCESSOR
 devices by mapping them to T_NODEVICE instead.
 
 -- 
 John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012021840.oB2Ie9Qu031581>