Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Dec 2018 10:39:22 +0000 (UTC)
From:      Kashyap D Desai <kadesai@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342528 - head/sys/dev/mpr
Message-ID:  <201812261039.wBQAdMPP035475@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kadesai
Date: Wed Dec 26 10:39:22 2018
New Revision: 342528
URL: https://svnweb.freebsd.org/changeset/base/342528

Log:
  Copy back the Sense data at proper location expected by the application
  
  typedef struct mps_pass_thru
  {
                 uint64_t               PtrRequest;
                 uint64_t               PtrReply;
                 uint64_t               PtrData;
                 uint32_t               RequestSize;
                 uint32_t               ReplySize;
                 uint32_t               DataSize;
                 uint32_t               DataDirection;
                 uint64_t               PtrDataOut;
                 uint32_t               DataOutSize;
                 uint32_t               Timeout;
  } mps_pass_thru_t, * ptrmpssas_pass_thru_t;
  
  In the above mps_pass_thru structure; Application expects PrtReply buffer
  should contain both MPI reply followed by sense data. So, updated driver
  to copy sense data at PtrReply + sizeof(MPI2 reply) location where
  application wants the driver to copy back the sense data info.
  
  Submitted by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
  Reviewed by:  Kashyap Desai <Kashyap.Desai@broadcom.com>
  Approved by:  ken
  MFC after:  3 days
  Sponsored by:   Broadcom Inc

Modified:
  head/sys/dev/mpr/mpr_user.c

Modified: head/sys/dev/mpr/mpr_user.c
==============================================================================
--- head/sys/dev/mpr/mpr_user.c	Wed Dec 26 10:38:51 2018	(r342527)
+++ head/sys/dev/mpr/mpr_user.c	Wed Dec 26 10:39:22 2018	(r342528)
@@ -1106,7 +1106,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru
 				    SenseCount)), sizeof(struct
 				    scsi_sense_data));
 				mpr_unlock(sc);
-				copyout(cm->cm_sense, cm->cm_req + 64,
+				copyout(cm->cm_sense,
+				    (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))),
 				    sense_len);
 				mpr_lock(sc);
 			}
@@ -1140,7 +1141,9 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru
 			sz = MIN(le32toh(nvme_error_reply->ErrorResponseCount),
 			    NVME_ERROR_RESPONSE_SIZE);
 			mpr_unlock(sc);
-			copyout(cm->cm_sense, cm->nvme_error_response, sz);
+			copyout(cm->cm_sense,
+			    (PTRIN(data->PtrReply +
+			    sizeof(MPI2_SCSI_IO_REPLY))), sz);
 			mpr_lock(sc);
 		}
 	}



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