Module Name:    src
Committed By:   kardel
Date:           Fri Dec 28 15:06:07 UTC 2018

Modified Files:
        src/sys/dev/pci: mpii.c

Log Message:
fix LUN handling (byte order issue)

now ch0 on a NEOSeries FlexStor II is detected again on LUN 1
this is a regression introduced in 1.15 update and 1.8.10.3 pullup

Tested with NEOSeries FlexStor II:
mpii0 at pci1 dev 0 function 0: vendor 1000 product 00ab (rev. 0x01)
mpii0: interrupting at irq 11
mpii0: HBA 9400-8i8e, firmware 3.0.4.0, MPI 2.6
mpii0: physical disk inserted in slot 9
mpii0: physical disk inserted in slot 13
mpii0: physical disk inserted in slot 16
st0 at scsibus0 target 9 lun 0: <IBM, ULTRIUM-HH7, J4D1> tape removable
st0: drive empty
st0: tagged queueing
st1 at scsibus0 target 13 lun 0: <IBM, ULTRIUM-HH7, J4D1> tape removable
st1: drive empty
ch0 at scsibus0 target 13 lun 1: <BDT, FlexStor II, 5.50> changer removable
ch0: 23 slots, 2 drives, 1 picker, 1 portal
st1: tagged queueing
ch0: tagged queueing
ses0 at scsibus0 target 16 lun 0: <LSI, VirtualSES, 01> enclosure services fixed
ses0: SCSI-3 SES Device


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.18 src/sys/dev/pci/mpii.c:1.19
--- src/sys/dev/pci/mpii.c:1.18	Wed Dec  5 10:38:22 2018
+++ src/sys/dev/pci/mpii.c	Fri Dec 28 15:06:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.18 2018/12/05 10:38:22 bouyer Exp $ */
+/* $NetBSD: mpii.c,v 1.19 2018/12/28 15:06:07 kardel Exp $ */
 /*	$OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $	*/
 /*
  * Copyright (c) 2010, 2012 Mike Belopuhov
@@ -20,7 +20,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.18 2018/12/05 10:38:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.19 2018/12/28 15:06:07 kardel Exp $");
 
 #include "bio.h"
 
@@ -3036,7 +3036,7 @@ mpii_scsipi_request(struct scsipi_channe
 	io->sgl_offset0 = sizeof(struct mpii_msg_scsi_io) / 4;
 	io->io_flags = htole16(xs->cmdlen);
 	io->dev_handle = htole16(ccb->ccb_dev_handle);
-	io->lun[0] = htole16(periph->periph_lun);
+	io->lun[0] = htobe16(periph->periph_lun);
 
 	switch (xs->xs_control & (XS_CTL_DATA_IN | XS_CTL_DATA_OUT)) {
 	case XS_CTL_DATA_IN:

Reply via email to