aac(4) & mfi(4): Fix masking bug.
authorSascha Wildner <saw@online.de>
Mon, 6 Dec 2010 18:12:30 +0000 (19:12 +0100)
committerSascha Wildner <saw@online.de>
Mon, 6 Dec 2010 18:13:12 +0000 (19:13 +0100)
When masking direct and processor devices during an inquiry, properly
preserve the upper bits of the first data byte.

Taken-from: FreeBSD

sys/dev/raid/aac/aac_cam.c
sys/dev/raid/mfi/mfi_cam.c

index 3f8b355..da26f25 100644 (file)
@@ -531,7 +531,8 @@ aac_cam_complete(struct aac_command *cm)
                                    (device == T_PROCESSOR) ||
                                    (sc->flags & AAC_FLAGS_CAM_PASSONLY))
                                        ccb->csio.data_ptr[0] =
-                                           ((device & 0xe0) | T_NODEVICE);
+                                           ((ccb->csio.data_ptr[0] & 0xe0) |
+                                           T_NODEVICE);
                        }
                }
        }
index 5f3f90f..43e80e8 100644 (file)
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/dev/mfi/mfi_cam.c,v 1.4 2010/03/02 17:34:11 kib Exp $
+ * $FreeBSD: src/sys/dev/mfi/mfi_cam.c,v 1.5 2010/12/06 17:02:56 jhb Exp $
  */
 
 #include "opt_mfi.h"
@@ -338,7 +338,7 @@ mfip_done(struct mfi_command *cm)
                        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;
        }